feat: 重构控制台为37du自动化平台,新增权限授权与通知中心功能

- 更新系统名称、登录页宣传文案为37du平台相关内容
- 移除聊天功能相关代码与配置
- 新增客户端版本上报字段与设备统计接口
- 新增通知中心功能(60s轮询、localStorage已读标记)
- 新增权限授权工作台相关接口与页面
- 新增统一页头组件ArtPageHeader
- 调整快速入口配置指向真实功能页面
- 修复控制面地址为内网生产库
This commit is contained in:
2026-10-15 18:01:29 +08:00
parent f0a94bf523
commit a7dbc5a77e
49 changed files with 4925 additions and 2904 deletions
+17 -9
View File
@@ -6,7 +6,14 @@
## 1. 总览
版本源(插件包 + 壳子安装包 + 文件登记)全部在**中心机控制面**(`http://117.72.191.188:8800`)。
版本源(插件包 + 壳子安装包 + 文件登记)全部在**中心机控制面**(内网 `http://172.30.30.243:8800`)。
> ⚠️ **发版必须指向内网库**(2026-10-15 踩坑):控制面有两套——
> 内网生产库 `http://172.30.30.243:8800`(执行机实际连接源,端口分工:8800 控制面 / 8802 文件服务器下载 /
> 8899 文件服务器管理台)与公网旧库 `http://117.72.191.188:8800`(迁移前旧库,仍在线但执行机不连)。
> 两库数据不同步,发错库的症状:执行机永远"已是最新版本"/插件不更新,而公网库里查得到记录。
> 发版命令一律**显式** `--base http://172.30.30.243:8800`;
> 验证:`curl -H "X-API-Token: <token>" http://172.30.30.243:8800/api/shell/version`。
| 交付物 | 更新机制 | 入口 |
|--------|----------|------|
@@ -26,16 +33,16 @@ d:\work\code\37duAutomation\.venv\Scripts\python.exe -m controlplane.tools.agent
1. **密码登录(推荐,任意机器可用)**:
`--admin <管理员> --password <密码>`(或环境变量 `AGENT_ADMIN_PASSWORD` / `AGENT_ADMIN_ACCOUNT`),
远程机器再加 `--base http://<中心机地址>:8800`
并**一律显式加** `--base http://172.30.30.243:8800`(内网生产库,勿用公网旧库,见第 1 节警告)
2. **本机密钥自签(仅中心机本机)**:复用 `controlplane/.env` 与 `.admin_secret`
实际账号:管理员 `puddy`,密码 `123456`,中心机控制面 `http://117.72.191.188:8800`。
实际账号:管理员 `puddy`,密码 `123456`,中心机控制面 `http://172.30.30.243:8800`。
本开发机直接示例:
```powershell
d:\work\code\37duAutomation\.venv\Scripts\python.exe -m controlplane.tools.agent_cli `
--admin puddy --password 123456 --base http://117.72.191.188:8800 `
--admin puddy --password 123456 --base http://172.30.30.243:8800 `
publish <插件.zip> --id <id> --version <v>
```
@@ -47,7 +54,7 @@ d:\work\code\37duAutomation\.venv\Scripts\python.exe -m controlplane.tools.agent
```powershell
.venv\Scripts\python.exe -m controlplane.tools.agent_cli `
--admin puddy --password 123456 `
--admin puddy --password 123456 --base http://172.30.30.243:8800 `
publish dist-plugin\<id>_v<版本>.zip --id <id> --version <版本>
```
@@ -55,8 +62,8 @@ d:\work\code\37duAutomation\.venv\Scripts\python.exe -m controlplane.tools.agent
3. **授权 / 收回**(按账号管控可执行性):
```powershell
.venv\Scripts\python.exe -m controlplane.tools.agent_cli grant <账号> <id>
.venv\Scripts\python.exe -m controlplane.tools.agent_cli revoke <账号> <id>
.venv\Scripts\python.exe -m controlplane.tools.agent_cli --base http://172.30.30.243:8800 grant <账号> <id>
.venv\Scripts\python.exe -m controlplane.tools.agent_cli --base http://172.30.30.243:8800 revoke <账号> <id>
```
4. **执行机端**:登录后按账号权限自动同步——`plugin_sync.py` 拉版本清单 → 下载 → sha256 校验 →
@@ -77,12 +84,13 @@ d:\work\code\37duAutomation\.venv\Scripts\python.exe -m controlplane.tools.agent
```powershell
.venv\Scripts\python.exe -m controlplane.tools.agent_cli `
--admin puddy --password 123456 `
--admin puddy --password 123456 --base http://172.30.30.243:8800 `
file push <安装包> --category shell --version <新版本> [--notes "说明"]
```
> 安装包上传到内网文件服务器(`FILESERVER_BASE_URL=172.30.35.135:8802`),并登记到中心机
> 安装包上传到内网文件服务器(`FILESERVER_BASE_URL=172.30.30.243:8802`),并登记到**内网中心机**
> `file_sources(shell)`,执行机 `shell_updater` 从该直链下载。**不要用旧的 `shell-release` 子命令**。
> 登记(`--base`)必须指内网库 `http://172.30.30.243:8800`,发到公网旧库执行机检测不到(见第 1 节警告)。
6. **执行机端**:自动下载安装包,前端提示后用户点击升级重启。