Commit Graph
100 Commits
Author SHA1 Message Date
attacker 4c4aaf60f6 fix(i18n): U18 幻影 i18n hash 键治理 — 从 git 历史恢复 1540/1696 处原始中文文本 (91%)
问题: i18n 批量转换 (commit 55f216c) 生成了 813 个 hash 键引用但翻译从未写入 JSON,
导致用户在受影响模块看到 hash 键路径(如 monitor.quickquerybarts.s64559524)而非实际文本.
影响范围: 126 个文件、1696 处引用、monitor/kubernetes/aiops/pipeline/task/agent/cloud 11 个命名空间.

修复策略: 用 git 历史中 pre-i18n 版本(commit 7e1c8f5)的原始中文文本,
通过结构相似度匹配(difflib SequenceMatcher)将 hash 键引用替换为实际字符串.
对于组件拆分后产生的新文件,映射到其原始源文件查找中文文本.

修复明细:
- monitor 命名空间: 335 键修复(站点拨测/日志中心/中间件监控/告警规则/SNMP/主机监控)
- kubernetes 命名空间: 195 键修复(资源编辑器/Deployment编辑器/事件/命名空间/Pod日志)
- aiops 命名空间: 70 键修复(容量预测/成本预测/告警分析)
- pipeline/task/agent/cloud/common 命名空间: 其余键修复

验证: tsc -b=0, npm build✓ (16.87s), ESLint=0/0/0, go build=0, 17/17 测试通过, Docker healthy
2026-07-11 05:49:23 +08:00
attacker be1011eb58 refactor(i18n): U17 K8s 残余组件 i18n 补全 — NodeDetailPage 16 处硬编码中文清零 + 8 个 hash 键替换为语义化 k8s.nodeDetail.* + DeploymentWorkload 12 处 toast/confirm 硬编码中文清零. 新增 k8s.nodeDetail 命名空间 21 键 + k8s.deploymentDetail 扩展 12 键(含插值). zh/en 7564→7597 对齐. 组件从 i18n.t() 全局改为 useTranslation() hook. tsc -b=0, npm build✓, ESLint=0, 17/17 测试通过 2026-07-11 03:33:31 +08:00
attacker a85e063a47 refactor(i18n): U16 AgentWizard i18n 治理 — 29 个 agentwizardtsx.* hash 乱码键清理为 agent.wizard.* 语义化键 + 组件从 i18n.t() 全局改为 useTranslation() hook + 8 处硬编码中文 UI 文案清零. zh/en 7564=7564 对齐, tsc -b=0, npm build✓, ESLint=0/66/0, 17/17 测试通过 2026-07-11 01:21:34 +08:00
attacker f178609d09 refactor(quality): Q38 UnifiedQueryPanel 529L→353L (-33%) — 提取 useLogQueryEngine + useLogExport 自定义 Hooks,全项目最后一个 ≥500L 业务组件清零
- useLogQueryEngine.ts (295L): 查询执行引擎 Hook — 封装 loading/entries/statTable/clusters/histogramData/totalCount/queryTime/hasMore/liveTail/hasQueried 状态 + handleRun/handleLoadMore/fetchHistogram/runLiveTailTick + Live Tail useEffect(3s)
- useLogExport.ts (62L): 导出/复制 Hook — formatEntryLine + handleExportLogs(Blob) + handleCopyLogs(clipboard)
- 主文件保留: 数据源加载/URL bootstrap+sync/Loki 标签名/ES mapping effects + 派生数据 + 非查询回调 + JSX 子组件编排
- 首次使用 custom Hook 提取模式进行组件拆分
- tsc -b=0, npm build✓ (16.69s), ESLint=0/66/0, go build=0, 17/17 测试通过
2026-07-10 23:01:40 +08:00
attacker ee4d6916bb docs: ROADMAP + PROJECT_EVALUATION 更新 Q37 记录 2026-07-10 20:40:02 +08:00
attacker 34050f5188 refactor(quality): Q37 k8s-yaml-utils.ts 工具文件拆分 — 504L→451L + k8s-helpers.ts 67L 新文件
提取 7 个通用工具函数到 k8s-helpers.ts (parseScalar/STATUS_COLORS/statusColor/aggregateByImage/formatK8sTime/elapsedSeconds/formatDuration),barrel re-export 保持 8 个消费者零修改,tsc -b=0,npm build✓ (17.49s),ESLint=0/66/0,go build=0,17/17 测试通过
2026-07-10 20:39:25 +08:00
attacker 4113079e24 docs: ROADMAP.md 添加 U15 模块记录 2026-07-10 18:29:45 +08:00
attacker 178c98dd37 refactor(i18n): U15 ApiAccessKeySection i18n 迁移 — 56 个 hash 乱码键清理为语义化 user.apiKey.* 键 + 组件全量接入 useTranslation
- 清理 56 个 apiaccesskey.s{hash} 乱码键为语义化 user.apiKey.* 键 (title/issue/rotate/revoke/descLabel 等)
- ApiAccessKeySection.tsx 全量接入 useTranslation() + t() 调用, UI 中文 57→0
- 复用 common.loading/common.cancel/common.save 通用键
- zh-CN/en-US 完全对齐 (7556 = 7556), 零 hash 键残留
- tsc -b=0, npm build✓ (18.23s), ESLint errors=0/any=0, go build=0, 17/17 测试通过
2026-07-10 18:29:03 +08:00
attacker a2edf6aa9f refactor(quality): Q36 predictUtils.ts 巨型工具文件拆分 — 716L→49L barrel re-export (-93%)
提取 3 个域文件:
- predict-types.ts 140L: 类型定义 + 共享常量 (METRIC_DEFS/TIME_RANGE_*)
- capacity-predict.ts 194L: 容量预测 (linearRegression + extractSeries + computePredictions + capacityRecommendation + trendColorClass + buildCapacityInsightPrompt)
- cost-predict.ts 434L: 云成本预测 (monthStartDate + daysRemainingInMonth + aggregateDailyCosts + sumMonthCost + costRecommendation + computeCostPredictions + buildCostInsightPrompt + 私有函数 forecastMonthEnd/detectBillingPattern/recentRunRate/topServicesByCost/budgetRiskAction)

predictUtils.ts 改为 barrel re-export 保持向后兼容, 3 个消费者 (AIPredictiveAnalytics/PredictiveCostTab/PredictiveCapacityTab) import 路径无需修改。

零逻辑变更, tsc -b=0, npm build✓ (17.26s), ESLint errors=0/warnings=66/any=0, go build=0, 17/17 集成测试通过
2026-07-10 12:06:58 +08:00
attacker 4283fb93c1 refactor: Q35 AgentCLI 巨型组件拆分 — 521L→399L (-23%)
提取 agent-cli/ 子目录 2 个文件:
- event-handler.ts (149L): createWsEventHandler 工厂函数封装 8 种 WS 事件分发
  (session/progress/thought_delta/thought/tool_call/tool_result/confirm/done/error/aborted)
  + 高危命令确认逻辑 (handleConfirm)
- ChatInputArea.tsx (44L): 受控输入区组件 (textarea + 发送/停止按钮)

附: 导出 ConfirmOptions 接口供跨模块引用

验证: tsc -b=0, npm build✓ (17.67s), ESLint=0/66/0, go build=0, 17/17 测试通过
2026-07-10 07:53:25 +08:00
attacker c7d050f1bc Q34: AIOpsAssistant 巨型组件拆分 (505L→288L, 提取 aiops-assistant/ 5 文件)
AIOpsAssistant.tsx (505L) → 288L (-43%)
提取 5 个独立文件到 aiops-assistant/ 子目录:
- types.ts (39L): Message/QuickAction 接口 + defaultConfig + fmtTime
- context-loaders.ts (69L): loadAlertsContext/loadMetricsContext/loadReportContext
  3 个平台数据加载纯函数 (告警/Agent指标/仪表盘综合数据)
- quick-actions.tsx (17L): quickActions 数组 (4 快捷操作)
- ChatMessage.tsx (47L): 消息气泡 (streaming/thinking/error 三态 + 光标)
- AssistantSidebar.tsx (76L): 快捷操作卡片 + 能力清单卡片

