From 73505d660465e98ce87b6d6558b2ce6200ffa48a Mon Sep 17 00:00:00 2001 From: attacker Date: Wed, 17 Jun 2026 08:04:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=B8=85=E7=90=86=E6=AD=BB?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=20LogManager.tsx(514=E8=A1=8C)+logsApi+LogEn?= =?UTF-8?q?try=E7=B1=BB=E5=9E=8B(=E5=B7=B2=E7=A7=BB=E9=99=A4=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=83=BD=E5=8A=9B=E8=8F=9C=E5=8D=95=E7=9A=84=E5=AD=A4?= =?UTF-8?q?=E7=AB=8B=E6=AE=8B=E7=95=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/services/api.ts | 33 --------------------------------- frontend/src/types/index.ts | 11 +---------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index e299ae7..ab2231a 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -574,39 +574,6 @@ export const ansibleApi = { }, }; -// ==================== 日志监控 API ==================== -export const logsApi = { - query: async (params?: { - level?: string; - service?: string; - host?: string; - keyword?: string; - source_id?: number | string; - page?: number; - page_size?: number; - }) => { - return http.get('/logs', params); - }, - getSources: async (params?: { page?: number; page_size?: number }) => { - return http.get('/logs/sources', params); - }, - createSource: async (data: any) => { - return http.post('/logs/sources', data); - }, - deleteSource: async (id: number | string) => { - return http.delete(`/logs/sources/${id}`); - }, - export: async (params?: { - level?: string; - service?: string; - host?: string; - keyword?: string; - source_id?: number | string; - }) => { - return http.post('/logs/export', params); - }, -}; - // ==================== 告警中心 API(基于 /alerts 真实路由) ==================== // 说明:alertCenterApi 与 alertApi 共用同一套后端 /alerts 路由,此处独立封装以便告警中心页使用 export const alertCenterApi = { diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 8692f8e..a3d1319 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -355,13 +355,4 @@ export interface MetricData { labels: Record; } -// 日志条目 -export interface LogEntry { - id: string; - timestamp: string; - level: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'FATAL'; - source: string; - message: string; - host: string; - metadata?: Record; -} +