Files
Nexus/docs/changelog/2026-06-20-btpanel-standalone-module.md
T
2026-07-08 22:31:31 +08:00

51 lines
1.7 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.
# 2026-06-20 — 宝塔面板独立模块
## 摘要
新增与「运维」菜单分离的 **宝塔面板** 分组及 10 个子页,后端 `/api/btpanel/*` 代理宝塔 API(签名 + Redis Cookie)并支持 SSH 生成 `tmp_token` 一键登录。
## 动机
用户需在 Nexus 内统一管理子机宝塔:一键登录、监控、网站/域名/SSL/数据库/计划任务/服务启停,且**不并入**现有服务器、文件、调度页面。
## 功能范围
| 编号 | 子菜单 | 说明 |
|------|--------|------|
| A1/A5 | 面板登录 | API `set_temp_login` 或 SSH `tools.py` |
| B1B3 | 系统监控 | GetSystemTotal / Disk / NetWork |
| C1,C6 | 网站列表 | 列表 + 启停 |
| C4 | 创建网站 | AddSite |
| C10 | 域名管理 | AddDomain / DelDomain |
| C15 | SSL 证书 | 列表 + SetSSL + apply_cert |
| D1–D4 | 数据库 | 列表 / 创建 / 改密 / 备份 |
| F1 | 计划任务 | GetCrontab 只读 |
| H1 | 服务管理 | ServiceAdmin |
| — | 连接配置 | `extra_attrs.bt_panel` 加密存 API Key |
## 涉及文件
- `server/infrastructure/btpanel/*`
- `server/application/services/btpanel_service.py`
- `server/api/btpanel.py`, `btpanel_schemas.py`
- `server/main.py`
- `frontend/src/pages/btpanel/*`, `components/btpanel/*`, `api/btpanel.ts`
- `frontend/src/App.vue`, `router/index.ts`
- `docs/design/specs/2026-06-20-btpanel-module-design.md`
- `tests/test_btpanel_client.py`
## 迁移 / 重启
- 无 DB 迁移(凭据在 `servers.extra_attrs`
- 需重启 API 加载新路由
- 前端需 `vite build`
## 验证
```bash
pytest tests/test_btpanel_client.py -q
cd frontend && npx vite build
```
侧栏「宝塔面板」→ 各子页;先在「连接配置」填写面板地址与 API Key,并在子机白名单加入中心 IP。