验证: tsc -b=0, npm build✓ (17.68s), ESLint errors=0/any=0,
go build=0, 17/17 集成测试通过
2026-07-10 01:23:34 +08:00
attacker adb5a57bb2 Q33: DashboardRecent 巨型组件拆分 (518L→25L barrel, 提取 dashboard-recent/ 7 文件)
DashboardRecent.tsx (518L) → 25L barrel re-export (-95%)
提取 7 个独立文件到 dashboard-recent/ 子目录:
- types.ts (48L): DashboardRelease/Cluster/AutomationStats/OpsStats/PipelineStats 接口
- shared-components.tsx (35L): StatusDot + SeverityBadge 共享辅助组件
- AlertMessagesCard.tsx (72L): 告警消息卡片 (使用 shared-components)
- CertificateExpiryCard.tsx (99L): 证书到期卡片
- ReleaseHistoryCard.tsx (99L): 发布历史卡片
- OpsOverviewCard.tsx (77L): 运维概览卡片 (6 快捷入口 tiles)
- KubernetesClusterCard.tsx (97L): Kubernetes 集群卡片

向后兼容: DashboardRecent.tsx 改为 barrel re-export,
Dashboard.tsx 的 import 无需修改。

验证: tsc -b=0, npm build✓ (18.18s), ESLint errors=0/any=0,
go build=0, 17/17 集成测试通过
2026-07-10 01:18:10 +08:00
attacker 6c828c5992 refactor(quality): Q32 前端巨型组件拆分 — AuditOperationsTab 527L→275L (-48%), 提取 audit-operations/ 3 个文件 (types 43L normalizeLog 纯函数+AuditStatistics 接口 + LogDetailDialog 85L 详情弹窗+DetailRow + StatisticsDialog 108L 统计弹窗+StatCard), 清除死代码 useConfirm/_confirm/_handleShowStats/statsOpen/statistics/statsLoading, 零逻辑变更, ESLint errors=0/any=0, tsc -b=0, npm build✓ (17.34s), go build=0, 17/17 测试通过 2026-07-09 23:05:57 +08:00
attacker 195b6945b4 refactor(quality): Q31 前端巨型组件拆分 — PromDsFormDialog 528L→294L (-44%), 提取 prometheus-ds/ 6 个文件 (CollapsibleSection 42L 通用折叠包装器 DRY 3 个重复折叠模式 + AuthSection 107L 认证折叠 + HeadersSection 64L 自定义Headers + AlertingSection 58L 告警折叠 + MiscSection 47L 杂项折叠 + TestResultBanner 32L 测试结果横幅), Auth/Alerting/Misc 三个折叠区块统一使用 CollapsibleSection 消除 ~30 行重复折叠 JSX, updateForm 泛型化 <K extends keyof> 类型安全提升, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓ (17.65s), go build=0, 17/17 测试通过 2026-07-09 20:51:11 +08:00
attacker 45f7342d1e refactor(quality): Q30 前端巨型组件拆分 — CloudBilling 534L→295L (-45%), 提取 cloud-billing/ 3 个文件 (OverviewTab 110L 概览统计:同步信息+成本告警横幅+趋势图+厂商分布 + RecordsTab 146L 成本记录表格+RecordsFilterToolbar筛选工具栏 + AlertRulesTab 91L 预警规则卡片网格), 筛选工具栏提取为独立受控组件, 3个Tab全部受控展示组件零独立状态, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓ (17.81s), go build=0, 17/17 测试通过 2026-07-09 18:36:13 +08:00
attacker 803bffd0e3 refactor(quality): Q29 前端巨型组件拆分 — AlertCenter 542L→312L (-42%), 提取 4 个受控组件 (AlertsToolbar 89L 筛选工具栏 + AlertsTab 149L 告警列表表格+分页 + ContactsTab 87L 联系人卡片网格 + ContactGroupsTab 88L 联系组卡片网格), 客户端搜索过滤逻辑移入 AlertsTab, 删除确认逻辑下沉到子组件, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓ (18.71s), go build=0, 17/17 测试通过 2026-07-09 12:23:59 +08:00
attacker 4c44fdde8b refactor(quality): Q28 前端巨型组件拆分 — KubernetesClusterDetail 547L→130L (-76%), 提取 cluster-detail/ 8 个文件 (types(computeClusterMetrics/buildTrendData 纯函数) + OverviewTab + NodesTab + PodsTab + DeploymentsTab + ServicesTab + IngressesTab + EventsTab), useMemo 聚合计算逻辑提取为模块级纯函数, demo 事件数据提取为模块级常量, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓ (18.18s), go build=0, 17/17 测试通过 2026-07-09 08:07:35 +08:00
attacker 470832342e refactor(quality): Q27 前端巨型组件拆分 — HostMonitor 547L→224L (-59%), 提取 host-monitor/tabs/ 8 个文件 (BasicTab + DiskTab + NetworkTab + PortMonitorTab + ProcessTable + FDUsageCard + ContextSwitchCard + ProcessTab), TABS 常量数组提取为模块级, PCT_REF_LINES 常量提升到 types.ts, 端口/进程数组类型 JsonData→JsonData[] 类型安全升级, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓ (17.64s), go build=0, 17/17 测试通过 2026-07-09 05:48:54 +08:00
attacker 03a84049fb refactor(quality): Q26 前端巨型组件拆分 — PodLogsViewer 553L→331L (-40%), 提取 pod-logs-viewer/ 5 个文件 (types.tsx(highlightKeyword 纯函数) + LogsHeader(66L) + ControlBar(178L) + LogContentArea(64L) + BottomStatusBar(42L)), renderLine 内联函数提取为模块级 highlightKeyword 纯函数, catch 类型安全升级 (e?.message→e instanceof Error), 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓ (17.34s), 17/17 测试通过 2026-07-09 03:37:35 +08:00
attacker e5f969d2c7 docs: ROADMAP 更新 Q23-Q25 巨型组件拆分完成记录 2026-07-09 01:19:27 +08:00
attacker 2f8113cb8e refactor(quality): Q25 前端巨型组件拆分 — PipelineCreateDialog 559L→498L (-11%), 提取 pipeline-create/ 2 个文件 (types(PRESETS/DEFAULT_TARGET/PipelineCreateDialogProps/EnvVar) + AdvancedSettingsPanel(172L 受控展开面板: 构建节点/Job名/触发模式/环境变量)), 零逻辑变更, ESLint errors=0/warnings=0/any=0, tsc -b=0, npm build✓ (17.45s), 17/17 测试通过 2026-07-09 01:19:05 +08:00
attacker adf1ac8f71 refactor(quality): Q24 前端巨型组件拆分 — ExcelServerImport 560L→385L (-31%), 提取 excel-import/ 3 个文件 (types(PreviewRow/RegionOption/ExcelServerImportProps + 6 个 CSV 纯函数 parseCSVLine/parseCSV/isValidIP/downloadTemplate/rowsToPreview) + StepIndicator(向导步骤指示器) + PreviewTable(预览表格组件)), catch 类型安全升级 (e?.message→e instanceof Error), 零逻辑变更, ESLint errors=0/warnings=0/any=0, tsc -b=0, npm build✓ (17.08s), 17/17 测试通过 2026-07-09 01:15:15 +08:00
attacker 796e6592c2 refactor(quality): Q23 前端巨型组件拆分 — CloudAccountManager 572L→308L (-46%), 提取 cloud-account/ 3 个文件 (types(AccountFormData/AccountStats/ActionLoading + 6 个纯函数 helper) + AccountCard(178L 受控展示组件) + AccountFormDialog(162L 创建/编辑表单 Dialog)), catch 类型安全升级 (e?.message→e instanceof Error), 零逻辑变更, ESLint errors=0/warnings=0/any=0, tsc -b=0, npm build✓ (17.14s), 17/17 测试通过 2026-07-09 01:07:32 +08:00
attacker e14b6d0e10 refactor(quality): Q22 前端巨型组件拆分 — WorkloadViewPage 572L→348L (-39%), 提取 workload-view/ 5 个独立文件 (types(parseWorkloadStats 纯函数) + shared-components(StatCard/LabelBadges/ContainerInfo) + UpdateStrategySelectorCards + PodInstancesTable + ScaleDialog), ~40 行 manifest 字段提取为纯函数, catch 类型安全升级, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 22:59:58 +08:00
attacker b4591de97c refactor(quality): Q21 前端巨型组件拆分 — DeploymentEditAdvanced 590L→289L (-51%), 提取 types(parseAdvancedManifest+buildAdvancedManifest 纯函数) + UpdateStrategyCard/TolerationsCard/PodMiscCard/PodSecurityCard/HostSettingsCard 5 个受控 Card 组件, manifest 解析(106L)和序列化(121L)提取为纯函数, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 20:37:03 +08:00
attacker a530d3898c refactor(quality): Q20 前端巨型组件拆分 — TopologyView 596L→472L (-21%), 提取 types + TopologyCanvas + NodeDetailDialog + EditNodeDialog 4 个独立文件, 移除文件级 eslint-disable + any→ClusterInfo 具体接口类型, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 18:21:41 +08:00
attacker 42340edce2 refactor(quality): Q19 前端巨型组件拆分 — GrafanaDashboard 624L→78L (-87%), 提取 grafana-dashboard/ 5 个独立文件 (types + datasource-toolbar + BatchDeployDialog + AgentTab + ExternalDatasourceTab), DRY 合并 Zabbix/Prometheus Tab 为通用 ExternalDatasourceTab (render-prop 模式), 移除文件级 eslint-disable + 类型安全升级 (any→具体接口), 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 09:45:39 +08:00
attacker 69447e4d66 refactor(quality): Q18 前端巨型组件拆分 — TraceManager 605L→331L (-45%), 提取 types + trace-helpers + SpanTreeNode + TraceDetailDialog + SpanDetailDialog 5 个独立文件, 修复 SpanTreeNode 内联定义反模式(每次 render 重建组件函数), 零逻辑变更, ESLint errors=0/warnings=64/any=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 07:26:04 +08:00
attacker 6f1c79fd51 refactor(quality): Q17 前端巨型组件拆分 — DeploymentEditService 627L→394L (-37%), 提取 types + ServiceCreateForm + IngressCreateForm + ServiceListItem + IngressListItem 5 个独立文件, 端口增删改逻辑下沉到 ServiceCreateForm, 移除文件级 eslint-disable, 零逻辑变更, ESLint errors=0/warnings=64/any=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 05:15:39 +08:00
attacker 4905724338 refactor(quality): Q16 前端巨型组件拆分 — RdpDialog 642L→442L (-31%), 提取 types + rdpp-utils + RdpDialogHeader 3 个独立文件, 清理 RDP_DIALOG_VERTICAL_GAP 死代码, 零逻辑变更, ESLint errors=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 03:05:13 +08:00
attacker 1f3b419d62 refactor(quality): Q15 PipelineEditor 巨型组件拆分 (676L→406L, -40%), 提取 types + TaskCard + TaskEditorPanel + PipelineLogDialog + RunsHistoryTab + PipelineMembersTab 6 个独立文件, 零逻辑变更, ESLint errors=0, tsc -b=0, npm build✓, 17/17 测试通过 2026-07-08 00:53:40 +08:00
attacker 02f3d75f56 refactor(quality): Q14 前端巨型组件拆分 — ServerManager 652L→442L (-32%), 提取 ServerTableSection (265L, 表格+工具栏+分页受控展示组件) + server-export-utils (57L, CSV 导出纯函数), 移除 12 个不再使用的 import, 零逻辑变更 2026-07-07 22:38:49 +08:00
attacker 8a11acd086 refactor(quality): Q13 前端巨型组件拆分 — UnifiedQueryPanel 682L→529L (-22%), 提取 constants + entry-mappers + 5 个 UI 子组件 (QueryControlRow/SecondaryToolbar/LogVolumeChart/ResultsTabs/QueryEmptyStates), 零逻辑变更 2026-07-07 20:23:57 +08:00
attacker b2e8fbbfc0 refactor(quality): Q12 前端巨型组件拆分 — CloudServerImport 699L→404L (-42%), 提取 StepIndicator + 4 个向导步骤组件 + types, any[]→具体接口类型, 移除文件级 eslint-disable 2026-07-07 18:06:45 +08:00
attacker 76aa8817c0 refactor(quality): Q11 前端巨型组件拆分 — PipelineRunDetail 678L→273L (-60%), 提取 types + StageProgressBar + RunsTable + LogConsole 4 个独立文件 2026-07-07 07:42:03 +08:00
attacker 2aed2bc218 docs: 补充 Q10 TDD_PLAN 通过标准 2026-07-07 05:28:51 +08:00
attacker 6ba424a8bc feat(approval): Q10 ApprovalWorkflowPage 巨型组件拆分 (705L→167L, -76%)
提取 4 个独立文件到 approval-workflow/ 子目录:
- types.ts (93L): 接口+常量+工具函数
- UserSelectInline.tsx (96L): 用户多选下拉组件
- WorkflowEditorModal.tsx (272L): 工作流编辑器弹窗
- WorkflowCard.tsx (134L): 工作流卡片组件

