mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-06-06 00:00:06 +08:00
feat(hermes): Batch 2 §H - Profiles 管理 UI + Dashboard API 通用代理
校对稿要点:「Profiles 全部走 HTTP /api/profiles*,无需自己写 CLI 桥接」。
## 基础设施: hermes_dashboard_api_proxy(通用 9119 HTTP 代理)
新增 Tauri 命令 hermes_dashboard_api_proxy(method, path, body, headers):
- 支持 GET/POST/PUT/PATCH/DELETE
- 走 Dashboard 9119 端口(无需 API_SERVER_KEY,本地绑定)
- 自动 JSON parse + 错误时友好提示「请先启动 Dashboard」
- 一次实现,未来 Batch 2/3 的 Profiles/Kanban/OAuth/Sessions 都走这一个入口
前端 wrapper: api.hermesDashboardApi(method, path, body, headers)
dev-api.js: Web 模式同步实现
## Profiles 管理页 /h/profiles
新文件 src/engines/hermes/pages/profiles.js:
- GET /api/profiles 列表 → 渲染卡片网格(复用 .lazy-deps-grid 样式)
- 每张卡片:profile 名 + active 徽章 + Switch/Rename/Delete 按钮
- 「+ 新建」按钮 → showModal 弹窗(name + clone_from_default 选项)
- 「重命名」→ PATCH /api/profiles/{name} { new_name }
- 「删除」→ showConfirm(带 impact 提示「永久清除会话/凭据/记忆」)→ DELETE /api/profiles/{name}
- 「切换到此」→ 复用现有 chatStore.switchProfile(CLI 实现)
- 失败走 humanizeError 友好提示
- active profile 与 chatStore.state.activeProfile 对齐
## sidebar + 路由
- Hermes 引擎「管理」section 加 Profile 管理入口
- 路由 /h/profiles 注册到 hermes/index.js
## i18n
- engine.hermesProfilesTitle / hermesProfilesDesc / hermesProfilesEmpty
- hermesProfileNew / NewTitle / NameLabel / NameRequired / CloneFromDefault / CloneHint
- hermesProfileSwitch / Switched / SwitchFailed
- hermesProfileRename / RenameTitle / NewNameLabel / Renamed / RenameFailed
- hermesProfileDelete / DeleteConfirm / DeleteImpact / Deleted / DeleteFailed
- hermesProfileActive / Created / CreateFailed
- 共 21 个键 × 3 语言
## 累计
- Rust: 1 个新命令(hermes_dashboard_api_proxy ~50 行)
- 前端: 1 个 wrapper + 新页面 ~180 行
- dev-api.js: 1 个 handler
- i18n: 21 个新键 × 3 语言
- cargo check ✓ + npm build ✓
This commit is contained in:
@@ -460,6 +460,32 @@ export default {
|
||||
chatAttachTooBig: _('图片过大(最大 10 MB)', 'Image too large (max 10 MB)', '圖片過大(最大 10 MB)'),
|
||||
chatAttachTooMany: _('最多 5 张图片', 'Up to 5 images', '最多 5 張圖片'),
|
||||
chatAttachReadFailed: _('读取图片失败', 'Failed to read image', '讀取圖片失敗'),
|
||||
// Batch 2 §H: Profiles 管理
|
||||
hermesProfilesTitle: _('Profile 管理', 'Profiles', 'Profile 管理'),
|
||||
hermesProfilesDesc: _('每个 Profile 是独立的工作区,凭据、记忆、会话彼此隔离', 'Each profile is an isolated workspace — credentials, memory, sessions are kept separate', '每個 Profile 是獨立的工作區,憑證、記憶、會話彼此隔離'),
|
||||
hermesProfilesEmpty: _('暂无 Profile(请先启动 Dashboard)', 'No profiles (start Dashboard first)', '暫無 Profile(請先啟動 Dashboard)'),
|
||||
hermesProfileNew: _('新建', 'New', '新建'),
|
||||
hermesProfileNewTitle: _('新建 Profile', 'New profile', '新建 Profile'),
|
||||
hermesProfileNameLabel: _('Profile 名称', 'Profile name', 'Profile 名稱'),
|
||||
hermesProfileNameRequired: _('名称不能为空', 'Name is required', '名稱不能為空'),
|
||||
hermesProfileCloneFromDefault: _('从默认 Profile 复制(推荐)', 'Clone from default (recommended)', '從預設 Profile 複製(推薦)'),
|
||||
hermesProfileCloneHint: _('打勾会复制 default 的模型、技能、记忆。不勾会创建空白 Profile。', 'Checked: clone default\'s models / skills / memory. Unchecked: empty profile.', '勾選會複製 default 的模型、技能、記憶。不勾建立空白 Profile。'),
|
||||
hermesProfileSwitch: _('切换到此', 'Switch to', '切換到此'),
|
||||
hermesProfileSwitched: _('已切换到 {name}', 'Switched to {name}', '已切換到 {name}'),
|
||||
hermesProfileSwitchFailed: _('切换失败', 'Switch failed', '切換失敗'),
|
||||
hermesProfileRename: _('重命名', 'Rename', '重新命名'),
|
||||
hermesProfileRenameTitle: _('重命名 Profile "{name}"', 'Rename profile "{name}"', '重新命名 Profile "{name}"'),
|
||||
hermesProfileNewNameLabel: _('新名称', 'New name', '新名稱'),
|
||||
hermesProfileRenamed: _('已重命名: {from} → {to}', 'Renamed: {from} → {to}', '已重新命名: {from} → {to}'),
|
||||
hermesProfileRenameFailed: _('重命名失败', 'Rename failed', '重新命名失敗'),
|
||||
hermesProfileDelete: _('删除', 'Delete', '刪除'),
|
||||
hermesProfileDeleteConfirm: _('确认删除 Profile "{name}"?', 'Delete profile "{name}"?', '確認刪除 Profile "{name}"?'),
|
||||
hermesProfileDeleteImpact: _('这会永久清除该 Profile 的会话、凭据和记忆文件', 'This permanently removes the profile\'s sessions, credentials, and memory files', '這會永久清除該 Profile 的會話、憑證和記憶檔案'),
|
||||
hermesProfileDeleted: _('Profile "{name}" 已删除', 'Profile "{name}" deleted', 'Profile "{name}" 已刪除'),
|
||||
hermesProfileDeleteFailed: _('删除失败', 'Delete failed', '刪除失敗'),
|
||||
hermesProfileActive: _('当前', 'Active', '當前'),
|
||||
hermesProfileCreated: _('已创建 Profile "{name}"', 'Profile "{name}" created', '已建立 Profile "{name}"'),
|
||||
hermesProfileCreateFailed: _('创建失败', 'Create failed', '建立失敗'),
|
||||
// Web 模式(远程浏览器)下流式聊天暂不可用
|
||||
chatWebModeStreamingUnsupported: _(
|
||||
'Web 模式暂不支持 Hermes 实时流式聊天(依赖桌面端事件桥)。请打开桌面客户端使用此功能。',
|
||||
|
||||
Reference in New Issue
Block a user