Commit Graph
290 Commits
Author SHA1 Message Date
attacker 3039b76cb5 fix(i18n): U30 修复 8 处批量 i18n 转换损坏的调用 — DeploymentEditContainers/DeploymentEditStorage/AgentRuleDialog/LogFieldSidebar
损坏原因: 早期批量正则 i18n 转换 (U20 记录的 i18n.t() 损坏模式遗留) 将模板表达式/JSX
碎片错误包裹进 i18n.t() 调用, 产生运行时垃圾文本渲染.

修复清单:
- DeploymentEditContainers.tsx:85 — toast 调用 description 字段损坏 (i18n.t('), description: ...'))
- DeploymentEditStorage.tsx:175 — !manifest 空状态文案损坏
- DeploymentEditStorage.tsx:202 — 数据卷卡片副标题损坏
- AgentRuleDialog.tsx:111 — DialogDescription 损坏 (i18n.t('>阈值 {ruleForm.metric !== '))
- AgentRuleDialog.tsx:157 — 操作符 Label 损坏
- AgentRuleDialog.tsx:183 — 端口 Label 损坏
- AgentRuleDialog.tsx:195 — 持续时间 Label 损坏
- LogFieldSidebar.tsx:68 — 搜索框 placeholder 损坏

新增 i18n 键 (zh/en 对齐 7370→7376 +6):
- agent.ruleDialog.description / operator / port / duration
- kubernetes.storage.volumeDesc
- monitor.lbl.searchFields

验证: tsc -b=0, npm build✓ (17.99s), ESLint=0/53/0, go build=0, 17/17 测试通过
2026-07-12 09:48:09 +08:00
attacker 064b6c4ec2 refactor(i18n): U29 phantom key 全项目清零 — 28 个 phantom key → 0
AlertRuleDialog.tsx (9处) + DeployTargetFields.tsx (3处) + HealthProbeSection.tsx (2处+1处硬编码) + PodLogsViewer.tsx (2处终端ANSI字符串) + AlertChannelDialog.tsx (2处) + PodMetricsPage.tsx/CapacityPage.tsx (各1处) + PodExecTerminal.tsx (1处终端ANSI) + BuildNodesManager.tsx (1处) + HostDetailDialog.tsx (1处)

修复类型:
- 批量正则损坏的 i18n.t('>中文 <span className=') → 语义化键
- 终端 ANSI 转义字符串 (PodLogsViewer/PodExecTerminal) → 移除 i18n.t() 包裹改纯字符串
- 硬编码中文 (取消/通知渠道提示/日志数据源提示) → i18n.t() 调用