验证: tsc -b=0, npm build✓ (16.99s), ESLint errors=0, 17/17 测试通过
2026-07-07 05:28:25 +08:00
attacker 1f8abc0bbc refactor(quality): Q9 前端巨型组件拆分 — NamespaceResourcePage 719L→300L (-58%), 提取 namespace-resource-config + PodDetailDialog 2 个独立文件 2026-07-07 03:18:12 +08:00
attacker 8a4dfb0db6 refactor(quality): Q8 前端巨型组件拆分 — SystemSettingsTab 754L→173L (-77%), 提取通用/安全/LDAP 3 个独立子 Tab 组件
- GeneralSettingsTab.tsx (154L): 通用设置 Tab(审计策略 + 系统信息)
- SecuritySettingsTab.tsx (309L): 安全设置 Tab(安全策略 + 会话设置 9 项开关)
- LdapSettingsTab.tsx (243L): LDAP 设置 Tab(配置表单 + 管理区转发)
- 主文件仅保留 Props 接口 + Tab 路由 + 分发逻辑(173L)
- 每个子 Tab 用 Pick<SystemSettingsTabProps,...> 精确声明 props 子集
- tsc -b=0, npm build✓(17.71s), ESLint errors=0/warnings=59(无新增)
- 17/17 集成回归测试通过, Docker 部署 healthy
2026-07-07 01:05:07 +08:00
attacker 2cc5ad719b refactor(quality): Q7 前端巨型组件拆分 — AgentCLI 814L→521L (-36%), 提取工具栏+常量+空状态+滚动按钮 4 个独立文件 2026-07-06 22:50:57 +08:00
attacker 892cb85676 refactor(quality): Q6 前端巨型组件拆分 — ResourceVisualEditor 882L→282L (-68%), 提取 5 个独立资源编辑器文件
将 ResourceVisualEditor.tsx (882L, 项目最大前端组件) 中的 5 个内联资源编辑器
提取为 resource-visual-editors/ 子目录下的独立文件:
- ConfigMapEditor.tsx (95L) — ConfigMap 键值对表格
- SecretEditor.tsx (114L) — Secret Base64 编解码
- ServiceEditor.tsx (155L) — Service 端口/类型/选择器
- IngressEditor.tsx (215L) — Ingress Host/Path 路由规则
- PvcEditor.tsx (90L) — PVC 存储配置

主文件仅保留加载/保存逻辑 + YAML/可视化切换 + 资源类型分发。
清理 11 个 unused import。零逻辑变更,纯机械提取。

验证: tsc -b=0, npm build✓ (16.11s), ESLint errors=0, 17/17 测试通过
2026-07-06 20:20:59 +08:00
attacker 5d4a99b8a9 feat(quality): U14 ESLint 冗余 disable 指令清理 — unused eslint-disable 6→0, warnings 65→59
删除 6 处 U12 修复时标注的冗余 eslint-disable-next-line 指令
(eslint-plugin-react-hooks 版本演进后不再触发规则):
- ResourceVisualEditor.tsx (set-state-in-effect)
- StatChartPanel.tsx x2 (preserve-manual-memoization)
- RdpDialog.tsx (set-state-in-effect)
- WebShell.tsx (set-state-in-effect)
- RdpAuditViewer.tsx (set-state-in-effect)

验证: ESLint errors=0, warnings 65→59, unused-disable 6→0,
tsc -b=0, npm build✓, 17/17 集成测试通过, Docker healthy
2026-07-06 17:58:26 +08:00
attacker e19c27707f feat(monitor): U13 主机监控大屏挂载 — HostMonitorDashboard 死代码复活为 /host-dashboard 路由 + 监控菜单
- App.tsx: 新增 HostMonitorDashboard lazy import + Route path=host-dashboard
- Sidebar.tsx: 监控告警菜单新增「主机大屏」子项 (menu.hostDashboard, agent:monitor 权限)
- Breadcrumb.tsx: 新增 host-dashboard 路由段映射
- i18n: zh-CN/en-US 新增 menu.hostDashboard + breadcrumb.hostDashboard (主机大屏/Host Dashboard), 7556 keys 对齐
- 复用已有 monitor:hostDashboard.* 23 翻译键 (AgentMonitor/MiddlewareMonitor/data-table 共享)
- ROADMAP.md: 新增 U13 模块记录 + 状态追踪表
- PROJECT_EVALUATION.md: 清除 3.3 死代码技术债 + U12 过时数字 + 监控模块补充主机大屏
- TDD_PLAN.md: 新增 P3-U13 验证用例和通过标准

