Files
37duAutomation/desktop/controlplane/README.md
T
puddy c89da029c8 feat(controlplane): 定时备份槽位支持流程编排 flows 字段
- POST/GET /api/schedules/backup 增加 flows 支持,schema_version=2

- 老客户端只推 schedules 时保留已有 flows,避免流程编排被抹掉

- 新增上限:flows 200 条、备份体 2MB(413/400 明确报错)

- 同步旧 FastAPI 版 schedules.py(仅兼容维护,内网生产为 controlplane-next)
2026-10-27 13:39:13 +08:00

33 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 控制面(FastAPI 版)— ⚠️ 已废弃
> **状态:DEPRECATED(2026-10 起)**
> 本目录是**第一代中心机服务端**(Python / FastAPI + 自研 Vue 控制台),
> 已由 [`desktop/controlplane-next`](../controlplane-next)(cool-admin-midway + Art Design Pro)取代。
>
> - **不要在这里加新功能**,新需求一律走 `controlplane-next`
> - 仅保留 **必要的问题修复**,用于给尚未升级的执行机兜底、以及迁移期的回滚
> - 计划在全部执行机升到 2.x 后下线;下线前请确认没有存量设备仍指向这套服务
> - 迁移背景与范围见 [`docs/架构/服务端迁移方案_cool-admin.md`](../../docs/架构/服务端迁移方案_cool-admin.md)
## 为什么还留着
- 存量执行机(1.x)仍可能指向这套服务的 `/api/*` 契约,直接删除会导致它们无法登录/同步插件
- 迁移期需要能快速回滚:新服务出问题时,把地址切回这里即可恢复
## 兼容性说明(维护时注意)
执行机 1.8 起,`POST /api/schedules/backup` 的 `data` 里会多一个 `flows` 字段(流程编排备份)。
本目录的 `apis/schedules.py` 已做兼容处理(不认识的字段原样存储、未带 flows 时保留旧值),
**不要因为"老服务不需要流程"就删掉这段逻辑**,否则 1.8+ 客户端备份完再被 1.7.x 客户端推一次就会丢流程。
## 启动方式(保留备查)
```bash
# 需在 desktop/ 目录下执行(模块搜索根 = desktop/)
python -m controlplane.app # 首次自动建表 + 种子 + 生成示例包
uvicorn controlplane.app:app --port 8800
```
DB:MySQL(连接参数见 `.env` 的 `MYSQL_*`,库 `37du_center`);插件包放 `packages/`;
`CONTROLPLANE_TOKEN` 非空时客户端须带 `X-API-Token`。