dsh-mcp-connector 0.2.88 → 0.2.90
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/CHANGELOG.md +24 -0
- package/README.en.md +3 -3
- package/README.md +3 -3
- package/docs/I18N.md +2 -2
- package/docs/screenshots/01-market-overview.jpg +0 -0
- package/docs/screenshots/02-connector-detail.jpg +0 -0
- package/docs/screenshots/03-tool-discovery.jpg +0 -0
- package/docs/screenshots/04-json-import.jpg +0 -0
- package/docs/screenshots/05-unified-tool-search.png +0 -0
- package/docs/screenshots/06-tool-parameters.png +0 -0
- package/docs/screenshots/07-connection-diagnostics.png +0 -0
- package/docs/screenshots/08-ten-recommendations.jpg +0 -0
- package/docs/screenshots/README.md +1 -1
- package/docs/screenshots/assets.json +30 -30
- package/docs/tutorials/FIRST-SUCCESS-SCENARIOS.md +1 -1
- package/package.json +1 -1
- package/ui/index.html +48 -21
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);首个公开版本从 `0.1.0` 开始。
|
|
4
4
|
|
|
5
|
+
## [0.2.90] - 2026-11-01
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- 语言入口缩为「中文 / EN」并入工具栏,不再独占一行;完整语言名称保留在提示与读屏标签中。
|
|
10
|
+
- 刷新目录与首次使用改为带完整提示的紧凑图标按钮,桌面操作区共用一行,窄窗口自适应两行,为卡片留出更多空间。
|
|
11
|
+
- 保留语言记忆与未保存编辑确认,编辑弹窗正常遮挡背景工具栏。
|
|
12
|
+
|
|
13
|
+
### Verification
|
|
14
|
+
|
|
15
|
+
- 完整回归及隔离 Chrome Mock 验证中英文切换、紧凑布局、窄屏与防御性确认;不代表 Windows Desktop 实机验收。
|
|
16
|
+
|
|
17
|
+
## [0.2.89] - 2026-11-01
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- 语言下拉改为面板顶部右侧始终可见的「简体中文 / English」按钮,当前语言高亮,支持键盘和读屏。
|
|
22
|
+
- 记住当前浏览器同源下的主动语言选择;存储不可用时仍可通过页面参数切换,未选择时继续跟随 Host 并回退中文。
|
|
23
|
+
- 编辑时切换语言仍需确认放弃未保存内容;只重载面板,不重启 DSH 或修改 Host 配置。
|
|
24
|
+
|
|
25
|
+
### Verification
|
|
26
|
+
|
|
27
|
+
- 完整回归及隔离 Chrome Mock 验证覆盖切换、重开记忆、取消确认、窄屏与存储降级,不代表 Windows Desktop 实机验收。
|
|
28
|
+
|
|
5
29
|
## [0.2.88] - 2026-10-31
|
|
6
30
|
|
|
7
31
|
### Added
|
package/README.en.md
CHANGED
|
@@ -10,7 +10,7 @@ OAuth availability depends on each provider's client-registration policy and acc
|
|
|
10
10
|
|
|
11
11
|
[简体中文](README.md)
|
|
12
12
|
|
|
13
|
-
**Bilingual interface:**
|
|
13
|
+
**Bilingual interface:** Compact **中文 / EN** buttons share the top toolbar; full language names remain in tooltips and accessible labels. Your explicit choice is remembered in this browser. Host messages follow the explicit DSH language preference, defaulting to Chinese when unavailable; configure `locale: en` or `locale: zh-CN` to override. Switching reloads only the panel. Provider descriptions and user content retain their original language. See [language configuration](docs/I18N.md).
|
|
14
14
|
|
|
15
15
|
### Homepage recommendations
|
|
16
16
|
|
|
@@ -114,7 +114,7 @@ As of 2026-10-24, the public Registry publishes 112 connector descriptors. After
|
|
|
114
114
|
| Connection diagnostics and last-success cache | |
|
|
115
115
|
|  | |
|
|
116
116
|
|
|
117
|
-
<!-- generated:media -->Screenshots and GIF were captured from v0.2.
|
|
117
|
+
<!-- generated:media -->Screenshots and GIF were captured from v0.2.90 (2026-11-01), using the credential-free Mock harness. They demonstrate UI, not real business acceptance; counts are fixtures. See [asset provenance](docs/screenshots/README.md).<!-- /generated:media -->
|
|
118
118
|
|
|
119
119
|
## Installation
|
|
120
120
|
|
|
@@ -245,7 +245,7 @@ npm run dev:ui
|
|
|
245
245
|
|
|
246
246
|
Every Registry merge regenerates `catalog-stats.json`; an hourly workflow in this repository synchronizes the Chinese and English product copy plus a local stats snapshot. The static npm README updates with package releases, while the live badges above read the Registry directly and therefore stay current without another npm release.
|
|
247
247
|
|
|
248
|
-
<!-- generated:version -->The current public version is [`dsh-mcp-connector@0.2.
|
|
248
|
+
<!-- generated:version -->The current public version is [`dsh-mcp-connector@0.2.90`](https://www.npmjs.com/package/dsh-mcp-connector), with [GitHub Release v0.2.90](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.90).<!-- /generated:version -->
|
|
249
249
|
|
|
250
250
|
See [CHANGELOG.md](CHANGELOG.md) for version history and [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md) for the Desktop release checklist.
|
|
251
251
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ OAuth 是否可用取决于服务商的客户端注册、账号权限与授权
|
|
|
10
10
|
|
|
11
11
|
[English](README.en.md)
|
|
12
12
|
|
|
13
|
-
**中英文界面:**
|
|
13
|
+
**中英文界面:** 顶部工具栏直接展示「中文 / EN」按钮,完整语言名称保留在提示中,并记住当前浏览器中的主动选择。插件 Host 默认跟随 DSH 显式语言偏好,缺失时保持中文;可配置 `locale: zh-CN` 或 `locale: en`。面板切换不重启 DSH;详情见 [语言设置](docs/I18N.md)。
|
|
14
14
|
|
|
15
15
|
### 首页推荐
|
|
16
16
|
|
|
@@ -116,7 +116,7 @@ Desktop 需要完全退出并重新启动应用;Web 需要停止原 `dsh web`
|
|
|
116
116
|
| 连接诊断与最后成功缓存 | |
|
|
117
117
|
|  | |
|
|
118
118
|
|
|
119
|
-
<!-- generated:media -->截图与 GIF 采集自 v0.2.
|
|
119
|
+
<!-- generated:media -->截图与 GIF 采集自 v0.2.90(2026-11-01)无凭据 Mock 页面,展示界面而非真实业务验收;市场数量是测试夹具。来源与更新方法见 [素材说明](docs/screenshots/README.md)。<!-- /generated:media -->
|
|
120
120
|
|
|
121
121
|
## 安装
|
|
122
122
|
|
|
@@ -240,7 +240,7 @@ npm run dev:ui
|
|
|
240
240
|
|
|
241
241
|
公共 Registry 每次合并后会生成 `catalog-stats.json`;本仓库的定时工作流每小时同步中英文介绍和统计快照。npm 页面中的静态正文随版本发布更新,上方动态统计徽标则直接读取 Registry,可在不发布新 npm 版本时保持实时数量一致。
|
|
242
242
|
|
|
243
|
-
<!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.
|
|
243
|
+
<!-- generated:version -->当前公开版本为 [`dsh-mcp-connector@0.2.90`](https://www.npmjs.com/package/dsh-mcp-connector),对应 [GitHub Release v0.2.90](https://github.com/duhu2000/dsh-mcp-connector/releases/tag/v0.2.90)。<!-- /generated:version -->
|
|
244
244
|
|
|
245
245
|
版本能力与变更记录见 [CHANGELOG.md](CHANGELOG.md)。
|
|
246
246
|
Desktop 发版回归见 [docs/DESKTOP-E2E.md](docs/DESKTOP-E2E.md)。
|
package/docs/I18N.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
- 界面语言**跟随用户在 DSH 里的选择**(设置 → Language),插件不覆盖用户偏好。
|
|
9
9
|
- 保持中文界面**零回归**:中文仍是 DSH 默认语言,既有中文文案逐字不变。
|
|
10
10
|
- 用户在 DSH 选英文、或配置 `locale: 'en'` 时,Host 启动后使用英文提示与管理工具描述。
|
|
11
|
-
-
|
|
11
|
+
- 面板顶部工具栏直接展示紧凑的「中文 / EN」按钮,不再单独占行;完整名称「简体中文 / English」保留在悬停提示及读屏标签中。当前语言高亮,支持键盘及读屏。编辑弹窗遮挡工具栏;切换处理器仍保留未保存编辑确认。仅重载当前面板,不修改 Host 配置或重启 DSH。主动选择保存在当前浏览器同源 localStorage(不同浏览器/设备不共享,同源面板共享);存储不可用时仍可通过当前页参数切换。面板语言与 Host 文案可独立;需要统一时同时设置 DSH/插件语言并手工重启 Host。
|
|
12
12
|
- 服务商目录说明、品牌名称、用户内容、示例任务中的企业名及 v1 模板协议常量保留原文,不宣称第三方内容全部英文化。
|
|
13
13
|
- 缺译文**绝不**显示空白或 key:回退中文原文。
|
|
14
14
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
`locale` 默认值为 `'auto'`,即走上述链路;`'zh-CN'` / `'en'` 为强制指定。
|
|
29
29
|
|
|
30
|
-
面板优先级:用户当前页 `uiLocale` 选择 → Host 注入语言 → 客户端 `locale` 参数 → HTML 默认中文。新增懒加载分享界面的词典位于 `ui/locale.js`,只翻译显示与提示,不改写用户输入或序列化模板常量。
|
|
30
|
+
面板优先级:用户当前页 `uiLocale` 选择 → 浏览器保存的主动选择 → Host 注入语言 → 客户端 `locale` 参数 → HTML 默认中文。新增懒加载分享界面的词典位于 `ui/locale.js`,只翻译显示与提示,不改写用户输入或序列化模板常量。
|
|
31
31
|
|
|
32
32
|
验收:`npm run check` 为代码门禁;`node scripts/check-i18n-ui.mjs` 为独立 Chromium + Mock API UI 验收,需配置 Playwright。Windows CI 和真实 Windows Desktop 仍是不同证据,不可互相替代。
|
|
33
33
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 产品截图与演示的来源及更新
|
|
2
2
|
|
|
3
|
-
<!-- generated:media -->本组 8 张截图和 GIF 均从 v0.2.
|
|
3
|
+
<!-- generated:media -->本组 8 张截图和 GIF 均从 v0.2.90 于 2026-11-01 重新采集,未修改截图中的版本文字。<!-- /generated:media -->
|
|
4
4
|
|
|
5
5
|
前七张素材由真实产品 UI 的无凭据 Mock harness 渲染:1280×720 浏览器视口、800px 产品面板、桌面两列卡片。顶部保留“无凭据 Mock”标识;目录数、连接数与工具数是演示夹具,不代表生产统计或真实授权、业务验收。不会读取用户 profile、调用服务商或上传业务数据。
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"capture": {
|
|
4
|
-
"capturedOn": "2026-
|
|
5
|
-
"sourceVersion": "0.2.
|
|
6
|
-
"sourceFingerprint": "
|
|
4
|
+
"capturedOn": "2026-11-01",
|
|
5
|
+
"sourceVersion": "0.2.90",
|
|
6
|
+
"sourceFingerprint": "1aafa7ba2ccd272fa7f554a5307f55f1c322978169fdbca6464139c4b8108c74",
|
|
7
7
|
"browserViewport": {
|
|
8
8
|
"width": 1280,
|
|
9
9
|
"height": 720
|
|
@@ -16,63 +16,63 @@
|
|
|
16
16
|
"screenshots": [
|
|
17
17
|
{
|
|
18
18
|
"path": "docs/screenshots/01-market-overview.jpg",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "4ed694eaf1a515a5e92ee93b75408ba99eb5c2cf0aa9c66148150a2044a14892",
|
|
20
20
|
"width": 1280,
|
|
21
21
|
"height": 720,
|
|
22
|
-
"capturedOn": "2026-
|
|
23
|
-
"sourceVersion": "0.2.
|
|
22
|
+
"capturedOn": "2026-11-01",
|
|
23
|
+
"sourceVersion": "0.2.90"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"path": "docs/screenshots/02-connector-detail.jpg",
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "e7e96e98462c8a21a54f8832611941ae94fd2ffef7c7d1655544ec9d39100e7d",
|
|
28
28
|
"width": 1280,
|
|
29
29
|
"height": 720,
|
|
30
|
-
"capturedOn": "2026-
|
|
31
|
-
"sourceVersion": "0.2.
|
|
30
|
+
"capturedOn": "2026-11-01",
|
|
31
|
+
"sourceVersion": "0.2.90"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"path": "docs/screenshots/03-tool-discovery.jpg",
|
|
35
|
-
"sha256": "
|
|
35
|
+
"sha256": "ed7a23f2e4ff57a64d2688c83f502186b78a303a1bad319266f79b553cff9837",
|
|
36
36
|
"width": 1280,
|
|
37
37
|
"height": 720,
|
|
38
|
-
"capturedOn": "2026-
|
|
39
|
-
"sourceVersion": "0.2.
|
|
38
|
+
"capturedOn": "2026-11-01",
|
|
39
|
+
"sourceVersion": "0.2.90"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": "docs/screenshots/04-json-import.jpg",
|
|
43
|
-
"sha256": "
|
|
43
|
+
"sha256": "25430f6e3ad740140ccdee67c69c93173a8576bd343f9e733fcb8657b7f7b998",
|
|
44
44
|
"width": 1280,
|
|
45
45
|
"height": 720,
|
|
46
|
-
"capturedOn": "2026-
|
|
47
|
-
"sourceVersion": "0.2.
|
|
46
|
+
"capturedOn": "2026-11-01",
|
|
47
|
+
"sourceVersion": "0.2.90"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"path": "docs/screenshots/05-unified-tool-search.png",
|
|
51
|
-
"sha256": "
|
|
51
|
+
"sha256": "7f61c94dcf46e4f1e7d364bcae8cde878306b8e599ec7336a188f54ebe1a4ace",
|
|
52
52
|
"width": 1280,
|
|
53
53
|
"height": 720,
|
|
54
|
-
"capturedOn": "2026-
|
|
55
|
-
"sourceVersion": "0.2.
|
|
54
|
+
"capturedOn": "2026-11-01",
|
|
55
|
+
"sourceVersion": "0.2.90"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"path": "docs/screenshots/06-tool-parameters.png",
|
|
59
|
-
"sha256": "
|
|
59
|
+
"sha256": "bf131b3de0c6098c72eab84a5b889ee78cbf92495ddd3769f96fcf35fb26ba40",
|
|
60
60
|
"width": 1280,
|
|
61
61
|
"height": 720,
|
|
62
|
-
"capturedOn": "2026-
|
|
63
|
-
"sourceVersion": "0.2.
|
|
62
|
+
"capturedOn": "2026-11-01",
|
|
63
|
+
"sourceVersion": "0.2.90"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"path": "docs/screenshots/07-connection-diagnostics.png",
|
|
67
|
-
"sha256": "
|
|
67
|
+
"sha256": "ea7dd623d7de1e9eac516839540b7b0429b3baa6d9ac90cb684d6a567eb10863",
|
|
68
68
|
"width": 1280,
|
|
69
69
|
"height": 720,
|
|
70
|
-
"capturedOn": "2026-
|
|
71
|
-
"sourceVersion": "0.2.
|
|
70
|
+
"capturedOn": "2026-11-01",
|
|
71
|
+
"sourceVersion": "0.2.90"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"path": "docs/screenshots/08-ten-recommendations.jpg",
|
|
75
|
-
"sha256": "
|
|
75
|
+
"sha256": "8d22b656446382eedb0a235e976922bf1db0db1e14bd298c55d179f9d883efb8",
|
|
76
76
|
"width": 1280,
|
|
77
77
|
"height": 1400,
|
|
78
78
|
"browserViewport": {
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
"height": 1400
|
|
81
81
|
},
|
|
82
82
|
"panelHeight": 1280,
|
|
83
|
-
"capturedOn": "2026-
|
|
84
|
-
"sourceVersion": "0.2.
|
|
83
|
+
"capturedOn": "2026-11-01",
|
|
84
|
+
"sourceVersion": "0.2.90"
|
|
85
85
|
}
|
|
86
86
|
],
|
|
87
87
|
"demo": {
|
|
88
88
|
"path": "docs/demo.gif",
|
|
89
|
-
"sha256": "
|
|
89
|
+
"sha256": "37db590b4b1ff1338890353fdaa4540de4987bbfac3ba362fcc9ce6d1940c160",
|
|
90
90
|
"width": 960,
|
|
91
91
|
"height": 540,
|
|
92
|
-
"capturedOn": "2026-
|
|
93
|
-
"sourceVersion": "0.2.
|
|
92
|
+
"capturedOn": "2026-11-01",
|
|
93
|
+
"sourceVersion": "0.2.90",
|
|
94
94
|
"durationSeconds": 36
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| 项目 | 验收要求 |
|
|
10
10
|
|---|---|
|
|
11
|
-
| 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.
|
|
11
|
+
| 前提 | <!-- generated:version -->正式 `dsh-mcp-connector@0.2.90`<!-- /generated:version -->;当前 Workspace;企查查 OAuth 可用;测试账号具有目标企业数据权限 |
|
|
12
12
|
| 权限/管理员 | 账号权限、组织授权和可见字段由服务商控制;企业组织可能需要管理员开通,当前文档不能替代审批 |
|
|
13
13
|
| 费用 | 可能受套餐、次数或字段权限影响;MCP连接器无法确认本次费用,调用前在服务商侧核对 |
|
|
14
14
|
| 运行/数据去向 | 远程 MCP Server;企业名称、查询参数和调用结果经 DSH Host 发送到/返回自 `agent.qcc.com` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mcp-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.90",
|
|
4
4
|
"description": "DeepSeek Harness MCP Connector: connect servers, search tools across active connections, and troubleshoot discovery. Includes a continuously updated catalog; supports OAuth 2.0 PKCE, API keys, Streamable HTTP/stdio, and mcpServers JSON import.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
package/ui/index.html
CHANGED
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
|
|
62
62
|
/* Header */
|
|
63
63
|
header {
|
|
64
|
-
display: flex; align-items: center; gap:
|
|
65
|
-
padding: 16px
|
|
64
|
+
display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
|
65
|
+
padding: 12px 16px; border-bottom: 1px solid var(--line);
|
|
66
66
|
background: var(--card); position: sticky; top: 0; z-index: 5;
|
|
67
67
|
flex-shrink: 0;
|
|
68
68
|
}
|
|
@@ -84,6 +84,17 @@
|
|
|
84
84
|
.tabs button.active .tab-count { background: var(--accent-light); color: var(--accent); }
|
|
85
85
|
.tab-count:empty { display: none; }
|
|
86
86
|
.header-spacer { flex: 1; }
|
|
87
|
+
.toolbar { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
|
|
88
|
+
.toolbar .tabs { flex-shrink: 0; }
|
|
89
|
+
.toolbar .tabs button { padding-inline: 10px; }
|
|
90
|
+
.toolbar .search-box { flex: 1; width: auto; min-width: 80px; }
|
|
91
|
+
.toolbar .icon-btn { white-space: nowrap; padding-inline: 10px; min-height: 34px; }
|
|
92
|
+
.toolbar .compact-action { width: 34px; flex-shrink: 0; padding: 4px; font-size: 18px; }
|
|
93
|
+
.language-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
|
|
94
|
+
.language-switch { flex-shrink: 0; }
|
|
95
|
+
.language-switch button { min-height: 28px; padding: 3px 7px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
|
|
96
|
+
.language-switch button[aria-pressed="true"] { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); }
|
|
97
|
+
.language-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
87
98
|
.search-box {
|
|
88
99
|
display: flex; align-items: center; gap: 8px;
|
|
89
100
|
background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
|
|
@@ -442,7 +453,10 @@
|
|
|
442
453
|
@media (max-width: 620px) {
|
|
443
454
|
header { padding: 12px; }
|
|
444
455
|
.header-spacer { display: none; }
|
|
445
|
-
.
|
|
456
|
+
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; }
|
|
457
|
+
.toolbar .tabs { grid-column: 1 / 4; }
|
|
458
|
+
.toolbar .language-switch { grid-column: 4; justify-self: end; }
|
|
459
|
+
.toolbar .search-box { grid-column: 1; min-width: 0; }
|
|
446
460
|
main { padding: 14px; }
|
|
447
461
|
.grid { grid-template-columns: 1fr; }
|
|
448
462
|
.card { flex-wrap: wrap; }
|
|
@@ -481,23 +495,24 @@
|
|
|
481
495
|
<body>
|
|
482
496
|
<div class="app">
|
|
483
497
|
<header>
|
|
498
|
+
<div class="toolbar">
|
|
484
499
|
<div class="tabs" id="tabs">
|
|
485
500
|
<button data-view="market" class="active"><span id="tab-market">市场</span> <span class="tab-count" id="market-tab-count"></span></button>
|
|
486
501
|
<button data-view="installed"><span id="tab-installed">已安装</span> <span class="tab-count" id="installed-tab-count"></span></button>
|
|
487
502
|
<button data-view="tools"><span id="tab-tools">工具</span></button>
|
|
488
503
|
</div>
|
|
489
|
-
<div class="
|
|
490
|
-
|
|
491
|
-
<
|
|
492
|
-
|
|
493
|
-
</select>
|
|
504
|
+
<div id="ui-language" class="language-switch" role="group" aria-label="Language / 语言">
|
|
505
|
+
<button type="button" data-locale="zh-CN" lang="zh-CN" aria-label="简体中文" title="简体中文" aria-pressed="true">中文</button>
|
|
506
|
+
<button type="button" data-locale="en" lang="en" aria-label="English" title="English" aria-pressed="false">EN</button>
|
|
507
|
+
</div>
|
|
494
508
|
<div class="search-box">
|
|
495
509
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color:var(--muted);flex-shrink:0"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
|
|
496
510
|
<input id="search" type="text" placeholder="搜索连接器…" />
|
|
497
511
|
</div>
|
|
498
512
|
<button class="icon-btn primary" id="add-connection" type="button">+ 添加连接</button>
|
|
499
|
-
<button class="icon-btn" id="refresh" title="刷新连接器目录"
|
|
500
|
-
<button class="icon-btn" id="first-use" type="button"
|
|
513
|
+
<button class="icon-btn compact-action" id="refresh" type="button" title="刷新连接器目录" aria-label="刷新连接器目录">↻</button>
|
|
514
|
+
<button class="icon-btn compact-action" id="first-use" type="button" title="首次使用" aria-label="首次使用">?</button>
|
|
515
|
+
</div>
|
|
501
516
|
<div class="market-nav" id="market-nav" aria-label="市场分类导航"></div>
|
|
502
517
|
</header>
|
|
503
518
|
<main id="main"></main>
|
|
@@ -1098,6 +1113,7 @@
|
|
|
1098
1113
|
// 时同样回退中文原文,绝不显示空白或 key。
|
|
1099
1114
|
// 面板是独立 HTML,不能 import ES 模块,所以这里内联等价实现(纯函数)。
|
|
1100
1115
|
const DEFAULT_LOCALE = 'zh-CN';
|
|
1116
|
+
const LANGUAGE_STORAGE_KEY = 'mcp-connector.ui-language';
|
|
1101
1117
|
const ACTIVE_LOCALE = detectLocale();
|
|
1102
1118
|
document.documentElement.lang = ACTIVE_LOCALE;
|
|
1103
1119
|
|
|
@@ -1113,9 +1129,7 @@
|
|
|
1113
1129
|
}
|
|
1114
1130
|
|
|
1115
1131
|
/**
|
|
1116
|
-
*
|
|
1117
|
-
* 只在英文时注入,中文时完全不存在 → undefined 视为 zh-CN)→ iframe URL 上的
|
|
1118
|
-
* `?locale=` 查询参数(client.js 也会带)→ `<html lang>` → 中文默认值。
|
|
1132
|
+
* 语言优先级:当前面板参数 → 浏览器中主动选择 → Host 注入 → locale 参数 → HTML。
|
|
1119
1133
|
* 无法识别或不受支持一律回退中文(中文仍是默认界面)。
|
|
1120
1134
|
*/
|
|
1121
1135
|
function detectLocale() {
|
|
@@ -1124,6 +1138,10 @@
|
|
|
1124
1138
|
const choice = normalizeLocale(new URLSearchParams(window.location.search || '').get('uiLocale'));
|
|
1125
1139
|
if (choice) return choice;
|
|
1126
1140
|
} catch { /* fall through to Host preference */ }
|
|
1141
|
+
try {
|
|
1142
|
+
const saved = normalizeLocale(window.localStorage.getItem(LANGUAGE_STORAGE_KEY));
|
|
1143
|
+
if (saved) return saved;
|
|
1144
|
+
} catch { /* Storage may be unavailable in embedded/private contexts. */ }
|
|
1127
1145
|
const fromHost = normalizeLocale(window.__MCP_CONNECTOR_LOCALE__);
|
|
1128
1146
|
if (fromHost !== undefined) return fromHost;
|
|
1129
1147
|
let requested = '';
|
|
@@ -3355,8 +3373,8 @@
|
|
|
3355
3373
|
function refresh() { return view === 'tools' ? loadToolExplorer() : view === 'market' ? loadMarket() : loadInstalled(); }
|
|
3356
3374
|
function syncTabs() {
|
|
3357
3375
|
searchInput.placeholder = t(view === 'tools' ? '搜索工具名称或描述…' : '搜索连接器…');
|
|
3358
|
-
$('#refresh').
|
|
3359
|
-
$('#refresh').
|
|
3376
|
+
$('#refresh').title = t(view === 'tools' ? '刷新工具视图' : '刷新连接器目录');
|
|
3377
|
+
$('#refresh').setAttribute('aria-label', $('#refresh').title);
|
|
3360
3378
|
document.querySelectorAll('#tabs button').forEach((button) => button.classList.toggle('active', button.dataset.view === view));
|
|
3361
3379
|
syncMarketNav();
|
|
3362
3380
|
}
|
|
@@ -3419,7 +3437,8 @@
|
|
|
3419
3437
|
setText('#tab-installed', '已安装');
|
|
3420
3438
|
setText('#tab-tools', '工具');
|
|
3421
3439
|
setText('#add-connection', '+ 添加连接');
|
|
3422
|
-
|
|
3440
|
+
$('#first-use').title = t('首次使用');
|
|
3441
|
+
$('#first-use').setAttribute('aria-label', t('首次使用'));
|
|
3423
3442
|
setText('#prompt-title', '试试这样用');
|
|
3424
3443
|
setText('#prompt-next', '换一批');
|
|
3425
3444
|
setText('#tools-title', '工具详情');
|
|
@@ -3437,15 +3456,23 @@
|
|
|
3437
3456
|
}
|
|
3438
3457
|
|
|
3439
3458
|
applyStaticLocale();
|
|
3440
|
-
const
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3459
|
+
const languageSwitch = $('#ui-language');
|
|
3460
|
+
for (const button of languageSwitch.querySelectorAll('button[data-locale]')) {
|
|
3461
|
+
button.setAttribute('aria-pressed', String(button.dataset.locale === ACTIVE_LOCALE));
|
|
3462
|
+
}
|
|
3463
|
+
let languageChangePending = false;
|
|
3464
|
+
languageSwitch.addEventListener('click', async (event) => {
|
|
3465
|
+
const button = event.target.closest('button[data-locale]');
|
|
3466
|
+
if (!button || languageChangePending) return;
|
|
3467
|
+
const choice = normalizeLocale(button.dataset.locale);
|
|
3468
|
+
if (!choice) return;
|
|
3444
3469
|
if (choice === ACTIVE_LOCALE) return;
|
|
3470
|
+
languageChangePending = true;
|
|
3445
3471
|
if ($('#modalMask').classList.contains('show') && !await confirmDialog({
|
|
3446
3472
|
title: t('切换界面语言'),
|
|
3447
3473
|
message: t('切换语言将重新加载面板,未保存的编辑会丢失。继续吗?'),
|
|
3448
|
-
})) {
|
|
3474
|
+
})) { languageChangePending = false; return; }
|
|
3475
|
+
try { window.localStorage.setItem(LANGUAGE_STORAGE_KEY, choice); } catch { /* URL fallback still works. */ }
|
|
3449
3476
|
const url = new URL(window.location.href);
|
|
3450
3477
|
url.searchParams.set('uiLocale', choice);
|
|
3451
3478
|
window.location.assign(url.href);
|