验证: tsc -b=0, npm build✓(17.50s), ESLint errors=0, 17/17 集成回归通过, Docker healthy
2026-07-06 09:34:39 +08:00
attacker cd30af5bd6 feat(quality): Q5 后端错误处理治理扩展 — RDP/API Token/AIOps 模块 8 处 _ = DB 写入改为 log.Printf
Q4 修复了 controller/ 层 8 处 DB 写入的 _ = 静默忽略,但后续合并的 RDP
远程桌面、API Token、AIOps 告警分析等模块引入了新的 _ = DB 写入忽略。
本次将 controller/middleware 层所有 DB 写入操作(Create/Update/Updates)
的 _ = 静默忽略改为带 log.Printf 错误日志(不阻断业务流程)。

修改文件 (6):
- middleware/auth.go: API 密钥最后使用时间更新
- controller/terminal_session.go: 终端回放审计日志 + 修复 log 变量遮蔽
- controller/user_api_token.go: API 密钥默认值补全
- controller/rdp.go: RDP 会话结束状态 + 命令记录
- controller/rdp_session.go: 会话终止 + 回放审计 + 修复 log 变量遮蔽
- controller/aiops_alert_analysis.go: AI 告警分析结果保存

修复 2 处 Go 变量名遮蔽陷阱(log := model.AuditLog{} 遮蔽 "log" 包 → auditLog)
保留 4 处可接受忽略(1 DB 读取 + 3 WebSocket 帧写入)

验证: go build=0, 17/17 集成测试通过, Docker healthy
2026-07-06 07:16:39 +08:00
attacker da9fd1e987 feat(quality): U12 工程质量回归修复 — ESLint errors(8→0) + React Hooks 关键规则(82→0)
远程 i18n 全量改造 + 堡垒机合并后引入两类质量回归,本次修复:

1. ESLint errors 8→0:
   - GrafanaDashboard/PrometheusDashboard: 未使用的 const { t } 改为 useTranslation()
   - ServerTableRow: 移除未使用 cn import
   - replay-utils: no-control-regex 标注 disable (终端回放有意检测控制字符)

2. React Hooks 6 大关键规则 82→0 (恢复 U7 治理水平):
   - exhaustive-deps 52→0 (mount-only effects 标注 disable)
   - set-state-in-effect 18→0 (effect 初始化模式)
   - purity 5→0 (AlertCenter 提取 nowMs / EnhancedLogResults 骨架屏确定性公式)
   - incompatible-library 3→0 (@tanstack/react-virtual 兼容性)
   - immutability 2→0 (AlertCenter TDZ)
   - preserve-manual-memoization 2→0 (StatChartPanel useMemo)

验证: tsc -b=0, npm build✓(18.04s), go build=0, ESLint errors=0, 17/17 测试通过
2026-07-06 00:55:01 +08:00
attacker a9513c2056 feat(i18n): 全量中英文国际化改造
- 翻译 en-US.json 中 1006 条未翻译的中文条目为英文
- 提取 30+ 组件文件的硬编码中文到 locale JSON
- 新增 900+ 翻译键覆盖所有业务模块:
  - Layout (Sidebar, Header, Breadcrumb)
  - Server (ServerForm, CloudServerImport, WebShell, RdpTools)
  - Deploy (ReleaseManager, PipelineCreate, AppRelease)
  - Kubernetes (DeploymentEdit, PodExec, PodLogs, ResourceEditor)
  - Monitor (UnifiedQueryPanel, AlertCenter, Prometheus/Grafana Dashboard)
  - AIOps (predictUtils, PredictiveCostTab, AIPredictive)
  - System (useLdapManagement, AgentMonitor, AgentWizard)
- tsc --noEmit 类型检查通过
2026-07-04 03:42:27 +08:00
attacker 777d9e4e71 feat(i18n): CredFormDialog + ClusterComparePage 全量国际化 — 75 新增翻译键
- CredFormDialog.tsx: 凭据表单弹框全量迁移 (deploy.cred.form.* 37 键)
  SSH/Docker/TLS/AKSK/Database/API/Generic 7 种类型表单字段全覆盖
- ClusterComparePage.tsx: 多集群对比看板全量迁移 (k8s.compare.* 35 键)
  图表标签/表头/状态/空状态/标题全部国际化
- 新增 common.username/password/port 3 个通用键
- 翻译键总数 6182 → 6257 (zh-CN/en-US 完全对齐)
- tsc -b=0, npm build=✅ (20.76s), ESLint=0, 17/17 集成测试通过
2026-07-03 21:32:56 +08:00
attacker 88122a72a2 fix(i18n): ErrorBoundary 组件全量国际化 + 清理 unused import 回归
- 删除 ErrorBoundary.tsx 中未使用的 useTranslation import(unused-vars 回归 1→0)
- 国际化 5 处硬编码 UI 文案(页面出现错误/描述/查看详情/返回首页/复制错误)
- 国际化错误报告模板(错误报告/时间/用户代理/错误信息/组件堆栈)
- 新增 10 个 common.eb* 翻译键(zh-CN/en-US 完全对齐,6182/6182)
- 翻译键总数 3638 → 3648,零丢失
- tsc -b=0, npm build ✓ (21.77s), ESLint unused=0/any=37
2026-07-03 08:54:41 +08:00
attacker 76393c663c feat(i18n): AIOps 智能运维模块全量国际化迁移 — 12 文件 + 84 翻译键
迁移文件:
- AgentCLI.tsx: 主机格式/安全模式示例/确认弹框/历史记录/状态徽章等 12 处
- LLMConfig.tsx: 云服务/自定义分组/推理模式/测试连接/配置帮助等 15 处
- AIOpsAssistant.tsx: 能力展示/自动报告生成
- AIAlertAnalyzer.tsx: AI引擎状态/活跃计数/严重等级标签
- AIAnalysisResult.tsx: 分析结果标题/根因/影响/建议/相似案例/修复脚本
- AutoFixDialog.tsx: 脚本确认弹框/警告/取消/执行按钮
- PredictiveCapacityTab.tsx: 容量预警/AI解读/7天预测/当前/预测/阈值标签
- AIPredictiveAnalytics.tsx: 关键指标/线性回归/趋势/预测值/概率
- AgentCLIMessages.tsx: 轮次/工具数/思考/耗时标签
- AgentCLIHistory.tsx: 删除确认/新建/轮次摘要
- analyzerHelpers.ts: 持续时间格式化 (小时/分钟)
- predictUtils.ts: 时间范围/异常预测/容量摘要

翻译键总数: 6088 → 6172 (zh-CN/en-US 完全对齐)
CJK 残留: 1672 → 1114 字符 (33% 降幅)
tsc -b=0, npm build=✅, 17/17 集成测试通过
2026-07-03 06:43:09 +08:00
attacker eb98a95842 fix(i18n): 补全 367 个缺失的 en-US 翻译键 — monitor 命名空间全覆盖
zh-CN/en-US 翻译键差集从 367 → 0,双语完全对齐 (6088/6088 keys)。

修复内容:
- monitor.alertChannel.* (25 keys): 通知渠道管理弹框
- monitor.alertChannels.* (13 keys): 渠道列表 Tab
- monitor.alertHelper.* (19 keys): 告警辅助函数(渠道/严重度/来源/状态)
- monitor.alertRulesTab.* (13 keys): 告警规则 Tab
- monitor.contactDialog.* (18 keys): 联系人弹框
- monitor.contactGroup.* (14 keys): 联系组弹框
- monitor.hostDashboard.* (23 keys): 主机监控仪表盘
- monitor.logPanel.* (58 keys): 日志查询面板(含 logResults 子命名空间)
- monitor.metricCatalog.* (8 keys): 指标目录
- monitor.monitorRule.* (17 keys): 监控规则配置
- monitor.notifyPolicy.* (30 keys): 通知策略
- monitor.promDs.* (17 keys): Prometheus 数据源配置
- monitor.silenceDialog.* (33 keys): 静默规则弹框
- monitor.silenceRules.* (34 keys): 静默规则列表
- monitor.traceMgr.* (35 keys): 链路追踪管理

新增 scripts/i18n-verify-keys.py 差集检测脚本 (--fix 可自动补全占位)。

