codexmate 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -44
- package/README.vi.md +45 -36
- package/README.zh.md +51 -42
- package/cli/session-usage.js +2 -2
- package/cli/skills.js +33 -8
- package/cli.js +379 -19
- package/package.json +6 -1
- package/web-ui/app.js +12 -1
- package/web-ui/index.html +3 -2
- package/web-ui/logic.sessions.mjs +30 -4
- package/web-ui/modules/app.computed.dashboard.mjs +1 -1
- package/web-ui/modules/app.computed.session.mjs +52 -33
- package/web-ui/modules/app.methods.agents.mjs +36 -0
- package/web-ui/modules/app.methods.codex-config.mjs +3 -1
- package/web-ui/modules/app.methods.providers.mjs +12 -4
- package/web-ui/modules/app.methods.session-actions.mjs +10 -8
- package/web-ui/modules/app.methods.session-browser.mjs +8 -2
- package/web-ui/modules/app.methods.session-trash.mjs +16 -16
- package/web-ui/modules/app.methods.system-prompt.mjs +1 -8
- package/web-ui/modules/app.methods.theme.mjs +5 -4
- package/web-ui/modules/i18n/locales/en.mjs +80 -1
- package/web-ui/modules/i18n/locales/ja.mjs +80 -1
- package/web-ui/modules/i18n/locales/vi.mjs +80 -1
- package/web-ui/modules/i18n/locales/zh-tw.mjs +80 -1
- package/web-ui/modules/i18n/locales/zh.mjs +80 -1
- package/web-ui/modules/i18n.mjs +23 -0
- package/web-ui/modules/skills.computed.mjs +11 -0
- package/web-ui/modules/skills.methods.mjs +58 -8
- package/web-ui/partials/index/layout-footer.html +1 -1
- package/web-ui/partials/index/layout-header.html +32 -12
- package/web-ui/partials/index/modal-config-template-agents.html +1 -1
- package/web-ui/partials/index/modal-health-check.html +1 -1
- package/web-ui/partials/index/modal-openclaw-config.html +50 -50
- package/web-ui/partials/index/panel-dashboard.html +1 -1
- package/web-ui/partials/index/panel-market.html +23 -5
- package/web-ui/partials/index/panel-prompts.html +2 -2
- package/web-ui/partials/index/panel-sessions.html +52 -42
- package/web-ui/partials/index/panel-settings.html +6 -0
- package/web-ui/partials/index/panel-trash.html +3 -0
- package/web-ui/res/web-ui-render.precompiled.js +567 -439
- package/web-ui/session-helpers.mjs +3 -0
- package/web-ui/styles/base-theme.css +2 -2
- package/web-ui/styles/bridge-pool.css +1 -1
- package/web-ui/styles/feedback.css +26 -0
- package/web-ui/styles/layout-shell.css +66 -3
- package/web-ui/styles/navigation-panels.css +4 -10
- package/web-ui/styles/sessions-list.css +19 -1
- package/web-ui/styles/sessions-preview.css +88 -1
- package/web-ui/styles/sessions-toolbar-trash.css +2 -2
- package/web-ui/styles/settings-panel.css +1 -1
- package/web-ui/styles/skills-market.css +47 -0
- package/web-ui/styles/theme-dark-tokens.css +2 -2
- package/web-ui/styles/theme-dark.css +2 -2
- package/web-ui/styles/theme-ocean-tokens.css +88 -0
- package/web-ui/styles/theme-ocean.css +920 -0
- package/web-ui/styles/titles-cards.css +1 -1
- package/web-ui/styles/trash-panel.css +43 -6
- package/web-ui/styles.css +1 -0
|
@@ -524,6 +524,11 @@ const zh = Object.freeze({
|
|
|
524
524
|
'toast.provider.updateFail': '更新失败',
|
|
525
525
|
'toast.provider.resetSuccess': '配置已重装{backup}',
|
|
526
526
|
'toast.provider.resetFail': '重装失败',
|
|
527
|
+
|
|
528
|
+
'toast.provider.resetBackup': '(已备份: {file})',
|
|
529
|
+
'toast.provider.modelRequired': '请输入模型',
|
|
530
|
+
'toast.provider.addModelFail': '新增模型失败',
|
|
531
|
+
'toast.provider.deleteModelFail': '删除模型失败',
|
|
527
532
|
'toast.provider.fieldsRequired': '名称、URL、API Key 和模型名称必填',
|
|
528
533
|
'toast.provider.urlRequired': 'URL 必填',
|
|
529
534
|
'toast.claude.modelRequired': '请输入模型',
|
|
@@ -690,11 +695,12 @@ const zh = Object.freeze({
|
|
|
690
695
|
'sessions.source.workbuddy': 'WorkBuddy AI',
|
|
691
696
|
'sessions.source.pi': 'Pi',
|
|
692
697
|
'sessions.source.opencode': 'OpenCode',
|
|
698
|
+
'sessions.source.zed': 'Zed',
|
|
693
699
|
'sessions.loadingList': '会话加载中...',
|
|
694
700
|
'sessions.empty': '暂无可用会话记录',
|
|
695
701
|
'sessions.unknownTime': '未知时间',
|
|
696
702
|
|
|
697
|
-
'sessions.query.placeholder.enabled':
|
|
703
|
+
'sessions.query.placeholder.enabled': "关键词检索(例:claude code)",
|
|
698
704
|
'sessions.query.placeholder.disabled': '当前来源暂不支持关键词检索',
|
|
699
705
|
'sessions.pin': '置顶',
|
|
700
706
|
'sessions.unpin': '取消置顶',
|
|
@@ -720,6 +726,17 @@ const zh = Object.freeze({
|
|
|
720
726
|
'sessions.preview.moveToTrash': '移入回收站',
|
|
721
727
|
'sessions.preview.deleting': '删除中...',
|
|
722
728
|
'sessions.preview.moving': '移入中...',
|
|
729
|
+
'sessions.export.range': "导出范围",
|
|
730
|
+
'sessions.export.default': "最近 1000 条",
|
|
731
|
+
'sessions.export.all': "全部可提取消息",
|
|
732
|
+
'sessions.export.scopeHint': "全部仅取消消息数量上限,不是完整状态备份。",
|
|
733
|
+
'sessions.export.truncated': "本次导出已截断;需要更早内容可选择全部后重新导出。",
|
|
734
|
+
'sessions.search.coverage': "已扫描 {scanned} / {candidates} 条候选会话",
|
|
735
|
+
'sessions.search.partial': "本次候选尚未扫描完,请缩小来源或项目范围。",
|
|
736
|
+
'sessions.search.scopeHint': "仅反映本次候选范围,不代表全部历史记录。",
|
|
737
|
+
'sessions.empty.filtered': "当前筛选没有匹配记录。",
|
|
738
|
+
'sessions.empty.source': "当前来源未发现可展示记录,请确认本机已有会话并刷新。",
|
|
739
|
+
'sessions.empty.clearFilters': "清除筛选",
|
|
723
740
|
'sessions.preview.export': '导出记录',
|
|
724
741
|
'sessions.preview.exporting': '导出中...',
|
|
725
742
|
'sessions.preview.convert': '生成派生会话',
|
|
@@ -1136,6 +1153,7 @@ const zh = Object.freeze({
|
|
|
1136
1153
|
'settings.theme.meta': '选择 Web UI 的配色主题',
|
|
1137
1154
|
'settings.theme.light': '浅色',
|
|
1138
1155
|
'settings.theme.dark': '深色',
|
|
1156
|
+
'settings.theme.ocean': '海洋蓝',
|
|
1139
1157
|
'settings.theme.hint': '主题偏好会自动保存,刷新后保持不变。',
|
|
1140
1158
|
'settings.sharePrefix.title': '分享命令前缀',
|
|
1141
1159
|
'settings.sharePrefix.meta': '影响 Web UI 里“复制分享命令”的前缀',
|
|
@@ -1211,6 +1229,20 @@ const zh = Object.freeze({
|
|
|
1211
1229
|
'settings.trash.retentionLabel': '保留天数',
|
|
1212
1230
|
'settings.trash.retentionUnit': '天',
|
|
1213
1231
|
'settings.trash.retentionHint': '范围 1-365 天,默认 30 天。每次加载回收站时自动清理过期记录。',
|
|
1232
|
+
|
|
1233
|
+
'settings.trash.loadCountFail': '加载回收站数量失败',
|
|
1234
|
+
'settings.trash.loadFail': '加载回收站失败',
|
|
1235
|
+
'settings.trash.restored': '会话已恢复',
|
|
1236
|
+
'settings.trash.restoreFail': '恢复失败',
|
|
1237
|
+
'settings.trash.purged': '已彻底删除',
|
|
1238
|
+
'settings.trash.purgeFail': '彻底删除失败',
|
|
1239
|
+
'settings.trash.cleared': '回收站已清空',
|
|
1240
|
+
'settings.trash.clearFail': '清空回收站失败',
|
|
1241
|
+
'settings.trash.purgeConfirmTitle': '彻底删除回收站记录',
|
|
1242
|
+
'settings.trash.purgeConfirmMessage': '该会话将从回收站永久删除,且无法恢复。',
|
|
1243
|
+
'settings.trash.clearConfirmTitle': '清空回收站',
|
|
1244
|
+
'settings.trash.clearConfirmMessage': '该操作会永久删除回收站中的全部会话,且无法恢复。',
|
|
1245
|
+
'settings.trash.clearConfirmButton': '全部清空',
|
|
1214
1246
|
'settings.trash.count': '共 {count} 项',
|
|
1215
1247
|
'settings.trash.retentionShort': '保留 {days} 天',
|
|
1216
1248
|
'settings.trash.disabled': '回收站已关闭',
|
|
@@ -1251,6 +1283,9 @@ const zh = Object.freeze({
|
|
|
1251
1283
|
'settings.reset.button': '重装配置',
|
|
1252
1284
|
'settings.reset.loading': '重装中...',
|
|
1253
1285
|
|
|
1286
|
+
'settings.reset.confirmTitle': '确认重置配置',
|
|
1287
|
+
'settings.reset.confirmMessage': '将先备份 config.toml,再用默认配置覆盖当前配置。确定继续吗?',
|
|
1288
|
+
|
|
1254
1289
|
// Market (Skills)
|
|
1255
1290
|
'market.title': 'Skills 概览',
|
|
1256
1291
|
'market.subtitle': '切换目标并查看本地 Skills。',
|
|
@@ -1266,6 +1301,12 @@ const zh = Object.freeze({
|
|
|
1266
1301
|
'market.summary.importableDirect': '可直接导入',
|
|
1267
1302
|
'market.root.fallback': '默认目录',
|
|
1268
1303
|
|
|
1304
|
+
'market.backup.action': '备份当前目标',
|
|
1305
|
+
'market.backup.running': '备份中...',
|
|
1306
|
+
'market.export.action': '导出选中',
|
|
1307
|
+
'market.export.running': '导出中...',
|
|
1308
|
+
'market.selection.all': '全选',
|
|
1309
|
+
'market.selection.count': '已选 {count}',
|
|
1269
1310
|
'market.installed.title': '已安装 Skills',
|
|
1270
1311
|
'market.installed.note': '仅显示前 6 项。',
|
|
1271
1312
|
'market.local.refresh': '刷新本地',
|
|
@@ -1361,6 +1402,44 @@ const zh = Object.freeze({
|
|
|
1361
1402
|
'modal.openclaw.quick.subtitle': '按 3 步完成:填 Provider 和模型,写入编辑器,保存并应用。',
|
|
1362
1403
|
'modal.openclaw.quick.step2': '点击写入编辑器',
|
|
1363
1404
|
'modal.openclaw.structured.writeHint': '写入编辑器会重排 JSON,注释可能丢失。',
|
|
1405
|
+
|
|
1406
|
+
'modal.openclaw.next': '下一步 →',
|
|
1407
|
+
'modal.openclaw.prev': '← 上一步',
|
|
1408
|
+
'modal.openclaw.finish': '完成 ✓',
|
|
1409
|
+
'modal.openclaw.quick.advancedOptions': '高级选项',
|
|
1410
|
+
'modal.openclaw.quick.providerNamePlaceholder': '例如: custom-myapi',
|
|
1411
|
+
'modal.openclaw.quick.modelIdHint': '必填,例如: gpt-4',
|
|
1412
|
+
'modal.openclaw.quick.modelNameHint': '可选,用于显示',
|
|
1413
|
+
'modal.openclaw.structured.title': '结构化配置(高级)',
|
|
1414
|
+
'modal.openclaw.structured.primaryModel': '主模型',
|
|
1415
|
+
'modal.openclaw.structured.fallbackModels': '备选模型',
|
|
1416
|
+
'modal.openclaw.structured.providerModelPlaceholder': '例如: provider/model',
|
|
1417
|
+
'modal.openclaw.structured.addFallback': '添加备选',
|
|
1418
|
+
'modal.openclaw.structured.workspacePlaceholder': '例如: ~/.openclaw/workspace',
|
|
1419
|
+
'modal.openclaw.structured.timeoutPlaceholder': '例如: 600',
|
|
1420
|
+
'modal.openclaw.structured.contextTokensPlaceholder': '例如: 4096',
|
|
1421
|
+
'modal.openclaw.structured.maxConcurrentPlaceholder': '例如: 2',
|
|
1422
|
+
'modal.openclaw.structured.envVars': '环境变量',
|
|
1423
|
+
'modal.openclaw.structured.addEnvVar': '添加变量',
|
|
1424
|
+
'modal.openclaw.structured.addAllow': '添加 allow',
|
|
1425
|
+
'modal.openclaw.structured.addDeny': '添加 deny',
|
|
1426
|
+
'modal.openclaw.structured.allowPlaceholder': '例如: fs.read*',
|
|
1427
|
+
'modal.openclaw.structured.denyPlaceholder': '例如: net.*',
|
|
1428
|
+
'modal.openclaw.structured.providersTitle': 'Providers(只读)',
|
|
1429
|
+
'modal.openclaw.structured.noProviders': '未发现 providers 配置(可能使用环境变量或外部配置)。',
|
|
1430
|
+
'modal.openclaw.structured.sourceLabel': '来源',
|
|
1431
|
+
'modal.openclaw.structured.active': '使用中',
|
|
1432
|
+
'modal.openclaw.structured.noFields': '未配置字段',
|
|
1433
|
+
'modal.openclaw.structured.missingProviders': '使用中的 provider 未在配置中显示:{list}。',
|
|
1434
|
+
'modal.openclaw.structured.agentsTitle': 'Agents(只读)',
|
|
1435
|
+
'modal.openclaw.structured.noAgents': '未发现 agents.list 配置。',
|
|
1436
|
+
'modal.openclaw.structured.themeLabel': '主题',
|
|
1437
|
+
'modal.openclaw.structured.emojiLabel': '表情',
|
|
1438
|
+
'modal.openclaw.structured.avatarLabel': '头像',
|
|
1439
|
+
'modal.openclaw.editorLabel': 'OpenClaw 配置(JSON5)',
|
|
1440
|
+
'modal.openclaw.editorPlaceholder': '在这里编辑 OpenClaw 配置(JSON5)',
|
|
1441
|
+
'modal.openclaw.defaultConfigHint': '默认配置始终映射当前 openclaw.json,请直接使用“保存并应用”。',
|
|
1442
|
+
'modal.openclaw.saveOnlyHint': '保存仅写入本地配置库。点击“保存并应用”后会写入 openclaw.json。',
|
|
1364
1443
|
'openclaw.action.applyAria': '应用 OpenClaw 配置:{name}',
|
|
1365
1444
|
'openclaw.action.editAria': '编辑 OpenClaw 配置:{name}',
|
|
1366
1445
|
'openclaw.action.deleteAria': '删除 OpenClaw 配置:{name}'
|
package/web-ui/modules/i18n.mjs
CHANGED
|
@@ -57,9 +57,32 @@ export function createI18nMethods() {
|
|
|
57
57
|
languageOptions() {
|
|
58
58
|
return getAvailableLanguages();
|
|
59
59
|
},
|
|
60
|
+
paren(text) {
|
|
61
|
+
const value = String(text);
|
|
62
|
+
const lang = normalizeLang(this.lang);
|
|
63
|
+
return (lang === 'zh' || lang === 'zh-tw' || lang === 'ja')
|
|
64
|
+
? `(${value})`
|
|
65
|
+
: ` (${value})`;
|
|
66
|
+
},
|
|
60
67
|
currentLanguageLabel() {
|
|
61
68
|
return getLanguageMeta(this.lang).nativeName || '中文';
|
|
62
69
|
},
|
|
70
|
+
toggleLanguageMenu() {
|
|
71
|
+
this.languageMenuOpen = !this.languageMenuOpen;
|
|
72
|
+
},
|
|
73
|
+
closeLanguageMenu() {
|
|
74
|
+
this.languageMenuOpen = false;
|
|
75
|
+
},
|
|
76
|
+
selectLanguage(nextLang) {
|
|
77
|
+
this.setLang(nextLang);
|
|
78
|
+
this.languageMenuOpen = false;
|
|
79
|
+
},
|
|
80
|
+
handleLanguageMenuFocusOut(event) {
|
|
81
|
+
const currentTarget = event && event.currentTarget;
|
|
82
|
+
const relatedTarget = event && event.relatedTarget;
|
|
83
|
+
if (currentTarget && relatedTarget && currentTarget.contains(relatedTarget)) return;
|
|
84
|
+
this.languageMenuOpen = false;
|
|
85
|
+
},
|
|
63
86
|
openLanguageSettings() {
|
|
64
87
|
if (typeof this.switchMainTab === 'function') {
|
|
65
88
|
this.switchMainTab('settings');
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
const selected = Array.isArray(this.skillsSelectedNames) ? this.skillsSelectedNames : [];
|
|
53
53
|
return Array.from(new Set(selected.map((item) => String(item || '').trim()).filter(Boolean))).length;
|
|
54
54
|
},
|
|
55
|
+
skillsMarketSelectedCount() {
|
|
56
|
+
const selected = Array.isArray(this.skillsMarketSelectedNames) ? this.skillsMarketSelectedNames : [];
|
|
57
|
+
return Array.from(new Set(selected.map((item) => String(item || '').trim()).filter(Boolean))).length;
|
|
58
|
+
},
|
|
55
59
|
skillsVisibleSelectedCount() {
|
|
56
60
|
const selectable = this.skillsSelectableNames;
|
|
57
61
|
const selectedSet = new Set(Array.isArray(this.skillsSelectedNames) ? this.skillsSelectedNames : []);
|
|
@@ -63,6 +67,12 @@
|
|
|
63
67
|
const selectedSet = new Set(Array.isArray(this.skillsSelectedNames) ? this.skillsSelectedNames : []);
|
|
64
68
|
return selectable.every((name) => selectedSet.has(name));
|
|
65
69
|
},
|
|
70
|
+
skillsMarketAllSelected() {
|
|
71
|
+
const selectable = this.skillsList.map((item) => item && item.name).filter(Boolean);
|
|
72
|
+
if (!selectable.length) return false;
|
|
73
|
+
const selectedSet = new Set(Array.isArray(this.skillsMarketSelectedNames) ? this.skillsMarketSelectedNames : []);
|
|
74
|
+
return selectable.every((name) => selectedSet.has(name));
|
|
75
|
+
},
|
|
66
76
|
skillsImportSelectableKeys() {
|
|
67
77
|
const list = Array.isArray(this.skillsImportList) ? this.skillsImportList : [];
|
|
68
78
|
return list
|
|
@@ -97,6 +107,7 @@
|
|
|
97
107
|
|| this.skillsImporting
|
|
98
108
|
|| this.skillsZipImporting
|
|
99
109
|
|| this.skillsExporting
|
|
110
|
+
|| this.skillsBackingUp
|
|
100
111
|
);
|
|
101
112
|
},
|
|
102
113
|
skillsMarketInstalledPreview() {
|
|
@@ -20,6 +20,7 @@ export function createSkillsMethods({ api }) {
|
|
|
20
20
|
|
|
21
21
|
resetSkillsTargetState() {
|
|
22
22
|
this.skillsSelectedNames = [];
|
|
23
|
+
this.skillsMarketSelectedNames = [];
|
|
23
24
|
this.skillsKeyword = '';
|
|
24
25
|
this.skillsStatusFilter = 'all';
|
|
25
26
|
this.skillsRootPath = '';
|
|
@@ -38,6 +39,7 @@ export function createSkillsMethods({ api }) {
|
|
|
38
39
|
|| this.skillsImporting
|
|
39
40
|
|| this.skillsZipImporting
|
|
40
41
|
|| this.skillsExporting
|
|
42
|
+
|| this.skillsBackingUp
|
|
41
43
|
|| this.skillsMarketLoading
|
|
42
44
|
) {
|
|
43
45
|
return false;
|
|
@@ -73,6 +75,7 @@ export function createSkillsMethods({ api }) {
|
|
|
73
75
|
|| this.skillsImporting
|
|
74
76
|
|| this.skillsZipImporting
|
|
75
77
|
|| this.skillsExporting
|
|
78
|
+
|| this.skillsBackingUp
|
|
76
79
|
|| this.skillsMarketLoading
|
|
77
80
|
) {
|
|
78
81
|
return false;
|
|
@@ -93,6 +96,7 @@ export function createSkillsMethods({ api }) {
|
|
|
93
96
|
this.skillsKeyword = '';
|
|
94
97
|
this.skillsStatusFilter = 'all';
|
|
95
98
|
this.skillsImportSelectedKeys = [];
|
|
99
|
+
this.skillsMarketSelectedNames = [];
|
|
96
100
|
}
|
|
97
101
|
this.showSkillsModal = true;
|
|
98
102
|
await this.refreshSkillsList({ silent: false });
|
|
@@ -106,6 +110,7 @@ export function createSkillsMethods({ api }) {
|
|
|
106
110
|
|| this.skillsImporting
|
|
107
111
|
|| this.skillsZipImporting
|
|
108
112
|
|| this.skillsExporting
|
|
113
|
+
|| this.skillsBackingUp
|
|
109
114
|
);
|
|
110
115
|
if (busy) return;
|
|
111
116
|
this.showSkillsModal = false;
|
|
@@ -213,7 +218,7 @@ export function createSkillsMethods({ api }) {
|
|
|
213
218
|
},
|
|
214
219
|
|
|
215
220
|
async scanImportableSkills(options = {}) {
|
|
216
|
-
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting) return false;
|
|
221
|
+
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting || this.skillsBackingUp) return false;
|
|
217
222
|
const silent = !!(options && options.silent);
|
|
218
223
|
this.skillsScanningImports = true;
|
|
219
224
|
try {
|
|
@@ -251,7 +256,7 @@ export function createSkillsMethods({ api }) {
|
|
|
251
256
|
},
|
|
252
257
|
|
|
253
258
|
async importSelectedSkills() {
|
|
254
|
-
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting) return;
|
|
259
|
+
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting || this.skillsBackingUp) return;
|
|
255
260
|
const selectedSet = new Set(Array.isArray(this.skillsImportSelectedKeys) ? this.skillsImportSelectedKeys : []);
|
|
256
261
|
const selectedItems = (Array.isArray(this.skillsImportList) ? this.skillsImportList : [])
|
|
257
262
|
.filter((item) => selectedSet.has(this.buildSkillImportKey(item)))
|
|
@@ -343,7 +348,7 @@ export function createSkillsMethods({ api }) {
|
|
|
343
348
|
},
|
|
344
349
|
|
|
345
350
|
async importSkillsFromZipFile(file) {
|
|
346
|
-
if (this.skillsDeleting || this.skillsScanningImports || this.skillsZipImporting || this.skillsImporting || this.skillsExporting) return;
|
|
351
|
+
if (this.skillsDeleting || this.skillsScanningImports || this.skillsZipImporting || this.skillsImporting || this.skillsExporting || this.skillsBackingUp) return;
|
|
347
352
|
const maxSize = 20 * 1024 * 1024;
|
|
348
353
|
if (file.size > maxSize) {
|
|
349
354
|
this.showMessage('ZIP 文件过大,限制 20MB', 'error');
|
|
@@ -378,9 +383,16 @@ export function createSkillsMethods({ api }) {
|
|
|
378
383
|
},
|
|
379
384
|
|
|
380
385
|
async exportSelectedSkills() {
|
|
381
|
-
if (this.skillsDeleting || this.skillsExporting || this.skillsZipImporting || this.skillsImporting) return;
|
|
382
|
-
|
|
383
|
-
|
|
386
|
+
if (this.skillsDeleting || this.skillsExporting || this.skillsBackingUp || this.skillsZipImporting || this.skillsImporting) return;
|
|
387
|
+
return this.exportSkillSelection(this.skillsSelectedNames);
|
|
388
|
+
},
|
|
389
|
+
async exportMarketSelectedSkills() {
|
|
390
|
+
if (this.skillsDeleting || this.skillsExporting || this.skillsBackingUp || this.skillsZipImporting || this.skillsImporting) return;
|
|
391
|
+
return this.exportSkillSelection(this.skillsMarketSelectedNames);
|
|
392
|
+
},
|
|
393
|
+
async exportSkillSelection(sourceNames) {
|
|
394
|
+
const selected = Array.isArray(sourceNames)
|
|
395
|
+
? Array.from(new Set(sourceNames.map((item) => String(item || '').trim()).filter(Boolean)))
|
|
384
396
|
: [];
|
|
385
397
|
if (!selected.length) {
|
|
386
398
|
this.showMessage('请先选择要导出的 skill', 'error');
|
|
@@ -423,6 +435,33 @@ export function createSkillsMethods({ api }) {
|
|
|
423
435
|
}
|
|
424
436
|
},
|
|
425
437
|
|
|
438
|
+
async backupCurrentSkills() {
|
|
439
|
+
if (this.skillsDeleting || this.skillsExporting || this.skillsBackingUp || this.skillsZipImporting || this.skillsImporting) return;
|
|
440
|
+
this.skillsBackingUp = true;
|
|
441
|
+
try {
|
|
442
|
+
const res = await api('backup-skills', { targetApp: this.skillsTargetApp });
|
|
443
|
+
if (res && res.error) {
|
|
444
|
+
this.showMessage(res.error, 'error');
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
if (!res || !res.fileName) {
|
|
448
|
+
this.showMessage('备份失败:未生成压缩包', 'error');
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
const link = document.createElement('a');
|
|
452
|
+
link.href = res.downloadPath || `/download/${encodeURIComponent(res.fileName)}`;
|
|
453
|
+
link.download = res.fileName;
|
|
454
|
+
document.body.appendChild(link);
|
|
455
|
+
link.click();
|
|
456
|
+
document.body.removeChild(link);
|
|
457
|
+
const count = Array.isArray(res.exported) ? res.exported.length : 0;
|
|
458
|
+
this.showMessage(`已备份 ${this.skillsTargetLabel} 的 ${count} 个 skill`, 'success');
|
|
459
|
+
} catch (e) {
|
|
460
|
+
this.showMessage('备份 skill 失败', 'error');
|
|
461
|
+
} finally {
|
|
462
|
+
this.skillsBackingUp = false;
|
|
463
|
+
}
|
|
464
|
+
},
|
|
426
465
|
async deleteSelectedSkills() {
|
|
427
466
|
if (this.skillsDeleting || this.skillsZipImporting || this.skillsExporting || this.skillsImporting) return;
|
|
428
467
|
if (this.skillsScanningImports) {
|
|
@@ -479,11 +518,22 @@ export function createSkillsMethods({ api }) {
|
|
|
479
518
|
}
|
|
480
519
|
},
|
|
481
520
|
|
|
521
|
+
toggleSkillsMarketSelection(name) {
|
|
522
|
+
const value = String(name || '').trim();
|
|
523
|
+
if (!value) return;
|
|
524
|
+
const selected = new Set(Array.isArray(this.skillsMarketSelectedNames) ? this.skillsMarketSelectedNames : []);
|
|
525
|
+
if (selected.has(value)) selected.delete(value);
|
|
526
|
+
else selected.add(value);
|
|
527
|
+
this.skillsMarketSelectedNames = Array.from(selected);
|
|
528
|
+
},
|
|
529
|
+
toggleAllSkillsMarketSelection() {
|
|
530
|
+
const names = (Array.isArray(this.skillsList) ? this.skillsList : []).map((item) => item && item.name).filter(Boolean);
|
|
531
|
+
this.skillsMarketSelectedNames = this.skillsMarketAllSelected ? [] : names;
|
|
532
|
+
},
|
|
533
|
+
|
|
482
534
|
openSkillsMenu() {
|
|
483
|
-
// Open skills manager modal as menu
|
|
484
535
|
this.openSkillsManager();
|
|
485
536
|
},
|
|
486
|
-
|
|
487
537
|
async importSingleSkill(skill) {
|
|
488
538
|
if (this.skillsImporting || this.skillsZipImporting) return;
|
|
489
539
|
const key = this.buildSkillImportKey(skill);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<div id="app" class="container" v-cloak>
|
|
1
|
+
<div id="app" class="container" :class="{ 'navigation-pending': !navigationReady }" v-cloak>
|
|
2
|
+
<div v-if="!navigationReady" class="app-navigation-loading-state" role="status" aria-live="polite">
|
|
3
|
+
{{ t('app.loadingConfig') }}
|
|
4
|
+
</div>
|
|
2
5
|
<div v-if="!sessionStandalone" class="mobile-brand-bar">
|
|
3
6
|
<div class="mobile-brand-title">Codex Mate<span v-if="appVersion" class="brand-version"> v{{ appVersion }}</span></div>
|
|
4
7
|
<button
|
|
@@ -412,11 +415,34 @@
|
|
|
412
415
|
|
|
413
416
|
<div class="side-rail-lang">
|
|
414
417
|
<div class="side-rail-lang-actions">
|
|
415
|
-
<
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
<div class="side-language-menu">
|
|
419
|
+
<button
|
|
420
|
+
type="button"
|
|
421
|
+
class="language-settings-link"
|
|
422
|
+
:aria-label="t('settings.language.sideLabel', { language: currentLanguageLabel() })"
|
|
423
|
+
:aria-expanded="languageMenuOpen ? 'true' : 'false'"
|
|
424
|
+
aria-haspopup="menu"
|
|
425
|
+
@click="toggleLanguageMenu"
|
|
426
|
+
@keydown.esc.prevent="closeLanguageMenu">
|
|
427
|
+
{{ t('settings.language.sideLabel', { language: currentLanguageLabel() }) }}
|
|
428
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 6l4 4 4-4"/></svg>
|
|
429
|
+
</button>
|
|
430
|
+
<div v-if="languageMenuOpen" class="side-language-dropdown" role="menu" @focusout="handleLanguageMenuFocusOut">
|
|
431
|
+
<button
|
|
432
|
+
v-for="option in languageOptions()"
|
|
433
|
+
:key="option.code"
|
|
434
|
+
type="button"
|
|
435
|
+
class="side-language-option"
|
|
436
|
+
:class="{ active: option.code === lang }"
|
|
437
|
+
role="menuitemradio"
|
|
438
|
+
:aria-checked="option.code === lang ? 'true' : 'false'"
|
|
439
|
+
@click="selectLanguage(option.code)">
|
|
440
|
+
<span>{{ option.nativeName }}</span>
|
|
441
|
+
<small>{{ option.englishName }}</small>
|
|
442
|
+
<svg v-if="option.code === lang" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>
|
|
443
|
+
</button>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
420
446
|
<button
|
|
421
447
|
type="button"
|
|
422
448
|
class="side-announcement-button"
|
|
@@ -583,12 +609,6 @@
|
|
|
583
609
|
<span class="value">{{ installRegistryPreview || 'npmmirror' }}</span>
|
|
584
610
|
</div>
|
|
585
611
|
</div>
|
|
586
|
-
<div class="status-strip status-strip-placeholder" v-else-if="!sessionStandalone" aria-hidden="true">
|
|
587
|
-
<div class="status-chip">
|
|
588
|
-
<span class="label"> </span>
|
|
589
|
-
<span class="value"> </span>
|
|
590
|
-
</div>
|
|
591
|
-
</div>
|
|
592
612
|
<div
|
|
593
613
|
v-if="!sessionStandalone && mainTab === 'config' && isProviderConfigMode && forceCompactLayout && !loading && !initError && displayProvidersList.length > 1"
|
|
594
614
|
class="provider-fast-switch">
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
<div class="form-hint">
|
|
124
124
|
{{ agentsPath || t('common.notLoaded') }}
|
|
125
125
|
<span v-if="agentsPath">
|
|
126
|
-
|
|
126
|
+
{{ paren(agentsExists ? t('common.exists') : t('common.notExistsWillCreateOnSave')) }}
|
|
127
127
|
</span>
|
|
128
128
|
</div>
|
|
129
129
|
</div>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<template v-else>
|
|
8
8
|
<div class="form-hint">
|
|
9
9
|
{{ healthCheckResult.ok ? t('config.health.ok') : t('config.health.fail') }}
|
|
10
|
-
<span v-if="healthCheckResult.issues"
|
|
10
|
+
<span v-if="healthCheckResult.issues">{{ paren(t('config.health.issues', { count: healthCheckResult.issues.length })) }}</span>
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
13
|
<div v-if="healthCheckResult.remote && healthCheckResult.remote.type === 'remote-health-check'" class="form-hint">
|