mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-29 20:30:00 +08:00
面向小白用户的产品定位重塑,从七大 UX 痛点逐一改造:
## U1 错误友好度(59 处改造)
- 新工具 src/lib/humanize-error.js:自动把后端原始错误(fetch failed、ENETUNREACH、ENOENT 等)
映射成「主行 + hint 行动建议 + 折叠技术详情」三段式结构化对象
- toast 组件升级支持 { message, hint, raw } 结构化入参,向后完全兼容
- 14 个 page 文件中所有 toast(t('xxx.failed') + ': ' + e, 'error') 替换为 toast(humanizeError(e, t(...)), 'error')
- common.js 加 error.* / errorHint.* 共 13 个新 i18n 键(11 语言):
网络/Gateway 未启动/命令缺失/权限/超时/限流/未找到/鉴权/服务繁忙/通用
## U2 致命操作强确认(14 处改造)
- showConfirm 升级支持结构化对象 { message, impact[], title, confirmText, cancelText, variant }
- 加 .modal-impact-list 红边样式(让小白看清楚删了会丢什么)
- 14 处致命操作改造,每处显示影响列表 + 红色「删除/移除/重置」按钮 + 灰色「保留」取消:
· agents.js 删除 Agent(动态显示 N 个绑定影响)
· channels.js 移除平台(动态算 N 个 binding)+ 移除 Agent binding
· memory.js 删除记忆文件
· services.js 卸载 Gateway(3 段影响)+ 删除备份
· models.js 批量删模型
· chat.js 删除会话 + 重置会话
· dreaming.js 重置梦境日记 + 清空 grounded 短期记忆
· agent-detail.js 解除渠道绑定
· cron.js 删除任务(OpenClaw + Hermes 两端)
- skills.js 原生 confirm() 改 showConfirm
- hermes-cron.js 原生 confirm() 改 showConfirm,顺手修末尾多余 `}` 的 syntax 残留
## U3-C 空状态 emoji+CTA(5 页面)
- 通用 .empty-state 组件(大 emoji + 标题 + 副本 + CTA 按钮 + 紧凑变体)
- agents.js: 🤖 + 「+ 新建 Agent」CTA
- memory.js: 🧠 + 「+ 新建记忆文件」CTA(紧凑版)
- cron.js: ⏰ + 「+ 新建任务」CTA
- skills.js: 🛠️ + 「技能商店」CTA(点击切 Tab)
- channels.js: 💬 + 紧凑提示
- CTA 巧妙复用页面顶部已有按钮的 click,零重复逻辑
## U3-B Dashboard 新手任务卡片
- 蓝紫渐变卡片,4 步任务自动检测:启动 Gateway / 添加模型 / 创建 Agent / 第一次聊天
- 已完成:✓ 徽章 + 删除线 + 60% 透明
- 未完成:编号徽章 + 蓝色 CTA 按钮跳对应页面
- 全部完成 → 庆祝条「🎉 全部搞定!」+ 关闭按钮
- localStorage 标记,用户主动关闭后永久隐藏
- 14 个新 i18n 键,文案小白化(Gateway 是「发动机」/ Agent 是「分身」/ 模型给 AI 装「大脑」)
## U3-A 术语表页(/glossary)
- 25 个核心术语 × 4 大分类(核心 8 / 模型 6 / 接入 5 / 进阶 6)
- 搜索框实时过滤 + Tab 切换分类 + 卡片网格布局
- 每条术语:「比喻 + 一句话」描述(避免循环引用)+ 「打开页面 →」CTA 直达配置
- 3 语言(zh-CN / en / zh-TW)完整翻译,其他 8 语言 fallback
- 双引擎(OpenClaw + Hermes)共用路由
- dashboard quick-actions 加「📖 面板术语」入口
## U3-D 术语 ⓘ tooltip
- 通用 src/lib/term-tooltip.js helper:termHelpHtml(id) + attachTermTooltips(root)
- 8 个高频术语精简表(OAuth / Webhook / Bot Token / API Key / Token / Context Window / Binding / Scope)
- channels.js 字段 label 智能匹配关键词自动追加 ⓘ(覆盖 8 个渠道全部敏感字段)
- models.js 添加/编辑 provider 的 API Key label 也加 ⓘ
- 点 ⓘ → 弹小型 modal 含解释 + 「打开术语表 →」CTA
- attachTermTooltips 内部去重,可安全多次调用
## 累计交付
- 4 个新文件(humanize-error.js / term-tooltip.js / glossary.js page / glossary.js i18n)
- 6 个升级文件(toast / modal / components.css / dashboard / channels / models)
- 14 个 page 错误 toast 友好化(59 处)
- 14 处致命操作强确认
- 5 处空状态升级 + Dashboard 新手卡片 + 术语表 + ⓘ tooltip
- 109 个新 i18n 键(11 语言)
- Build 全程通过
86 lines
6.5 KiB
JavaScript
86 lines
6.5 KiB
JavaScript
import { _ } from '../helper.js'
|
||
|
||
export default {
|
||
back: _('← 返回 Agent 列表', '← Back to Agents'),
|
||
tabOverview: _('概览', 'Overview'),
|
||
tabFiles: _('文件', 'Files'),
|
||
tabChannels: _('渠道', 'Channels'),
|
||
tabTools: _('工具', 'Tools'),
|
||
tabSkills: _('技能', 'Skills'),
|
||
defaultAgent: _('默认 Agent', 'Default Agent'),
|
||
basicInfo: _('基本信息', 'Basic Info'),
|
||
agentId: _('Agent ID', 'Agent ID'),
|
||
name: _('名称', 'Name'),
|
||
emoji: _('表情', 'Emoji'),
|
||
workspace: _('工作区', 'Workspace'),
|
||
notSet: _('未设置', 'Not set'),
|
||
modelConfig: _('模型配置', 'Model Config'),
|
||
primaryModel: _('主模型', 'Primary Model'),
|
||
fallbackModels: _('备选模型', 'Fallback Models'),
|
||
addFallback: _('+ 添加备选', '+ Add Fallback'),
|
||
noFallback: _('未配置备选模型(主模型不可用时无法切换)', 'No fallback models configured.'),
|
||
removeFallback: _('移除', 'Remove'),
|
||
thinkingLevel: _('推理级别', 'Thinking Level'),
|
||
thinkingOff: _('关闭', 'Off'),
|
||
thinkingMinimal: _('最小', 'Minimal'),
|
||
thinkingLow: _('低', 'Low'),
|
||
thinkingMedium: _('中', 'Medium'),
|
||
thinkingHigh: _('高', 'High'),
|
||
thinkingXhigh: _('极高', 'Very High'),
|
||
thinkingAdaptive: _('自适应', 'Adaptive'),
|
||
saveOverview: _('保存配置', 'Save Config'),
|
||
saving: _('保存中...', 'Saving...'),
|
||
saveSuccess: _('配置已保存', 'Config saved'),
|
||
saveFailed: _('保存失败', 'Save failed'),
|
||
filesTitle: _('Bootstrap 文件', 'Bootstrap Files'),
|
||
filesDesc: _('Agent 工作区中的核心配置文件,定义 Agent 的行为、身份和记忆', 'Core files in the Agent directory that define behavior, identity and memory.'),
|
||
fileExists: _('已创建', 'Created'),
|
||
fileMissing: _('未创建', 'Missing'),
|
||
fileEdit: _('编辑', 'Edit'),
|
||
fileView: _('查看', 'View'),
|
||
fileCreate: _('创建', 'Create'),
|
||
noFiles: _('无文件', 'No files'),
|
||
fileSize: _('大小', 'Size'),
|
||
fileUpdated: _('更新时间', 'Updated'),
|
||
editFileTitle: _('编辑 {name}', 'Edit {name}'),
|
||
fileSaved: _('文件已保存', 'File saved'),
|
||
fileSaveFailed: _('文件保存失败', 'Failed to save file'),
|
||
fileCreated: _('文件已创建', 'File created'),
|
||
channelsTitle: _('渠道绑定', 'Channel Bindings'),
|
||
channelsDesc: _('管理此 Agent 绑定的消息渠道', 'Manage message channels bound to this Agent.'),
|
||
addBinding: _('+ 添加绑定', '+ Add Binding'),
|
||
manageChannels: _('去消息渠道配置', 'Open Channels Page'),
|
||
noBindings: _('此 Agent 尚未绑定任何渠道', 'This Agent has no bindings yet.'),
|
||
removeBinding: _('解绑', 'Unbind'),
|
||
bindingRemoved: _('已解除绑定', 'Binding removed'),
|
||
bindingAdded: _('已添加绑定', 'Binding added'),
|
||
bindingFailed: _('绑定操作失败', 'Binding action failed'),
|
||
selectChannel: _('选择渠道', 'Select Channel'),
|
||
accountOptional: _('账号 ID(可选)', 'Account ID (optional)'),
|
||
accountOptionalPlaceholder: _('留空表示所有账号', 'Leave empty to match all accounts'),
|
||
removeBindingConfirm: _('确定解除渠道绑定 {channel} ?', 'Unbind channel {channel}?'),
|
||
removeBindingTitle: _('解除渠道绑定', 'Unbind channel', '解除頻道綁定', 'チャンネル連携を解除', '채널 연결 해제', 'Huỷ liên kết kênh', 'Desvincular canal', 'Desvincular canal', 'Отвязать канал', 'Délier le canal', 'Kanalverknüpfung lösen'),
|
||
removeBindingBtn: _('解除', 'Unbind', '解除', '解除', '해제', 'Huỷ', 'Desvincular', 'Desvincular', 'Отвязать', 'Délier', 'Lösen'),
|
||
removeBindingCancel: _('保留', 'Keep', '保留', '保持', '유지', 'Giữ lại', 'Conservar', 'Manter', 'Оставить', 'Conserver', 'Behalten'),
|
||
removeBindingImpactAgent: _('该 Agent 在此渠道上将不再被触发', 'The Agent will no longer be triggered through this channel', '該 Agent 在此頻道上將不再被觸發', 'この Agent はこのチャンネルで起動されなくなります', '이 Agent는 이 채널에서 더 이상 트리거되지 않습니다', 'Agent sẽ không còn được kích hoạt trên kênh này', 'El Agent ya no se activará por este canal', 'O Agent não será mais acionado por este canal', 'Agent больше не будет запускаться через этот канал', 'L\u2019Agent ne sera plus déclenché sur ce canal', 'Der Agent wird über diesen Kanal nicht mehr ausgelöst'),
|
||
removeBindingImpactChannel: _('渠道平台本身的设置不会被改动', 'The channel platform settings themselves will not be changed', '頻道平台本身的設定不會被改動', 'チャンネルプラットフォーム自体の設定は変更されません', '채널 플랫폼 자체의 설정은 변경되지 않습니다', 'Cấu hình của nền tảng kênh sẽ không thay đổi', 'La configuración de la plataforma del canal no se modificará', 'A configuração da plataforma do canal não será alterada', 'Настройки самой платформы канала не изменятся', 'Les paramètres de la plateforme du canal ne seront pas modifiés', 'Die Einstellungen der Kanalplattform werden nicht geändert'),
|
||
loadFailed: _('加载失败', 'Load failed'),
|
||
toolsTitle: _('工具权限', 'Tool Permissions'),
|
||
toolsDesc: _('配置 Agent 可用工具的基础 profile 与额外 allow / deny 规则。', 'Configure the base tool profile and extra allow / deny rules for this Agent.'),
|
||
toolProfile: _('工具配置模板', 'Tool Profile'),
|
||
toolAllow: _('显式允许', 'Explicit Allow'),
|
||
toolAllowHint: _('逗号或换行分隔。设置后会作为基础 allowlist。', 'Comma or newline separated. Acts as the base allowlist when set.'),
|
||
toolAlsoAllow: _('追加允许', 'Also Allow'),
|
||
toolAlsoAllowHint: _('在 profile 基础上额外开放的工具。', 'Extra tools allowed on top of the selected profile.'),
|
||
toolDeny: _('显式禁止', 'Explicit Deny'),
|
||
toolDenyHint: _('优先级高于 allow/profile。', 'Higher priority than allow/profile.'),
|
||
saveTools: _('保存工具配置', 'Save Tool Config'),
|
||
toolsSaved: _('工具配置已保存', 'Tool config saved'),
|
||
skillsTitle: _('技能白名单', 'Skill Allowlist'),
|
||
skillsDesc: _('勾选当前 Agent 允许使用的 Skills;留空表示不启用技能白名单。', 'Choose which Skills this Agent may use. Empty means no skill allowlist is enforced.'),
|
||
saveSkills: _('保存技能配置', 'Save Skill Config'),
|
||
skillsSaved: _('技能配置已保存', 'Skill config saved'),
|
||
noSkills: _('未获取到可用 Skills', 'No Skills available'),
|
||
skillDisabled: _('已禁用', 'Disabled'),
|
||
skillUnavailable: _('环境未满足', 'Unavailable'),
|
||
} |