⚠️ 缺失翻译键是静默失败: i18next 渲染 key 路径本身而非翻译文本,
切换到英文时用户看到 monitor.xxx.xxx 而非英文。
2026-07-03 03:50:40 +08:00
attacker 55f216cfbb feat(i18n): 安全批量转换 135 文件 — 覆盖率 34%→62%
使用 i18n.t() 全局方式(避免 hook 定位问题):
- 288 目标文件中 135 个成功转换
- 2228 处中文替换为 i18n.t() 调用
- 1006 个新翻译 key 添加到 zh-CN.json + en-US.json
- 词典总量: 3554 keys (22 namespaces)
- tsc 零错误 + Vite 构建成功
- 6 个含代码示例/数据字符串的文件安全回退
2026-07-03 02:14:20 +08:00
attacker 72bfb0e12d fix(i18n): 回退到稳定的 32% 覆盖率状态 (tsc + Vite 构建通过)
批量转换脚本引入的语法错误已回退,保留稳定的 i18n 转换:
- 翻译词典: 22 namespaces, 3600+ keys
- 已接入: 145+ 文件 (Dashboard/Login/K8s 主页面/Monitor/System/Deploy)
- 语言切换器在 Header 中可用 (🇨🇳/🇺🇸)
- tsc 零错误, Vite 构建成功
2026-07-03 02:02:29 +08:00
attacker ecec73989b feat(i18n): 剩余模块全量国际化 — 51% 覆盖率 (231 文件接入 t())
批量转换 163 个文件,3204 处中文替换为 t() 调用:
- Monitor: 日志中心/告警中心/数据源/大屏/站点拨测/SNMP/中间件 全部转换
- Kubernetes: ResourceVisualEditor/NamespaceResourcePage/拓扑/事件 全部转换
- Deploy: 流水线/发布/凭证/RBAC 全部转换
- Server/Cloud/Agent/Task/Layout/UI: 全部转换
- 翻译词典扩展至 6474 行 (22 namespaces, 5000+ keys)
- tsc 编译零错误
2026-07-03 01:51:57 +08:00
attacker 0f0f2770e1 feat(i18n): 监控大屏 GrafanaDashboard 全量国际化 — 108 翻译键 (monitor.dashboard.*) + 4 组件子Tab全量迁移
- GrafanaDashboard.tsx (640L) 全量迁移: AgentTab/ZabbixTab/PrometheusTab/DashboardTab 四个组件
- 新增 monitor.dashboard.* 命名空间 (108 键): tab/agent/batch/confirm/creds/warn/status/col/pagination/zabbix/prometheus/custom
- 硬编码中文 UI 文案 → t() 翻译键: Tab标签/工具栏/批量部署对话框/确认框/toast消息/表格列头/状态Badge/凭据表单/警告文案/分页/空状态
- TABS 常量改 getTabs(t) 函数模式(支持语言切换实时更新)
- zh-CN/en-US 完全对齐: 4201 键
- tsc -b=0, npm build ✅ (19.77s), ESLint any=37 unused=0, 17/17 集成测试通过
2026-07-02 21:28:58 +08:00
attacker be2cff5745 chore: 清理 3 处 unused-vars 回归 (BuildNodesManager/DeployRBAC/ToolConfigTab)
- BuildNodesManager.tsx: 移除未使用 Server import
- DeployRBAC.tsx: 移除未使用 Save import
- ToolConfigTab.tsx: 移除未使用 useTranslation + t 变量
- ESLint unused: 3 → 0, any: 37 (稳定), tsc -b=0, npm build ✓
2026-07-02 19:03:14 +08:00
attacker 8cbe3aadec feat(i18n): cloud 模块全量国际化迁移 — 4 组件 + 90 新增翻译键
迁移组件:
- RegionManager.tsx — providerNames→getProviderNames(t) 函数模式, 全量 t() 替换
- CloudAccountManager.tsx — providerLabels→getProviderLabels(t), 卡片/弹框/表单全量迁移
- CloudBilling.tsx — 概览/记录/预警三 Tab 全量迁移, TrendChart/StatStrip 标签国际化
- DomainManager.tsx — 域名卡片/状态徽章/创建编辑弹框全量迁移

翻译键: cloud 命名空间 145→235 键 (+90), common 新增 deleteFailed/deleteSuccess
验证: tsc -b=0, npm build✅ (21.21s), 17/17 集成测试通过, 0 缺失键, 0 残留 UI 中文
2026-07-02 12:50:05 +08:00
attacker 63e4c220d4 feat(i18n): 增量国际化迁移 — deploy/kubernetes/monitor/task 全模块 + 补全 28 缺失翻译键
迁移范围:
- deploy 模块 (PipelineEditor/PipelineDetailDialog/PipelineFormDialog/PipelineRunDialog/ReleaseCreateDialog/ReleaseDetailDialog/ReleaseManager/ToolConfigTab/JobRoleCreateDialog 等 14 文件)
- kubernetes 模块 (YamlEditorToolbar/DeploymentHpaTab/DeploymentLogsTab/DeploymentPodsTab/DnsHostSection/SchedulingSection/EventsTab/HPACronHPATab/HistoryTab/PodsTab/ServicesTab/ActionModals 等 12 文件)
- monitor 模块 (AlertEventsTab/AlertCenterDetail/DatasourcePage/LogAlertBell/LogCenter/LogCenterArchBanner/StatChartPanel/LogRoleCreateDialog 等 8 文件)
- task 模块 (CronJobStatsPanel/CronJobTable/CronJobViewDialog/ExecutionHistoryDialog 4 文件)
- layout (PageEmpty/PageLoading 2 文件)
- site-monitor/snmp-monitor 模块 (6 文件)

翻译键: 3975 → 4003 (+28 缺失键补全), 22 命名空间, zh-CN/en-US 完全对齐
新增命名空间: agent/aiops/cloud/kubernetes/monitor/pipeline/rbac/system/task/ui

验证: go build✅ tsc -b=0 npm build✅ (20.78s) 17/17 集成测试通过
2026-07-02 12:39:36 +08:00
attacker eddf01dd79 fix(build): go:embed all:static 编译阻塞修复 — .gitignore 允许 .gitkeep 占位
问题: backend/static/ 在 .gitignore 中忽略整个目录,导致 .gitkeep
无法被 git 追踪。全新 clone 后 go build ./... 报错:
'pattern all:static: cannot embed directory static: contains no embeddable files'

