feat: 重构接口日志页面与接口监控看板,支持HTTP方法过滤和实时轮询

This commit is contained in:
liumangmang
2026-07-01 15:04:32 +08:00
parent 397a14c978
commit 8abfa4c5ef
19 changed files with 2463 additions and 37 deletions
+58
View File
@@ -462,6 +462,64 @@ export const customPagesApi = {
delete: (id: number) => api.delete(`/api/custom-pages/${id}`),
}
// ——— External API Logs ———
export interface ExternalApiLogData {
id: number
direction: string
target_type: string
target_id: number | null
target_name: string | null
method: string
path: string
url_host: string
status_code: number | null
success: boolean
duration_ms: number
error_type: string | null
error_message: string | null
created_at: string
}
export interface ExternalApiLogSummaryItem {
direction: string
target_type: string
target_id: number | null
target_name: string | null
method: string
path: string
call_count: number
success_count: number
fail_count: number
avg_duration_ms: number
max_duration_ms: number
slow_count: number
}
export const externalApiLogsApi = {
list: (params?: {
direction?: string
target_type?: string
target_id?: number
method?: string
success?: boolean
status_code?: number
path?: string
limit?: number
offset?: number
}) => api.get<ExternalApiLogData[]>('/api/external-api-logs', { params }),
count: (params?: {
direction?: string
target_type?: string
target_id?: number
method?: string
success?: boolean
status_code?: number
path?: string
}) => api.get<{ total: number }>('/api/external-api-logs/count', { params }),
summary: (params?: { slow_ms?: number }) =>
api.get<ExternalApiLogSummaryItem[]>('/api/external-api-logs/summary', { params }),
}
// ——— Auth Capture ———
export interface BrowserImportSession {
session_id: string