新增 16 个翻译键 (monitor.alertRuleDialog2.* + monitor.alertChannel.name + agent.portCount + monitor.lbl.noProbeHint)
zh/en 7358→7375 +17 键对齐
phantom key 28→0 (全项目零 phantom key)
tsc -b=0, npm build✓ (17.00s), ESLint=0/53/0, go build=0, 17/17 测试通过
2026-07-12 07:34:42 +08:00
attacker b2715ca3bd refactor(i18n): U28 多模块 phantom key 清零 — theme/middleware-monitor/site-monitor/analytics/cost-predict/predict-types/agentAlertHelper/export-audit/AgentCLIMessages/copy-button 10 文件 74 phantom key → 语义化键, 新增 4 命名空间 (theme/agent.alerts.metric*/audit.*) + 扩展 3 命名空间 (monitor.lbl.mw*/site*/aiops.predict*), zh/en 7294→7358 +64 键对齐, phantom key 103→29 (残留全为 JSX 模板表达式/ANSI 转义码误匹配), tsc -b=0, npm build✓ (17.40s), ESLint=0/53/0, go build=0, 17/17 测试通过 2026-07-12 05:18:52 +08:00
attacker b812b3b20c refactor(i18n): U27 多模块 phantom key 批量清理 — Cloud/Deploy/Agent/Monitor/System 5 模块 25 文件, 180 个 phantom key → 51 残留, 129 个替换为语义化键, 新增 12 子命名空间, zh/en 7185→7294 +109 键对齐, tsc -b=0, npm build✓ (16.31s), ESLint=0/0/0, go build=0, 17/17 测试通过 2026-07-12 03:00:20 +08:00
attacker 7f5295cfc2 refactor(i18n): U26 Kubernetes 模块 phantom key 大规模清理 — 32 文件 171 phantom key → 8 残留(均为误匹配), 163 个替换为 k8s.* 语义化键, 新增 19 子命名空间 + 扩展 8 个已有, zh/en 6990→7185 +195 键对齐, tsc -b=0, npm build✓ (17.59s), ESLint=0/53/0, go build=0, 17/17 测试通过 2026-07-12 00:43:20 +08:00
attacker c6a50216dd refactor(i18n): U25 AIOps 模块 phantom key 清零 — analyzerHelpers.ts (23处) + capacity-predict.ts (18处) 中文文本键替换为 aiops.analysis.*/aiops.capacity.* 语义化键 + 硬编码资源名 i18n 化 + buildCapacityInsightPrompt 重复行合并, zh/en 6990=6990 对齐, tsc -b=0, npm build✓ (18.66s), ESLint=0/53/0, go build=0, 17/17 测试通过 2026-07-11 22:31:07 +08:00
attacker d21eac9117 refactor(i18n): U24 Monitor 模块 i18n hook 迁移 — 26 个 .tsx 文件从全局 i18n.t() 迁移到 useTranslation() hook + 89 个 phantom 中文文本键替换为 monitor.lbl.* 语义化键
- 新增 monitor.lbl 翻译子命名空间 89 键(HostMonitor/Middleware/Site/SNMP/Shared)
- 26 .tsx: import i18n → useTranslation() hook + i18n.t('中文') → t('monitor.lbl.semanticKey')
- 模块级代码(TABS/METRIC_CATEGORIES)保留 i18n.t() + 语义化键
- 1 .ts helpers 文件 phantom 键替换
- zh/en 6886→6975 +89 键对齐
- tsc -b=0, npm build✓ (17.16s), ESLint=0/53/0, go build=0, Docker healthy
2026-07-11 20:15:44 +08:00
attacker de6f9454fc refactor(i18n): U23 Task 模块 i18n 治理 — 4 文件 phantom key + hash key + 硬编码中文清零
- CronJobManager/CronJobFormDialog/ScriptManager/RemoteExecPage
  从 import i18n 全局调用改为 useTranslation() hook
- 42 处 phantom key (i18n.t('Chinese text') → 语义化键)
- 28 个孤儿 hash key 清理 (cronjobformdial.s*/remoteexecpaget.s*)
- 50+ 处硬编码 JSX 中文 → t() 调用
- 新增 task.cronJob.*/task.scriptList.*/task.remoteExec.* 子命名空间
- zh/en 6825→6886 keys 对齐
- tsc -b=0, npm build✓ (17.46s), ESLint=0/45/0, go build=0
- 17/17 集成回归测试通过
2026-07-11 17:48:04 +08:00
attacker a8f6fd190b refactor(i18n): U22 日志中心组件 i18n 治理 — QuickQueryBar/types-v3/TimeRangePicker/LogRBAC 中文键清零
- QuickQueryBar.tsx: 23 处中文键 → monitor.logCenter.quickQuery.* 语义键
- types-v3.ts: 15 处中文键 → monitor.logCenter.quickQuery.* 语义键 (含 QUICK_TEMPLATES 3 引擎)
- TimeRangePicker.tsx: 13 处中文键 → monitor.timeRangePicker.* 语义键 + 修复 3 个复制粘贴 bug 键
  (i18n.t('开启后折叠行仅显示前 500 字预览') 应为 '选择时间范围'/'绝对时间'/'自定义时间范围')
  (i18n.t(' > 另存为 <ChevronDown className=') 应为 '相对时间')