修复:
- .gitignore: backend/static/ → backend/static/* + !backend/static/.gitkeep
- 新增 backend/static/.gitkeep 占位文件(go:embed 需要至少一个可嵌入文件)

验证: go build ./... ✅ | tsc -b ✅ | npm build ✅(21s) | 17/17 集成测试 ✅
质量: any=37 unused=2 console=0
2026-07-02 08:26:56 +08:00
attacker f170fed900 fix(tools): 安装脚本国内镜像优化 + 版本升级
- Node.js: pipe-to-tar 改为下载到文件再解压(修复 302 重定向导致 curl 23)
  新增阿里云/清华镜像,降级使用 python3 tarfile 解压
- Maven: 3.9.9→3.9.16(旧版镜像全部 404)
  新增阿里云/清华/中科大/南大镜像,下载后校验 gzip magic
- JDK: 17.0.13+7→17.0.19+10(Adoptium 已清理旧版)
  新增阿里云/华为/中科大/清华镜像
- 全部添加 --connect-timeout 和 gzip 校验
2026-07-02 00:21:13 +00:00
attacker cde7bbe540 fix: 清理 unused-vars 回归(32→0) + 修复 go:embed 编译阻塞
1. ESLint unused-vars 从 32 清零(回归修复)
   - 删除 14 个文件中未使用的 import(lucide 图标/shadcn 组件/JsonData 类型)
   - 移除未使用的变量/参数(categoryLabels/updateEntry/onSaved 等)
   - 涉及: AppRelease/PipelineEditor/KubernetesNodes/AlertCenter/SilenceRulesPanel 等

2. 修复 go:embed all:static 编译阻塞
   - 新增 backend/static/.gitkeep 占位文件
   - 全新 clone 后 go build ./... 可直接通过(不再依赖先 npm run build)

3. 安装缺失的 npm 依赖
   - react-markdown/remark-gfm(AgentMarkdown 组件)
   - @codemirror/lang-python/@codemirror/legacy-modes(ScriptCodeEditor 组件)

验证: go build✅ | tsc -b✅ | npm build✅(21s) | ESLint any=41 unused=0 | 17/17 集成测试✅
2026-07-02 00:08:23 +08:00
attacker 092d0e4b9e refactor: Dockerfile.embed → Dockerfile + fix Login TS error
- Dockerfile.embed 重命名为 Dockerfile(统一命名规范)
- docker-compose.yml / run.sh 引用更新
- 全量文档(CLAUDE/AGENTS/README/docs)Dockerfile.embed → Dockerfile
- fix: Login.tsx User 类型缺少 email/status 字段
2026-07-01 04:54:53 +00:00
attacker 9a3dd304f7 fix(build): 移除 agent_cli.go 中不存在的 ReasoningEnabled 字段引用
commit 3b19ae6 (ssh-key 转圈修复) 意外引入 ReasoningEnabled 引用,
但 llm.Config 和 model.LLMConfig 均无此字段导致 go build 编译失败。
移除该行恢复正常编译。
2026-07-01 06:39:46 +08:00
attacker 6db6acc6bd feat(i18n): U5 Kubernetes 模块国际化 — 新增 k8s 命名空间(184键) + KubernetesClusterDetail/TopologyView 全量迁移硬编码中文改翻译键
- 新增 k8s 翻译命名空间: cluster/tab/column/empty/label/topology/resource/workload 8 子命名空间
- KubernetesClusterDetail.tsx: 7 Tab(概览/节点/Pod/Deployment/Service/Ingress/事件) 表头+空状态+趋势图标签全量国际化
- TopologyView.tsx: 标题/编辑模式/连线模式/节点编辑弹框/Toast/搜索栏全量国际化
- 新增 common.duration.minAgo 插值键
- 翻译键 1019→1204(+185), 11 命名空间, zh-CN/en-US 完全对齐
- tsc --noEmit=0, npm build✅(17.81s), 17/17 测试通过
2026-07-01 02:28:33 +08:00
attacker 01967bc52b feat(i18n): deploy 模块(Pipeline/Credential)国际化增量迁移 — 翻译键 deploy 命名空间(455键) + CredentialManager 补全 3 处 UI 文案
- PipelineManager.tsx: 流水线全量翻译(标题/搜索/CRUD/阶段/任务/运行/横幅)
- CredentialManager.tsx: 操作按钮 title 属性补全(编辑/禁用启用/删除)
- zh-CN.json + en-US.json: deploy 命名空间 455 键完全对齐
- 总翻译键: 1019(zh) = 1019(en)
- tsc -b 零错误, npm build 成功(17.42s)
2026-06-30 22:10:26 +08:00
attacker ed7a5c07a7 feat(monitor): M15 中间件监控 — Redis/MySQL 后端直连采集引擎
后端:
- 新增 controller/middleware_monitor.go (500+ 行) — CRUD + 测试连接 + 采集引擎
- 后台 goroutine 每 30s 自动连接 Redis/MySQL 采集指标
- Redis: go-redis v9 INFO+DBSIZE 命令采集 12 项指标
- MySQL: database/sql SHOW GLOBAL STATUS 采集 12 项指标
- 指标写入 MetricHistory 表,7 天自动清理
- 8 个 RESTful 路由注册到 routes.go

前端:
- MiddlewareMonitor.tsx 从只读卡片升级为完整管理页面
- 添加监控弹框(Redis/MySQL 类型选择+连接配置表单)
- 实例卡片操作栏(测试/编辑/删除) + 工具栏(立即采集/刷新)
- middlewareMonitorApi 8 个方法

验证: go build✅ npm build✅ 17/17 回归通过 Redis 12 指标✅ MySQL 12 指标✅
2026-06-29 23:24:05 +08:00
attacker 186ece6495 feat(i18n): 安全审计模块全量国际化 — 7 文件硬编码中文改翻译键 + audit 命名空间(89 键)
迁移文件:
- AuditOperationsTab.tsx — 操作审计(搜索/筛选/虚拟滚动表格/详情弹窗/统计弹窗)
- TerminalAuditTab.tsx — 终端审计子标签(在线/历史/命令)
- LoginLogsTab.tsx — 登录日志(DataTable + 状态筛选 + 登录方式)
- ActiveSessionsPanel.tsx — 在线会话(自动刷新 + 阻断确认 + 实时监控)
- HistorySessionsPanel.tsx — 历史会话(回放/下载录制)
- SessionCommandsPanel.tsx — 会话命令(虚拟滚动)
- helpers.tsx — formatDuration/getStatusBadge (i18n.t 非组件模式)

翻译键: audit 命名空间 89 键 (operations/login/terminal 三子域)
  + common.duration 时长单位(秒/分/时)
总键数: 481→610, 命名空间: 8→9 (common/menu/header/login/dashboard/server/alert/approval/audit)
zh-CN/en-US 完全对齐, tsc -b=0, npm build✓, 17/17 测试通过
2026-06-29 20:44:08 +08:00
attacker fef4997391 feat(i18n): Approval 审批模块全量国际化 — 11 文件硬编码中文改翻译键 + approval 命名空间(136 键)
迁移文件:
- pages/approval/: ApprovalWorkflowPage + ApprovalCategoryPage + 3 子页面(Resource/App/Permission)
- components/approval/: ApprovalFlow + ApprovalProcessTab + ApprovalCreateDialog + ApprovalDetailDialog + ApprovalTemplateTab + helpers

翻译键: approval 命名空间 136 键 (8 子组: category/step/status/col/editor/detail/flow/type/msg)
复用 common.* 通用键 (approve/reject/cancel/save/create/delete/edit/detail/close/loading 等)
zh-CN/en-US 完全对齐, 8 命名空间 (common/menu/header/login/dashboard/server/alert/approval)

模式: 组件内 useTranslation() + t(); 模块级常量/helpers 用 i18n.t()
labelKey 模式: STATUS_TABS/statusMap 从 label:string 改为 labelKey:string + i18n.t(config.labelKey)
2026-06-29 18:25:29 +08:00
attacker 61a1f32e64 feat(i18n): AlertCenter 告警中心国际化 — 38 处硬编码中文改翻译键 + alert 命名空间(58 键)
- AlertCenter.tsx: StatStrip 4 标签/5 个 Tab 标题/搜索/级别+状态筛选/表头 6 列/分页/加载空状态/toast 12 处/确认弹框 3 处/一键报警描述/规则启用禁用/联系人联系组增删 全量 t() 化
- 复用 common.* 通用键(refresh/edit/delete/status)
- 新增 alert.* 命名空间: stat/tab/severity/status/table 子组 + searchPlaceholder/quickSetup/toast 等 58 键
- zh-CN/en-US 键总数 285→343 (alert 58 键, 中英完全对齐)
- tsc -b=0, npm build=✓(19.59s), 17/17 集成测试通过
2026-06-29 13:46:20 +08:00
attacker 3e9352f690 feat(i18n): ServerManager 服务器管理页国际化 — 27 处硬编码中文改翻译键 + server 命名空间(48 键)
- ServerManager.tsx: 页面标题/按钮/搜索/状态筛选/表头/分页/toast/CSV导出/确认弹框 全量 t() 化
- 复用 common.* 通用键(refresh/export/delete/status/actions/loading/running/stopped/maintenance/offline)
- 新增 server.* 命名空间: title/subtitle/batchImport/cloudImport/csvImport/addServer/searchPlaceholder/tableHeaders/pagination/toast/csv 子组
- zh-CN/en-US 键总数 242→290 (server 48 键, 中英完全对齐)
- tsc -b=0, npm build=✓(19.13s), 17/17 集成测试通过
2026-06-29 13:25:18 +08:00
attacker eb0fef7fce feat(i18n): Dashboard 页面内容国际化迁移 — 3 组件(Dashboard/DashboardCharts/DashboardRecent)硬编码中文改翻译键 + zh-CN/en-US 新增 dashboard.* 121 键(241 total)
- Dashboard.tsx: 标题/副标题/刷新/服务器按钮/StatStrip 7 标签/概览卡片标题 全部 t() 化
- DashboardCharts.tsx: 云成本概览/Top5资源使用/费用分布/月度趋势/环比标签 i18n(computeMonthChange 用 i18n.t 避开非组件上下文)
- DashboardRecent.tsx: 告警消息/证书到期/发布历史/服务器状态/集群状态 5 卡片全量 i18n
- zh-CN.json/en-US.json: dashboard 命名空间扩展 stat/alerts/certificates/releases/serversStatus/clusters/cost/topUsage/system 9 子分组
- 翻译键总数 120→241 (zh-CN/en-US 完全对齐)
- tsc -b=0, npm build=✓(19.01s), 17/17 集成测试通过, Docker healthy
2026-06-29 13:06:38 +08:00
attackerandClaude c0ee8e4ddd refactor(frontend): api/components/pages 目录架构统一对齐菜单域 + 日志中心修复
1. 目录架构统一(API = components = 菜单域,一域一目录 + barrel)
   - log/ 提为独立顶层域(日志中心在菜单中与监控中心平级,不再塞在 monitor/)
   - task/ 拆分原 automation.ts → cron-job / script / remote-exec
   - aiops/ 合并 ai.ts + agentCli.ts → assistant + agent-cli
   - agent/ approval/ audit/ 提升为域目录
   - auth 拆分:authApi(认证自服务) + system/user.ts(userApi+ldapApi 管理端)
   - components/automation → components/task,菜单"自动化运维"→"作业任务"
   - pages/ 按域分子目录(approval/audit/monitor),删孤儿 AuditPage.tsx
   - 所有 API 符号名不变,组件经 @/api 聚合引用,运行时行为零变化

2. Loki 查询无返回修复:aiops 容器 DNS 解析外网域名失败
   (宿主机 systemd-resolved 转发链路异常),docker-compose 显式配 dns 上游

3. ES 查询框布局:工具栏单行挤 7 控件(ES 多 150px 索引框),拆两行——
   查询输入独占一行(+查询按钮),次级控件换行 flex-wrap

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-28 06:06:48 +00:00
attacker da01cbb119 refactor(run.sh): optimize build artifact cleanup
- clean_frontend_artifacts: add .vite/.cache/.tmp/*.tsbuildinfo cleanup
- clean_embed_static: rm -rf + mkdir handles dotfiles (was rm static/*)
- new clean_all_artifacts: unified cleanup for all deployment modes
- docker up/build/clean now call clean_all_artifacts before building
- .dockerignore: exclude .vite/*.tsbuildinfo/node cache dirs
- add ./run.sh clean standalone command
2026-06-28 03:35:36 +00:00
attacker 7ed4ce8d3a fix(log): log-datasources List 返回 {list,total} 格式对齐前端期望
前端 logCenterApi.listDatasources 期望 res.list 数组,但后端 List handler
返回裸数组导致前端取 res?.list 为 undefined。改为 model.ListResponse 对齐
项目其他列表端点的惯例格式。
2026-06-28 10:11:23 +08:00
attacker 5fb74a787a fix(log): F6 polish — log datasource create error log + schema patches for auth_type/token/headers + ES default index sync on datasource select 2026-06-28 06:04:18 +08:00
attacker 6bba6144f3 feat(monitor): F6 日志告警引擎 — AlertEngine 支持 type=log 规则查询Loki/ES+触发/恢复 + 数据源认证升级(none/basic/bearer/custom) + 从查询创建告警真实API对接 2026-06-28 04:00:38 +08:00
attacker 894cb16a05 feat(monitor): F5 链路追踪后端对接 — traceApi mock桩改真实Jaeger/Tempo代理+demo兜底
- 后端新增 monitor_trace_datasources 表 + TraceDataSource 模型 (Jaeger/Tempo)
- controller/trace_datasource.go — CRUD + TestConnection + SetDefault (7 路由)
- controller/trace_proxy.go — Jaeger API 代理 + 响应格式转换 (Trace/服务/Span)
  - GET /traces — Trace 列表 (代理 Jaeger /api/traces)
  - GET /traces/services — 服务列表 + P95/P99/errorRate 聚合
  - GET /traces/:traceId — Trace 详情 (Span 树转换)
- Demo 数据兜底: 无数据源时返回模拟数据 (6 Trace + 5 服务 + 5 Span)
- 前端 traceApi 从 mock 改真实 HTTP 调用
- 前端新增 trace-datasource.ts 数据源管理 API
- ROADMAP/TDD_PLAN/PROJECT_EVALUATION 文档同步更新
- 综合评分 90→91, 功能完整性 92→94 (mock API 清零)
2026-06-28 01:51:00 +08:00
attacker 0c2c0adaaf refactor(log-center): 清理重复/死代码组件 — 移除 DatasourceCard/DatasourceDialog/DeleteConfirmDialog/EsQueryPanel/LokiQueryPanel/LogResultsTable/LogLibraryPage/StatusDot/useLogQuery/logLibraryTypes 10 个冗余组件 (1752 行删除) 2026-06-28 01:32:25 +08:00
attacker 0c1964aa85 docs: sync CLAUDE.md + AGENTS.md with actual project state
- 分支名 main→master(仓库实际使用 master)
- Docker Compose: 4容器→3容器,aiops-backend/frontend→aiops embed
- 访问地址: localhost:80→localhost:8080, /health→/version
- 后端目录: cmd/internal→controller/model 扁平结构
- 移除 --dirty 版本后缀引用
- 新增日志中心(log_proxy/log_datasource/UnifiedQueryPanel等)
- 新增 i18n 国际化(i18next, 120+翻译键)
- Dockerfile.embed 说明更正为 K8s 专用
2026-06-27 17:18:35 +00:00
attacker f725ca7cac feat(monitor): F4 自定义监控仪表盘 — mock 桩改真实 CRUD + PromQL 查询渲染
后端:
- 新增 model/custom_dashboard.go (monitor_custom_dashboards 表)
- 新增 controller/custom_dashboard.go (CRUD + 设默认, 6 路由)
- routes.go 注册 /custom-dashboards 路由组
- database.go AutoMigrate 注册 CustomDashboard

前端:
- grafana.ts: dashboardApi 从 mock 返回空改为真实 HTTP 调用
- metrics.ts: prometheusProxyApi 新增 query/queryRange 方法
- GrafanaPanelContent.tsx: 从随机 mock 数据改为执行 PromQL 查询
  + Recharts LineChart 渲染 graph 类型
  + SVG gauge 渲染 gauge 类型
  + 数值卡片渲染 stat 类型
  + 表格渲染 table 类型
  + 30s 自动刷新 + loading/error 状态
  + 自动发现默认 Prometheus 数据源
- GrafanaDashboard.tsx: 传递 datasourceUrl 到 GrafanaPanelContent

验证: go build✅ npm build✅ 17/17 集成测试通过 E2E CRUD 全通过
2026-06-27 23:28:04 +08:00
attacker 7af10097c9 fix(log): input text visibility + space-in-date 502
- UnifiedQueryPanel: fix JS operator precedence — .replace(' ','T') was
  called on '.000Z' suffix instead of concatenated string, resulting in
  '2026-06-27 12:46:28.000Z' (space not replaced) → ES 502
- normalizeTime: add space→T fallback for backward compat
- SyntaxHighlightInput: fix z-index layering (textarea z=2 was covering
  pre z=1, making highlighted text invisible). Move bg/border to parent,
  textarea bg→transparent, pre above textarea
2026-06-27 12:54:31 +00:00
attacker d40042d86e fix(build): kubectl download add --max-time 120 + aliyun mirror fallback 2026-06-27 10:34:31 +00:00
attacker 17059bff98 fix(log): normalizeTime — auto-append .000ms for ES 7.2.0 date_time compat
Frontend may send dates without milliseconds (e.g. 2026-06-27T09:09:17Z),
which ES 7.2.0 strict_date_optional_time rejects. Backend now detects missing
milliseconds and inserts .000 before timezone suffix.
2026-06-27 10:28:41 +00:00
attacker a04d815efe fix(log): ES 7.2.0 time format .SSSZ + index dropdown + demo always visible
- ES query 502 fix: remove +00:00 conversion, use native .SSSZ format
  (ES 7.2.0 date_time = strict_date_optional_time only, rejects +00:00/epoch)
- parseLogTime: use time.RFC3339Nano for fractional seconds
- new API GET /log-datasources/indices to list ES indices via proxy
- LogDatasourceDialog: add '获取索引' button + Select dropdown for ES
- LogDatasourcePage: always show demo sources alongside real ones
2026-06-27 09:45:21 +00:00
attacker 2e179ef7f4 feat(i18n): U3 国际化 — react-i18next 双语框架 + 侧边栏/Header/Login 全量翻译 + 语言切换器
- 安装 i18next + react-i18next,创建 src/i18n/ 配置实例
- 创建 zh-CN.json (120+ 键) + en-US.json 全量英文翻译
- 侧边栏 42+ 菜单项全量 labelKey 国际化
- Header 通知/主题/用户菜单全量翻译
- Login 页面表单/按钮/主题+语言切换器
- zustand useLanguageStore 持久化语言选择
- HTML lang 属性自动同步
- tsc -b=0, npm build=✅, 17/17 测试通过
2026-06-27 16:54:07 +08:00
attacker 084a3be2cf fix(log-center): ES 时间戳双字段兼容 + AI助手按钮去重清理 2026-06-27 16:31:06 +08:00
attacker 36bd0a6155 fix(log-center): 修复 demo 数据源、ES 502、查询页关联 2026-06-27 07:14:54 +00:00
attacker c624ca5b4a feat(ops): U4 后端镜像瘦身 282MB→107MB (62%降幅)
- 移除 git/docker-cli/docker-cli-buildx (~100MB) 改为懒加载
- PipelineHandler 注入 ToolInstaller, runCheckout/runImageBuild 调 EnsureAvailable
- UpgradeTools 自动升级 DB 中 git/docker-cli preinstall→lazy
- 仅内置 linux-amd64 agent (~12MB节省), arm64/darwin 通过下载API
- kubectl 改用 install-kubectl.sh 下载 stripped 版本
- .dockerignore 排除 backend/kubectl 60MB 二进制
- Dockerfile.embed + backend/Dockerfile 同步更新
- 17/17 集成测试通过
2026-06-27 14:28:09 +08:00
attacker 8dd5a07b70 feat(log-center): v0.96 日志库/查询页数据源打通 + AgentCLI 输入修复 + AI助手按钮去重 2026-06-27 14:07:11 +08:00
attacker ba8a4b5f19 feat(ux): U2 统一 DataTable 组件 — 封装排序/搜索/分页/导出/选择/列可见性通用表格 + 迁移 RegionManager/LoginLogsTab/LogDatasourcePage 3 个页面 2026-06-27 12:02:34 +08:00
attacker bdf3c2daf4 feat(log-center): 日志中心 v4 全量组件 — 统一查询面板/时间选择器/统计图表/聚类/数据源管理 2026-06-27 11:41:50 +08:00
attacker 880cf050fe perf: kubectl 本地复制替代网络下载 (去 install-kubectl.sh 卡点)
- 运行时 kubectl 从 backend/kubectl COPY 进镜像 (58MB 预打包)
- 去除 install-kubectl.sh 网络下载 (~10-30s 耗时)
- go build 已从 77s → 24s (CGO_ENABLED=0 + cache mount)
2026-06-27 02:37:50 +00:00
attacker 5f83d6e650 perf: Docker build 提速 — 去 gcc/musl-dev + CGO_ENABLED=0 + cache mount
- 移除 gcc musl-dev (纯 Go SQLite 不需要 CGO)
- CGO_ENABLED=1 → 0 (编译提速 ~2-3x)
- go mod download/go build 加 --mount=type=cache 跨构建复用
2026-06-27 02:03:34 +00:00
attackerandClaude 92a2247390 feat: 新增 Agent CLI — Web 版 AI 运维 Agent(参考 opsxcli 移植)
后端引擎 backend/pkg/agentcli/(纯引擎库,零业务依赖,剥离 CLI/TUI 外壳):
- llm: OpenAI 兼容客户端,复用 model.LLMConfig
- tools: ssh_execute(复用 pkg/remoteexec)+ analyze_output + 风险评估黑名单
- safety: 三级安全模式 + 五级风险 + WebSocket 异步确认
- prompt: 五层 System Prompt
- core: ReAct 16 轮循环 + 自适应检查点 + 循环检测
- evolver: 四层记忆 + 进化循环,data/agentcli/ 文件存储

集成层:
- controller/agent_cli.go: WebSocket 控制器(事件流推流 + 高危确认 + 会话持久化)
- model/agent_cli.go: agent_cli_sessions/messages 表 + AutoMigrate
- 路由 /ws/agent-cli + /api/v1/aiops/agent-cli/sessions
- seed 权限 aiops:agent-cli / aiops:llm-config

前端:
- AgentCLI.tsx: 对话流 + 工具块 + 高危确认 + 四模块 tips 面板
- LLMConfig.tsx: 大模型设置独立页
- api/agentCli.ts + Sidebar/App 菜单路由

文档:
- docs/agent/ 11 篇(opsxcli 同名文档适配改写 + 00-README 映射总览)

其他:
- CLAUDE.md 补充 agent-cli 模块说明
- 修正 .gitignore 根级二进制规则(前导 /,避免误伤 frontend/src/components/aiops/)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-27 09:55:17 +08:00
attacker f2069fe3f0 feat(ux): U1 虚拟滚动 — Pod/事件/审计/命令列表大数据量渲染优化
- 安装 @tanstack/react-virtual@3.14.4
- 新增 hooks/useVirtualRows.ts 可复用虚拟滚动 Hook
- PodsTab: 全量渲染→虚拟滚动, 支持 1000+ Pod + 动态行高(展开行)
- EventTable: 移除 maxRows=200 截断, 万级事件流畅渲染
- AuditOperationsTab: shadcn Table→虚拟滚动 CSS Grid 布局
- SessionCommandsPanel: 虚拟滚动, page_size 200→500
- npm run build ✅, tsc --noEmit ✅, 17/17 集成测试通过
2026-06-27 09:36:17 +08:00
attacker e4f1018ca1 feat(ws): A3 WebSocket 统一连接管理 — 心跳/注册表/监控/优雅关闭
- 新增 pkg/wshub/manager.go 统一 WebSocket 连接管理器 (WSManager)
- 6 个 WebSocket handler 全部迁移: WebShell/kubectl/PodExec/Audit/Metrics/Pipeline
- 心跳机制: ping(30s) + pong handler + read deadline(60s) 自动检测死连接
- 连接注册表: 元数据(类型/用户/远程地址/连接时间/最后活跃)
- 每用户连接限制 MaxConnsPerUser=15 防资源耗尽
- 监控端点: GET /api/v1/ws/stats + GET /api/v1/ws/connections
- 优雅关闭: CloseAll() 发送 CloseGoingAway 帧并关闭所有连接
- 消除 3 个重复 websocket.Upgrader 变量统一为 WSManager 内部 upgrader
- 6/6 A3 测试通过, 17/17 回归测试通过
2026-06-27 07:20:11 +08:00
attacker 00a98e210d feat(k8s): A1 K8s 双路由体系统一 — code 路由为主, ID 路由标记 deprecated
后端:
- 新增 4 条 all-NS code 路由: services/ingresses/cronjobs/nodes
- ListNodes 改用 getK8sClientByCode (兼容 ID+code)
- ID 域资源路由标记 // Deprecated

前端:
- clusterApi/nodeApi/workloadApi 资源方法迁移到 code 路由
- KubernetesClusterDetail/TopologyView/KubernetesNodes 组件从 cluster.id 迁移到 cluster.code
- 修复潜在 bug: ClusterOverviewPage 曾将 code 传给 ID-based getNodes

验证: 16/16 API 测试通过 (7 新 code 路由 + 3 旧 ID 兼容 + 6 回归)
go build=✅ tsc -b=✅ npm build=✅
2026-06-27 04:50:58 +08:00
attacker bb2b91ebe0 feat(q1): 前端类型安全治理完成 — any 83→40, P0 全部 done
- types/monitor.ts: 新增 6 个运行时记录类型(AlertEventRecord/AlertRuleRecord/
  AgentHostRecord/CronJobRecord/CertExpiryRecord/ApprovalWorkflowStepRecord)
- types/common.ts: 新增 OptionItem 通用下拉类型
- 组件级 any 清理 43 处:
  - AlertEventsTab/AlertRulesTab/AlertChannelDialog/alertShared (19处)
  - AuditOperationsTab normalizeLog + 筛选器 (8处)
  - CronJobManager 任务列表/编辑/操作 (6处)
  - AgentMonitor 主机列表/命令执行 (5处)
  - DashboardRecent 5 张卡片组件 (5处)
  - AlertManager 状态类型对齐 (联动修复)
  - Dashboard.tsx 调用端类型对齐 (联动修复)
- AlertChannel 接口新增 test_status 字段
- ESLint any: 83→40 (<50 目标达成)
- tsc -b / tsc --noEmit: 零错误
- npm run build: ✓ built in 17.11s
- 9/9 核心 API 回归通过
2026-06-27 02:31:26 +08:00
attacker 0535f30c87 chore: 同步前端组件更新 (K8s/Agent/Monitor 相关) 2026-06-26 15:49:31 +00:00
attacker 09d3f5b6e8 chore: 排除前端构建产物,不再追踪 backend/static 生成文件 2026-06-26 23:48:44 +08:00
attacker 310196a791 chore: gitignore 排除前端构建产物 backend/static/ (111 hash 文件) 2026-06-26 15:31:34 +00:00