mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-29 04:10:00 +08:00
feat(hermes): UX 小白化第一步 - services restart/stop 加 showConfirm 防误触
Gateway restart/stop 是高影响动作(in-flight agent runs 会断),
对应 Approval Flow / multimodal 等改进可能正在跑 — 误触代价大。
## services.js
- runGatewayAction('restart' | 'stop') 调用前先 showConfirm
- 文案:「正在进行的 Agent 会话会被中断」(impact 列表)
- danger 变体(红色确认按钮)
- start 不加 confirm(用户主动启动不需要)
- 复用 confirmText 用 dashRestartGw / dashStopGw(已有 i18n)
## i18n
- servicesConfirmRestart / servicesConfirmStop / servicesImpactInflight 3 个新键 × 3 语言
This commit is contained in:
@@ -422,6 +422,18 @@ export function render() {
|
||||
|
||||
async function runGatewayAction(action) {
|
||||
if (actionBusy) return
|
||||
// Hermes UX 小白化:restart/stop 是高影响动作,提前提示(不阻塞 start)
|
||||
if (action === 'restart' || action === 'stop') {
|
||||
const ok = await showConfirm({
|
||||
message: action === 'restart'
|
||||
? t('engine.servicesConfirmRestart')
|
||||
: t('engine.servicesConfirmStop'),
|
||||
impact: [t('engine.servicesImpactInflight')],
|
||||
confirmText: action === 'restart' ? t('engine.dashRestartGw') : t('engine.dashStopGw'),
|
||||
variant: 'danger',
|
||||
})
|
||||
if (!ok) return
|
||||
}
|
||||
actionBusy = true
|
||||
setPageMessage(
|
||||
action === 'start'
|
||||
|
||||
@@ -515,6 +515,10 @@ export default {
|
||||
hermesKanbanMoveStatusTitle: _('修改任务状态', 'Change task status', '修改任務狀態'),
|
||||
hermesKanbanBoardSwitched: _('已切换到看板 "{name}"', 'Switched to board "{name}"', '已切換到看板 "{name}"'),
|
||||
hermesKanbanBoardSwitchFailed: _('切换看板失败', 'Switch board failed', '切換看板失敗'),
|
||||
// Hermes UX 小白化:services 重启/停止确认
|
||||
servicesConfirmRestart: _('确认重启 Gateway?', 'Restart Gateway?', '確認重啟 Gateway?'),
|
||||
servicesConfirmStop: _('确认停止 Gateway?', 'Stop Gateway?', '確認停止 Gateway?'),
|
||||
servicesImpactInflight: _('正在进行的 Agent 会话会被中断', 'In-flight agent runs will be aborted', '正在進行的 Agent 會話會被中斷'),
|
||||
// Web 模式(远程浏览器)下流式聊天暂不可用
|
||||
chatWebModeStreamingUnsupported: _(
|
||||
'Web 模式暂不支持 Hermes 实时流式聊天(依赖桌面端事件桥)。请打开桌面客户端使用此功能。',
|
||||
|
||||
Reference in New Issue
Block a user