Add live logs to admin dashboard with level filtering and error middleware

This commit is contained in:
root
2026-03-31 15:54:21 -05:00
parent 40322e8861
commit a0d9f1f9d9
4 changed files with 153 additions and 6 deletions

View File

@@ -310,4 +310,14 @@ export interface AdminStats {
export const getAdminStats = () =>
api.get<AdminStats>('/admin/stats').then((r) => r.data)
export interface LogEntry {
timestamp: string
level: string
logger: string
message: string
}
export const getAdminLogs = (level: string = 'ALL', limit: number = 100) =>
api.get<{ logs: LogEntry[]; total: number }>('/admin/logs', { params: { level, limit } }).then((r) => r.data)
export default api