From e05ecb40808dc69cfdc41adae52e21ab5d288778 Mon Sep 17 00:00:00 2001 From: attacker Date: Sun, 14 Jun 2026 08:17:09 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E6=97=A5=E5=BF=97=20=E2=80=94=20=E8=AE=B0=E5=BD=95=E4=BA=91?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD+mock.go?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/dev-log.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/dev-log.md b/docs/dev-log.md index a2d6ed6..b9ee86f 100644 --- a/docs/dev-log.md +++ b/docs/dev-log.md @@ -191,3 +191,27 @@ cd ~/devops/aiops - 联动验证: 新增账号后 dashboard month_cost 实时更新(95200→100200)✅ - 浏览器 UI 验证: 添加账号弹窗正常打开、字段填写、提交后列表刷新显示新账号 ✅ - 服务运行中: 后端:8080 + 前端:5173 ✅ + +## 2026-06-14 08:15 自动推进 + +- **任务**: 云账号编辑功能 + 修复 scripts/mock.go 编译错误(generateNotifyChannels 未定义)+ 提交前序未入库的告警通知渠道 CRUD +- **修改**: + - `backend/scripts/mock.go` — **编译错误修复**: 补充缺失的 `generateNotifyChannels` 函数(5种渠道种子:邮件/短信/钉钉/企业微信/Webhook),解决 `go build ./...` 失败 + - `backend/internal/api/handlers/server.go` — 新增 `UpdateCloudAccount` handler:查询现有记录→仅在提供非空值时更新凭证字段(AccessKey/SecretKey 留空保持不变)→db.Save + - `backend/internal/api/routes/routes.go` — 注册 `PUT /cloud-accounts/:id` 路由 + - `frontend/src/services/api.ts` — cloudApi 新增 `updateAccount(id, data)` 方法 + - `frontend/src/components/cloud/CloudAccountManager.tsx` — 编辑功能:添加 editingAccount 状态 + handleOpenEdit 预填表单 + handleSubmit 统一处理创建/编辑 + 卡片新增编辑按钮(Pencil图标) + Dialog 标题/描述/按钮文案动态切换 + AccessKey/SecretKey 标签"留空保持不变"提示 + - 包含前序未提交的变更(已验证编译通过):告警通知渠道 CRUD 后端API(alert.go handlers + models)、AlertManager 通知配置前端UI、AlertCenter 通知渠道管理弹窗 +- **结果**: + - `go build ./...` 全包编译通过(含 scripts/)✅ + - `npx tsc --noEmit` 类型检查通过 ✅ + - `npm run build` 构建通过 ✅ + - API 验证: PUT /cloud-accounts/1 → Code 200 "更新成功",monthly_cost 28500→30000 ✅ + - 凭证安全验证: 更新请求不含 access_key/secret_key,DB 中原凭证 LTAIDuBzWq... / pQyacN59tQ... 保持不变 ✅ + - 浏览器 UI 验证: 编辑弹窗正常打开,4个字段预填正确,标题显示"编辑云账号",凭证字段显示"留空保持不变"提示 ✅ + - git push origin master 成功 (commit af2e60a) ✅ +- **下一步建议**: + - K8s 集群拓扑图(TopologyView)前后端数据联调 + - 仪表盘「+12.5%」等增长率标签从硬编码改为基于 month_trend 真实计算 + - 域名管理编辑功能(当前仅有 GET/POST/DELETE,缺 PUT 端点,与云账号编辑同理) + - 告警规则关联通知渠道 — 规则创建时可选择已配置的通知渠道