@lemoncat7/dsh-partner 1.15.0 → 1.16.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.md +12 -1
- package/docs/notification-delivery.md +24 -0
- package/docs/releases/1.16.0.md +22 -0
- package/lib/api.js +26 -1
- package/lib/api.js.map +1 -1
- package/lib/channels/direct/discovery.d.ts.map +1 -1
- package/lib/channels/direct/discovery.js +17 -3
- package/lib/channels/direct/discovery.js.map +1 -1
- package/lib/channels/direct/transport.d.ts +1 -0
- package/lib/channels/direct/transport.d.ts.map +1 -1
- package/lib/channels/direct/transport.js +1 -1
- package/lib/channels/direct/transport.js.map +1 -1
- package/lib/channels/manager.d.ts +3 -1
- package/lib/channels/manager.d.ts.map +1 -1
- package/lib/channels/manager.js +34 -17
- package/lib/channels/manager.js.map +1 -1
- package/lib/channels/notification-delivery.d.ts +28 -0
- package/lib/channels/notification-delivery.d.ts.map +1 -0
- package/lib/channels/notification-delivery.js +69 -0
- package/lib/channels/notification-delivery.js.map +1 -0
- package/lib/channels/notification-route.d.ts +4 -0
- package/lib/channels/notification-route.d.ts.map +1 -1
- package/lib/channels/notification-route.js +21 -0
- package/lib/channels/notification-route.js.map +1 -1
- package/lib/client-api.d.ts +7 -0
- package/lib/client-api.d.ts.map +1 -1
- package/lib/client-api.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +562 -379
- package/lib/client.js.map +4 -4
- package/lib/domain.d.ts +8 -0
- package/lib/domain.d.ts.map +1 -1
- package/lib/domain.js.map +1 -1
- package/lib/heartbeat.d.ts +1 -0
- package/lib/heartbeat.d.ts.map +1 -1
- package/lib/heartbeat.js +16 -4
- package/lib/heartbeat.js.map +1 -1
- package/lib/store.js +15 -0
- package/lib/store.js.map +1 -1
- package/lib/ui/channels-panel.d.ts.map +1 -1
- package/lib/ui/channels-panel.js +4 -10
- package/lib/ui/channels-panel.js.map +1 -1
- package/lib/ui/notification-settings.d.ts +7 -0
- package/lib/ui/notification-settings.d.ts.map +1 -0
- package/lib/ui/notification-settings.js +33 -0
- package/lib/ui/notification-settings.js.map +1 -0
- package/package.json +3 -1
package/lib/client.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(client_exports, {
|
|
|
35
35
|
inject: () => inject
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(client_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_react43 = require("react");
|
|
39
39
|
|
|
40
40
|
// src/workspace-ownership.ts
|
|
41
41
|
var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
|
|
@@ -8283,22 +8283,103 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
8283
8283
|
}
|
|
8284
8284
|
|
|
8285
8285
|
// src/ui/channels-panel.tsx
|
|
8286
|
+
var import_react39 = require("react");
|
|
8287
|
+
|
|
8288
|
+
// src/ui/notification-settings.tsx
|
|
8286
8289
|
var import_react38 = require("react");
|
|
8287
8290
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
8291
|
+
function NotificationSettings({ companion, snapshot, onChanged }) {
|
|
8292
|
+
const channels = snapshot.channels.filter((c) => c.companionId === companion.id);
|
|
8293
|
+
const pairings = snapshot.pairings.filter((p) => channels.some((c) => c.id === p.channelId));
|
|
8294
|
+
const [mode, setMode] = (0, import_react38.useState)(companion.notificationDelivery?.mode ?? "recent");
|
|
8295
|
+
const [targets, setTargets] = (0, import_react38.useState)(companion.notificationDelivery?.targets ?? []);
|
|
8296
|
+
const [selectedChannels, setSelectedChannels] = (0, import_react38.useState)(targets.map((t) => t.channelId));
|
|
8297
|
+
const [busy, setBusy] = (0, import_react38.useState)(false), [feedback, setFeedback] = (0, import_react38.useState)(""), [failed, setFailed] = (0, import_react38.useState)(false);
|
|
8298
|
+
const saveRef = (0, import_react38.useRef)(null);
|
|
8299
|
+
(0, import_react38.useEffect)(() => {
|
|
8300
|
+
if (!busy && feedback && document.activeElement === document.body) saveRef.current?.focus();
|
|
8301
|
+
}, [busy, feedback]);
|
|
8302
|
+
const unavailable = targets.filter((t) => !pairings.some((p) => p.channelId === t.channelId && p.userId === t.userId && p.status === "approved") || !channels.some((c) => c.id === t.channelId && c.enabled));
|
|
8303
|
+
const emptyChannel = selectedChannels.some((id) => !targets.some((t) => t.channelId === id));
|
|
8304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-delivery-form", "aria-busy": busy, onSubmit: (e) => {
|
|
8305
|
+
e.preventDefault();
|
|
8306
|
+
if (busy) return;
|
|
8307
|
+
setBusy(true);
|
|
8308
|
+
setFeedback("");
|
|
8309
|
+
setFailed(false);
|
|
8310
|
+
const targetPairingIds = targets.map((t) => pairings.find((p) => p.channelId === t.channelId && p.userId === t.userId)?.id);
|
|
8311
|
+
void api(`/companions/${companion.id}/notifications`, { method: "PUT", body: JSON.stringify({ mode, targetPairingIds: mode === "recent" ? [] : targetPairingIds }) }).then(async () => {
|
|
8312
|
+
await onChanged();
|
|
8313
|
+
setFeedback("\u901A\u77E5\u8BBE\u7F6E\u5DF2\u4FDD\u5B58");
|
|
8314
|
+
}).catch((error) => {
|
|
8315
|
+
setFailed(true);
|
|
8316
|
+
setFeedback(errorMessage(error));
|
|
8317
|
+
}).finally(() => setBusy(false));
|
|
8318
|
+
}, children: [
|
|
8319
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "dsh-partner-channel-field", children: [
|
|
8320
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u901A\u77E5\u53D1\u9001\u5230" }),
|
|
8321
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { disabled: busy, value: mode, onChange: (e) => setMode(e.target.value), children: [
|
|
8322
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "recent", children: "\u6700\u8FD1\u8054\u7CFB\u7684\u6E20\u9053\u4E0E\u7528\u6237" }),
|
|
8323
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "selected", children: "\u6307\u5B9A\u6E20\u9053\u4E0E\u63A5\u6536\u4EBA" })
|
|
8324
|
+
] })
|
|
8325
|
+
] }),
|
|
8326
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "\u4EC5\u5F71\u54CD\u4E3B\u52A8\u901A\u77E5\u4E0E\u7ED3\u679C\u4EA4\u4ED8\u3002\u5BF9\u8BDD\u56DE\u590D\u4ECD\u53D1\u9001\u5230\u6D88\u606F\u6765\u6E90\u6E20\u9053\u3002" }),
|
|
8327
|
+
!companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { role: "status", children: "\u5F53\u524D\u4ECD\u4F7F\u7528\u65E7\u7684\u8054\u7CFB\u4EBA\u6295\u9012\u89C4\u5219\uFF0C\u4FDD\u5B58\u540E\u7EDF\u4E00\u4F7F\u7528\u8FD9\u91CC\u7684\u901A\u77E5\u8BBE\u7F6E\u3002" }),
|
|
8328
|
+
mode === "selected" && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-notification-choices", children: [
|
|
8329
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "\u53EF\u9009\u62E9\u591A\u4E2A\u6E20\u9053\uFF1B\u6BCF\u4E2A\u6E20\u9053\u81F3\u5C11\u9009\u62E9\u4E00\u4F4D\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\u3002\u4FDD\u5B58\u540E\u5BF9\u65B0\u901A\u77E5\u751F\u6548\uFF0C\u5F85\u91CD\u8BD5\u901A\u77E5\u4FDD\u7559\u539F\u63A5\u6536\u4EBA\u3002" }),
|
|
8330
|
+
!channels.length && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "\u8BF7\u5148\u6DFB\u52A0\u6E20\u9053\u5E76\u6388\u6743\u8054\u7CFB\u4EBA\u3002" }),
|
|
8331
|
+
channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("fieldset", { disabled: busy, className: "dsh-partner-notification-channel", children: [
|
|
8332
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
8333
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { type: "checkbox", checked: selectedChannels.includes(channel.id), onChange: (e) => {
|
|
8334
|
+
setSelectedChannels((ids) => e.target.checked ? [...ids, channel.id] : ids.filter((id) => id !== channel.id));
|
|
8335
|
+
if (!e.target.checked) setTargets((items) => items.filter((t) => t.channelId !== channel.id));
|
|
8336
|
+
} }),
|
|
8337
|
+
channel.name,
|
|
8338
|
+
!channel.enabled ? "\uFF08\u5DF2\u505C\u7528\uFF09" : ""
|
|
8339
|
+
] }) }),
|
|
8340
|
+
selectedChannels.includes(channel.id) && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-notification-users", children: [
|
|
8341
|
+
!pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "\u6682\u65E0\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\uFF0C\u8BF7\u5148\u5728\u6E20\u9053\u914D\u7F6E\u4E2D\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" }),
|
|
8342
|
+
pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
8343
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { type: "checkbox", checked: targets.some((t) => t.channelId === p.channelId && t.userId === p.userId), onChange: (e) => setTargets((items) => e.target.checked ? [...items, { channelId: p.channelId, userId: p.userId }] : items.filter((t) => t.channelId !== p.channelId || t.userId !== p.userId)) }),
|
|
8344
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { children: [
|
|
8345
|
+
p.displayName,
|
|
8346
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("small", { children: p.userId })
|
|
8347
|
+
] })
|
|
8348
|
+
] }, p.id))
|
|
8349
|
+
] })
|
|
8350
|
+
] }, channel.id)),
|
|
8351
|
+
unavailable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { role: "alert", children: [
|
|
8352
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "\u90E8\u5206\u5DF2\u9009\u63A5\u6536\u4EBA\u5DF2\u5931\u6548\u6216\u6E20\u9053\u5DF2\u505C\u7528\u3002\u8BF7\u79FB\u9664\u6216\u6062\u590D\u6388\u6743\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6539\u53D1\u5176\u4ED6\u4EBA\u3002" }),
|
|
8353
|
+
unavailable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: busy, onClick: () => {
|
|
8354
|
+
setTargets((items) => items.filter((x) => x.channelId !== t.channelId || x.userId !== t.userId));
|
|
8355
|
+
if (!targets.some((x) => x.channelId === t.channelId && x.userId !== t.userId)) setSelectedChannels((ids) => ids.filter((id) => id !== t.channelId));
|
|
8356
|
+
}, children: [
|
|
8357
|
+
"\u79FB\u9664 ",
|
|
8358
|
+
t.userId
|
|
8359
|
+
] }, JSON.stringify(t)))
|
|
8360
|
+
] })
|
|
8361
|
+
] }),
|
|
8362
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
|
|
8363
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { ref: saveRef, className: "is-primary", disabled: busy || mode === "selected" && (!targets.length || unavailable.length > 0 || emptyChannel), children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u901A\u77E5\u8BBE\u7F6E" }) })
|
|
8364
|
+
] });
|
|
8365
|
+
}
|
|
8366
|
+
|
|
8367
|
+
// src/ui/channels-panel.tsx
|
|
8368
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
8288
8369
|
function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
8289
|
-
const [platform, setPlatform] = (0,
|
|
8290
|
-
const [name, setName] = (0,
|
|
8291
|
-
const [baseUrl, setBaseUrl] = (0,
|
|
8292
|
-
const [targetId, setTargetId] = (0,
|
|
8293
|
-
const [botToken, setToken] = (0,
|
|
8294
|
-
const [authMode, setAuthMode] = (0,
|
|
8295
|
-
const [username, setUsername] = (0,
|
|
8296
|
-
const [busy, setBusy] = (0,
|
|
8297
|
-
const [feedback, setFeedback] = (0,
|
|
8298
|
-
const [deleting, setDeleting] = (0,
|
|
8299
|
-
const [adding, setAdding] = (0,
|
|
8300
|
-
const [fixedPlatform, setFixedPlatform] = (0,
|
|
8301
|
-
const [configuring, setConfiguring] = (0,
|
|
8370
|
+
const [platform, setPlatform] = (0, import_react39.useState)("matrix");
|
|
8371
|
+
const [name, setName] = (0, import_react39.useState)("");
|
|
8372
|
+
const [baseUrl, setBaseUrl] = (0, import_react39.useState)("");
|
|
8373
|
+
const [targetId, setTargetId] = (0, import_react39.useState)("");
|
|
8374
|
+
const [botToken, setToken] = (0, import_react39.useState)("");
|
|
8375
|
+
const [authMode, setAuthMode] = (0, import_react39.useState)("password");
|
|
8376
|
+
const [username, setUsername] = (0, import_react39.useState)(""), [password, setPassword] = (0, import_react39.useState)(""), [mfaToken, setMfaToken] = (0, import_react39.useState)("");
|
|
8377
|
+
const [busy, setBusy] = (0, import_react39.useState)(false);
|
|
8378
|
+
const [feedback, setFeedback] = (0, import_react39.useState)("");
|
|
8379
|
+
const [deleting, setDeleting] = (0, import_react39.useState)();
|
|
8380
|
+
const [adding, setAdding] = (0, import_react39.useState)(false);
|
|
8381
|
+
const [fixedPlatform, setFixedPlatform] = (0, import_react39.useState)(false);
|
|
8382
|
+
const [configuring, setConfiguring] = (0, import_react39.useState)();
|
|
8302
8383
|
const closeAdd = () => {
|
|
8303
8384
|
setAdding(false);
|
|
8304
8385
|
setToken("");
|
|
@@ -8342,19 +8423,19 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
|
8342
8423
|
}
|
|
8343
8424
|
setFeedback(save ? "\u8D26\u53F7\u5DF2\u4FDD\u5B58\u3002\u8BF7\u542F\u7528\u6E20\u9053\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u9001\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u5E76\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" : "\u8D26\u53F7\u9A8C\u8BC1\u901A\u8FC7\uFF0C\u53EF\u4EE5\u4FDD\u5B58\u3002");
|
|
8344
8425
|
});
|
|
8345
|
-
return /* @__PURE__ */ (0,
|
|
8346
|
-
/* @__PURE__ */ (0,
|
|
8347
|
-
/* @__PURE__ */ (0,
|
|
8348
|
-
/* @__PURE__ */ (0,
|
|
8426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { id: "dsh-partner-channels", className: "dsh-partner-form is-channel dsh-partner-channels", children: [
|
|
8427
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-toolbar", children: [
|
|
8428
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SectionHeading, { eyebrow: "CHANNELS", title: "\u6211\u7684\u6E20\u9053", detail: "\u67E5\u770B\u8FDE\u63A5\u72B6\u6001\uFF0C\u7BA1\u7406\u8054\u7CFB\u4EBA\u4E0E\u901A\u77E5\u6295\u9012\u3002" }),
|
|
8429
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", onClick: () => openAdd(), children: "\u6DFB\u52A0\u6E20\u9053" })
|
|
8349
8430
|
] }),
|
|
8350
|
-
!adding && feedback && /* @__PURE__ */ (0,
|
|
8351
|
-
adding && /* @__PURE__ */ (0,
|
|
8431
|
+
!adding && feedback && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { role: "status", children: feedback }),
|
|
8432
|
+
adding && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceDialog, { title: fixedPlatform ? `${platform === "matrix" ? "Matrix" : "Mattermost"} \u914D\u7F6E` : "\u6DFB\u52A0\u6E20\u9053", detail: platform === "matrix" ? "\u4EC5\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u53EF\u83B7\u53D6\u914D\u5BF9\u7801\u3002\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002" : "\u5148\u767B\u5F55\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6388\u6743\u3002", close: () => {
|
|
8352
8433
|
if (!busy) closeAdd();
|
|
8353
|
-
}, children: /* @__PURE__ */ (0,
|
|
8434
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", "aria-busy": busy, onSubmit: (event) => {
|
|
8354
8435
|
event.preventDefault();
|
|
8355
8436
|
void configure(true);
|
|
8356
8437
|
}, children: [
|
|
8357
|
-
!fixedPlatform && /* @__PURE__ */ (0,
|
|
8438
|
+
!fixedPlatform && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "\u5E73\u53F0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("select", { autoFocus: true, disabled: busy, value: platform, onChange: (e) => {
|
|
8358
8439
|
setPlatform(e.target.value);
|
|
8359
8440
|
setPassword("");
|
|
8360
8441
|
setToken("");
|
|
@@ -8362,180 +8443,150 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
|
8362
8443
|
setTargetId("");
|
|
8363
8444
|
setFeedback("");
|
|
8364
8445
|
}, children: [
|
|
8365
|
-
/* @__PURE__ */ (0,
|
|
8366
|
-
/* @__PURE__ */ (0,
|
|
8446
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: "matrix", children: "Matrix" }),
|
|
8447
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: "mattermost", children: "Mattermost" })
|
|
8367
8448
|
] }) }),
|
|
8368
|
-
/* @__PURE__ */ (0,
|
|
8369
|
-
/* @__PURE__ */ (0,
|
|
8370
|
-
/* @__PURE__ */ (0,
|
|
8371
|
-
/* @__PURE__ */ (0,
|
|
8372
|
-
/* @__PURE__ */ (0,
|
|
8449
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { autoFocus: fixedPlatform, disabled: busy, maxLength: 80, value: name, onChange: (e) => setName(e.target.value), placeholder: `\u4F8B\u5982\uFF1A\u6211\u7684 ${platform === "matrix" ? "Matrix" : "Mattermost"}` }) }),
|
|
8450
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, required: true, type: "url", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://chat.example.com" }) }),
|
|
8451
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("details", { children: [
|
|
8452
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("summary", { children: "\u9AD8\u7EA7\u914D\u7F6E\uFF08\u53EF\u9009\uFF09" }),
|
|
8453
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: platform === "matrix" ? "\u56FA\u5B9A\u623F\u95F4 ID" : "\u56FA\u5B9A DM \u4F1A\u8BDD ID", hint: "\u7559\u7A7A\u5219\u81EA\u52A8\u53D1\u73B0\u79C1\u804A\uFF0C\u901A\u8FC7\u914D\u5BF9\u6388\u6743\u3002\u586B\u5199\u540E\u4EC5\u76D1\u542C\u6307\u5B9A\u4F1A\u8BDD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, value: targetId, onChange: (e) => setTargetId(e.target.value), placeholder: platform === "matrix" ? "!room:example.com" : "DM channel ID" }) })
|
|
8373
8454
|
] }),
|
|
8374
|
-
/* @__PURE__ */ (0,
|
|
8455
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "\u767B\u5F55\u65B9\u5F0F", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("select", { disabled: busy, value: authMode, onChange: (e) => {
|
|
8375
8456
|
setAuthMode(e.target.value);
|
|
8376
8457
|
setToken("");
|
|
8377
8458
|
setPassword("");
|
|
8378
8459
|
setMfaToken("");
|
|
8379
8460
|
}, children: [
|
|
8380
|
-
/* @__PURE__ */ (0,
|
|
8381
|
-
/* @__PURE__ */ (0,
|
|
8461
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: "password", children: "\u8D26\u53F7\u5BC6\u7801" }),
|
|
8462
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("option", { value: "token", children: "Access Token" })
|
|
8382
8463
|
] }) }),
|
|
8383
|
-
authMode === "password" ? /* @__PURE__ */ (0,
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8385
|
-
/* @__PURE__ */ (0,
|
|
8386
|
-
platform === "mattermost" && /* @__PURE__ */ (0,
|
|
8387
|
-
] }) : /* @__PURE__ */ (0,
|
|
8388
|
-
feedback && /* @__PURE__ */ (0,
|
|
8389
|
-
/* @__PURE__ */ (0,
|
|
8390
|
-
/* @__PURE__ */ (0,
|
|
8391
|
-
/* @__PURE__ */ (0,
|
|
8392
|
-
/* @__PURE__ */ (0,
|
|
8464
|
+
authMode === "password" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
8465
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "\u8D26\u53F7", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, required: true, autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), placeholder: platform === "matrix" ? "@\u8D26\u53F7:\u670D\u52A1\u5668\u57DF\u540D" : "\u7528\u6237\u540D\u6216\u90AE\u7BB1" }) }),
|
|
8466
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "\u5BC6\u7801", hint: "\u4EC5\u7528\u4E8E\u6362\u53D6\u4EE4\u724C\uFF0C\u4E0D\u4FDD\u5B58\u5BC6\u7801\uFF1B\u8BF7\u4F18\u5148\u4F7F\u7528 HTTPS \u670D\u52A1\u5668\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }),
|
|
8467
|
+
platform === "mattermost" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "\u53CC\u91CD\u9A8C\u8BC1\u9A8C\u8BC1\u7801\uFF08\u5982\u5DF2\u5F00\u542F\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, autoComplete: "one-time-code", inputMode: "numeric", value: mfaToken, onChange: (e) => setMfaToken(e.target.value) }) })
|
|
8468
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField2, { label: "Access Token", hint: "\u4EC5\u4FDD\u5B58\u81F3 DSH \u51ED\u636E\u5E93\uFF1B\u5EFA\u8BAE HTTPS\uFF0CHTTP \u4F1A\u660E\u6587\u4F20\u8F93\u51ED\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "new-password", value: botToken, onChange: (e) => setToken(e.target.value) }) }),
|
|
8469
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { role: "status", children: feedback }),
|
|
8470
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("footer", { children: [
|
|
8471
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", disabled: busy, onClick: closeAdd, children: "\u53D6\u6D88" }),
|
|
8472
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", disabled: busy || !(authMode === "password" ? username && password : botToken) || !baseUrl, onClick: () => void configure(false), children: "\u6D4B\u8BD5\u8FDE\u63A5" }),
|
|
8473
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { className: "is-primary", disabled: busy, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
|
|
8393
8474
|
] })
|
|
8394
8475
|
] }) }),
|
|
8395
|
-
/* @__PURE__ */ (0,
|
|
8396
|
-
/* @__PURE__ */ (0,
|
|
8397
|
-
/* @__PURE__ */ (0,
|
|
8398
|
-
/* @__PURE__ */ (0,
|
|
8399
|
-
/* @__PURE__ */ (0,
|
|
8476
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-list", children: [
|
|
8477
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
8478
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
8479
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: "\u5FAE\u4FE1" }),
|
|
8480
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("small", { children: channels.some((c) => !c.platform || c.platform === "weixin") ? "\u7BA1\u7406\u8FDE\u63A5\u4E0E\u79C1\u804A\u6388\u6743" : "\u5C1A\u672A\u8FDE\u63A5 \xB7 \u626B\u7801\u63A5\u5165" })
|
|
8400
8481
|
] }),
|
|
8401
|
-
channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0,
|
|
8402
|
-
/* @__PURE__ */ (0,
|
|
8403
|
-
configuring === "weixin" && /* @__PURE__ */ (0,
|
|
8482
|
+
channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChannelStatus, { channel: channels.find((c) => !c.platform || c.platform === "weixin") }),
|
|
8483
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", "aria-label": "\u914D\u7F6E\u5FAE\u4FE1", onClick: () => setConfiguring("weixin"), children: "\u914D\u7F6E" }),
|
|
8484
|
+
configuring === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceDialog, { title: "\u5FAE\u4FE1\u914D\u7F6E", detail: "\u7BA1\u7406\u626B\u7801\u767B\u5F55\u3001\u8FDE\u63A5\u4E0E\u8054\u7CFB\u4EBA\u6388\u6743\u3002", close: () => setConfiguring(void 0), children: weixin })
|
|
8404
8485
|
] }),
|
|
8405
|
-
["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0,
|
|
8406
|
-
/* @__PURE__ */ (0,
|
|
8407
|
-
/* @__PURE__ */ (0,
|
|
8408
|
-
/* @__PURE__ */ (0,
|
|
8486
|
+
["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
8487
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
8488
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: platform2 === "matrix" ? "Matrix" : "Mattermost" }),
|
|
8489
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("small", { children: "\u5C1A\u672A\u8FDE\u63A5" })
|
|
8409
8490
|
] }),
|
|
8410
|
-
/* @__PURE__ */ (0,
|
|
8491
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${platform2}`, onClick: () => openAdd(platform2), children: "\u914D\u7F6E" })
|
|
8411
8492
|
] }, platform2)),
|
|
8412
|
-
channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0,
|
|
8413
|
-
/* @__PURE__ */ (0,
|
|
8414
|
-
/* @__PURE__ */ (0,
|
|
8415
|
-
/* @__PURE__ */ (0,
|
|
8493
|
+
channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-row has-notice-slot", children: [
|
|
8494
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
8495
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: channel.name }),
|
|
8496
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("small", { children: [
|
|
8416
8497
|
channel.platform,
|
|
8417
8498
|
" \xB7 ",
|
|
8418
8499
|
pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
|
|
8419
8500
|
" \u4E2A\u5F85\u6388\u6743"
|
|
8420
8501
|
] })
|
|
8421
8502
|
] }),
|
|
8422
|
-
/* @__PURE__ */ (0,
|
|
8423
|
-
/* @__PURE__ */ (0,
|
|
8503
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChannelStatus, { channel }),
|
|
8504
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => {
|
|
8424
8505
|
setFeedback("");
|
|
8425
8506
|
setConfiguring(channel.id);
|
|
8426
8507
|
}, children: "\u914D\u7F6E" }),
|
|
8427
|
-
configuring === channel.id && /* @__PURE__ */ (0,
|
|
8508
|
+
configuring === channel.id && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceDialog, { title: `${channel.name} \xB7 \u914D\u7F6E`, detail: "\u7BA1\u7406\u8FDE\u63A5\u72B6\u6001\u53CA\u8054\u7CFB\u4EBA\u8BBF\u95EE\u6743\u9650\u3002", close: () => {
|
|
8428
8509
|
if (!busy) {
|
|
8429
8510
|
setConfiguring(void 0);
|
|
8430
8511
|
setDeleting(void 0);
|
|
8431
8512
|
}
|
|
8432
|
-
}, children: /* @__PURE__ */ (0,
|
|
8433
|
-
/* @__PURE__ */ (0,
|
|
8434
|
-
/* @__PURE__ */ (0,
|
|
8435
|
-
/* @__PURE__ */ (0,
|
|
8436
|
-
/* @__PURE__ */ (0,
|
|
8437
|
-
channel.direct?.targetId && /* @__PURE__ */ (0,
|
|
8513
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-detail dsh-partner-channel-manage", children: [
|
|
8514
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-connection", children: [
|
|
8515
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
8516
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("small", { children: "\u767B\u5F55\u8D26\u53F7" }),
|
|
8517
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: channel.accountId }),
|
|
8518
|
+
channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("small", { children: channel.direct.targetId })
|
|
8438
8519
|
] }),
|
|
8439
|
-
/* @__PURE__ */ (0,
|
|
8520
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChannelStatus, { channel })
|
|
8440
8521
|
] }),
|
|
8441
|
-
|
|
8442
|
-
channel.
|
|
8443
|
-
/* @__PURE__ */ (0,
|
|
8444
|
-
|
|
8522
|
+
channel.platform === "matrix" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: "\u4EC5\u652F\u6301\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u3002\u52A0\u5BC6\u4F1A\u8BDD\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u6216\u53D1\u9001\u914D\u5BF9\u7801\uFF1B\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002\u68C0\u6D4B\u5230\u52A0\u5BC6\u4F1A\u8BDD\u65F6\u4F1A\u5728\u6B64\u63D0\u793A\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u672A\u52A0\u5BC6\u4F1A\u8BDD\u3002" }),
|
|
8523
|
+
!channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: "\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u5728\u4E0B\u65B9\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6279\u51C6\u3002\u8BF7\u6C42\u4F1A\u81EA\u52A8\u66F4\u65B0\u3002" }),
|
|
8524
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { role: "alert", children: channel.lastError }),
|
|
8525
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
8526
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
8445
8527
|
await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: !channel.enabled }) });
|
|
8446
8528
|
await onChanged();
|
|
8447
8529
|
}), children: channel.enabled ? "\u505C\u7528" : "\u542F\u7528" }),
|
|
8448
|
-
channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0,
|
|
8530
|
+
channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
8449
8531
|
await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: true }) });
|
|
8450
8532
|
await onChanged();
|
|
8451
8533
|
}), children: "\u91CD\u8FDE" }),
|
|
8452
|
-
/* @__PURE__ */ (0,
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { disabled: busy, onClick: () => deleting === channel.id ? void run(async () => {
|
|
8453
8535
|
await api(`/channels/${channel.id}`, { method: "DELETE" });
|
|
8454
8536
|
setDeleting(void 0);
|
|
8455
8537
|
await onChanged();
|
|
8456
8538
|
}) : setDeleting(channel.id), children: deleting === channel.id ? "\u786E\u8BA4\u5220\u9664\u914D\u7F6E\u4E0E\u51ED\u636E" : "\u5220\u9664\u6E20\u9053" }),
|
|
8457
|
-
deleting === channel.id && /* @__PURE__ */ (0,
|
|
8539
|
+
deleting === channel.id && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" })
|
|
8458
8540
|
] }),
|
|
8459
|
-
/* @__PURE__ */ (0,
|
|
8460
|
-
/* @__PURE__ */ (0,
|
|
8461
|
-
/* @__PURE__ */ (0,
|
|
8541
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("section", { className: "dsh-partner-channel-access", children: [
|
|
8542
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h3", { children: "\u8054\u7CFB\u4EBA\u6388\u6743" }),
|
|
8543
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { role: "status", children: [
|
|
8462
8544
|
pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
|
|
8463
8545
|
" \u4E2A\u7B49\u5F85\u6279\u51C6 \xB7 \u81EA\u52A8\u5237\u65B0"
|
|
8464
8546
|
] }),
|
|
8465
|
-
pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0,
|
|
8466
|
-
/* @__PURE__ */ (0,
|
|
8467
|
-
/* @__PURE__ */ (0,
|
|
8468
|
-
/* @__PURE__ */ (0,
|
|
8469
|
-
p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0,
|
|
8547
|
+
pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-person", children: [
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
8549
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: p.displayName }),
|
|
8550
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("small", { children: p.status === "approved" ? "\u5DF2\u6388\u6743" : p.status === "pending" ? "\u7B49\u5F85\u6279\u51C6" : "\u5DF2\u963B\u6B62" }),
|
|
8551
|
+
p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
8470
8552
|
"\u914D\u5BF9\u7801 ",
|
|
8471
|
-
/* @__PURE__ */ (0,
|
|
8553
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("code", { children: p.pairingCode })
|
|
8472
8554
|
] })
|
|
8473
8555
|
] }),
|
|
8474
|
-
/* @__PURE__ */ (0,
|
|
8556
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
8475
8557
|
await api(`/pairings/${p.id}/status`, { method: "POST", body: JSON.stringify({ status: p.status === "approved" ? "blocked" : "approved" }) });
|
|
8476
8558
|
await onChanged();
|
|
8477
8559
|
}), children: p.status === "approved" ? "\u64A4\u9500\u6388\u6743" : "\u6279\u51C6\u8054\u7CFB\u4EBA" })
|
|
8478
8560
|
] }, p.id))
|
|
8479
8561
|
] }),
|
|
8480
|
-
feedback && /* @__PURE__ */ (0,
|
|
8481
|
-
] }) })
|
|
8562
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { role: "status", children: feedback })
|
|
8563
|
+
] }) }),
|
|
8564
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-inline-notice", role: "status", "aria-atomic": "true", children: [
|
|
8565
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: channel.runtimeStatus === "running" ? "\u4F1A\u8BDD\u63D0\u793A" : "\u8FDE\u63A5\u63D0\u793A" }),
|
|
8566
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: channel.lastError })
|
|
8567
|
+
] })
|
|
8482
8568
|
] }, channel.id))
|
|
8483
8569
|
] }),
|
|
8484
|
-
/* @__PURE__ */ (0,
|
|
8485
|
-
/* @__PURE__ */ (0,
|
|
8486
|
-
/* @__PURE__ */ (0,
|
|
8487
|
-
/* @__PURE__ */ (0,
|
|
8570
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("section", { className: "dsh-partner-channel-notifications", "aria-label": "\u901A\u77E5\u8BBE\u7F6E", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
8571
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
8572
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: "\u901A\u77E5\u4E0E\u4EA4\u4ED8" }),
|
|
8573
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("small", { children: companion.notificationDelivery?.mode === "selected" ? `\u5DF2\u6307\u5B9A ${companion.notificationDelivery.targets.length} \u4F4D\u63A5\u6536\u4EBA` : "\u9ED8\u8BA4\u8DDF\u968F\u6700\u8FD1\u6E20\u9053\u4E0E\u7528\u6237" })
|
|
8488
8574
|
] }),
|
|
8489
|
-
/* @__PURE__ */ (0,
|
|
8575
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", onClick: () => setConfiguring("delivery"), children: "\u914D\u7F6E" })
|
|
8490
8576
|
] }) }),
|
|
8491
|
-
configuring === "delivery" && /* @__PURE__ */ (0,
|
|
8492
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u65E0\u9700\u5173\u8054\u8054\u7CFB\u4EBA\u3002\u901A\u77E5\u9ED8\u8BA4\u8D70\u6700\u8FD1\u6536\u5230\u6D88\u606F\u7684\u6E20\u9053\uFF1B\u6307\u5B9A\u76EE\u6807\u4E0D\u53EF\u7528\u65F6\u7B49\u5F85\u91CD\u8BD5\uFF0C\u4E0D\u6539\u53D1\u5176\u4ED6\u6E20\u9053\u3002" }),
|
|
8493
|
-
!pairings.some((p) => p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: "\u6279\u51C6\u8054\u7CFB\u4EBA\u540E\uFF0C\u5373\u53EF\u8BBE\u7F6E\u901A\u77E5\u6295\u9012\u76EE\u6807\u3002" }),
|
|
8494
|
-
pairings.filter((p) => p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DeliverySettings, { pairing: p, pairings, channels, onChanged }, `${p.id}:${p.updatedAt}`))
|
|
8495
|
-
] }) })
|
|
8577
|
+
configuring === "delivery" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceDialog, { title: "\u901A\u77E5\u4E0E\u4EA4\u4ED8", detail: "\u9009\u62E9\u901A\u77E5\u6E20\u9053\uFF0C\u518D\u9009\u62E9\u5404\u6E20\u9053\u7684\u63A5\u6536\u4EBA\uFF1B\u652F\u6301\u540C\u65F6\u6295\u9012\u3002", close: () => setConfiguring(void 0), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(NotificationSettings, { companion, snapshot, onChanged }) })
|
|
8496
8578
|
] });
|
|
8497
8579
|
}
|
|
8498
8580
|
function FormField2({ label, hint, children }) {
|
|
8499
|
-
return /* @__PURE__ */ (0,
|
|
8500
|
-
/* @__PURE__ */ (0,
|
|
8581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "dsh-partner-channel-field", children: [
|
|
8582
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: label }),
|
|
8501
8583
|
children,
|
|
8502
|
-
hint && /* @__PURE__ */ (0,
|
|
8503
|
-
] });
|
|
8504
|
-
}
|
|
8505
|
-
function DeliverySettings({ pairing, pairings, channels, onChanged }) {
|
|
8506
|
-
const contactKey = pairing.contactKey ?? "";
|
|
8507
|
-
const [target, setTarget] = (0, import_react38.useState)(pairing.deliveryTarget ? pairings.find((p) => p.status === "approved" && p.channelId === pairing.deliveryTarget?.channelId && p.userId === pairing.deliveryTarget?.userId)?.id ?? "unavailable" : "");
|
|
8508
|
-
const [busy, setBusy] = (0, import_react38.useState)(false), [error, setError] = (0, import_react38.useState)("");
|
|
8509
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", onSubmit: (e) => {
|
|
8510
|
-
e.preventDefault();
|
|
8511
|
-
if (busy) return;
|
|
8512
|
-
setBusy(true);
|
|
8513
|
-
setError("");
|
|
8514
|
-
void api(`/pairings/${pairing.id}/delivery`, { method: "POST", body: JSON.stringify({ contactKey, targetPairingId: target || null }) }).then(onChanged).catch((e2) => setError(errorMessage(e2))).finally(() => setBusy(false));
|
|
8515
|
-
}, children: [
|
|
8516
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("h4", { children: [
|
|
8517
|
-
channels.find((c) => c.id === pairing.channelId)?.name,
|
|
8518
|
-
" \xB7 ",
|
|
8519
|
-
pairing.displayName
|
|
8520
|
-
] }),
|
|
8521
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FormField2, { label: "\u901A\u77E5\u6295\u9012\u76EE\u6807", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { disabled: busy, value: target, onChange: (e) => setTarget(e.target.value), children: [
|
|
8522
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "", children: "\u81EA\u52A8\uFF1A\u8BE5\u8054\u7CFB\u4EBA\u6700\u8FD1\u6E20\u9053" }),
|
|
8523
|
-
target === "unavailable" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "unavailable", disabled: true, children: "\u539F\u6307\u5B9A\u76EE\u6807\u4E0D\u53EF\u7528\uFF0C\u8BF7\u660E\u786E\u91CD\u65B0\u9009\u62E9" }),
|
|
8524
|
-
pairings.filter((p) => p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("option", { value: p.id, children: [
|
|
8525
|
-
channels.find((c) => c.id === p.channelId)?.name,
|
|
8526
|
-
" \xB7 ",
|
|
8527
|
-
p.displayName
|
|
8528
|
-
] }, p.id))
|
|
8529
|
-
] }) }),
|
|
8530
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
8531
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { role: "alert", children: error }),
|
|
8532
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { disabled: busy, children: "\u4FDD\u5B58\u6295\u9012\u8BBE\u7F6E" })
|
|
8533
|
-
] })
|
|
8584
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("small", { children: hint })
|
|
8534
8585
|
] });
|
|
8535
8586
|
}
|
|
8536
8587
|
|
|
8537
8588
|
// src/ui/use-channel-status.ts
|
|
8538
|
-
var
|
|
8589
|
+
var import_react40 = require("react");
|
|
8539
8590
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
8540
8591
|
var timer;
|
|
8541
8592
|
var active;
|
|
@@ -8560,7 +8611,7 @@ async function poll() {
|
|
|
8560
8611
|
}
|
|
8561
8612
|
}
|
|
8562
8613
|
function useChannelStatus(setSnapshot) {
|
|
8563
|
-
(0,
|
|
8614
|
+
(0, import_react40.useEffect)(() => {
|
|
8564
8615
|
const update = (value) => setSnapshot((previous) => previous ? { ...previous, ...value } : previous);
|
|
8565
8616
|
listeners2.add(update);
|
|
8566
8617
|
lastValue = "";
|
|
@@ -8582,13 +8633,144 @@ function useChannelStatus(setSnapshot) {
|
|
|
8582
8633
|
// src/ui/identity-editor.css
|
|
8583
8634
|
var identity_editor_default = "/* Own the identity form skin without changing host forms or theme tokens. */\n#dsh-partner-identity-editor.dsh-partner-form {\n min-width: 0;\n padding: 0;\n border: 0;\n background: transparent;\n box-shadow: none;\n color: var(--partner-text);\n font-family: var(--partner-font-family);\n}\n#dsh-partner-identity-editor .dsh-partner-identity-card {\n min-width: 0;\n padding: 20px;\n border: 1px solid var(--partner-border);\n border-radius: 15px;\n background: var(--partner-card-surface);\n box-shadow: var(--partner-card-shadow);\n}\n#dsh-partner-identity-editor .dsh-partner-field > span { flex-wrap: wrap; gap: 4px 12px; }\n#dsh-partner-identity-editor .dsh-partner-field small { text-align: start; }\n#dsh-partner-identity-editor .dsh-partner-field :is(input, textarea) {\n appearance: none;\n box-sizing: border-box;\n width: 100%;\n min-height: 40px;\n padding: 10px 12px;\n border: 1px solid var(--partner-border);\n border-radius: 10px;\n outline: none;\n color: var(--partner-text);\n background: var(--partner-control);\n font: var(--partner-font-label)/1.5 var(--partner-font-family);\n box-shadow: inset 0 1px 0 var(--partner-glass-highlight);\n}\n#dsh-partner-identity-editor .dsh-partner-field textarea { resize: vertical; }\n#dsh-partner-identity-editor .dsh-partner-field :is(input, textarea):focus {\n border-color: var(--partner-focus-ring);\n background: var(--partner-raised);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent);\n}\n#dsh-partner-identity-editor .dsh-partner-form-actions { flex-wrap: wrap; gap: 12px; }\n#dsh-partner-identity-editor .dsh-partner-form-actions > button {\n min-height: 40px;\n padding: 0 16px;\n border: 1px solid var(--partner-border);\n border-radius: 10px;\n color: var(--partner-on-accent);\n background: var(--partner-accent-strong);\n box-shadow: none;\n font: 600 var(--partner-font-body)/1.4 var(--partner-font-family);\n}\n#dsh-partner-identity-editor .dsh-partner-form-actions > button:hover:not(:disabled) { filter: brightness(.94); }\n#dsh-partner-identity-editor .dsh-partner-identity-danger { flex-wrap: wrap; }\n#dsh-partner-identity-editor .dsh-partner-identity-danger > span { flex: 1 1 250px; }\n#dsh-partner-identity-editor .dsh-partner-identity-danger > div { display: flex; flex-wrap: wrap; gap: 8px; }\n#dsh-partner-identity-editor .dsh-partner-identity-danger button {\n min-height: 36px;\n padding: 6px 12px;\n border: 1px solid color-mix(in srgb, var(--partner-danger) 24%, transparent);\n border-radius: 8px;\n color: var(--partner-danger);\n background: transparent;\n box-shadow: none;\n font: var(--partner-font-caption)/1.4 var(--partner-font-family);\n}\n#dsh-partner-identity-editor button:focus-visible { outline: 2px solid var(--partner-focus-ring); outline-offset: 3px; }\n#dsh-partner-identity-editor :is(input, textarea, button):disabled { opacity: .55; cursor: default; }\n@media (max-width: 640px) {\n #dsh-partner-identity-editor .dsh-partner-identity-card { padding: 14px; }\n #dsh-partner-identity-editor .dsh-partner-fields.two { grid-template-columns: minmax(0, 1fr); }\n}\n@media (forced-colors: active) {\n #dsh-partner-identity-editor .dsh-partner-field :is(input, textarea):focus { outline: 2px solid Highlight; }\n}\n";
|
|
8584
8635
|
|
|
8636
|
+
// src/ui/form-surface.css
|
|
8637
|
+
var form_surface_default = `/* Deliberate, local boundary against host themes with global !important form rules.
|
|
8638
|
+
Keep layout responsive and use the plugin's light/dark material tokens. */
|
|
8639
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-settings { display: grid; gap: 10px; }
|
|
8640
|
+
.dsh-partner-workspace #dsh-partner-channels :is(.dsh-partner-delivery-hint, .dsh-partner-delivery-empty) { margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-caption); line-height: 1.5; }
|
|
8641
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-contact { padding: 0; border: 1px solid var(--partner-border); border-radius: 10px; background: var(--partner-control); }
|
|
8642
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-contact > summary { padding: 12px; cursor: pointer; color: var(--partner-text); }
|
|
8643
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-contact > summary > span { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; vertical-align: middle; }
|
|
8644
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-contact small { color: var(--partner-text-secondary); }
|
|
8645
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-form { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; margin: 0; padding: 0; }
|
|
8646
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-form > p:not([role="alert"]) { color: var(--partner-text-secondary); background: transparent; padding: 0; }
|
|
8647
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-form > p { grid-column: 1 / -1; margin: 0; }
|
|
8648
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog:has(.dsh-partner-delivery-form) { width: min(560px, 100%); height: auto; align-self: center; max-height: calc(100% - 24px); border-radius: 16px !important; }
|
|
8649
|
+
.dsh-partner-workspace #dsh-partner-identity-editor.dsh-partner-form,
|
|
8650
|
+
.dsh-partner-workspace #dsh-partner-channels.dsh-partner-form {
|
|
8651
|
+
background: transparent !important;
|
|
8652
|
+
background-image: none !important;
|
|
8653
|
+
border: 0 !important;
|
|
8654
|
+
box-shadow: none !important;
|
|
8655
|
+
font-family: var(--partner-font-family) !important;
|
|
8656
|
+
color: var(--partner-text) !important;
|
|
8657
|
+
}
|
|
8658
|
+
.dsh-partner-workspace #dsh-partner-identity-editor .dsh-partner-identity-card {
|
|
8659
|
+
background: var(--partner-card-surface) !important;
|
|
8660
|
+
border: 1px solid var(--partner-border) !important;
|
|
8661
|
+
border-radius: 15px !important;
|
|
8662
|
+
box-shadow: var(--partner-card-shadow) !important;
|
|
8663
|
+
}
|
|
8664
|
+
.dsh-partner-workspace #dsh-partner-identity-editor .dsh-partner-field :is(input, textarea),
|
|
8665
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-field > :is(input, select) {
|
|
8666
|
+
appearance: none !important;
|
|
8667
|
+
box-sizing: border-box;
|
|
8668
|
+
min-width: 0;
|
|
8669
|
+
width: 100%;
|
|
8670
|
+
min-height: 40px;
|
|
8671
|
+
padding: 10px 12px !important;
|
|
8672
|
+
color: var(--partner-text) !important;
|
|
8673
|
+
background-color: var(--partner-control) !important;
|
|
8674
|
+
border: 1px solid var(--partner-border) !important;
|
|
8675
|
+
border-radius: 10px !important;
|
|
8676
|
+
box-shadow: inset 0 1px 0 var(--partner-glass-highlight) !important;
|
|
8677
|
+
font: var(--partner-font-label)/1.5 var(--partner-font-family) !important;
|
|
8678
|
+
}
|
|
8679
|
+
.dsh-partner-workspace #dsh-partner-identity-editor .dsh-partner-field :is(input, textarea),
|
|
8680
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-field > input { background-image: none !important; }
|
|
8681
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-field > select {
|
|
8682
|
+
padding-right: 36px !important;
|
|
8683
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23909095' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
|
|
8684
|
+
background-repeat: no-repeat !important;
|
|
8685
|
+
background-position: right 12px center !important;
|
|
8686
|
+
}
|
|
8687
|
+
.dsh-partner-workspace #dsh-partner-identity-editor button,
|
|
8688
|
+
.dsh-partner-workspace #dsh-partner-channels button {
|
|
8689
|
+
appearance: none !important;
|
|
8690
|
+
display: inline-flex;
|
|
8691
|
+
align-items: center;
|
|
8692
|
+
justify-content: center;
|
|
8693
|
+
gap: 6px;
|
|
8694
|
+
min-height: 40px;
|
|
8695
|
+
padding: 8px 14px !important;
|
|
8696
|
+
border: 1px solid var(--partner-border) !important;
|
|
8697
|
+
border-radius: 10px !important;
|
|
8698
|
+
color: var(--partner-text) !important;
|
|
8699
|
+
background: var(--partner-control) !important;
|
|
8700
|
+
box-shadow: none !important;
|
|
8701
|
+
font: 600 var(--partner-font-body)/1.4 var(--partner-font-family) !important;
|
|
8702
|
+
cursor: pointer;
|
|
8703
|
+
}
|
|
8704
|
+
.dsh-partner-workspace #dsh-partner-identity-editor .dsh-partner-form-actions > button,
|
|
8705
|
+
.dsh-partner-workspace #dsh-partner-channels button.is-primary {
|
|
8706
|
+
color: var(--partner-on-accent) !important;
|
|
8707
|
+
background: var(--partner-accent-strong) !important;
|
|
8708
|
+
}
|
|
8709
|
+
.dsh-partner-workspace #dsh-partner-identity-editor .dsh-partner-identity-danger button:not(.is-secondary) {
|
|
8710
|
+
color: var(--partner-danger) !important;
|
|
8711
|
+
border-color: color-mix(in srgb, var(--partner-danger) 30%, transparent) !important;
|
|
8712
|
+
}
|
|
8713
|
+
.dsh-partner-workspace #dsh-partner-identity-editor .dsh-partner-identity-danger button.is-danger {
|
|
8714
|
+
background: var(--partner-danger) !important;
|
|
8715
|
+
color: var(--partner-on-accent) !important;
|
|
8716
|
+
}
|
|
8717
|
+
.dsh-partner-workspace #dsh-partner-identity-editor button:hover:not(:disabled),
|
|
8718
|
+
.dsh-partner-workspace #dsh-partner-channels button:hover:not(:disabled) { filter: brightness(.94); }
|
|
8719
|
+
.dsh-partner-workspace #dsh-partner-identity-editor :is(input, textarea, button):focus-visible,
|
|
8720
|
+
.dsh-partner-workspace #dsh-partner-channels :is(input, select, button, summary):focus-visible {
|
|
8721
|
+
outline: 2px solid var(--partner-focus-ring) !important;
|
|
8722
|
+
outline-offset: 2px;
|
|
8723
|
+
}
|
|
8724
|
+
.dsh-partner-workspace #dsh-partner-identity-editor :disabled,
|
|
8725
|
+
.dsh-partner-workspace #dsh-partner-channels :disabled { opacity: .55; cursor: not-allowed; }
|
|
8726
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog {
|
|
8727
|
+
background: var(--partner-solid-panel) !important;
|
|
8728
|
+
color: var(--partner-text) !important;
|
|
8729
|
+
border: 1px solid var(--partner-border) !important;
|
|
8730
|
+
border-radius: 16px !important;
|
|
8731
|
+
font-family: var(--partner-font-family) !important;
|
|
8732
|
+
box-shadow: 0 22px 58px color-mix(in srgb, #000 18%, transparent), 0 4px 14px color-mix(in srgb, #000 8%, transparent), inset 0 1px 0 var(--partner-card-highlight) !important;
|
|
8733
|
+
}
|
|
8734
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog > header {
|
|
8735
|
+
background: var(--partner-solid-raised) !important;
|
|
8736
|
+
color: var(--partner-text) !important;
|
|
8737
|
+
}
|
|
8738
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog > header button {
|
|
8739
|
+
width: 32px; min-height: 32px; padding: 0 !important;
|
|
8740
|
+
background: transparent !important; border-color: transparent !important;
|
|
8741
|
+
}
|
|
8742
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-form {
|
|
8743
|
+
background: transparent !important; box-shadow: none !important; border: 0 !important;
|
|
8744
|
+
color: var(--partner-text) !important;
|
|
8745
|
+
font: var(--partner-font-body)/1.5 var(--partner-font-family) !important;
|
|
8746
|
+
}
|
|
8747
|
+
@media (max-width: 640px) {
|
|
8748
|
+
.dsh-partner-workspace #dsh-partner-channels button,
|
|
8749
|
+
.dsh-partner-workspace #dsh-partner-identity-editor button { min-height: 44px; }
|
|
8750
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog { border-radius: 0 !important; border-width: 0 !important; }
|
|
8751
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-toolbar { align-items: flex-start; flex-wrap: wrap; }
|
|
8752
|
+
}
|
|
8753
|
+
|
|
8754
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-notification-choices { display: grid; gap: 16px; min-width: 0; }
|
|
8755
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-notification-channel { margin: 0; padding: 8px 16px; min-width: 0; border: 1px solid var(--partner-border); border-radius: 12px; }
|
|
8756
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-notification-channel label { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
|
|
8757
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-notification-channel input[type="checkbox"] { appearance: auto !important; width: 18px !important; height: 18px !important; min-height: 0 !important; flex: 0 0 18px; padding: 0 !important; margin: 0 !important; box-shadow: none !important; }
|
|
8758
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-notification-users { display: grid; gap: 8px; }
|
|
8759
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-notification-users span { min-width: 0; overflow-wrap: anywhere; }
|
|
8760
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-notification-users small { display: block; color: var(--partner-text-secondary); }
|
|
8761
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-row.has-notice-slot { display: grid; grid-template-columns: minmax(0,1fr) auto auto; }
|
|
8762
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-inline-notice { grid-column: 1 / -1; min-width: 0; padding-top: 12px; border-top: 1px solid var(--partner-border); color: var(--partner-text); font-size: var(--partner-font-body); line-height: 1.6; overflow-wrap: anywhere; }
|
|
8763
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-inline-notice strong { font-weight: 600; }
|
|
8764
|
+
.dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-inline-notice p { margin: 4px 0 0; color: var(--partner-text-secondary); }
|
|
8765
|
+
`;
|
|
8766
|
+
|
|
8585
8767
|
// src/ui/companion-create.tsx
|
|
8586
|
-
var
|
|
8768
|
+
var import_react41 = require("react");
|
|
8587
8769
|
var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8588
|
-
var
|
|
8770
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
8589
8771
|
function CompanionCreateDialog({ close, create }) {
|
|
8590
|
-
const [busy, setBusy] = (0,
|
|
8591
|
-
const [error, setError] = (0,
|
|
8772
|
+
const [busy, setBusy] = (0, import_react41.useState)(false);
|
|
8773
|
+
const [error, setError] = (0, import_react41.useState)();
|
|
8592
8774
|
const submit = async (event) => {
|
|
8593
8775
|
event.preventDefault();
|
|
8594
8776
|
const data = new FormData(event.currentTarget);
|
|
@@ -8607,30 +8789,30 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
8607
8789
|
setBusy(false);
|
|
8608
8790
|
}
|
|
8609
8791
|
};
|
|
8610
|
-
return /* @__PURE__ */ (0,
|
|
8792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
|
|
8611
8793
|
void submit(event);
|
|
8612
8794
|
}, children: [
|
|
8613
|
-
/* @__PURE__ */ (0,
|
|
8614
|
-
/* @__PURE__ */ (0,
|
|
8615
|
-
/* @__PURE__ */ (0,
|
|
8795
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { children: [
|
|
8796
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
|
|
8797
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
|
|
8616
8798
|
] }),
|
|
8617
|
-
/* @__PURE__ */ (0,
|
|
8618
|
-
/* @__PURE__ */ (0,
|
|
8619
|
-
/* @__PURE__ */ (0,
|
|
8799
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { children: [
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
|
|
8801
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
|
|
8620
8802
|
] }),
|
|
8621
|
-
/* @__PURE__ */ (0,
|
|
8622
|
-
/* @__PURE__ */ (0,
|
|
8623
|
-
/* @__PURE__ */ (0,
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "is-wide", children: [
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
|
|
8624
8806
|
] }),
|
|
8625
|
-
/* @__PURE__ */ (0,
|
|
8626
|
-
/* @__PURE__ */ (0,
|
|
8627
|
-
/* @__PURE__ */ (0,
|
|
8807
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "is-wide", children: [
|
|
8808
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
|
|
8809
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
|
|
8628
8810
|
] }),
|
|
8629
|
-
error && /* @__PURE__ */ (0,
|
|
8630
|
-
/* @__PURE__ */ (0,
|
|
8631
|
-
/* @__PURE__ */ (0,
|
|
8632
|
-
/* @__PURE__ */ (0,
|
|
8633
|
-
/* @__PURE__ */ (0,
|
|
8811
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(WorkspaceNotice, { children: error }),
|
|
8812
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("footer", { children: [
|
|
8813
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
8814
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
8815
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_dsh_client_ui_primitives20.IconPlusOutline16, { size: 14 }),
|
|
8634
8816
|
busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
|
|
8635
8817
|
] })
|
|
8636
8818
|
] })
|
|
@@ -8638,7 +8820,7 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
8638
8820
|
}
|
|
8639
8821
|
|
|
8640
8822
|
// src/main-panel-compat.ts
|
|
8641
|
-
var
|
|
8823
|
+
var import_react42 = require("react");
|
|
8642
8824
|
function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
8643
8825
|
}) {
|
|
8644
8826
|
const layout = ctx.layout;
|
|
@@ -8649,7 +8831,7 @@ function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
|
8649
8831
|
let disposed = false;
|
|
8650
8832
|
let generation = 0;
|
|
8651
8833
|
const Body = (props) => {
|
|
8652
|
-
(0,
|
|
8834
|
+
(0, import_react42.useEffect)(() => {
|
|
8653
8835
|
const current2 = ++generation;
|
|
8654
8836
|
return () => {
|
|
8655
8837
|
queueMicrotask(() => {
|
|
@@ -8756,7 +8938,7 @@ function sessions(ctx) {
|
|
|
8756
8938
|
}
|
|
8757
8939
|
|
|
8758
8940
|
// src/client.tsx
|
|
8759
|
-
var
|
|
8941
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
8760
8942
|
var PLUGIN_ID = "@lemoncat7/dsh-partner";
|
|
8761
8943
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
8762
8944
|
var cssText = `${client_default}
|
|
@@ -8767,30 +8949,31 @@ ${requirement_board_default}
|
|
|
8767
8949
|
${widget_default}
|
|
8768
8950
|
${settings_panel_default}
|
|
8769
8951
|
${memory_ui_default}
|
|
8770
|
-
${identity_editor_default}
|
|
8952
|
+
${identity_editor_default}
|
|
8953
|
+
${form_surface_default}`;
|
|
8771
8954
|
var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "pendant"]);
|
|
8772
8955
|
var inject = ["slots", "layout", "sessions"];
|
|
8773
8956
|
function apply(ctx) {
|
|
8774
8957
|
ctx.effect(installStyles, "dsh-partner: styles");
|
|
8775
|
-
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0,
|
|
8776
|
-
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0,
|
|
8958
|
+
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
|
|
8959
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PartnerPendant, { controller })));
|
|
8777
8960
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
|
|
8778
8961
|
ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
|
|
8779
8962
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
8780
8963
|
name: "sidebar.footer.action",
|
|
8781
8964
|
id: "partner",
|
|
8782
8965
|
order: -120
|
|
8783
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
8966
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
8784
8967
|
}
|
|
8785
8968
|
function PartnerSidebar(props) {
|
|
8786
|
-
const ref = (0,
|
|
8969
|
+
const ref = (0, import_react43.useRef)(null);
|
|
8787
8970
|
useWorkspaceTopAnchor(ref);
|
|
8788
|
-
const [open, setOpen] = (0,
|
|
8789
|
-
const [snapshot, setSnapshot] = (0,
|
|
8971
|
+
const [open, setOpen] = (0, import_react43.useState)(true);
|
|
8972
|
+
const [snapshot, setSnapshot] = (0, import_react43.useState)();
|
|
8790
8973
|
useChannelStatus(setSnapshot);
|
|
8791
|
-
const [, update] = (0,
|
|
8792
|
-
(0,
|
|
8793
|
-
(0,
|
|
8974
|
+
const [, update] = (0, import_react43.useState)(0);
|
|
8975
|
+
(0, import_react43.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
|
|
8976
|
+
(0, import_react43.useEffect)(() => {
|
|
8794
8977
|
void loadPartner().then(setSnapshot).catch(() => {
|
|
8795
8978
|
});
|
|
8796
8979
|
}, [props.controller.isOpen()]);
|
|
@@ -8798,35 +8981,35 @@ function PartnerSidebar(props) {
|
|
|
8798
8981
|
props.controller.open(id);
|
|
8799
8982
|
if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
|
|
8800
8983
|
};
|
|
8801
|
-
if (!props.wide) return /* @__PURE__ */ (0,
|
|
8802
|
-
return /* @__PURE__ */ (0,
|
|
8803
|
-
/* @__PURE__ */ (0,
|
|
8804
|
-
/* @__PURE__ */ (0,
|
|
8984
|
+
if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconAgentPresetOutline16, { size: 18 }) }) });
|
|
8985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
|
|
8986
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
|
|
8987
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconChevronDownOutline14, { size: 14 }) }),
|
|
8805
8988
|
"\u4F19\u4F34"
|
|
8806
8989
|
] }) }),
|
|
8807
|
-
/* @__PURE__ */ (0,
|
|
8808
|
-
/* @__PURE__ */ (0,
|
|
8809
|
-
/* @__PURE__ */ (0,
|
|
8810
|
-
/* @__PURE__ */ (0,
|
|
8811
|
-
/* @__PURE__ */ (0,
|
|
8990
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
|
|
8991
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconAgentPresetOutline16, { size: 16 }) }),
|
|
8992
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
8993
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
|
|
8994
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
|
|
8812
8995
|
] }),
|
|
8813
|
-
/* @__PURE__ */ (0,
|
|
8996
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
|
|
8814
8997
|
] }) }) })
|
|
8815
8998
|
] });
|
|
8816
8999
|
}
|
|
8817
9000
|
function PartnerWorkspace({ controller }) {
|
|
8818
|
-
const [snapshot, setSnapshot] = (0,
|
|
9001
|
+
const [snapshot, setSnapshot] = (0, import_react43.useState)();
|
|
8819
9002
|
useChannelStatus(setSnapshot);
|
|
8820
|
-
const [selectedId, setSelectedId] = (0,
|
|
8821
|
-
const [view, setView] = (0,
|
|
8822
|
-
const [requestedDestination, setRequestedDestination] = (0,
|
|
8823
|
-
const [error, setError] = (0,
|
|
8824
|
-
const [loading, setLoading] = (0,
|
|
8825
|
-
const [creatingCompanion, setCreatingCompanion] = (0,
|
|
8826
|
-
const [notice, setNotice] = (0,
|
|
8827
|
-
const selectionRef = (0,
|
|
9003
|
+
const [selectedId, setSelectedId] = (0, import_react43.useState)(controller.selected());
|
|
9004
|
+
const [view, setView] = (0, import_react43.useState)(controller.destination()?.page ?? "home");
|
|
9005
|
+
const [requestedDestination, setRequestedDestination] = (0, import_react43.useState)(controller.destination());
|
|
9006
|
+
const [error, setError] = (0, import_react43.useState)();
|
|
9007
|
+
const [loading, setLoading] = (0, import_react43.useState)(true);
|
|
9008
|
+
const [creatingCompanion, setCreatingCompanion] = (0, import_react43.useState)(false);
|
|
9009
|
+
const [notice, setNotice] = (0, import_react43.useState)();
|
|
9010
|
+
const selectionRef = (0, import_react43.useRef)({ selectedId, companions: snapshot?.companions });
|
|
8828
9011
|
selectionRef.current = { selectedId, companions: snapshot?.companions };
|
|
8829
|
-
const refresh = (0,
|
|
9012
|
+
const refresh = (0, import_react43.useCallback)(async (throwOnError = false) => {
|
|
8830
9013
|
try {
|
|
8831
9014
|
const next = await loadPartner();
|
|
8832
9015
|
setSnapshot(next);
|
|
@@ -8839,10 +9022,10 @@ function PartnerWorkspace({ controller }) {
|
|
|
8839
9022
|
setLoading(false);
|
|
8840
9023
|
}
|
|
8841
9024
|
}, []);
|
|
8842
|
-
(0,
|
|
9025
|
+
(0, import_react43.useEffect)(() => {
|
|
8843
9026
|
void refresh();
|
|
8844
9027
|
}, [refresh]);
|
|
8845
|
-
(0,
|
|
9028
|
+
(0, import_react43.useEffect)(() => controller.subscribe(() => {
|
|
8846
9029
|
const next = controller.selected();
|
|
8847
9030
|
if (next) setSelectedId(next);
|
|
8848
9031
|
const destination = controller.destination();
|
|
@@ -8911,18 +9094,18 @@ function PartnerWorkspace({ controller }) {
|
|
|
8911
9094
|
setSelectedId(id);
|
|
8912
9095
|
setView("home");
|
|
8913
9096
|
};
|
|
8914
|
-
return /* @__PURE__ */ (0,
|
|
8915
|
-
creatingCompanion && /* @__PURE__ */ (0,
|
|
8916
|
-
/* @__PURE__ */ (0,
|
|
8917
|
-
/* @__PURE__ */ (0,
|
|
8918
|
-
/* @__PURE__ */ (0,
|
|
8919
|
-
/* @__PURE__ */ (0,
|
|
8920
|
-
/* @__PURE__ */ (0,
|
|
8921
|
-
/* @__PURE__ */ (0,
|
|
8922
|
-
/* @__PURE__ */ (0,
|
|
9097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("main", { className: "dsh-partner-workspace", children: [
|
|
9098
|
+
creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
|
|
9099
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { className: "dsh-partner-topbar", children: [
|
|
9100
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
|
|
9101
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconChevronLeftOutline14, { size: 15 }) }),
|
|
9102
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconAgentPresetOutline16, { size: 18 }),
|
|
9103
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9104
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u4F19\u4F34" }),
|
|
9105
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
|
|
8923
9106
|
] })
|
|
8924
9107
|
] }),
|
|
8925
|
-
/* @__PURE__ */ (0,
|
|
9108
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8926
9109
|
MobileWorkspaceControls,
|
|
8927
9110
|
{
|
|
8928
9111
|
companions: snapshot?.companions ?? [],
|
|
@@ -8934,117 +9117,117 @@ function PartnerWorkspace({ controller }) {
|
|
|
8934
9117
|
}
|
|
8935
9118
|
)
|
|
8936
9119
|
] }),
|
|
8937
|
-
/* @__PURE__ */ (0,
|
|
8938
|
-
/* @__PURE__ */ (0,
|
|
8939
|
-
/* @__PURE__ */ (0,
|
|
8940
|
-
/* @__PURE__ */ (0,
|
|
8941
|
-
/* @__PURE__ */ (0,
|
|
8942
|
-
/* @__PURE__ */ (0,
|
|
9120
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-grid", children: [
|
|
9121
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("aside", { className: "dsh-partner-roster", children: [
|
|
9122
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-roster-title", children: [
|
|
9123
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9124
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "COMPANIONS" }),
|
|
9125
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
|
|
8943
9126
|
] }),
|
|
8944
|
-
/* @__PURE__ */ (0,
|
|
9127
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconPlusOutline16, { size: 16 }) })
|
|
8945
9128
|
] }),
|
|
8946
|
-
/* @__PURE__ */ (0,
|
|
9129
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
|
|
8947
9130
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
8948
|
-
return /* @__PURE__ */ (0,
|
|
8949
|
-
/* @__PURE__ */ (0,
|
|
8950
|
-
/* @__PURE__ */ (0,
|
|
8951
|
-
/* @__PURE__ */ (0,
|
|
8952
|
-
/* @__PURE__ */ (0,
|
|
9131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
|
|
9132
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Avatar, { name: companion.name }),
|
|
9133
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9134
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: companion.name }),
|
|
9135
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: companion.role })
|
|
8953
9136
|
] }),
|
|
8954
|
-
/* @__PURE__ */ (0,
|
|
9137
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
|
|
8955
9138
|
] }, companion.id);
|
|
8956
9139
|
}) }),
|
|
8957
|
-
/* @__PURE__ */ (0,
|
|
8958
|
-
/* @__PURE__ */ (0,
|
|
8959
|
-
/* @__PURE__ */ (0,
|
|
8960
|
-
/* @__PURE__ */ (0,
|
|
8961
|
-
/* @__PURE__ */ (0,
|
|
9140
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
|
|
9141
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
|
|
9142
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconBrowseOutline16, { size: 16 }) }),
|
|
9143
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "Skill \u5E02\u573A" }),
|
|
9144
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
|
|
8962
9145
|
] }),
|
|
8963
|
-
/* @__PURE__ */ (0,
|
|
8964
|
-
/* @__PURE__ */ (0,
|
|
8965
|
-
/* @__PURE__ */ (0,
|
|
8966
|
-
/* @__PURE__ */ (0,
|
|
9146
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
|
|
9147
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconListPenOutline16, { size: 16 }) }),
|
|
9148
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
|
|
9149
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
|
|
8967
9150
|
] }),
|
|
8968
|
-
/* @__PURE__ */ (0,
|
|
8969
|
-
/* @__PURE__ */ (0,
|
|
8970
|
-
/* @__PURE__ */ (0,
|
|
8971
|
-
/* @__PURE__ */ (0,
|
|
9151
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
|
|
9152
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconPlayOutline16, { size: 16 }) }),
|
|
9153
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
|
|
9154
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
|
|
8972
9155
|
] }),
|
|
8973
|
-
/* @__PURE__ */ (0,
|
|
8974
|
-
/* @__PURE__ */ (0,
|
|
8975
|
-
/* @__PURE__ */ (0,
|
|
8976
|
-
/* @__PURE__ */ (0,
|
|
9156
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
|
|
9157
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconEditOutline16, { size: 16 }) }),
|
|
9158
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
|
|
9159
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
|
|
8977
9160
|
] })
|
|
8978
9161
|
] }),
|
|
8979
|
-
/* @__PURE__ */ (0,
|
|
8980
|
-
/* @__PURE__ */ (0,
|
|
8981
|
-
/* @__PURE__ */ (0,
|
|
8982
|
-
/* @__PURE__ */ (0,
|
|
8983
|
-
/* @__PURE__ */ (0,
|
|
9162
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
9163
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconLinkOutline16, { size: 16 }),
|
|
9164
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9165
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
9166
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
8984
9167
|
] })
|
|
8985
9168
|
] })
|
|
8986
9169
|
] }),
|
|
8987
|
-
/* @__PURE__ */ (0,
|
|
8988
|
-
loading ? /* @__PURE__ */ (0,
|
|
8989
|
-
view === "skills" && /* @__PURE__ */ (0,
|
|
8990
|
-
view === "board" && /* @__PURE__ */ (0,
|
|
8991
|
-
view === "schedules" && /* @__PURE__ */ (0,
|
|
8992
|
-
view === "pendant" && /* @__PURE__ */ (0,
|
|
8993
|
-
] }) : selected === void 0 ? /* @__PURE__ */ (0,
|
|
8994
|
-
/* @__PURE__ */ (0,
|
|
8995
|
-
/* @__PURE__ */ (0,
|
|
8996
|
-
/* @__PURE__ */ (0,
|
|
8997
|
-
/* @__PURE__ */ (0,
|
|
8998
|
-
/* @__PURE__ */ (0,
|
|
8999
|
-
/* @__PURE__ */ (0,
|
|
9170
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
|
|
9171
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
|
|
9172
|
+
view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SkillsPanel, {}),
|
|
9173
|
+
view === "board" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
|
|
9174
|
+
view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
|
|
9175
|
+
view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PendantSettingsPanel, {})
|
|
9176
|
+
] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
9177
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-identity", children: [
|
|
9178
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Avatar, { name: selected.name }),
|
|
9179
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9180
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "ACTIVE COMPANION" }),
|
|
9181
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { children: selected.name }),
|
|
9182
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: selected.description || selected.role })
|
|
9000
9183
|
] }),
|
|
9001
|
-
/* @__PURE__ */ (0,
|
|
9184
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
|
|
9002
9185
|
] }),
|
|
9003
|
-
/* @__PURE__ */ (0,
|
|
9004
|
-
/* @__PURE__ */ (0,
|
|
9005
|
-
/* @__PURE__ */ (0,
|
|
9006
|
-
/* @__PURE__ */ (0,
|
|
9007
|
-
/* @__PURE__ */ (0,
|
|
9008
|
-
/* @__PURE__ */ (0,
|
|
9009
|
-
/* @__PURE__ */ (0,
|
|
9186
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
|
|
9187
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
|
|
9188
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
|
|
9189
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
|
|
9190
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconLinkOutline16, { size: 16 }), children: "\u6E20\u9053" }),
|
|
9191
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" }),
|
|
9192
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconBrowseOutline16, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
|
|
9010
9193
|
] }),
|
|
9011
|
-
/* @__PURE__ */ (0,
|
|
9012
|
-
notice && /* @__PURE__ */ (0,
|
|
9013
|
-
view === "home" && /* @__PURE__ */ (0,
|
|
9014
|
-
view === "identity" && /* @__PURE__ */ (0,
|
|
9015
|
-
view === "capabilities" && /* @__PURE__ */ (0,
|
|
9016
|
-
view === "weixin" && /* @__PURE__ */ (0,
|
|
9017
|
-
view === "memory" && /* @__PURE__ */ (0,
|
|
9018
|
-
view === "concerns" && /* @__PURE__ */ (0,
|
|
9194
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
|
|
9195
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
|
|
9196
|
+
view === "home" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
|
|
9197
|
+
view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
|
|
9198
|
+
view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
|
|
9199
|
+
view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
|
|
9200
|
+
view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
|
|
9201
|
+
view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
|
|
9019
9202
|
] })
|
|
9020
9203
|
] }),
|
|
9021
|
-
error && /* @__PURE__ */ (0,
|
|
9204
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
|
|
9022
9205
|
] })
|
|
9023
9206
|
] })
|
|
9024
9207
|
] });
|
|
9025
9208
|
}
|
|
9026
9209
|
function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
|
|
9027
|
-
return /* @__PURE__ */ (0,
|
|
9028
|
-
/* @__PURE__ */ (0,
|
|
9029
|
-
/* @__PURE__ */ (0,
|
|
9030
|
-
/* @__PURE__ */ (0,
|
|
9210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
|
|
9211
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
|
|
9212
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
|
|
9213
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconPlusOutline16, { size: 17 }) })
|
|
9031
9214
|
] }),
|
|
9032
|
-
/* @__PURE__ */ (0,
|
|
9033
|
-
/* @__PURE__ */ (0,
|
|
9034
|
-
/* @__PURE__ */ (0,
|
|
9035
|
-
/* @__PURE__ */ (0,
|
|
9215
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
|
|
9216
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
|
|
9217
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconBrowseOutline16, { size: 16 }),
|
|
9218
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "Skill" })
|
|
9036
9219
|
] }),
|
|
9037
|
-
/* @__PURE__ */ (0,
|
|
9038
|
-
/* @__PURE__ */ (0,
|
|
9039
|
-
/* @__PURE__ */ (0,
|
|
9220
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
|
|
9221
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconListPenOutline16, { size: 16 }),
|
|
9222
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "\u770B\u677F" })
|
|
9040
9223
|
] }),
|
|
9041
|
-
/* @__PURE__ */ (0,
|
|
9042
|
-
/* @__PURE__ */ (0,
|
|
9043
|
-
/* @__PURE__ */ (0,
|
|
9224
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
|
|
9225
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconPlayOutline16, { size: 16 }),
|
|
9226
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "\u5B9A\u65F6" })
|
|
9044
9227
|
] }),
|
|
9045
|
-
/* @__PURE__ */ (0,
|
|
9046
|
-
/* @__PURE__ */ (0,
|
|
9047
|
-
/* @__PURE__ */ (0,
|
|
9228
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconEditOutline16, { size: 16 }),
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "\u5361\u7247" })
|
|
9048
9231
|
] })
|
|
9049
9232
|
] })
|
|
9050
9233
|
] });
|
|
@@ -9057,77 +9240,77 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
9057
9240
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
9058
9241
|
const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
|
|
9059
9242
|
const online = channel?.runtimeStatus === "running";
|
|
9060
|
-
return /* @__PURE__ */ (0,
|
|
9061
|
-
/* @__PURE__ */ (0,
|
|
9062
|
-
/* @__PURE__ */ (0,
|
|
9063
|
-
/* @__PURE__ */ (0,
|
|
9064
|
-
/* @__PURE__ */ (0,
|
|
9243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
9244
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
9245
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9246
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
|
|
9247
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
|
|
9065
9248
|
] }),
|
|
9066
|
-
/* @__PURE__ */ (0,
|
|
9249
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
|
|
9067
9250
|
] }),
|
|
9068
|
-
/* @__PURE__ */ (0,
|
|
9069
|
-
/* @__PURE__ */ (0,
|
|
9070
|
-
/* @__PURE__ */ (0,
|
|
9071
|
-
/* @__PURE__ */ (0,
|
|
9072
|
-
/* @__PURE__ */ (0,
|
|
9251
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
|
|
9252
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
|
|
9253
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Avatar, { name: companion.name }),
|
|
9254
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", {}) }),
|
|
9255
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WeixinGlyph, { large: true }) })
|
|
9073
9256
|
] }),
|
|
9074
|
-
/* @__PURE__ */ (0,
|
|
9075
|
-
/* @__PURE__ */ (0,
|
|
9076
|
-
/* @__PURE__ */ (0,
|
|
9257
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
|
|
9258
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
|
|
9259
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", {}),
|
|
9077
9260
|
"\u6D88\u606F\u6E20\u9053 \xB7 ",
|
|
9078
9261
|
channel?.platform === "matrix" ? "Matrix" : channel?.platform === "mattermost" ? "Mattermost" : "\u5FAE\u4FE1"
|
|
9079
9262
|
] }),
|
|
9080
|
-
/* @__PURE__ */ (0,
|
|
9081
|
-
/* @__PURE__ */ (0,
|
|
9082
|
-
/* @__PURE__ */ (0,
|
|
9083
|
-
/* @__PURE__ */ (0,
|
|
9084
|
-
/* @__PURE__ */ (0,
|
|
9263
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
|
|
9264
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
|
|
9265
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
|
|
9266
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
|
|
9267
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
|
|
9085
9268
|
] })
|
|
9086
9269
|
] })
|
|
9087
9270
|
] }),
|
|
9088
|
-
/* @__PURE__ */ (0,
|
|
9089
|
-
/* @__PURE__ */ (0,
|
|
9090
|
-
/* @__PURE__ */ (0,
|
|
9091
|
-
/* @__PURE__ */ (0,
|
|
9092
|
-
/* @__PURE__ */ (0,
|
|
9093
|
-
/* @__PURE__ */ (0,
|
|
9094
|
-
/* @__PURE__ */ (0,
|
|
9271
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-home-details", children: [
|
|
9272
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: "dsh-partner-home-profile", children: [
|
|
9273
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { children: [
|
|
9274
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconUserOutline16, { size: 16 }) }),
|
|
9275
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
9276
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
|
|
9277
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: companion.role })
|
|
9095
9278
|
] }),
|
|
9096
|
-
/* @__PURE__ */ (0,
|
|
9279
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
|
|
9097
9280
|
] }),
|
|
9098
|
-
/* @__PURE__ */ (0,
|
|
9281
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
|
|
9099
9282
|
] }),
|
|
9100
|
-
/* @__PURE__ */ (0,
|
|
9101
|
-
/* @__PURE__ */ (0,
|
|
9102
|
-
/* @__PURE__ */ (0,
|
|
9103
|
-
/* @__PURE__ */ (0,
|
|
9104
|
-
/* @__PURE__ */ (0,
|
|
9105
|
-
/* @__PURE__ */ (0,
|
|
9283
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
|
|
9284
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { children: [
|
|
9285
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconAgentPresetOutline16, { size: 16 }) }),
|
|
9286
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
9287
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
|
|
9288
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
|
|
9106
9289
|
] }),
|
|
9107
|
-
/* @__PURE__ */ (0,
|
|
9290
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
|
|
9108
9291
|
] }),
|
|
9109
|
-
/* @__PURE__ */ (0,
|
|
9292
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
|
|
9110
9293
|
] }),
|
|
9111
|
-
/* @__PURE__ */ (0,
|
|
9112
|
-
/* @__PURE__ */ (0,
|
|
9113
|
-
/* @__PURE__ */ (0,
|
|
9114
|
-
/* @__PURE__ */ (0,
|
|
9115
|
-
/* @__PURE__ */ (0,
|
|
9116
|
-
/* @__PURE__ */ (0,
|
|
9294
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
|
|
9295
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { children: [
|
|
9296
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconDataOutline16, { size: 16 }) }),
|
|
9297
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
9298
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
|
|
9299
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
|
|
9117
9300
|
] }),
|
|
9118
|
-
/* @__PURE__ */ (0,
|
|
9301
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
|
|
9119
9302
|
] }),
|
|
9120
|
-
/* @__PURE__ */ (0,
|
|
9303
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
|
|
9121
9304
|
] })
|
|
9122
9305
|
] })
|
|
9123
9306
|
] });
|
|
9124
9307
|
}
|
|
9125
9308
|
function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
9126
9309
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id && (!item.platform || item.platform === "weixin"));
|
|
9127
|
-
const [login, setLogin] = (0,
|
|
9128
|
-
const [busy, setBusy] = (0,
|
|
9129
|
-
const [error, setError] = (0,
|
|
9130
|
-
(0,
|
|
9310
|
+
const [login, setLogin] = (0, import_react43.useState)();
|
|
9311
|
+
const [busy, setBusy] = (0, import_react43.useState)(false);
|
|
9312
|
+
const [error, setError] = (0, import_react43.useState)();
|
|
9313
|
+
(0, import_react43.useEffect)(() => {
|
|
9131
9314
|
if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
|
|
9132
9315
|
const timer2 = window.setInterval(() => {
|
|
9133
9316
|
void api(`/weixin/login/${login.id}`).then(async (result) => {
|
|
@@ -9173,93 +9356,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
9173
9356
|
setError(errorMessage(reason));
|
|
9174
9357
|
}
|
|
9175
9358
|
};
|
|
9176
|
-
return /* @__PURE__ */ (0,
|
|
9177
|
-
/* @__PURE__ */ (0,
|
|
9178
|
-
!channel && !login && /* @__PURE__ */ (0,
|
|
9179
|
-
/* @__PURE__ */ (0,
|
|
9180
|
-
/* @__PURE__ */ (0,
|
|
9181
|
-
/* @__PURE__ */ (0,
|
|
9359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
|
|
9360
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
|
|
9361
|
+
!channel && !login && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
|
|
9362
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WeixinGlyph, { large: true }) }),
|
|
9363
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9364
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("strong", { children: [
|
|
9182
9365
|
"\u628A ",
|
|
9183
9366
|
companion.name,
|
|
9184
9367
|
" \u5E26\u5230\u5FAE\u4FE1"
|
|
9185
9368
|
] }),
|
|
9186
|
-
/* @__PURE__ */ (0,
|
|
9187
|
-
/* @__PURE__ */ (0,
|
|
9188
|
-
/* @__PURE__ */ (0,
|
|
9189
|
-
/* @__PURE__ */ (0,
|
|
9190
|
-
/* @__PURE__ */ (0,
|
|
9369
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
|
|
9370
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("ul", { children: [
|
|
9371
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
|
|
9372
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
|
|
9373
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
|
|
9191
9374
|
] })
|
|
9192
9375
|
] }),
|
|
9193
|
-
/* @__PURE__ */ (0,
|
|
9376
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
9194
9377
|
void begin();
|
|
9195
9378
|
}, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
|
|
9196
9379
|
] }),
|
|
9197
|
-
login && /* @__PURE__ */ (0,
|
|
9198
|
-
/* @__PURE__ */ (0,
|
|
9199
|
-
/* @__PURE__ */ (0,
|
|
9200
|
-
/* @__PURE__ */ (0,
|
|
9201
|
-
/* @__PURE__ */ (0,
|
|
9202
|
-
/* @__PURE__ */ (0,
|
|
9203
|
-
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0,
|
|
9380
|
+
login && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
|
|
9381
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
|
|
9382
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9383
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "WECHAT ILINK BOT" }),
|
|
9384
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
|
|
9385
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
|
|
9386
|
+
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { type: "button", onClick: () => {
|
|
9204
9387
|
setLogin(void 0);
|
|
9205
9388
|
void begin();
|
|
9206
9389
|
}, children: [
|
|
9207
|
-
/* @__PURE__ */ (0,
|
|
9390
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconRefreshOutline16, { size: 16 }),
|
|
9208
9391
|
"\u91CD\u65B0\u751F\u6210"
|
|
9209
9392
|
] })
|
|
9210
9393
|
] })
|
|
9211
9394
|
] }),
|
|
9212
|
-
channel && /* @__PURE__ */ (0,
|
|
9213
|
-
/* @__PURE__ */ (0,
|
|
9214
|
-
/* @__PURE__ */ (0,
|
|
9215
|
-
/* @__PURE__ */ (0,
|
|
9216
|
-
/* @__PURE__ */ (0,
|
|
9217
|
-
/* @__PURE__ */ (0,
|
|
9218
|
-
/* @__PURE__ */ (0,
|
|
9395
|
+
channel && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
9396
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
|
|
9397
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WeixinGlyph, { large: true }) }),
|
|
9398
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9399
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "WECHAT CHANNEL" }),
|
|
9400
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: channel.name }),
|
|
9401
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: channel.accountId })
|
|
9219
9402
|
] }),
|
|
9220
|
-
/* @__PURE__ */ (0,
|
|
9221
|
-
/* @__PURE__ */ (0,
|
|
9403
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChannelStatus, { channel }),
|
|
9404
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
|
|
9222
9405
|
void toggle();
|
|
9223
|
-
}, children: /* @__PURE__ */ (0,
|
|
9406
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("i", {}) })
|
|
9224
9407
|
] }),
|
|
9225
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
9226
|
-
/* @__PURE__ */ (0,
|
|
9227
|
-
/* @__PURE__ */ (0,
|
|
9228
|
-
/* @__PURE__ */ (0,
|
|
9229
|
-
/* @__PURE__ */ (0,
|
|
9408
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
|
|
9409
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
9411
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "ACCESS" }),
|
|
9412
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
|
|
9230
9413
|
] }),
|
|
9231
|
-
/* @__PURE__ */ (0,
|
|
9414
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("em", { children: [
|
|
9232
9415
|
pairings.filter((item) => item.status === "pending").length,
|
|
9233
9416
|
" \u4E2A\u5F85\u5904\u7406"
|
|
9234
9417
|
] })
|
|
9235
9418
|
] }),
|
|
9236
|
-
/* @__PURE__ */ (0,
|
|
9237
|
-
/* @__PURE__ */ (0,
|
|
9238
|
-
/* @__PURE__ */ (0,
|
|
9239
|
-
/* @__PURE__ */ (0,
|
|
9240
|
-
/* @__PURE__ */ (0,
|
|
9419
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA", detail: "\u6709\u4EBA\u9996\u6B21\u5411\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u540E\uFF0C\u914D\u5BF9\u8BF7\u6C42\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("article", { children: [
|
|
9420
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_dsh_client_ui_primitives21.IconUserOutline16, { size: 16 }) }),
|
|
9421
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
9422
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: pairing.displayName }),
|
|
9423
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("small", { children: [
|
|
9241
9424
|
pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
|
|
9242
9425
|
" \xB7 ",
|
|
9243
9426
|
new Date(pairing.updatedAt).toLocaleString()
|
|
9244
9427
|
] })
|
|
9245
9428
|
] }),
|
|
9246
|
-
pairing.status === "pending" && /* @__PURE__ */ (0,
|
|
9247
|
-
/* @__PURE__ */ (0,
|
|
9429
|
+
pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
9430
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { onClick: () => {
|
|
9248
9431
|
void actPairing(pairing.id, "blocked");
|
|
9249
9432
|
}, children: "\u62D2\u7EDD" }),
|
|
9250
|
-
/* @__PURE__ */ (0,
|
|
9433
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { className: "is-primary", onClick: () => {
|
|
9251
9434
|
void actPairing(pairing.id, "approved");
|
|
9252
9435
|
}, children: "\u6279\u51C6" })
|
|
9253
9436
|
] }),
|
|
9254
|
-
pairing.status === "approved" && /* @__PURE__ */ (0,
|
|
9437
|
+
pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { onClick: () => {
|
|
9255
9438
|
void actPairing(pairing.id, "blocked");
|
|
9256
9439
|
}, children: "\u64A4\u9500" }),
|
|
9257
|
-
pairing.status === "blocked" && /* @__PURE__ */ (0,
|
|
9440
|
+
pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { onClick: () => {
|
|
9258
9441
|
void actPairing(pairing.id, "approved");
|
|
9259
9442
|
}, children: "\u91CD\u65B0\u6279\u51C6" })
|
|
9260
9443
|
] }, pairing.id)) })
|
|
9261
9444
|
] }),
|
|
9262
|
-
error && /* @__PURE__ */ (0,
|
|
9445
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "dsh-partner-inline-error", children: error })
|
|
9263
9446
|
] });
|
|
9264
9447
|
}
|
|
9265
9448
|
function installStyles() {
|