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
This commit is contained in:
1 parent
cd30af5bd6
commit
e19c27707f
8 files changed
+101
-3
No files matched your search
+63
@@ -1088,3 +1088,66 @@ python3 ../tests/integration_test.py --host 127.0.0.1 --port 8080
|
||||
- [x] U4: KubernetesClusterDetail 非注释 CJK = 0
|
||||
- [x] U5: TopologyView 非注释 CJK = 0
|
||||
- [x] U6: 17/17 集成回归测试通过
|
||||
|
||||
---
|
||||
|
||||
## P3-U13: 主机监控大屏挂载(HostMonitorDashboard 死代码复活)
|
||||
|
||||
### 验证用例
|
||||
|
||||
```bash
|
||||
# U1: 路由配置存在
|
||||
grep -c 'host-dashboard' /srv/aiops/frontend/src/App.tsx
|
||||
# 期望: >= 2 (lazy import + Route)
|
||||
|
||||
# U2: Sidebar 菜单项存在
|
||||
grep -c 'host-dashboard' /srv/aiops/frontend/src/components/layout/Sidebar.tsx
|
||||
# 期望: >= 1
|
||||
|
||||
# U3: Breadcrumb 映射存在
|
||||
grep -c 'host-dashboard' /srv/aiops/frontend/src/components/layout/Breadcrumb.tsx
|
||||
# 期望: >= 1
|
||||
|
||||
# U4: i18n 翻译键存在且对齐
|
||||
python3 -c "
|
||||
import json
|
||||
zh = json.load(open('/srv/aiops/frontend/src/locales/zh-CN.json', encoding='utf-8'))
|
||||
en = json.load(open('/srv/aiops/frontend/src/locales/en-US.json', encoding='utf-8'))
|
||||
assert zh['menu']['hostDashboard'] == '主机大屏'
|
||||
assert en['menu']['hostDashboard'] == 'Host Dashboard'
|
||||
assert zh['breadcrumb']['hostDashboard'] == '主机大屏'
|
||||
assert en['breadcrumb']['hostDashboard'] == 'Host Dashboard'
|
||||
print('✅ i18n keys aligned')
|
||||
"
|
||||
|
||||
# U5: TypeScript 编译零错误
|
||||
cd /srv/aiops/frontend && npx tsc -b 2>&1 | tail -3
|
||||
# 期望: 退出码 0
|
||||
|
||||
# U6: Vite 构建
|
||||
npm run build 2>&1 | tail -3
|
||||
# 期望: built in Ns
|
||||
|
||||
# U7: ESLint 无新增 errors
|
||||
npx eslint src/ --format json 2>/dev/null | python3 -c "
|
||||
import json, sys
|
||||
data = json.load(sys.stdin)
|
||||
errors = sum(1 for r in data for m in r.get('messages', []) if m.get('severity') == 2)
|
||||
assert errors == 0, f'{errors} errors'
|
||||
print('✅ ESLint errors=0')
|
||||
"
|
||||
|
||||
# U8: 集成回归测试
|
||||
python3 /srv/aiops/tests/integration_test.py --host 127.0.0.1 --port 8080 | tail -3
|
||||
# 期望: 17/17 passed
|
||||
```
|
||||
|
||||
### 通过标准
|
||||
- [x] U1: App.tsx 路由配置存在(lazy import + Route path="host-dashboard")
|
||||
- [x] U2: Sidebar 监控菜单含「主机大屏」项
|
||||
- [x] U3: Breadcrumb 路由映射存在
|
||||
- [x] U4: zh/en 翻译键对齐(menu.hostDashboard + breadcrumb.hostDashboard)
|
||||
- [x] U5: `tsc -b` 零错误
|
||||
- [x] U6: `npm run build` 零错误(✓ built in 17.50s)
|
||||
- [x] U7: ESLint errors=0(无新增)
|
||||
- [x] U8: 17/17 集成回归测试通过(零回归)
|
||||
Reference in new issue
Block a user