feat(k8s): M6 编辑器基础设施 + 基本信息 Tab + YAML编辑器

- DeploymentWorkload: 三模式切换(查看/编辑/YAML编辑)+ EditModeContainer Tab 导航系统
- DeploymentEditBasic: 新增基本信息 Tab — replicas/labels/annotations/selector 编辑
- YamlViewer: 升级为 CodeMirror 6(语法高亮+行号+折叠+括号匹配),新增 inline 内联模式
- DeploymentDetailPage: mode 类型扩展为 view|edit|yaml
- 路由 :mode 参数自动支持 yaml 值
- M7-M9 Tab 预留占位(容器信息/存储/高级/服务)
This commit is contained in:
attacker committed 2026-06-23 05:15:42 +08:00
1 parent 2e66908e20
commit 68a954c1c5
9 files changed
+855 -42

No files matched your search

+40
View File
@@ -136,3 +136,43 @@ curl -s "http://127.0.0.1:8080/api/v1/kubernetes/prod-cluster/namespace/devops/d
- [x] ID 路由 + Kuboard code 路由均可用
- [x] 前端操作菜单显示「暂停更新/恢复更新」动态切换
- [x] CI/CD 发布按钮可跳转到流水线页面
---
## M6: 编辑器基础设施 + 基本信息 Tab + YAML编辑器
### 验证用例
```bash
# U1: 三模式路由 SPA fallback 200(非 301/404)
curl -s -o /dev/null -w "%{http_code}" \
"http://127.0.0.1/kubernetes/prod-cluster/namespace/devops/workload/yaml/Deployment/redis"
# 期望: 200
# U2: YAML GET API — CodeMirror 编辑器数据源
curl -s "http://127.0.0.1:8080/api/v1/kubernetes/prod-cluster/namespace/devops/deployments/redis/yaml" \
-H "Authorization: Bearer *** | head -5
# 期望: apiVersion: apps/v1 / kind: Deployment / metadata:
# U3: 前端构建含 CodeMirror 依赖
curl -s http://127.0.0.1/ | grep -oP 'index-[A-Za-z0-9]+\.js'
# 期望: 新 hash(每次构建变化)
# U4: TypeScript 编译无错误
cd frontend && npx tsc --noEmit
# 期望: 退出码 0
# U5: Vite 生产构建成功
cd frontend && npm run build 2>&1 | tail -3
# 期望: built in Ns
```
### 通过标准
- [x] U1: yaml 路由 SPA fallback 返回 200
- [x] U2: YAML API 返回有效 K8s manifest(apiVersion/kind/metadata 齐全)
- [x] U3: 前端 bundle 含 CodeMirror(codemirror 关键字在 JS chunk 中)
- [x] U4: TypeScript 零编译错误
- [x] U5: Vite 生产构建成功
- [x] YamlViewer 支持弹窗模式 + 内联模式(inline prop)
- [x] DeploymentEditBasic 可编辑 replicas/labels/annotations/selector
- [x] 编辑模式 Tab 导航系统就绪(基本信息可用 + M7-M9 预留)