feat(web): CopilotAlert 告警组件 + 告警 API 扩展

- CopilotAlert: 分级告警列表,30秒轮询刷新,危急 banner
- copilot.ts 新增 listAlerts 函数
This commit is contained in:
iven
2026-05-12 22:36:36 +08:00
parent a48ad6ed33
commit 6d97328ff6
3 changed files with 111 additions and 0 deletions

View File

@@ -54,6 +54,10 @@ export function dismissInsight(id: string) {
return client.post(`/copilot/insights/${id}/dismiss`);
}
export function listAlerts(params?: { severity?: string; page?: number; page_size?: number }) {
return listInsights({ insight_type: 'anomaly', ...params });
}
export function listRules(params?: { page?: number; page_size?: number }) {
return client.get<PaginatedResponse<Record<string, unknown>>>('/copilot/rules', { params });
}