Add client log filters and dashboard links
TaxBaik CI/CD / build-and-deploy (push) Successful in 4m52s
TaxBaik CI/CD / build-and-deploy (push) Successful in 4m52s
This commit is contained in:
@@ -14,6 +14,16 @@
|
||||
</header>
|
||||
|
||||
<div class="admin-simple-card">
|
||||
<div class="admin-log-filter-row">
|
||||
<input class="mud-input-slot" placeholder="검색어" @bind="_query" @bind:event="oninput" />
|
||||
<select class="mud-input-slot" @bind="_level">
|
||||
<option value="">전체 수준</option>
|
||||
<option value="error">error</option>
|
||||
<option value="warning">warning</option>
|
||||
<option value="info">info</option>
|
||||
</select>
|
||||
<button type="button" class="mud-button-root" @onclick="LoadAsync">새로고침</button>
|
||||
</div>
|
||||
@if (_loading)
|
||||
{
|
||||
<p>불러오는 중...</p>
|
||||
@@ -45,12 +55,23 @@
|
||||
@code {
|
||||
private readonly List<ClientLogDto> _entries = [];
|
||||
private bool _loading = true;
|
||||
private string _query = "";
|
||||
private string _level = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadAsync();
|
||||
}
|
||||
|
||||
private async Task LoadAsync()
|
||||
{
|
||||
_loading = true;
|
||||
_entries.Clear();
|
||||
|
||||
try
|
||||
{
|
||||
var result = await Http.GetFromJsonAsync<List<ClientLogDto>>("/taxbaik/api/client-logs/recent");
|
||||
var url = $"/taxbaik/api/client-logs/recent?q={Uri.EscapeDataString(_query ?? string.Empty)}&level={Uri.EscapeDataString(_level ?? string.Empty)}";
|
||||
var result = await Http.GetFromJsonAsync<List<ClientLogDto>>(url);
|
||||
if (result is not null)
|
||||
{
|
||||
_entries.AddRange(result);
|
||||
@@ -62,6 +83,7 @@
|
||||
finally
|
||||
{
|
||||
_loading = false;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user