feat(k8s): F7 集群详情EventsTab真实后端对接 + go vet修复

1. EventsTab.tsx: DEMO_EVENTS硬编码→kubernetesApi.getEvents真实K8s事件
   - 复用 normalizeK8sEvent/formatEventRelative 工具(与 EventsPage 一致)
   - 新增 loading/empty 状态 + 刷新按钮
   - Warning事件优先排序 + 限100条防溢出
   - KubernetesClusterDetail 传入 clusterCode prop
   - 修复 Q28 组件拆分时遗留的 demo 数据未对接缺口

2. aiops_alert_analysis.go: log.Printf %s→%d 修复 go vet 失败
   - AlertID 类型为 uint, %s 格式符不匹配致 go test 构建失败
   - go vet ./... 全量零错误

验证: tsc -b=0, npm build✓ (18.00s), go build=0, go vet=0, 17/17测试通过
Events API 返回5条真实事件 (type=Normal, reason=Pulled, count=5487)
This commit is contained in:
attacker committed 2026-07-16 21:23:19 +08:00
1 parent a874832f10
commit ca036a85ca
4 files changed
+94 -20

No files matched your search

+1 -1
View File
@@ -400,7 +400,7 @@ func (h *AIOpsAlertAnalysisHandler) saveAnalysisTrace(ctx context.Context, in an
Error: in.Error,
}
if err := h.db.WithContext(ctx).Create(&row).Error; err != nil {
log.Printf("[AIOpsAnalysis] 保存告警分析结果失败 (alert_id=%s, provider=%s): %v", in.AlertID, in.Provider, err)
log.Printf("[AIOpsAnalysis] 保存告警分析结果失败 (alert_id=%d, provider=%s): %v", in.AlertID, in.Provider, err)
}
}