feat: AI告警智能分析接入真实后端告警事件 — 替换硬编码mock为动态分析

- AIAlertAnalyzer: 从 GET /alerts 加载真实告警事件(替代4条硬编码mock)
- mapAlertEvent: 映射AlertEvent→AlertItem(解析表达式提取指标/阈值,计算持续时间)
- generateAIAnalysis: 按指标类型(CPU/内存/磁盘/网络/服务)动态生成根因分析/影响评估/修复建议/自动修复脚本
- Dashboard: 服务器/告警增长率标签从硬编码改为数据驱动(基于error/week_count)
- DomainManager: 到期时间截取YYYY-MM-DD格式
- PipelineManager: 流水线创建传递stages/code/type字段
This commit is contained in:
attacker committed 2026-06-14 14:07:03 +08:00
1 parent bae3a2f013
commit b99e971fc9
4 files changed
+216 -140

No files matched your search

@@ -452,7 +452,7 @@ function CertificateExpiryCard({ expCerts }: { expCerts: any[] }) {
</div>
<div>
<p className="text-sm font-medium text-slate-200">{domain.name}</p>
<p className="text-xs text-slate-500">到期: {domain.expire_date}</p>
<p className="text-xs text-slate-500">到期: {domain.expire_date?.substring(0, 10)}</p>
</div>
</div>
<Badge
@@ -878,8 +878,8 @@ export function Dashboard() {
value={serverStats?.total ?? 0}
description={`${serverStats?.running ?? 0} 台运行中`}
icon={Server}
trend="up"
trendValue="+3 本月"
trend={Number(serverStats?.error ?? 0) > 0 ? 'down' : 'neutral'}
trendValue={Number(serverStats?.error ?? 0) > 0 ? `${serverStats?.error} 台异常` : '运行正常'}
color="blue"
/>
<StatCard
@@ -896,8 +896,8 @@ export function Dashboard() {
value={alertStats?.firing ?? 0}
description={`${alertStats?.critical ?? 0} 个严重`}
icon={Bell}
trend="down"
trendValue="-5 本周"
trend={Number(alertStats?.today_count ?? 0) > 0 ? 'up' : 'down'}
trendValue={`本周 ${alertStats?.week_count ?? 0} 条`}
color="rose"
/>
<StatCard