feat(datasource): 完成 M03 数据源配置与熔断巡检

交付三种引擎登记、草稿/已保存连接测试、可逆启用、每源熔断与 Cron 巡检,以及控制台页面;用户确认收尾后标 DONE_LOCAL。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
unknownandCursor committed 2026-11-18 12:50:46 +08:00
1 parent f17bf19709
commit e6d37d176d
98 files changed
+9097 -91

No files matched your search

@@ -0,0 +1,54 @@
# Task Context Pack
## Task Goal
M03 S8:控制台覆盖 D23 — 保存前草稿测、启用、表单校验、详情熔断参数与状态展示。
## Current Slice Or Group
**S8**(已批准编码);`gateClass: standard`,`risk_score: 3`
## Requirement Source
`.task/2026-11-17/m03-datasource/requirement.md`(D23 UI)
## Implementation Source
`.task/2026-11-17/m03-datasource/implementation-plan.md` Slice 8
## Allowed Modification Scope
- `web/apps/console/src/datasources/**`
- `web/apps/console/locales/**`(四语言)
- `web/apps/console/e2e/**` 数据源相关
- 必要时极薄改动:`router.ts` / `AppShell.vue`(仅若导航文案需要)
## Forbidden Modification Scope
- 后端协议重写/迁移动 S6/S7 语义;口令进 localStorage;企微 UI;巡检 Cron 前端配置页(后端 env 即可)
## Key Entrypoints
- `DatasourceEdit.vue`、`DatasourceList.vue`、`client.ts`、`types.ts`、`payload.ts`
- API:`POST /datasources/test-draft`、`POST .../enable`、PATCH circuit_* 字段、公开 JSON 含 circuit_*
- UI 规则:D22 页脚居中;`docs/current/frontend-ui.md`
- 规范:`standards://frontend/frontend-stack?version=2.1.0`、`standards://frontend/element-plus?version=1.0.2`
## Validation Commands
```
cd web/apps/console && pnpm test:unit && pnpm test:e2e && pnpm typecheck
```
(或 filter `@watchman/console` 从 web/)
## Assumptions
- 草稿测:新建密码必填;编辑密码留空可带 id 用已存密文
- host 仅必填;port 1–65535;熔断默认 300/3/600,详情可编辑
- 停用显示启用;开闸提示 + circuit_open_until
- 列表行:停用可启用;开闸不可已保存测试
## Stop Conditions
- S8 评审后进入模块验收门禁(最终确认前不标 DONE_LOCAL)