41 lines
1.9 KiB
Markdown
41 lines
1.9 KiB
Markdown
|
|
# 2026-06-02 服务器添加/编辑表单重设计
|
|||
|
|
|
|||
|
|
## 摘要
|
|||
|
|
|
|||
|
|
Vuetify 服务器页的添加/编辑对话框与 `ServerCreate` 及 2026-05 设计文档对齐:认证方式、密码/SSH 密钥预设、目标路径、分类 combobox、平台/节点高级项。
|
|||
|
|
|
|||
|
|
## 动机
|
|||
|
|
|
|||
|
|
迁移 SPA 后表单仅含名称、错误字段 `address`、裸密码框,无法使用凭据预设与密钥认证,且缺少必填 `target_path`,导致与后端及旧版 `servers.html` 行为不一致。
|
|||
|
|
|
|||
|
|
## 涉及文件
|
|||
|
|
|
|||
|
|
- `frontend/src/composables/servers/useServerFormDialog.ts`(新建)
|
|||
|
|
- `frontend/src/components/servers/ServerFormDialog.vue`(新建)
|
|||
|
|
- `frontend/src/pages/ServersPage.vue`
|
|||
|
|
- `docs/design/specs/2026-06-02-server-form-redesign.md`
|
|||
|
|
- `docs/design/plans/2026-06-02-server-form-redesign.md`
|
|||
|
|
|
|||
|
|
## 迁移 / 重启
|
|||
|
|
|
|||
|
|
- 仅前端构建产物;需 `vite build` 后部署 `web/app/`
|
|||
|
|
- 后端无变更,无需重启(仅前端更新时不必重启 nexus)
|
|||
|
|
|
|||
|
|
## 验证
|
|||
|
|
|
|||
|
|
1. 服务器页 → **添加**:可见「密码 / SSH 密钥」切换、密码预设下拉、目标路径默认 `/www/wwwroot`
|
|||
|
|
2. 选择密码预设后 SSH 密码框隐藏
|
|||
|
|
3. 保存后 Network 中 `POST /api/servers/` 含 `auth_method`、`target_path`、`preset_id` 等
|
|||
|
|
4. **编辑** 回填 `auth_method`、`preset_id`、`target_path`、分类
|
|||
|
|
|
|||
|
|
## 部署记录(2026-06-02)
|
|||
|
|
|
|||
|
|
- 构建:`npx vite build`(Windows Node 20+)
|
|||
|
|
- 上传:`scp` → `root@47.254.123.106:/tmp/nexus-frontend.tar.gz`
|
|||
|
|
- 解压:`/www/wwwroot/api.synaglobal.vip/web/app`
|
|||
|
|
- 清理:`prune_frontend_assets.py`(removed=2203, kept=173)
|
|||
|
|
- 重启:`supervisorctl restart nexus`
|
|||
|
|
- 健康:`/health` → `ok`,`/app/` → HTTP 200
|
|||
|
|
- 产物:`ServersPage-CmUnLCji.js` 已含 `ServerFormDialog`(认证方式/密码预设/目标路径等文案)
|
|||
|
|
- 说明:本机 Cursor 内置浏览器访问 `https://api.synaglobal.vip/app/login` 为黑屏(环境网络/渲染限制),请在已登录浏览器打开 `/app/servers` 点「添加」终验
|