@xmanrui/dsh-im 5.5.0 → 5.6.0
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.en.md +2 -2
- package/README.md +2 -2
- package/lib/client.js +309 -243
- package/lib/index.js +307 -307
- package/package.json +4 -4
- package/plugin-src/client/channels/dingtalk/index.js +12 -9
- package/plugin-src/client/channels/feishu/group-settings.js +5 -5
- package/plugin-src/client/channels/feishu/index.js +33 -25
- package/plugin-src/client/channels/qq/index.js +5 -5
- package/plugin-src/client/channels/shared/token-api.js +12 -7
- package/plugin-src/client/channels/shared/token-channel.js +18 -11
- package/plugin-src/client/channels/wecom/index.js +5 -5
- package/plugin-src/client/channels/wecom-app/index.js +3 -3
- package/plugin-src/client/channels/weixin/index.js +2 -2
- package/plugin-src/client/channels/whatsapp/index.js +6 -6
- package/plugin-src/client/credential-binding.js +3 -2
- package/plugin-src/client/delivery-settings.js +3 -3
- package/plugin-src/client/ds-bot-settings.js +3 -3
- package/plugin-src/client/global-settings.js +5 -2
- package/plugin-src/client/i18n-ru.js +56 -34
- package/plugin-src/client/i18n.js +210 -124
- package/scripts/verify-package.mjs +1 -1
- package/src/channels/dingtalk/dingtalk-bridge.mjs +1 -0
- package/src/channels/feishu/bridge.mjs +25 -3
- package/src/channels/feishu/feishu-cards.mjs +1 -45
- package/src/channels/feishu/slash-command-panel.mjs +2 -5
- package/src/channels/qq/qq-bridge.mjs +1 -0
- package/src/channels/shared/bot-workspace-store.mjs +1 -1
- package/src/channels/shared/command-catalog.mjs +8 -5
- package/src/channels/shared/delivery-failure-log.mjs +111 -0
- package/src/channels/shared/diagnostic-details.mjs +1 -0
- package/src/channels/shared/harness-client.mjs +12 -6
- package/src/channels/shared/i18n-en/shared-b.mjs +5 -0
- package/src/channels/shared/i18n-en/shared-c.mjs +3 -0
- package/src/channels/shared/i18n-en/telegram.mjs +6 -0
- package/src/channels/shared/i18n-ru/shared-b.mjs +5 -0
- package/src/channels/shared/i18n-ru/shared-c.mjs +3 -0
- package/src/channels/shared/i18n-ru/telegram.mjs +5 -0
- package/src/channels/shared/message-failure.mjs +5 -2
- package/src/channels/shared/session-error.mjs +8 -0
- package/src/channels/shared/text-harness-bridge.mjs +201 -3
- package/src/channels/shared/workspace-command.mjs +41 -16
- package/src/channels/shared/workspace-labels.mjs +65 -0
- package/src/channels/shared/workspace-session.mjs +24 -4
- package/src/channels/telegram/telegram-api.mjs +31 -2
- package/src/channels/telegram/telegram-bridge.mjs +58 -0
- package/src/channels/telegram/telegram-runtime.mjs +85 -3
- package/src/channels/wecom/wecom-bridge.mjs +1 -0
- package/src/channels/wecom-app/wecom-app-bridge.mjs +1 -0
- package/src/channels/weixin/weixin-bridge.mjs +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmanrui/dsh-im",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"icon": "./assets/logo-plugin-message-link-gradient.webp",
|
|
5
5
|
"description": "把微信、飞书、企微、钉钉、QQ、Telegram、WhatsApp、Slack、Discord、Matrix接入DSH。 Connect Telegram, WhatsApp, Slack, Discord, Matrix, WeChat, Feishu, WeCom, DingTalk, and QQ to DSH.",
|
|
6
6
|
"keywords": [
|
|
@@ -112,10 +112,10 @@
|
|
|
112
112
|
"@wecom/aibot-node-sdk": "1.0.7",
|
|
113
113
|
"dingtalk-stream": "2.1.4",
|
|
114
114
|
"imapflow": "^2.0.5",
|
|
115
|
-
"mailparser": "^3.9.
|
|
116
|
-
"nodemailer": "^10.
|
|
115
|
+
"mailparser": "^3.9.43",
|
|
116
|
+
"nodemailer": "^10.1.4",
|
|
117
117
|
"qrcode": "1.5.4",
|
|
118
|
-
"undici": "7.
|
|
118
|
+
"undici": "7.30.1"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@deepseek-ai/cordis": "4.0.1",
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from '../../credential-binding.js';
|
|
6
6
|
import { AccountSettingsToggle, CollapsibleAccountSection } from '../shared/collapsible-account.js';
|
|
7
|
-
import { h } from '../../i18n.js';
|
|
7
|
+
import { channelName, h, localizeTemplate, localizeText } from '../../i18n.js';
|
|
8
8
|
import { WorkspaceEditor } from '../../workspace-editor.js';
|
|
9
9
|
import { ContextEnhancementEditor } from '../../context-enhancement.js';
|
|
10
10
|
import {
|
|
@@ -92,7 +92,7 @@ function Heading({ totals, adding, busy, onAdd, onCredential, credentialOpen, ad
|
|
|
92
92
|
}, h(CredentialActionIcon), credentialOpen ? '收起凭据' : '手动接入')),
|
|
93
93
|
totals.configured > 0
|
|
94
94
|
? h('div', { className: 'ddt-badge dim-onlineBadge' },
|
|
95
|
-
h('span', null,
|
|
95
|
+
h('span', null, localizeTemplate('{connected} / {configured} 在线', { connected: totals.connected, configured: totals.configured })))
|
|
96
96
|
: null));
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -107,7 +107,7 @@ function EmptyView({ busy, onStart }) {
|
|
|
107
107
|
h('div', { className: 'ddt-cardBody ddt-empty dim-surfaceBody dim-emptyView' },
|
|
108
108
|
h('div', { className: 'dim-emptyCopy' },
|
|
109
109
|
h('div', { className: 'ddt-stateLabel dim-stateLabel' },
|
|
110
|
-
h('span', { className: 'ddt-dot dim-stateDot' }), h('span', null, '
|
|
110
|
+
h('span', { className: 'ddt-dot dim-stateDot' }), h('span', null, localizeTemplate('尚未接入 {channel} 机器人', { channel: channelName('钉钉') }))),
|
|
111
111
|
h('h3', null, '扫一次码,自动创建并连接机器人'),
|
|
112
112
|
h('p', null, '授权由钉钉官方页面完成。扫码账号必须已加入一个企业/组织并有权创建机器人;创建成功后,应用凭据会直接写入 Harness Host。'),
|
|
113
113
|
h('div', { className: 'ddt-actions dim-viewActions' },
|
|
@@ -216,12 +216,12 @@ function RemoveConfirmation({ account, busy, onConfirm, onCancel }) {
|
|
|
216
216
|
return h('div', {
|
|
217
217
|
className: 'ddt-confirm dim-confirm',
|
|
218
218
|
role: 'alertdialog',
|
|
219
|
-
'aria-label':
|
|
219
|
+
'aria-label': localizeTemplate('移除{name}', { name: account.bot.name }),
|
|
220
220
|
onKeyDown: (event) => {
|
|
221
221
|
if (event.key === 'Escape' && !busy) onCancel();
|
|
222
222
|
},
|
|
223
223
|
},
|
|
224
|
-
h('strong', null,
|
|
224
|
+
h('strong', null, localizeTemplate('从 DeepSeek Harness 移除“{name}”?', { name: account.bot.name })),
|
|
225
225
|
h('p', null, '这会停止消息连接,并删除本机保存的应用凭据、机器人配置及会话映射。钉钉开放平台中的机器人不会被自动删除。'),
|
|
226
226
|
h('div', { className: 'ddt-actions dim-viewActions' },
|
|
227
227
|
h(Button, { ref: cancelRef, onClick: onCancel, disabled: busy }, '保留机器人'),
|
|
@@ -757,9 +757,12 @@ export function DingtalkSettingsTab({ rpcCall }) {
|
|
|
757
757
|
const visibleError = presentError(error);
|
|
758
758
|
const failureMessage = operation === 'reconnect'
|
|
759
759
|
? visibleError.referenceId
|
|
760
|
-
?
|
|
760
|
+
? localizeTemplate('连接检查失败:{error}(参考号:{reference})', {
|
|
761
|
+
error: localizeText(visibleError.message),
|
|
762
|
+
reference: visibleError.referenceId,
|
|
763
|
+
})
|
|
761
764
|
: '连接检查失败,请稍后重试。'
|
|
762
|
-
:
|
|
765
|
+
: localizeTemplate('操作失败:{error}', { error: localizeText(visibleError.message) });
|
|
763
766
|
if (operation === 'reconnect') {
|
|
764
767
|
setFeedbackByBot((current) => ({
|
|
765
768
|
...current,
|
|
@@ -910,14 +913,14 @@ export function DingtalkSettingsTab({ rpcCall }) {
|
|
|
910
913
|
}),
|
|
911
914
|
h('div', { className: 'ddt-visuallyHidden', role: 'status', 'aria-live': 'polite' }, notice),
|
|
912
915
|
model.error && model.phase === 'ready'
|
|
913
|
-
? h('div', { className: 'ddt-statusNotice dim-statusNotice', role: 'alert' },
|
|
916
|
+
? h('div', { className: 'ddt-statusNotice dim-statusNotice', role: 'alert' }, localizeTemplate('状态刷新失败:{error}', { error: localizeText(model.error.message) }))
|
|
914
917
|
: null,
|
|
915
918
|
model.phase === 'loading'
|
|
916
919
|
? h(LoadingView)
|
|
917
920
|
: model.phase === 'error'
|
|
918
921
|
? h('div', { className: 'ddt-card dim-surfaceCard' },
|
|
919
922
|
h('div', { className: 'ddt-inlineError dim-inlineError', role: 'alert' },
|
|
920
|
-
h('h3', null, '
|
|
923
|
+
h('h3', null, localizeTemplate('无法读取 {channel} 机器人状态', { channel: channelName('钉钉') })),
|
|
921
924
|
h('p', null, model.error?.message ?? '请稍后重试'),
|
|
922
925
|
h(Button, { onClick: () => void loadStatus() }, '重新读取')))
|
|
923
926
|
: h(React.Fragment, null,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { h } from '../../i18n.js';
|
|
3
|
+
import { h, localizeTemplate } from '../../i18n.js';
|
|
4
4
|
import {
|
|
5
5
|
FEISHU_ENDPOINTS,
|
|
6
6
|
FEISHU_REGISTRATION_OPERATIONS,
|
|
@@ -250,14 +250,14 @@ function PermissionFlow({ provision, now, busy, botName, onRetry, onCancel, onCl
|
|
|
250
250
|
|
|
251
251
|
return h('section', {
|
|
252
252
|
className: 'dim-feishuGroupAuthorization',
|
|
253
|
-
'aria-label':
|
|
253
|
+
'aria-label': localizeTemplate('{bot}的飞书授权流程', { bot: botName }),
|
|
254
254
|
},
|
|
255
255
|
h('div', { className: 'dim-feishuGroupQrColumn' },
|
|
256
256
|
h('div', { className: 'dim-feishuGroupQrFrame' },
|
|
257
257
|
qrSource
|
|
258
258
|
? h('img', {
|
|
259
259
|
src: qrSource,
|
|
260
|
-
alt:
|
|
260
|
+
alt: localizeTemplate('用于为{bot}开通群消息权限的一次性授权二维码', { bot: botName }),
|
|
261
261
|
})
|
|
262
262
|
: h('div', { className: 'dim-feishuGroupQrFallback' },
|
|
263
263
|
h(QrPlaceholder), h('span', null, '二维码未就绪,请打开授权链接')),
|
|
@@ -267,7 +267,7 @@ function PermissionFlow({ provision, now, busy, botName, onRetry, onCancel, onCl
|
|
|
267
267
|
: null),
|
|
268
268
|
h('div', {
|
|
269
269
|
className: 'dim-feishuGroupCountdown',
|
|
270
|
-
'aria-label': expired ? '二维码已失效' :
|
|
270
|
+
'aria-label': expired ? '二维码已失效' : localizeTemplate('二维码剩余 {remaining}', { remaining: formatRemaining(remaining) }),
|
|
271
271
|
},
|
|
272
272
|
h('span', null, expired ? '等待刷新' : '二维码有效时间'),
|
|
273
273
|
h('strong', null, formatRemaining(remaining)),
|
|
@@ -275,7 +275,7 @@ function PermissionFlow({ provision, now, busy, botName, onRetry, onCancel, onCl
|
|
|
275
275
|
h('span', { style: { width: `${Math.round(progress * 100)}%` } })))),
|
|
276
276
|
h('div', { className: 'dim-feishuGroupAuthorizationCopy' },
|
|
277
277
|
h('span', { className: 'dim-feishuGroupAuthorizationEyebrow' },
|
|
278
|
-
|
|
278
|
+
localizeTemplate('正在为「{bot}」开通群消息权限', { bot: botName })),
|
|
279
279
|
h('h3', null, expired ? '刷新二维码后继续' : '使用飞书确认群消息权限'),
|
|
280
280
|
h('p', null,
|
|
281
281
|
'扫码会更新现有飞书应用,只增量开通“获取群组中所有消息”权限,不会创建新应用。单独授权采集时保留原来的回复方式;选择响应所有消息时才切换。'),
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import { FeishuLogoGlyph } from "../../channel-logos.js";
|
|
6
6
|
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from "../../credential-binding.js";
|
|
7
7
|
import { AccountSettingsToggle, CollapsibleAccountSection } from "../shared/collapsible-account.js";
|
|
8
|
-
import { h } from "../../i18n.js";
|
|
8
|
+
import { h, localizeTemplate, localizeText } from "../../i18n.js";
|
|
9
9
|
import {
|
|
10
10
|
FEISHU_ENDPOINTS,
|
|
11
11
|
FEISHU_REGISTRATION_OPERATIONS,
|
|
@@ -186,8 +186,14 @@ function Heading({ totals, onAdd, onCredential, credentialOpen, adding, busy, ad
|
|
|
186
186
|
hasBots
|
|
187
187
|
? h("div", {
|
|
188
188
|
className: "bxf-totalBadge dim-onlineBadge",
|
|
189
|
-
"aria-label":
|
|
190
|
-
|
|
189
|
+
"aria-label": localizeTemplate('已接入 {configured} 个机器人,其中 {connected} 个在线', {
|
|
190
|
+
configured: totals.configured,
|
|
191
|
+
connected: totals.connected,
|
|
192
|
+
}),
|
|
193
|
+
}, h("span", null, localizeTemplate('{connected} / {configured} 在线', {
|
|
194
|
+
connected: totals.connected,
|
|
195
|
+
configured: totals.configured,
|
|
196
|
+
})))
|
|
191
197
|
: null,
|
|
192
198
|
),
|
|
193
199
|
);
|
|
@@ -272,9 +278,9 @@ function QrPane({ provision, now, onRefresh, onCancel, busy }) {
|
|
|
272
278
|
? h("img", {
|
|
273
279
|
src: qrSource,
|
|
274
280
|
alt: repairing
|
|
275
|
-
?
|
|
281
|
+
? localizeTemplate('用于为{bot}补全权限与回调的一次性授权二维码', { bot: botName })
|
|
276
282
|
: grantingGroupMessages
|
|
277
|
-
?
|
|
283
|
+
? localizeTemplate('用于为{bot}开通群消息权限的一次性授权二维码', { bot: botName })
|
|
278
284
|
: "用于新增 DeepSeek Harness 飞书机器人的一次性授权二维码",
|
|
279
285
|
onError: () => setImageFailed(true),
|
|
280
286
|
})
|
|
@@ -287,7 +293,9 @@ function QrPane({ provision, now, onRefresh, onCancel, busy }) {
|
|
|
287
293
|
),
|
|
288
294
|
h("div", {
|
|
289
295
|
className: "bxf-countdown dim-countdown",
|
|
290
|
-
"aria-label": expired
|
|
296
|
+
"aria-label": expired
|
|
297
|
+
? "二维码已失效"
|
|
298
|
+
: localizeTemplate('二维码剩余 {remaining}', { remaining: formatRemaining(remaining) }),
|
|
291
299
|
},
|
|
292
300
|
h("div", { className: "bxf-countdownTop dim-countdownTop", "aria-hidden": "true" },
|
|
293
301
|
h("span", null, expired ? "等待刷新" : "二维码有效时间"),
|
|
@@ -300,9 +308,9 @@ function QrPane({ provision, now, onRefresh, onCancel, busy }) {
|
|
|
300
308
|
h("div", { className: "bxf-stateLabel dim-stateLabel" },
|
|
301
309
|
h("span", { className: "bxf-dot dim-stateDot", "data-tone": "warning" }),
|
|
302
310
|
h("span", null, repairing
|
|
303
|
-
?
|
|
311
|
+
? localizeTemplate('正在为「{bot}」补全权限与回调', { bot: botName })
|
|
304
312
|
: grantingGroupMessages
|
|
305
|
-
?
|
|
313
|
+
? localizeTemplate('正在为「{bot}」开通群消息权限', { bot: botName })
|
|
306
314
|
: "正在添加新机器人")),
|
|
307
315
|
h("h3", null, expired
|
|
308
316
|
? "刷新二维码后继续"
|
|
@@ -456,7 +464,7 @@ function RemoveConfirmation({ bot, busy, onConfirm, onCancel }) {
|
|
|
456
464
|
}
|
|
457
465
|
},
|
|
458
466
|
},
|
|
459
|
-
h("h4", { id: titleId },
|
|
467
|
+
h("h4", { id: titleId }, localizeTemplate('从 DeepSeek Harness 移除“{name}”?', { name: bot.bot.name })),
|
|
460
468
|
h("p", { id: descriptionId },
|
|
461
469
|
"此操作会停止这个机器人的连接,并删除保存在本机的接入配置和凭据。飞书开放平台中的应用不会被自动删除,其他机器人也不受影响。"),
|
|
462
470
|
h("div", { className: "bxf-actions dim-viewActions" },
|
|
@@ -669,7 +677,7 @@ export function BotCard({
|
|
|
669
677
|
provisionContent
|
|
670
678
|
? h("section", {
|
|
671
679
|
className: "bxf-botProvision dim-botProvision",
|
|
672
|
-
"aria-label":
|
|
680
|
+
"aria-label": localizeTemplate('{bot}的飞书授权流程', { bot: bot.name }),
|
|
673
681
|
"data-provision-for": connection.botId,
|
|
674
682
|
ref: provisionRef,
|
|
675
683
|
tabIndex: -1,
|
|
@@ -681,7 +689,7 @@ export function BotCard({
|
|
|
681
689
|
h(Button, {
|
|
682
690
|
className: "dim-cardAction", onClick: onReconnect,
|
|
683
691
|
disabled: Boolean(busy), "aria-busy": busy === "reconnect" ? "true" : undefined,
|
|
684
|
-
"aria-label":
|
|
692
|
+
"aria-label": localizeTemplate(connected ? '检查连接{name}' : '重试连接{name}', { name: bot.name }),
|
|
685
693
|
}, busy === "reconnect" ? (connected ? "检查中…" : "正在连接…") : connected ? "检查连接" : "重试连接"),
|
|
686
694
|
h("span", { className: "bxf-repairAction" },
|
|
687
695
|
h(Button, {
|
|
@@ -689,7 +697,7 @@ export function BotCard({
|
|
|
689
697
|
onClick: onRepairCallback,
|
|
690
698
|
disabled: Boolean(busy) || repairDisabled,
|
|
691
699
|
"aria-busy": busy === "callback-repair" ? "true" : undefined,
|
|
692
|
-
"aria-label":
|
|
700
|
+
"aria-label": localizeTemplate('为{bot}补全权限与回调', { bot: bot.name }),
|
|
693
701
|
"aria-describedby": repairTooltipId,
|
|
694
702
|
}, busy === "callback-repair" ? "等待扫码…" : "补全权限"),
|
|
695
703
|
h("span", {
|
|
@@ -702,7 +710,7 @@ export function BotCard({
|
|
|
702
710
|
h(Button, {
|
|
703
711
|
className: "dim-cardAction", kind: "danger", onClick: onRequestRemove,
|
|
704
712
|
disabled: Boolean(busy), ref: removeButtonRef,
|
|
705
|
-
"aria-label":
|
|
713
|
+
"aria-label": localizeTemplate('从 DeepSeek Harness 移除{name}', { name: bot.name }),
|
|
706
714
|
}, "移除接入")),
|
|
707
715
|
summary ? h("div", { className: "bxf-healthSummary dim-cardSummary", "data-error": actionError || connection.error ? "true" : undefined },
|
|
708
716
|
summary) : null,
|
|
@@ -1025,9 +1033,9 @@ export function FeishuSettingsTab({ rpcCall }) {
|
|
|
1025
1033
|
},
|
|
1026
1034
|
}));
|
|
1027
1035
|
announce(repairing
|
|
1028
|
-
?
|
|
1036
|
+
? localizeTemplate('{bot}的权限补全二维码已生成,请使用飞书扫码。', { bot: botName ?? "机器人" })
|
|
1029
1037
|
: grantingGroupMessages
|
|
1030
|
-
?
|
|
1038
|
+
? localizeTemplate('{bot}的群消息权限二维码已生成,请使用飞书确认。', { bot: botName ?? "机器人" })
|
|
1031
1039
|
: "授权二维码已生成,请使用飞书扫码。");
|
|
1032
1040
|
} catch (error) {
|
|
1033
1041
|
setModel((current) => ({
|
|
@@ -1116,8 +1124,8 @@ export function FeishuSettingsTab({ rpcCall }) {
|
|
|
1116
1124
|
const targetBotName = targetBot?.bot.name ?? activeProvision.botName ?? "机器人";
|
|
1117
1125
|
setModel((current) => ({ ...current, provisioning: null }));
|
|
1118
1126
|
announce(grantingGroupMessages
|
|
1119
|
-
?
|
|
1120
|
-
:
|
|
1127
|
+
? localizeTemplate('{bot}已开通群消息权限,并启用“响应所有群消息”。', { bot: targetBotName })
|
|
1128
|
+
: localizeTemplate('{bot}的权限与回调已补全。', { bot: targetBotName }));
|
|
1121
1129
|
if (activeProvision.botId) setFocusBotId(activeProvision.botId);
|
|
1122
1130
|
await loadStatus({ silent: true, restoreProvisioning: false });
|
|
1123
1131
|
return;
|
|
@@ -1207,11 +1215,11 @@ export function FeishuSettingsTab({ rpcCall }) {
|
|
|
1207
1215
|
}
|
|
1208
1216
|
setModel((current) => ({ ...current, provisioning: null }));
|
|
1209
1217
|
announce(isCallbackRepair(provision)
|
|
1210
|
-
?
|
|
1218
|
+
? localizeTemplate('{bot}的权限与回调已补全。', { bot: targetBot.bot.name })
|
|
1211
1219
|
: isGroupMessagePermission(provision)
|
|
1212
|
-
?
|
|
1220
|
+
? localizeTemplate('{bot}已开通群消息权限,并启用“响应所有群消息”。', { bot: targetBot.bot.name })
|
|
1213
1221
|
: targetBot
|
|
1214
|
-
?
|
|
1222
|
+
? localizeTemplate('{bot}已连接,可以在飞书中开始聊天。', { bot: targetBot.bot.name })
|
|
1215
1223
|
: "新飞书机器人已连接,可以开始聊天。");
|
|
1216
1224
|
if (result.botId) setFocusBotId(result.botId);
|
|
1217
1225
|
return;
|
|
@@ -1327,8 +1335,8 @@ export function FeishuSettingsTab({ rpcCall }) {
|
|
|
1327
1335
|
setTestNoticesByBot((current) => ({ ...current, [botId]: testNotice }));
|
|
1328
1336
|
}
|
|
1329
1337
|
announce(testNotice ?? (connection.connected
|
|
1330
|
-
?
|
|
1331
|
-
:
|
|
1338
|
+
? localizeTemplate('{bot}连接检查完成。', { bot: bot.name })
|
|
1339
|
+
: localizeTemplate('{bot}已重新连接。', { bot: bot.name })));
|
|
1332
1340
|
} catch (error) {
|
|
1333
1341
|
const failure = new Error("连接检查失败,请稍后重试。");
|
|
1334
1342
|
failure.code = error?.code;
|
|
@@ -1405,11 +1413,11 @@ export function FeishuSettingsTab({ rpcCall }) {
|
|
|
1405
1413
|
if (mountedRef.current && workspaceFence.canCommitMutation(snapshotVersion)) {
|
|
1406
1414
|
mergeSnapshot(snapshot);
|
|
1407
1415
|
}
|
|
1408
|
-
announce(
|
|
1416
|
+
announce(localizeTemplate('{bot}已从此 DeepSeek Harness 移除;飞书开放平台中的应用未被删除。', { bot: bot.name }));
|
|
1409
1417
|
scheduleAnimationFrame(() => addButtonRef.current?.focus(), "focus");
|
|
1410
1418
|
} catch (error) {
|
|
1411
1419
|
setBotError(botId, error);
|
|
1412
|
-
announce(
|
|
1420
|
+
announce(localizeTemplate('{bot}移除失败,请重试。', { bot: bot.name }));
|
|
1413
1421
|
} finally {
|
|
1414
1422
|
const shouldRefresh = workspaceFence.endMutation();
|
|
1415
1423
|
if (shouldRefresh && mountedRef.current) void loadStatus({ silent: true });
|
|
@@ -1523,7 +1531,7 @@ export function FeishuSettingsTab({ rpcCall }) {
|
|
|
1523
1531
|
model.statusError
|
|
1524
1532
|
? h("div", { className: "bxf-statusNotice dim-statusNotice", role: "status" },
|
|
1525
1533
|
h(AlertIcon, { size: 16 }),
|
|
1526
|
-
h("span", null,
|
|
1534
|
+
h("span", null, localizeTemplate('状态自动刷新失败:{error}', { error: localizeText(model.statusError.message) })),
|
|
1527
1535
|
h(Button, { size: "small", onClick: () => void loadStatus({ silent: true }), disabled: pageBusy }, "立即重试"))
|
|
1528
1536
|
: null,
|
|
1529
1537
|
model.phase === "loading"
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { QqLogoGlyph } from '../../channel-logos.js';
|
|
6
6
|
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from '../../credential-binding.js';
|
|
7
7
|
import { AccountSettingsToggle, CollapsibleAccountSection } from '../shared/collapsible-account.js';
|
|
8
|
-
import { h } from '../../i18n.js';
|
|
8
|
+
import { channelName, h, localizeTemplate } from '../../i18n.js';
|
|
9
9
|
import { WorkspaceEditor } from '../../workspace-editor.js';
|
|
10
10
|
import { ContextEnhancementEditor } from '../../context-enhancement.js';
|
|
11
11
|
import {
|
|
@@ -83,14 +83,14 @@ function Heading({ totals, adding, busy, onAdd, onCredential, credentialOpen, ad
|
|
|
83
83
|
}, h(CredentialActionIcon), credentialOpen ? '收起凭据' : '手动接入')),
|
|
84
84
|
totals.configured > 0
|
|
85
85
|
? h('div', { className: 'ddt-badge dim-onlineBadge' },
|
|
86
|
-
h('span', null,
|
|
86
|
+
h('span', null, localizeTemplate('{connected} / {configured} 在线', { connected: totals.connected, configured: totals.configured })))
|
|
87
87
|
: null));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
function LoadingView() {
|
|
91
91
|
return h('div', { className: 'ddt-card ddt-loading dim-surfaceCard dim-loadingView', 'aria-busy': 'true' },
|
|
92
92
|
h('div', { className: 'ddt-spinner dim-spinner' }),
|
|
93
|
-
h('span', null, '正在读取
|
|
93
|
+
h('span', null, localizeTemplate('正在读取 {channel} 机器人状态…', { channel: channelName('QQ') })));
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
function EmptyView({ busy, onStart }) {
|
|
@@ -161,7 +161,7 @@ function ProvisionView({ provision, busy, onRetry, onClose }) {
|
|
|
161
161
|
|
|
162
162
|
function RemoveConfirmation({ account, busy, onConfirm, onCancel }) {
|
|
163
163
|
return h('div', { className: 'ddt-confirm dim-confirm', role: 'alertdialog' },
|
|
164
|
-
h('strong', null,
|
|
164
|
+
h('strong', null, localizeTemplate('从 DeepSeek Harness 移除“{name}”?', { name: account.bot.name })),
|
|
165
165
|
h('p', null, '这会停止消息连接,并删除本机保存的应用凭据、机器人配置及会话映射。腾讯平台中的机器人不会被自动删除。'),
|
|
166
166
|
h('div', { className: 'ddt-actions dim-viewActions' },
|
|
167
167
|
h(Button, { onClick: onCancel, disabled: busy }, '保留机器人'),
|
|
@@ -583,7 +583,7 @@ export function QqSettingsTab({ rpcCall }) {
|
|
|
583
583
|
}),
|
|
584
584
|
model.phase === 'loading' ? h(LoadingView)
|
|
585
585
|
: model.phase === 'error'
|
|
586
|
-
? h('div', { className: 'ddt-card dim-surfaceCard' }, h('div', { className: 'ddt-inlineError dim-inlineError' }, h('h3', null, '无法读取
|
|
586
|
+
? h('div', { className: 'ddt-card dim-surfaceCard' }, h('div', { className: 'ddt-inlineError dim-inlineError' }, h('h3', null, localizeTemplate('无法读取 {channel} 机器人状态', { channel: channelName('QQ') })), h(ConnectionError, { error: model.error }), h(Button, { onClick: () => void loadStatus() }, '重新读取')))
|
|
587
587
|
: h(React.Fragment, null,
|
|
588
588
|
credentialView,
|
|
589
589
|
provisionView,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
SET_THINKING_CADENCE_ENDPOINT,
|
|
13
13
|
} from '../../../../src/channels/shared/thinking-cadence.mjs';
|
|
14
14
|
import { normalizeSendLimitPerMinute, SET_SEND_LIMIT_ENDPOINT } from '../../../../src/channels/shared/send-limit.mjs';
|
|
15
|
+
import { channelName, localizeTemplate, localizeText } from '../../i18n.js';
|
|
15
16
|
|
|
16
17
|
const ACCOUNT_STATES = new Set(['connected', 'connecting', 'offline', 'error']);
|
|
17
18
|
|
|
@@ -56,10 +57,10 @@ export function createTokenChannelApi(channel, connectionSummary, {
|
|
|
56
57
|
} = {}) {
|
|
57
58
|
const unwrapRpcResult = (result) => {
|
|
58
59
|
if (!isRecord(result) || typeof result.ok !== 'boolean') {
|
|
59
|
-
throw new Error(
|
|
60
|
+
throw new Error(localizeTemplate('{channel} 服务返回了无法识别的响应', { channel: channelName(channel) }));
|
|
60
61
|
}
|
|
61
62
|
if (!result.ok) {
|
|
62
|
-
const error = new Error(text(result.error?.message,
|
|
63
|
+
const error = new Error(text(result.error?.message, localizeTemplate('{channel} 操作失败', { channel: channelName(channel) })));
|
|
63
64
|
error.code = text(result.error?.code, `${channel.toUpperCase()}_RPC_ERROR`, 80);
|
|
64
65
|
Object.assign(error, diagnosticFields(result.error));
|
|
65
66
|
throw error;
|
|
@@ -92,14 +93,18 @@ export function createTokenChannelApi(channel, connectionSummary, {
|
|
|
92
93
|
: {}),
|
|
93
94
|
bot: {
|
|
94
95
|
...normalizeBotAlias(value.bot),
|
|
95
|
-
name: text(value.bot?.name,
|
|
96
|
+
name: text(value.bot?.name, localizeTemplate('{channel}机器人', { channel: channelName(channel) }), 100),
|
|
96
97
|
username: text(value.bot?.username, '', 100),
|
|
97
98
|
idMasked: text(value.bot?.idMasked, '机器人标识已安全保存', 140),
|
|
98
99
|
},
|
|
99
100
|
health: {
|
|
100
101
|
summary: text(
|
|
101
102
|
value.health?.summary,
|
|
102
|
-
connected
|
|
103
|
+
connected
|
|
104
|
+
? localizeTemplate('{subject}运行正常', {
|
|
105
|
+
subject: `${channelName(channel)}${localizeText(connectionSummary)}`,
|
|
106
|
+
})
|
|
107
|
+
: localizeTemplate('{channel}连接尚未就绪', { channel: channelName(channel) }),
|
|
103
108
|
),
|
|
104
109
|
lastCheckedAt: timestamp(value.health?.lastCheckedAt),
|
|
105
110
|
},
|
|
@@ -107,7 +112,7 @@ export function createTokenChannelApi(channel, connectionSummary, {
|
|
|
107
112
|
error: isRecord(value.error) ? {
|
|
108
113
|
...diagnosticFields(value.error),
|
|
109
114
|
code: text(value.error.code, `${channel.toUpperCase()}_ACCOUNT_ERROR`, 80),
|
|
110
|
-
message: text(value.error.message,
|
|
115
|
+
message: text(value.error.message, localizeTemplate('{channel}连接尚未就绪', { channel: channelName(channel) })),
|
|
111
116
|
} : null,
|
|
112
117
|
...(isRecord(extension) ? extension : {}),
|
|
113
118
|
};
|
|
@@ -116,7 +121,7 @@ export function createTokenChannelApi(channel, connectionSummary, {
|
|
|
116
121
|
const normalizeSnapshot = (value) => {
|
|
117
122
|
const source = isRecord(value?.snapshot) ? value.snapshot : value;
|
|
118
123
|
if (!isRecord(source) || !Array.isArray(source.bots)) {
|
|
119
|
-
throw new Error(
|
|
124
|
+
throw new Error(localizeTemplate('{channel} 服务没有返回有效的机器人列表', { channel: channelName(channel) }));
|
|
120
125
|
}
|
|
121
126
|
const bots = source.bots.map(normalizeBot).filter(Boolean);
|
|
122
127
|
return {
|
|
@@ -132,7 +137,7 @@ export function createTokenChannelApi(channel, connectionSummary, {
|
|
|
132
137
|
const presentError = (error) => ({
|
|
133
138
|
...diagnosticFields(error),
|
|
134
139
|
code: text(error?.code, `${channel.toUpperCase()}_ERROR`, 80),
|
|
135
|
-
message: text(error?.message,
|
|
140
|
+
message: text(error?.message, localizeTemplate('{channel}操作失败,请稍后重试', { channel: channelName(channel) })),
|
|
136
141
|
});
|
|
137
142
|
|
|
138
143
|
return Object.freeze({ unwrapRpcResult, normalizeSnapshot, presentError });
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { CredentialActionIcon, CredentialBindingPanel } from '../../credential-binding.js';
|
|
6
6
|
import { AccountSettingsToggle, CollapsibleAccountSection } from './collapsible-account.js';
|
|
7
|
-
import { h } from '../../i18n.js';
|
|
7
|
+
import { channelName, h, localizeTemplate, localizeText } from '../../i18n.js';
|
|
8
8
|
import { installDingtalkStyles } from '../dingtalk/styles.js';
|
|
9
9
|
import { WorkspaceEditor } from '../../workspace-editor.js';
|
|
10
10
|
import { ContextEnhancementEditor } from '../../context-enhancement.js';
|
|
@@ -74,7 +74,7 @@ export function createTokenChannelSettings(definition) {
|
|
|
74
74
|
platformLabel,
|
|
75
75
|
CredentialPanel = null,
|
|
76
76
|
credentialPayload = ({ secret }) => ({ token: secret }),
|
|
77
|
-
credentialAriaLabel =
|
|
77
|
+
credentialAriaLabel = localizeTemplate('使用 Bot Token 接入 {channel} 机器人', { channel: channelName(channel) }),
|
|
78
78
|
credentialOpenLabel = '手动接入',
|
|
79
79
|
credentialCloseLabel = '收起凭据',
|
|
80
80
|
credentialNoun = 'Bot Token',
|
|
@@ -179,8 +179,11 @@ export function createTokenChannelSettings(definition) {
|
|
|
179
179
|
),
|
|
180
180
|
),
|
|
181
181
|
removing ? h('div', { className: 'ddt-confirm dim-confirm', role: 'alertdialog' },
|
|
182
|
-
h('strong', null,
|
|
183
|
-
h('p', null,
|
|
182
|
+
h('strong', null, localizeTemplate('从 DeepSeek Harness 移除“{name}”?', { name: account.bot.name })),
|
|
183
|
+
h('p', null, localizeTemplate('这会停止消息连接,并删除本机保存的 {credentials}、机器人配置及会话映射。{platform}中的机器人不会被自动删除。', {
|
|
184
|
+
credentials: localizeText(credentialNoun),
|
|
185
|
+
platform: localizeText(platformLabel),
|
|
186
|
+
})),
|
|
184
187
|
h('div', { className: 'ddt-actions dim-viewActions' },
|
|
185
188
|
h(Button, { onClick: onCancelRemove, disabled: Boolean(busy) }, '保留机器人'),
|
|
186
189
|
h(Button, { kind: 'danger', onClick: onConfirmRemove, disabled: Boolean(busy) },
|
|
@@ -215,7 +218,7 @@ export function createTokenChannelSettings(definition) {
|
|
|
215
218
|
}, []);
|
|
216
219
|
|
|
217
220
|
const invoke = React.useCallback(async (endpoint, payload = {}, signal) => {
|
|
218
|
-
if (typeof rpcCall !== 'function') throw new TypeError(
|
|
221
|
+
if (typeof rpcCall !== 'function') throw new TypeError(localizeTemplate('{channel} 设置页缺少 RPC 连接', { channel: channelName(channel) }));
|
|
219
222
|
const operation = !['connection.status', 'provision.poll', 'provision.begin', 'provision.cancel'].includes(endpoint);
|
|
220
223
|
if (operation && mounted.current) setOperationError(null);
|
|
221
224
|
try {
|
|
@@ -343,7 +346,7 @@ export function createTokenChannelSettings(definition) {
|
|
|
343
346
|
? h('section', { className: 'dim-listSection' },
|
|
344
347
|
h(ChannelListHeading, {
|
|
345
348
|
className: 'ddt-listHeading',
|
|
346
|
-
title:
|
|
349
|
+
title: localizeTemplate('已接入的 {channel} 机器人', { channel: channelName(channel) }),
|
|
347
350
|
connectionLabel,
|
|
348
351
|
}),
|
|
349
352
|
h('ul', { className: 'ddt-list dim-botList' }, model.bots.map((account) =>
|
|
@@ -416,7 +419,7 @@ export function createTokenChannelSettings(definition) {
|
|
|
416
419
|
value: model.agentPresetCatalog ?? EMPTY_AGENT_PRESET_CATALOG,
|
|
417
420
|
}, h('section', {
|
|
418
421
|
className: `ddt-page ${pageClass} dim-channelPage`,
|
|
419
|
-
'aria-label':
|
|
422
|
+
'aria-label': localizeTemplate('{channel} 设置', { channel: channelName(channel) }),
|
|
420
423
|
},
|
|
421
424
|
operationError ? h(ConnectionError, { error: operationError }) : null,
|
|
422
425
|
h('div', { className: 'ddt-heading' },
|
|
@@ -432,17 +435,21 @@ export function createTokenChannelSettings(definition) {
|
|
|
432
435
|
}, h(CredentialActionIcon), credentialOpen ? credentialCloseLabel : credentialOpenLabel)),
|
|
433
436
|
model.totals.configured > 0
|
|
434
437
|
? h('div', { className: 'ddt-badge dim-onlineBadge' },
|
|
435
|
-
h('span', null,
|
|
438
|
+
h('span', null, localizeTemplate('{connected} / {configured} 在线', {
|
|
439
|
+
connected: model.totals.connected,
|
|
440
|
+
configured: model.totals.configured,
|
|
441
|
+
})))
|
|
436
442
|
: null)),
|
|
437
443
|
model.phase === 'loading'
|
|
438
444
|
? h('div', {
|
|
439
445
|
className: 'ddt-card ddt-loading dim-surfaceCard dim-loadingView',
|
|
440
446
|
'aria-busy': 'true',
|
|
441
|
-
}, h('div', { className: 'ddt-spinner dim-spinner' }),
|
|
447
|
+
}, h('div', { className: 'ddt-spinner dim-spinner' }),
|
|
448
|
+
localizeTemplate('正在读取 {channel} 机器人状态…', { channel: channelName(channel) }))
|
|
442
449
|
: model.phase === 'error'
|
|
443
450
|
? h('div', { className: 'ddt-card dim-surfaceCard' },
|
|
444
451
|
h('div', { className: 'ddt-inlineError dim-inlineError' },
|
|
445
|
-
h('h3', null,
|
|
452
|
+
h('h3', null, localizeTemplate('无法读取 {channel} 机器人状态', { channel: channelName(channel) })),
|
|
446
453
|
h(ConnectionError, { error: model.error }),
|
|
447
454
|
h(Button, { onClick: () => void loadStatus() }, '重新读取')))
|
|
448
455
|
: h(React.Fragment, null,
|
|
@@ -475,7 +482,7 @@ export function createTokenChannelSettings(definition) {
|
|
|
475
482
|
h('div', { className: 'dim-emptyCopy' },
|
|
476
483
|
h('div', { className: 'ddt-stateLabel dim-stateLabel' },
|
|
477
484
|
h('span', { className: 'ddt-dot dim-stateDot' }),
|
|
478
|
-
h('span', null,
|
|
485
|
+
h('span', null, localizeTemplate('尚未接入 {channel} 机器人', { channel: channelName(channel) }))),
|
|
479
486
|
h('h3', null, emptyTitle),
|
|
480
487
|
h('p', null, emptyDescription),
|
|
481
488
|
h('div', { className: 'ddt-actions dim-viewActions' },
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { WecomLogoGlyph } from '../../channel-logos.js';
|
|
6
6
|
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from '../../credential-binding.js';
|
|
7
7
|
import { AccountSettingsToggle, CollapsibleAccountSection } from '../shared/collapsible-account.js';
|
|
8
|
-
import { h } from '../../i18n.js';
|
|
8
|
+
import { channelName, h, localizeTemplate } from '../../i18n.js';
|
|
9
9
|
import { WorkspaceEditor } from '../../workspace-editor.js';
|
|
10
10
|
import { ContextEnhancementEditor } from '../../context-enhancement.js';
|
|
11
11
|
import {
|
|
@@ -82,14 +82,14 @@ function Heading({ totals, adding, busy, onAdd, onCredential, credentialOpen, ad
|
|
|
82
82
|
}, h(CredentialActionIcon), credentialOpen ? '收起凭据' : '手动接入')),
|
|
83
83
|
totals.configured > 0
|
|
84
84
|
? h('div', { className: 'ddt-badge dim-onlineBadge' },
|
|
85
|
-
h('span', null,
|
|
85
|
+
h('span', null, localizeTemplate('{connected} / {configured} 在线', { connected: totals.connected, configured: totals.configured })))
|
|
86
86
|
: null));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
function LoadingView() {
|
|
90
90
|
return h('div', { className: 'ddt-card ddt-loading dim-surfaceCard dim-loadingView', 'aria-busy': 'true' },
|
|
91
91
|
h('div', { className: 'ddt-spinner dim-spinner' }),
|
|
92
|
-
h('span', null, '
|
|
92
|
+
h('span', null, localizeTemplate('正在读取 {channel} 机器人状态…', { channel: channelName('企业微信') })));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
function EmptyView({ busy, onStart }) {
|
|
@@ -160,7 +160,7 @@ function ProvisionView({ provision, busy, onRetry, onClose }) {
|
|
|
160
160
|
|
|
161
161
|
function RemoveConfirmation({ account, busy, onConfirm, onCancel }) {
|
|
162
162
|
return h('div', { className: 'ddt-confirm dim-confirm', role: 'alertdialog' },
|
|
163
|
-
h('strong', null,
|
|
163
|
+
h('strong', null, localizeTemplate('从 DeepSeek Harness 移除“{name}”?', { name: account.bot.name })),
|
|
164
164
|
h('p', null, '这会停止消息连接,并删除本机保存的应用凭据、机器人配置及会话映射。企业微信平台中的机器人不会被自动删除。'),
|
|
165
165
|
h('div', { className: 'ddt-actions dim-viewActions' },
|
|
166
166
|
h(Button, { onClick: onCancel, disabled: busy }, '保留机器人'),
|
|
@@ -615,7 +615,7 @@ export function WecomSettingsTab({ rpcCall }) {
|
|
|
615
615
|
h('div', { className: 'ddt-visuallyHidden', role: 'status', 'aria-live': 'polite' }, notice),
|
|
616
616
|
model.phase === 'loading' ? h(LoadingView)
|
|
617
617
|
: model.phase === 'error'
|
|
618
|
-
? h('div', { className: 'ddt-card dim-surfaceCard' }, h('div', { className: 'ddt-inlineError dim-inlineError' }, h('h3', null, '
|
|
618
|
+
? h('div', { className: 'ddt-card dim-surfaceCard' }, h('div', { className: 'ddt-inlineError dim-inlineError' }, h('h3', null, localizeTemplate('无法读取 {channel} 机器人状态', { channel: channelName('企业微信') })), h(ConnectionError, { error: model.error }), h(Button, { onClick: () => void loadStatus() }, '重新读取')))
|
|
619
619
|
: h(React.Fragment, null,
|
|
620
620
|
credentialView,
|
|
621
621
|
provisionView,
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { WecomLogoGlyph } from '../../channel-logos.js';
|
|
6
6
|
import { AccountSettingsToggle, CollapsibleAccountSection } from '../shared/collapsible-account.js';
|
|
7
|
-
import { h } from '../../i18n.js';
|
|
7
|
+
import { h, localizeTemplate } from '../../i18n.js';
|
|
8
8
|
import { WorkspaceEditor } from '../../workspace-editor.js';
|
|
9
9
|
import { ContextEnhancementEditor } from '../../context-enhancement.js';
|
|
10
10
|
import {
|
|
@@ -68,7 +68,7 @@ function Heading({ totals, adding, busy, onAdd, addButtonRef }) {
|
|
|
68
68
|
}, adding ? '收起表单' : '添加企业微信应用')),
|
|
69
69
|
totals.configured > 0
|
|
70
70
|
? h('div', { className: 'ddt-badge dim-onlineBadge' },
|
|
71
|
-
h('span', null,
|
|
71
|
+
h('span', null, localizeTemplate('{connected} / {configured} 在线', { connected: totals.connected, configured: totals.configured })))
|
|
72
72
|
: null));
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -232,7 +232,7 @@ function AppSettingsEditor({ bot, busy, onSave }) {
|
|
|
232
232
|
|
|
233
233
|
function RemoveConfirmation({ account, busy, onConfirm, onCancel }) {
|
|
234
234
|
return h('div', { className: 'ddt-confirm dim-confirm', role: 'alertdialog' },
|
|
235
|
-
h('strong', null,
|
|
235
|
+
h('strong', null, localizeTemplate('从 DeepSeek Harness 移除“{name}”?', { name: account.bot.name })),
|
|
236
236
|
h('p', null, '这会删除本机保存的应用凭据、回调配置及会话映射。企业微信后台的应用不会被删除。'),
|
|
237
237
|
h('div', { className: 'ddt-actions dim-viewActions' },
|
|
238
238
|
h(Button, { onClick: onCancel, disabled: busy }, '保留应用'),
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { WeixinLogoGlyph } from '../../channel-logos.js';
|
|
6
6
|
import { QrActionIcon } from '../../credential-binding.js';
|
|
7
7
|
import { AccountSettingsToggle, CollapsibleAccountSection } from '../shared/collapsible-account.js';
|
|
8
|
-
import { h } from '../../i18n.js';
|
|
8
|
+
import { h, localizeTemplate } from '../../i18n.js';
|
|
9
9
|
import {
|
|
10
10
|
WEIXIN_ENDPOINTS,
|
|
11
11
|
managementRequestError,
|
|
@@ -63,7 +63,7 @@ function Heading({ totals, adding, busy, onAdd, addButtonRef }) {
|
|
|
63
63
|
}, h(QrActionIcon), adding ? '正在接入' : '扫码接入机器人'),
|
|
64
64
|
totals.configured > 0
|
|
65
65
|
? h('div', { className: 'dxw-badge dim-onlineBadge' },
|
|
66
|
-
h('span', null,
|
|
66
|
+
h('span', null, localizeTemplate('{connected} / {configured} 在线', { connected: totals.connected, configured: totals.configured })))
|
|
67
67
|
: null,
|
|
68
68
|
),
|
|
69
69
|
);
|