- LogRBAC.tsx: 10 处中文键/硬编码 → monitor.logRbac.* 语义键 + 插值键 (scopeCount/deleteConfirm)
- zh/en 新增 68 键对齐 (7038→7098), tsc -b=0, npm build✓ (17.41s), ESLint=0/0/0, 17/17 测试通过
2026-07-11 15:15:47 +08:00
attacker fba5fc46b6 refactor(i18n): U21 Zabbix 组件 i18n 治理 — ZabbixDatasourceManager + ZabbixDashboard 从 i18n.t() 全局改为 useTranslation() hook
- ZabbixDatasourceManager.tsx (415L): 30 处 i18n.t()/硬编码中文清零, 删除 5 个 monitor.zabbixdatasourc.* hash 键, 新增 monitor.zabbixDs.* 语义化命名空间 (23 键)
- ZabbixDashboard.tsx (162L): 12 处 i18n.t()/硬编码中文清零, 删除 monitor.zabbixdashboard.* + monitor.prometheusdashb.s5e8eb212 hash 键, 修复 3 个中文幻影键 (i18n.t('磁盘') → t('monitor.zabbixDs.disk') 等)
- 新增 common.days/common.seconds 通用单位键
- 删除 monitor.zabbixdatasourc (5 hash 键) + monitor.zabbixdashboard (1 hash 键) + monitor.prometheusdashb.s5e8eb212 hash 键
- zh/en 6767=6767 对齐, tsc -b=0, npm build✓ (17.41s), ESLint=0/43/0/0, go build=0, 17/17 测试通过
2026-07-11 12:57:46 +08:00
attacker f953ba3248 fix(U20): ESLint static-components 清零 + CredDetailDialog 内联组件修复 + i18n 损坏修复
- CredDetailDialog.tsx: Field 内联组件提取为模块级 CredField (react-hooks/static-components 23→0)
- 修复 8 处被批量正则损坏的 i18n.t() 调用 (i18n.t('>名称:</span>') → 语义化键)
- 6 处硬编码中文清零 (凭据详情/密钥数据/无/创建时间/更新时间/安全提示)
- 新增 deploy.cred.sensitiveWarn i18n 键 (zh/en 对齐)
- ESLint warnings 66→43 (-35%), errors=0, any=0, unused=0
- tsc -b=0, npm build✓ (17.29s), go build=0, 17/17 测试通过
2026-07-11 10:22:34 +08:00
attacker bb2b50276a refactor(i18n): U19 i18n hash 键治理 — 删除 866 死键 + 重命名 21 高频键
死键清理: 从 zh-CN.json 和 en-US.json 移除 866 个重构遗弃的 unreferenced
hash keys (filename.hash 格式)。这些键在组件迁移到语义化键后成为孤儿。

Live 键重命名 (21 个):
  ui.datatable.s1a2b3c4d → selectedCount
  ui.datatable.s2b3c4d5e → columns
  ui.datatable.s3c4d5e6f → totalCount
  aiops.predictive.s{1-3} → metricsTab/capacityTab/costTab
  aiops.predictivecost.s{1-3} → aiFailed/overview/aiInsight
  task.systemtaskspanel.s{1-3} → monitor/cleanup/finops
  aiops.agentcli.s{1-3} → archLayer/archDesc/securityLayer
  system.useldapmanageme.s{1-2} → ouExists/createOuFailed
  common.requestts.sd3ab821c → common.request.tokenExpired
  k8s.editAdvanced.s0c1fec65 → secondsPlaceholder
  k8s.{kubectl,podExec}.sc8107726 → connectErrorAnsi

影响: zh/en 7597→6731 keys 对齐, 文件 328KB→276KB (-16%)
      仍有 172 个 live hash keys 待后续重命名

tsc -b=0, npm build✓ (17.45s), ESLint=0/66/0, go build=0, 17/17 测试通过
2026-07-11 08:08:07 +08:00
attacker 543365596d refactor(i18n): U19 清理 866 个死 i18n hash 键 — 孤儿键在重构后从未被引用
从 zh-CN.json 和 en-US.json 移除 866 个 unreferenced hash keys(重构遗弃的
filename.hash 格式键名如 common.themets.s02b08e05)。这些键在组件迁移到语义
化键后成为孤儿,仅占用 JSON 文件空间。

影响: zh-CN.json 328KB→276KB (-16%), en-US.json 332KB→280KB (-16%)
      行数 8139→7273 (-866 行/文件)
      剩余 6731 keys zh/en 完全对齐
      仍有 193 个 live hash keys 待重命名(下一步)

tsc -b=0, npm build✓ (17.40s), ESLint errors=0/warnings=66/any=0
2026-07-11 08:02:04 +08:00
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 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 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 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 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