This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
@page "/client-logs"
|
||||
@page "/admin/client-logs"
|
||||
@rendermode @(new InteractiveWebAssemblyRenderMode(prerender: false))
|
||||
@attribute [Authorize]
|
||||
@inject HttpClient Http
|
||||
|
||||
<PageTitle>클라이언트 로그</PageTitle>
|
||||
|
||||
<section class="admin-simple-page">
|
||||
<header class="admin-simple-header">
|
||||
<p class="admin-simple-eyebrow">Diagnostics</p>
|
||||
<h1 class="admin-simple-title">클라이언트 로그</h1>
|
||||
<p class="admin-simple-subtitle">브라우저 오류와 JS interop 실패를 최근 순서로 확인합니다.</p>
|
||||
</header>
|
||||
|
||||
<div class="admin-simple-card">
|
||||
@if (_loading)
|
||||
{
|
||||
<p>불러오는 중...</p>
|
||||
}
|
||||
else if (_entries.Count == 0)
|
||||
{
|
||||
<p>최근 클라이언트 로그가 없습니다.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="admin-log-list">
|
||||
@foreach (var entry in _entries)
|
||||
{
|
||||
<article class="admin-log-item">
|
||||
<div class="admin-log-item-header">
|
||||
<strong>@(entry.Level ?? "error")</strong>
|
||||
<span>@entry.Timestamp</span>
|
||||
<span>@entry.Source</span>
|
||||
</div>
|
||||
<p>@entry.Message</p>
|
||||
<small>@entry.Route</small>
|
||||
</article>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@code {
|
||||
private readonly List<ClientLogDto> _entries = [];
|
||||
private bool _loading = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await Http.GetFromJsonAsync<List<ClientLogDto>>("/taxbaik/api/client-logs/recent");
|
||||
if (result is not null)
|
||||
{
|
||||
_entries.AddRange(result);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
_loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class ClientLogDto
|
||||
{
|
||||
public string? Timestamp { get; set; }
|
||||
public string? Level { get; set; }
|
||||
public string? Source { get; set; }
|
||||
public string? Message { get; set; }
|
||||
public string? Route { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@ public static class AdminNavigationCatalog
|
||||
new("블로그 관리", "/taxbaik/admin/blog", Icons.Material.Filled.Article, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("시즌 시뮬레이터", "/taxbaik/admin/season-simulator", Icons.Material.Filled.CalendarMonth, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("문의 관리", "/taxbaik/admin/inquiries", Icons.Material.Filled.Inbox, AllowedRoles: ["Admin", "Manager", "Staff"]),
|
||||
new("클라이언트 로그", "/taxbaik/admin/client-logs", Icons.Material.Filled.BugReport, AllowedRoles: ["Admin"]),
|
||||
new("설정", "/taxbaik/admin/settings", Icons.Material.Filled.Settings, AllowedRoles: ["Admin"]),
|
||||
new("공통관리", "/taxbaik/admin/common-codes", Icons.Material.Filled.Apps, AllowedRoles: ["Admin"]),
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user