dsh-dock 0.20.0 → 0.21.1
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 +14 -10
- package/client.js +1164 -666
- package/features/animation/view.jsx +81 -4
- package/features/balance/view.js +9 -6
- package/features/notify/host.js +50 -15
- package/features/notify/view.jsx +713 -367
- package/features/tokenlog/view.jsx +9 -3
- package/package.json +1 -1
- package/screenshots/dock-notify.png +0 -0
- package/src/client.jsx +182 -106
- package/src/host-core.js +6 -0
package/client.js
CHANGED
|
@@ -3743,7 +3743,10 @@ function TokenLogChip(props) {
|
|
|
3743
3743
|
if (!sid) return null;
|
|
3744
3744
|
const t = snap.totals;
|
|
3745
3745
|
const gone = isTokenlogRouteGone();
|
|
3746
|
-
const
|
|
3746
|
+
const hasData = !!t && !gone && !(snap.err && !t);
|
|
3747
|
+
const labelIcon = hasData ? "\u26C1 " : "";
|
|
3748
|
+
const labelMain = gone ? "\u7528\u91CF\xB7\u672A\u542F\u7528" : snap.err && !t ? snap.err.includes("\u91CD\u542F") || snap.err.includes("\u542F\u7528") ? "\u7528\u91CF\xB7\u672A\u542F\u7528" : "\u7528\u91CF\xB7\u5931\u8D25" : t ? fmtCompact(t.totalTokens) : "\u2026";
|
|
3749
|
+
const labelExtra = hasData && t.cost > 0 ? " \xB7 " + fmtCostCny(t.cost, snap.rate) : "";
|
|
3747
3750
|
const title = gone ? routeGoneMessage() + "\n\uFF08\u53EF\u5728\u529F\u80FD\u575E\u91CC\u542F\u7528\u300C\u7528\u91CF\u8BB0\u5F55\u300D\uFF09" : t ? "\u672C\u4F1A\u8BDD " + fmtNum(t.calls) + " \u6B21\u8C03\u7528 \xB7 " + fmtNum(t.totalTokens) + " Token \xB7 " + fmtCostCny(t.cost, snap.rate) + "\uFF08\u4F30\u7B97\uFF09\n\u70B9\u51FB\u5728\u529F\u80FD\u575E\u67E5\u770B\u7528\u91CF\u8BB0\u5F55" : (snap.err ? snap.err + "\n" : "") + "\u70B9\u51FB\u5728\u529F\u80FD\u575E\u67E5\u770B\u7528\u91CF\u8BB0\u5F55";
|
|
3748
3751
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
3749
3752
|
"button",
|
|
@@ -3755,7 +3758,10 @@ function TokenLogChip(props) {
|
|
|
3755
3758
|
onClick: () => openPanel("tokenlog", { sessionId: sid, navAt: Date.now() }),
|
|
3756
3759
|
children: [
|
|
3757
3760
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-dot", style: { background: gone ? "var(--dsw-alias-label-tertiary,#8b95ab)" : "var(--dk-warn)" } }),
|
|
3758
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children:
|
|
3761
|
+
labelIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-ic", children: labelIcon }) : null,
|
|
3762
|
+
hasData ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-pre-s", children: "\u7528\u91CF " }) : null,
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: labelMain }),
|
|
3764
|
+
labelExtra ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dockchip-x", children: labelExtra }) : null
|
|
3759
3765
|
]
|
|
3760
3766
|
}
|
|
3761
3767
|
);
|
|
@@ -5438,10 +5444,10 @@ function chipBalanceText(p) {
|
|
|
5438
5444
|
const b = p && p.balance;
|
|
5439
5445
|
if (!b) return "\u4F59\u989D \u2026";
|
|
5440
5446
|
if (b.status !== "ok") {
|
|
5441
|
-
if (b.status === "login-required") return "\u4F59\u989D\
|
|
5442
|
-
if (b.status === "no-credential") return "\u4F59\u989D\
|
|
5443
|
-
if (b.status === "unsupported") return "\u4F59\u989D\
|
|
5444
|
-
return "\u4F59\u989D\
|
|
5447
|
+
if (b.status === "login-required") return "\u4F59\u989D \u9700\u767B\u5F55";
|
|
5448
|
+
if (b.status === "no-credential") return "\u4F59\u989D \u65E0\u5BC6\u94A5";
|
|
5449
|
+
if (b.status === "unsupported") return "\u4F59\u989D \u4E0D\u652F\u6301";
|
|
5450
|
+
return "\u4F59\u989D \u67E5\u8BE2\u5931\u8D25";
|
|
5445
5451
|
}
|
|
5446
5452
|
if (b.kind === "quota") {
|
|
5447
5453
|
const v2 = Number(b.remaining);
|
|
@@ -5464,9 +5470,10 @@ function BalanceChip(props) {
|
|
|
5464
5470
|
const def = selProvider || (data && data.default ? data.default.provider : null);
|
|
5465
5471
|
const cur = def ? providers.find((p) => p.id === def) : null;
|
|
5466
5472
|
const accent = cur ? accentOf(cur.id) : "#64748b";
|
|
5467
|
-
const text = snap.error ? "\u4F59\u989D\
|
|
5473
|
+
const text = snap.error ? "\u4F59\u989D \u5931\u8D25" : !data ? snap.loading ? "\u4F59\u989D \u2026" : "\u4F59\u989D \u2014" : cur ? chipBalanceText(cur) : "\u4F59\u989D \u2014";
|
|
5468
5474
|
const selModel = sel && (sel.model || sel.selected && sel.selected.model) || null;
|
|
5469
5475
|
const title = cur ? (cur.displayName || cur.id) + (selModel ? " \xB7 \u5F53\u524D\u6A21\u578B " + selModel : "") + " \xB7 \u70B9\u51FB\u5728\u529F\u80FD\u575E\u67E5\u770B\u4F59\u989D\u8BE6\u60C5" : "\u70B9\u51FB\u6253\u5F00\u529F\u80FD\u575E \xB7 \u6A21\u578B\u4F59\u989D";
|
|
5476
|
+
const mm = /^(余额 )([\s\S]*)$/.exec(text);
|
|
5470
5477
|
return import_react8.default.createElement(
|
|
5471
5478
|
"button",
|
|
5472
5479
|
{
|
|
@@ -5477,7 +5484,9 @@ function BalanceChip(props) {
|
|
|
5477
5484
|
onClick: () => openPanel("balance", def ? { provider: def } : null)
|
|
5478
5485
|
},
|
|
5479
5486
|
import_react8.default.createElement("span", { className: "dockchip-dot", style: { background: accent } }),
|
|
5480
|
-
import_react8.default.createElement("span",
|
|
5487
|
+
mm ? import_react8.default.createElement("span", { className: "dockchip-pre" }, mm[1]) : null,
|
|
5488
|
+
mm ? import_react8.default.createElement("span", { className: "dockchip-pre-s" }, "\u4F59\u989D ") : null,
|
|
5489
|
+
import_react8.default.createElement("span", null, mm ? mm[2] : text)
|
|
5481
5490
|
);
|
|
5482
5491
|
}
|
|
5483
5492
|
var feature6 = {
|
|
@@ -6517,6 +6526,85 @@ function AnimationOverlay(props) {
|
|
|
6517
6526
|
}, 0);
|
|
6518
6527
|
}
|
|
6519
6528
|
};
|
|
6529
|
+
const [badgePos, setBadgePos] = (0, import_react9.useState)(null);
|
|
6530
|
+
const badgePosRef = (0, import_react9.useRef)(null);
|
|
6531
|
+
const badgeDragRef = (0, import_react9.useRef)(null);
|
|
6532
|
+
const badgeClickBlockRef = (0, import_react9.useRef)(false);
|
|
6533
|
+
(0, import_react9.useEffect)(() => {
|
|
6534
|
+
try {
|
|
6535
|
+
if (typeof localStorage === "undefined") return;
|
|
6536
|
+
const raw = localStorage.getItem("dsh-dock/anim/badge-pos/v1");
|
|
6537
|
+
const p2 = raw ? JSON.parse(raw) : null;
|
|
6538
|
+
if (p2 && typeof p2.x === "number" && typeof p2.y === "number" && typeof window !== "undefined") {
|
|
6539
|
+
const card = document.querySelector(".dkan-badge");
|
|
6540
|
+
const w = card ? card.offsetWidth : 180, h = card ? card.offsetHeight : 34;
|
|
6541
|
+
const x = Math.min(Math.max(8, p2.x), Math.max(8, window.innerWidth - w - 8));
|
|
6542
|
+
const y = Math.min(Math.max(8, p2.y), Math.max(8, window.innerHeight - h - 8));
|
|
6543
|
+
badgePosRef.current = { x, y };
|
|
6544
|
+
setBadgePos({ x, y });
|
|
6545
|
+
}
|
|
6546
|
+
} catch {
|
|
6547
|
+
}
|
|
6548
|
+
}, []);
|
|
6549
|
+
const onBadgePointerDown = (e) => {
|
|
6550
|
+
if (e.button !== 0) return;
|
|
6551
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
6552
|
+
badgeDragRef.current = { sx: e.clientX, sy: e.clientY, ox: r.left, oy: r.top, moved: false };
|
|
6553
|
+
try {
|
|
6554
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
6555
|
+
} catch {
|
|
6556
|
+
}
|
|
6557
|
+
};
|
|
6558
|
+
const onBadgePointerMove = (e) => {
|
|
6559
|
+
const d = badgeDragRef.current;
|
|
6560
|
+
if (!d || typeof window === "undefined") return;
|
|
6561
|
+
const dx = e.clientX - d.sx, dy = e.clientY - d.sy;
|
|
6562
|
+
if (!d.moved && Math.hypot(dx, dy) < 4) return;
|
|
6563
|
+
d.moved = true;
|
|
6564
|
+
const el = e.currentTarget;
|
|
6565
|
+
const w = el.offsetWidth || 180, h = el.offsetHeight || 34;
|
|
6566
|
+
const x = Math.min(Math.max(8, d.ox + dx), window.innerWidth - w - 8);
|
|
6567
|
+
const y = Math.min(Math.max(8, d.oy + dy), window.innerHeight - h - 8);
|
|
6568
|
+
badgePosRef.current = { x, y };
|
|
6569
|
+
setBadgePos({ x, y });
|
|
6570
|
+
};
|
|
6571
|
+
const onBadgePointerUp = () => {
|
|
6572
|
+
const d = badgeDragRef.current;
|
|
6573
|
+
badgeDragRef.current = null;
|
|
6574
|
+
if (d && d.moved) {
|
|
6575
|
+
try {
|
|
6576
|
+
if (typeof localStorage !== "undefined") localStorage.setItem("dsh-dock/anim/badge-pos/v1", JSON.stringify(badgePosRef.current));
|
|
6577
|
+
} catch {
|
|
6578
|
+
}
|
|
6579
|
+
badgeClickBlockRef.current = true;
|
|
6580
|
+
setTimeout(() => {
|
|
6581
|
+
badgeClickBlockRef.current = false;
|
|
6582
|
+
}, 0);
|
|
6583
|
+
}
|
|
6584
|
+
};
|
|
6585
|
+
const resetBadgePos = () => {
|
|
6586
|
+
try {
|
|
6587
|
+
if (typeof localStorage !== "undefined") localStorage.removeItem("dsh-dock/anim/badge-pos/v1");
|
|
6588
|
+
} catch {
|
|
6589
|
+
}
|
|
6590
|
+
badgePosRef.current = null;
|
|
6591
|
+
setBadgePos(null);
|
|
6592
|
+
};
|
|
6593
|
+
const badgeClickTimer = (0, import_react9.useRef)(null);
|
|
6594
|
+
const onBadgeClick = () => {
|
|
6595
|
+
if (badgeClickBlockRef.current) return;
|
|
6596
|
+
if (badgeClickTimer.current) {
|
|
6597
|
+
clearTimeout(badgeClickTimer.current);
|
|
6598
|
+
badgeClickTimer.current = null;
|
|
6599
|
+
resetBadgePos();
|
|
6600
|
+
return;
|
|
6601
|
+
}
|
|
6602
|
+
badgeClickTimer.current = setTimeout(() => {
|
|
6603
|
+
badgeClickTimer.current = null;
|
|
6604
|
+
openPanel("animation");
|
|
6605
|
+
}, 240);
|
|
6606
|
+
};
|
|
6607
|
+
const badgeStyle = badgePos ? Object.assign({}, speedStyle, { "--dkan-phase": phaseColor(waitingTask ? "code" : phase), left: badgePos.x, top: badgePos.y, right: "auto", bottom: "auto" }) : Object.assign({}, speedStyle, { "--dkan-phase": phaseColor(waitingTask ? "code" : phase) });
|
|
6520
6608
|
const onBotResizePointerDown = (e) => {
|
|
6521
6609
|
if (e.button !== 0) return;
|
|
6522
6610
|
e.preventDefault();
|
|
@@ -6628,9 +6716,13 @@ function AnimationOverlay(props) {
|
|
|
6628
6716
|
{
|
|
6629
6717
|
type: "button",
|
|
6630
6718
|
className: "dkan-badge" + (mode === "breathe" ? " dkan-badge-breathe" : ""),
|
|
6631
|
-
style:
|
|
6632
|
-
title: active.length + " \u4E2A\u4EFB\u52A1\u8FDB\u884C\u4E2D \xB7 " + (waitingTask ? waitWord : phaseLabel(phase)) + " \xB7 \u70B9\u51FB\u67E5\u770B\u4EFB\u52A1\u52A8\u753B\u9875",
|
|
6633
|
-
|
|
6719
|
+
style: badgeStyle,
|
|
6720
|
+
title: active.length + " \u4E2A\u4EFB\u52A1\u8FDB\u884C\u4E2D \xB7 " + (waitingTask ? waitWord : phaseLabel(phase)) + " \xB7 \u70B9\u51FB\u67E5\u770B\u4EFB\u52A1\u52A8\u753B\u9875 \xB7 \u53EF\u62D6\u52A8\u5230\u4EFB\u610F\u4F4D\u7F6E\uFF0C\u53CC\u51FB\u590D\u4F4D",
|
|
6721
|
+
onPointerDown: onBadgePointerDown,
|
|
6722
|
+
onPointerMove: onBadgePointerMove,
|
|
6723
|
+
onPointerUp: onBadgePointerUp,
|
|
6724
|
+
onPointerCancel: onBadgePointerUp,
|
|
6725
|
+
onClick: onBadgeClick,
|
|
6634
6726
|
children: [
|
|
6635
6727
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dkan-dotwrap", children: [
|
|
6636
6728
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dkan-dot" }),
|
|
@@ -6953,7 +7045,7 @@ var css2 = [
|
|
|
6953
7045
|
".dkan-fx-confetti i{position:absolute;top:-14px;width:8px;height:13px;border-radius:2px;box-shadow:0 0 4px currentColor;animation:dkan-confetti 2s var(--ds-ease-in-out) forwards;}",
|
|
6954
7046
|
"@keyframes dkan-confetti{0%{opacity:1;transform:translateY(0) rotate(0)}100%{opacity:0;transform:translateY(75vh) translateX(var(--dx)) rotate(var(--r))}}",
|
|
6955
7047
|
// 右下角状态徽标(玻璃拟态,可点击);抬到 dsh 输入卡上方避免重叠错位
|
|
6956
|
-
".dkan-badge{position:fixed;right:20px;bottom:calc(var(--dsh-composer-height,152px) + 20px);z-index:2;display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;cursor:
|
|
7048
|
+
".dkan-badge{position:fixed;right:20px;bottom:calc(var(--dsh-composer-height,152px) + 20px);z-index:2;display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;border:1px solid var(--dsw-alias-border-l1);background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 78%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:0 6px 24px rgb(0 0 0 / .16);color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;line-height:18px;pointer-events:auto;animation:dkan-rise .3s var(--ds-ease-in-out);transition:color .15s var(--ds-ease-in-out);}",
|
|
6957
7049
|
".dkan-badge:hover{color:var(--dsw-alias-label-primary);}",
|
|
6958
7050
|
".dkan-badge .n{color:var(--dsw-alias-label-primary);font-weight:600;}",
|
|
6959
7051
|
"@keyframes dkan-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}",
|
|
@@ -7387,6 +7479,130 @@ function useVoiceClientEnabled() {
|
|
|
7387
7479
|
}, []);
|
|
7388
7480
|
return [on, set];
|
|
7389
7481
|
}
|
|
7482
|
+
var CONFIG_SOURCE_KEY = "dsh-dock/notify/config-source/v1";
|
|
7483
|
+
var CLIENT_CONFIG_KEY = "dsh-dock/notify/client-config/v1";
|
|
7484
|
+
var CLIENT_CONFIG_FIELDS = [
|
|
7485
|
+
"notifyOnComplete",
|
|
7486
|
+
"notifyOnError",
|
|
7487
|
+
"notifyOnConfirm",
|
|
7488
|
+
"notifyOnStuck",
|
|
7489
|
+
"notifyCards",
|
|
7490
|
+
"cardMode",
|
|
7491
|
+
"notifyStayMs",
|
|
7492
|
+
"soundNotify",
|
|
7493
|
+
"soundEffect",
|
|
7494
|
+
"systemNotify",
|
|
7495
|
+
"voiceMode",
|
|
7496
|
+
"voiceOnComplete",
|
|
7497
|
+
"voiceOnError",
|
|
7498
|
+
"voiceOnConfirm",
|
|
7499
|
+
"voiceOnStuck",
|
|
7500
|
+
"voiceRate",
|
|
7501
|
+
"voiceVolume",
|
|
7502
|
+
"voiceLang",
|
|
7503
|
+
"voiceURI"
|
|
7504
|
+
];
|
|
7505
|
+
function notifyConfigSource() {
|
|
7506
|
+
try {
|
|
7507
|
+
if (typeof localStorage === "undefined") return "server";
|
|
7508
|
+
return localStorage.getItem(CONFIG_SOURCE_KEY) === "client" ? "client" : "server";
|
|
7509
|
+
} catch {
|
|
7510
|
+
return "server";
|
|
7511
|
+
}
|
|
7512
|
+
}
|
|
7513
|
+
function setNotifyConfigSource(source) {
|
|
7514
|
+
try {
|
|
7515
|
+
if (typeof localStorage !== "undefined") localStorage.setItem(CONFIG_SOURCE_KEY, source === "client" ? "client" : "server");
|
|
7516
|
+
} catch {
|
|
7517
|
+
}
|
|
7518
|
+
}
|
|
7519
|
+
function readClientNotifyConfig() {
|
|
7520
|
+
try {
|
|
7521
|
+
if (typeof localStorage === "undefined") return null;
|
|
7522
|
+
const raw = localStorage.getItem(CLIENT_CONFIG_KEY);
|
|
7523
|
+
const obj = raw ? JSON.parse(raw) : null;
|
|
7524
|
+
return obj && typeof obj === "object" && !Array.isArray(obj) ? obj : null;
|
|
7525
|
+
} catch {
|
|
7526
|
+
return null;
|
|
7527
|
+
}
|
|
7528
|
+
}
|
|
7529
|
+
function writeClientNotifyConfig(cfg) {
|
|
7530
|
+
try {
|
|
7531
|
+
if (typeof localStorage !== "undefined") localStorage.setItem(CLIENT_CONFIG_KEY, JSON.stringify(cfg || {}));
|
|
7532
|
+
} catch {
|
|
7533
|
+
}
|
|
7534
|
+
}
|
|
7535
|
+
function pickClientConfig(serverCfg) {
|
|
7536
|
+
const src = serverCfg || {};
|
|
7537
|
+
const out = {};
|
|
7538
|
+
for (const key of CLIENT_CONFIG_FIELDS) {
|
|
7539
|
+
if (src[key] !== void 0) out[key] = src[key];
|
|
7540
|
+
}
|
|
7541
|
+
const matrix = {};
|
|
7542
|
+
const m = src.eventMatrix;
|
|
7543
|
+
if (m && typeof m === "object") {
|
|
7544
|
+
for (const [key, value] of Object.entries(m)) {
|
|
7545
|
+
if (typeof value === "boolean" && /^(card|sound|system|voice):/.test(key)) matrix[key] = value;
|
|
7546
|
+
}
|
|
7547
|
+
}
|
|
7548
|
+
out.eventMatrix = matrix;
|
|
7549
|
+
return out;
|
|
7550
|
+
}
|
|
7551
|
+
function mergeClientNotifyConfig(serverCfg, localCfg) {
|
|
7552
|
+
const server = serverCfg || {};
|
|
7553
|
+
const cfg = Object.assign({}, server, localCfg || {});
|
|
7554
|
+
for (const key of ["dingtalkEnabled", "dingtalkWebhook", "feishuEnabled", "feishuWebhook", "pushMode"]) {
|
|
7555
|
+
cfg[key] = server[key];
|
|
7556
|
+
}
|
|
7557
|
+
cfg.voiceNotify = server.voiceNotify === true;
|
|
7558
|
+
const matrix = Object.assign({}, server.eventMatrix || {});
|
|
7559
|
+
const localMatrix = localCfg && localCfg.eventMatrix || {};
|
|
7560
|
+
for (const [key, value] of Object.entries(localMatrix)) {
|
|
7561
|
+
if (typeof value === "boolean" && /^(card|sound|system|voice):/.test(key)) matrix[key] = value;
|
|
7562
|
+
}
|
|
7563
|
+
cfg.eventMatrix = matrix;
|
|
7564
|
+
return cfg;
|
|
7565
|
+
}
|
|
7566
|
+
function effectiveNotifyConfig(serverCfg) {
|
|
7567
|
+
const server = serverCfg || {};
|
|
7568
|
+
if (notifyConfigSource() !== "client") return server;
|
|
7569
|
+
const local = readClientNotifyConfig();
|
|
7570
|
+
if (!local) return server;
|
|
7571
|
+
return mergeClientNotifyConfig(server, local);
|
|
7572
|
+
}
|
|
7573
|
+
function useNotifyConfigSource() {
|
|
7574
|
+
const [source, setSource] = (0, import_react10.useState)(() => notifyConfigSource());
|
|
7575
|
+
const set = (0, import_react10.useCallback)((next) => {
|
|
7576
|
+
const value = next === "client" ? "client" : "server";
|
|
7577
|
+
setNotifyConfigSource(value);
|
|
7578
|
+
setSource(value);
|
|
7579
|
+
}, []);
|
|
7580
|
+
return [source, set];
|
|
7581
|
+
}
|
|
7582
|
+
var EVENT_CONFIG_KEY = {
|
|
7583
|
+
complete: "notifyOnComplete",
|
|
7584
|
+
error: "notifyOnError",
|
|
7585
|
+
confirm: "notifyOnConfirm",
|
|
7586
|
+
stuck: "notifyOnStuck"
|
|
7587
|
+
};
|
|
7588
|
+
var VOICE_EVENT_KEY = {
|
|
7589
|
+
complete: "voiceOnComplete",
|
|
7590
|
+
error: "voiceOnError",
|
|
7591
|
+
confirm: "voiceOnConfirm",
|
|
7592
|
+
stuck: "voiceOnStuck"
|
|
7593
|
+
};
|
|
7594
|
+
function eventEnabled(cfg, channel, event) {
|
|
7595
|
+
const key = channel + ":" + event;
|
|
7596
|
+
const matrix = cfg && cfg.eventMatrix;
|
|
7597
|
+
if (matrix && typeof matrix === "object" && typeof matrix[key] === "boolean") return matrix[key];
|
|
7598
|
+
if (channel === "voice") return !cfg || cfg[VOICE_EVENT_KEY[event]] !== false;
|
|
7599
|
+
return !cfg || cfg[EVENT_CONFIG_KEY[event]] !== false;
|
|
7600
|
+
}
|
|
7601
|
+
function withEventMatrix(cfg, channel, event, on) {
|
|
7602
|
+
const matrix = Object.assign({}, cfg && cfg.eventMatrix || {});
|
|
7603
|
+
matrix[channel + ":" + event] = !!on;
|
|
7604
|
+
return matrix;
|
|
7605
|
+
}
|
|
7390
7606
|
function localVoices() {
|
|
7391
7607
|
const s = synthOf();
|
|
7392
7608
|
if (!s) return [];
|
|
@@ -7618,6 +7834,12 @@ var notifyStore = {
|
|
|
7618
7834
|
this.emit();
|
|
7619
7835
|
}
|
|
7620
7836
|
},
|
|
7837
|
+
// 本机配置/配置来源变化:状态对象换一个浅拷贝,让订阅方(尤其浮层的 effect)重算。
|
|
7838
|
+
touch() {
|
|
7839
|
+
if (!this.snap.status) return;
|
|
7840
|
+
this.snap = Object.assign({}, this.snap, { status: Object.assign({}, this.snap.status) });
|
|
7841
|
+
this.emit();
|
|
7842
|
+
},
|
|
7621
7843
|
refresh() {
|
|
7622
7844
|
if (this.snap.loading) return Promise.resolve();
|
|
7623
7845
|
this.snap = Object.assign({}, this.snap, { loading: true });
|
|
@@ -7763,12 +7985,12 @@ function NotifyOverlay(props) {
|
|
|
7763
7985
|
const toastSeqRef = (0, import_react10.useRef)(0);
|
|
7764
7986
|
const pushToast = (0, import_react10.useCallback)((toast) => {
|
|
7765
7987
|
const st = notifyStore.snap.status;
|
|
7766
|
-
const cfg = st
|
|
7988
|
+
const cfg = st ? effectiveNotifyConfig(st.config) : null;
|
|
7767
7989
|
if (cfg && cfg.notifyCards === false) return;
|
|
7768
7990
|
setToasts((prev) => prev.concat([toast]).slice(-12));
|
|
7769
7991
|
}, []);
|
|
7770
7992
|
(0, import_react10.useEffect)(() => {
|
|
7771
|
-
const cfg = snap.status
|
|
7993
|
+
const cfg = snap.status ? effectiveNotifyConfig(snap.status.config) : null;
|
|
7772
7994
|
if (cfg && cfg.notifyCards === false) setToasts((prev) => prev.length ? [] : prev);
|
|
7773
7995
|
}, [snap.status]);
|
|
7774
7996
|
(0, import_react10.useEffect)(() => {
|
|
@@ -7800,7 +8022,7 @@ function NotifyOverlay(props) {
|
|
|
7800
8022
|
for (const task of prev) {
|
|
7801
8023
|
if (currIds.has(task.sessionId)) continue;
|
|
7802
8024
|
const record = (st.recent || []).find((r) => r.sessionId === task.sessionId) || null;
|
|
7803
|
-
handleTaskEnd(task, record, st.config || {});
|
|
8025
|
+
handleTaskEnd(task, record, effectiveNotifyConfig(st.config || {}));
|
|
7804
8026
|
}
|
|
7805
8027
|
}
|
|
7806
8028
|
prevActiveRef.current = st.active.slice();
|
|
@@ -7808,7 +8030,7 @@ function NotifyOverlay(props) {
|
|
|
7808
8030
|
(0, import_react10.useEffect)(() => {
|
|
7809
8031
|
const st = snap.status;
|
|
7810
8032
|
if (!st || !st.active) return;
|
|
7811
|
-
const cfg = st.config || {};
|
|
8033
|
+
const cfg = effectiveNotifyConfig(st.config || {});
|
|
7812
8034
|
const activeIds = new Set(st.active.map((x) => x.sessionId));
|
|
7813
8035
|
for (const [sid, seen] of remindedApprovalsRef.current) {
|
|
7814
8036
|
if (!activeIds.has(sid)) remindedApprovalsRef.current.delete(sid);
|
|
@@ -7824,10 +8046,10 @@ function NotifyOverlay(props) {
|
|
|
7824
8046
|
const fresh = approvals.filter((a) => a && !seen.has(a.id));
|
|
7825
8047
|
if (fresh.length === 0) continue;
|
|
7826
8048
|
for (const a of fresh) seen.add(a.id);
|
|
7827
|
-
if (voiceAllowed(cfg) && cfg
|
|
8049
|
+
if (voiceAllowed(cfg) && eventEnabled(cfg, "voice", "confirm")) {
|
|
7828
8050
|
speakVoice(confirmBroadcastText(task, fresh[0], cfg), cfg);
|
|
7829
8051
|
}
|
|
7830
|
-
if (cfg
|
|
8052
|
+
if (!eventEnabled(cfg, "card", "confirm")) continue;
|
|
7831
8053
|
const toolName = fresh[0].toolName || "";
|
|
7832
8054
|
const scene = toolLabel(toolName);
|
|
7833
8055
|
const tone = cardTone(cfg);
|
|
@@ -7853,8 +8075,8 @@ function NotifyOverlay(props) {
|
|
|
7853
8075
|
// 下面的对账 effect 据此自动收起卡片(处理完就不该再占着右上角)。
|
|
7854
8076
|
approvalKeys: fresh.filter((a) => a && a.id).map((a) => task.sessionId + "|" + a.id)
|
|
7855
8077
|
});
|
|
7856
|
-
if (cfg.soundNotify !== false) playAskSound(cfg.soundEffect);
|
|
7857
|
-
if (cfg.systemNotify && typeof document !== "undefined" && document.hidden && typeof Notification !== "undefined" && Notification.permission === "granted") {
|
|
8078
|
+
if (cfg.soundNotify !== false && eventEnabled(cfg, "sound", "confirm")) playAskSound(cfg.soundEffect);
|
|
8079
|
+
if (cfg.systemNotify && eventEnabled(cfg, "system", "confirm") && typeof document !== "undefined" && document.hidden && typeof Notification !== "undefined" && Notification.permission === "granted") {
|
|
7858
8080
|
try {
|
|
7859
8081
|
new Notification("dsh \u4EFB\u52A1\u9700\u8981\u786E\u8BA4", {
|
|
7860
8082
|
body: (task.title || "(\u65E0\u6807\u9898)") + " \xB7 " + (toolName || "\u5DE5\u5177") + " \u7B49\u5F85\u786E\u8BA4",
|
|
@@ -7868,7 +8090,7 @@ function NotifyOverlay(props) {
|
|
|
7868
8090
|
(0, import_react10.useEffect)(() => {
|
|
7869
8091
|
const st = snap.status;
|
|
7870
8092
|
if (!st || !st.active) return;
|
|
7871
|
-
const cfg = st.config || {};
|
|
8093
|
+
const cfg = effectiveNotifyConfig(st.config || {});
|
|
7872
8094
|
const activeIds = new Set(st.active.map((x) => x.sessionId));
|
|
7873
8095
|
for (const [sid, seen] of remindedQuestionsRef.current) {
|
|
7874
8096
|
if (!activeIds.has(sid)) remindedQuestionsRef.current.delete(sid);
|
|
@@ -7884,10 +8106,10 @@ function NotifyOverlay(props) {
|
|
|
7884
8106
|
const fresh = questions.filter((q) => q && q.id && !seen.has(q.id));
|
|
7885
8107
|
if (fresh.length === 0) continue;
|
|
7886
8108
|
for (const q of fresh) seen.add(q.id);
|
|
7887
|
-
if (voiceAllowed(cfg) && cfg
|
|
8109
|
+
if (voiceAllowed(cfg) && eventEnabled(cfg, "voice", "confirm")) {
|
|
7888
8110
|
speakVoice(questionBroadcastText(task, fresh[0], cfg), cfg);
|
|
7889
8111
|
}
|
|
7890
|
-
if (cfg
|
|
8112
|
+
if (!eventEnabled(cfg, "card", "confirm")) continue;
|
|
7891
8113
|
const tone = cardTone(cfg);
|
|
7892
8114
|
const head = fresh[0].header || "";
|
|
7893
8115
|
const body = fresh[0].question || "";
|
|
@@ -7908,8 +8130,8 @@ function NotifyOverlay(props) {
|
|
|
7908
8130
|
// 与这批提问绑定:回答落地后宿主把它们移出 questions,下面的对账 effect 据此收起
|
|
7909
8131
|
questionKeys: fresh.map((q) => task.sessionId + "|" + q.id)
|
|
7910
8132
|
});
|
|
7911
|
-
if (cfg.soundNotify !== false) playAskSound(cfg.soundEffect);
|
|
7912
|
-
if (cfg.systemNotify && typeof document !== "undefined" && document.hidden && typeof Notification !== "undefined" && Notification.permission === "granted") {
|
|
8133
|
+
if (cfg.soundNotify !== false && eventEnabled(cfg, "sound", "confirm")) playAskSound(cfg.soundEffect);
|
|
8134
|
+
if (cfg.systemNotify && eventEnabled(cfg, "system", "confirm") && typeof document !== "undefined" && document.hidden && typeof Notification !== "undefined" && Notification.permission === "granted") {
|
|
7913
8135
|
try {
|
|
7914
8136
|
new Notification("dsh \u4EFB\u52A1\u9700\u8981\u4F60\u56DE\u7B54", {
|
|
7915
8137
|
body: (task.title || "(\u65E0\u6807\u9898)") + " \xB7 " + (head || "\u6709\u4E00\u95EE\u5728\u7B49\u4F60\u9009\u62E9"),
|
|
@@ -7964,7 +8186,7 @@ function NotifyOverlay(props) {
|
|
|
7964
8186
|
(0, import_react10.useEffect)(() => {
|
|
7965
8187
|
const st = snap.status;
|
|
7966
8188
|
if (!st || !st.active) return;
|
|
7967
|
-
const cfg = st.config || {};
|
|
8189
|
+
const cfg = effectiveNotifyConfig(st.config || {});
|
|
7968
8190
|
const now = st.now || Date.now();
|
|
7969
8191
|
const activeIds = new Set(st.active.map((x) => x.sessionId));
|
|
7970
8192
|
for (const sid of Array.from(stuckSeenRef.current.keys())) {
|
|
@@ -7989,10 +8211,10 @@ function NotifyOverlay(props) {
|
|
|
7989
8211
|
const prev = stuckSeenRef.current.get(task.sessionId);
|
|
7990
8212
|
if (prev === lastAct) continue;
|
|
7991
8213
|
stuckSeenRef.current.set(task.sessionId, lastAct);
|
|
7992
|
-
if (voiceAllowed(cfg) && cfg
|
|
8214
|
+
if (voiceAllowed(cfg) && eventEnabled(cfg, "voice", "stuck")) {
|
|
7993
8215
|
speakVoice(stuckBroadcastText(task, Object.assign({}, cfg, { stuckMs })), cfg);
|
|
7994
8216
|
}
|
|
7995
|
-
if (cfg
|
|
8217
|
+
if (!eventEnabled(cfg, "card", "stuck")) continue;
|
|
7996
8218
|
const label = task.isSubtask ? "\u5B50\u4EFB\u52A1" : "\u4E3B\u4EFB\u52A1";
|
|
7997
8219
|
const title = task.title || "(\u65E0\u6807\u9898)";
|
|
7998
8220
|
const tool = task.lastToolName || "";
|
|
@@ -8038,43 +8260,48 @@ function NotifyOverlay(props) {
|
|
|
8038
8260
|
const reason = record && record.endReason || "";
|
|
8039
8261
|
const success = isSuccessReason2(reason);
|
|
8040
8262
|
const info = endInfo(reason);
|
|
8041
|
-
const
|
|
8042
|
-
|
|
8263
|
+
const event = success ? "complete" : "error";
|
|
8264
|
+
const cardWanted = eventEnabled(cfg, "card", event);
|
|
8265
|
+
const soundWanted = cfg.soundNotify !== false && eventEnabled(cfg, "sound", event);
|
|
8266
|
+
const systemWanted = !!cfg.systemNotify && eventEnabled(cfg, "system", event);
|
|
8267
|
+
if (voiceAllowed(cfg) && eventEnabled(cfg, "voice", event)) {
|
|
8043
8268
|
speakVoice(endBroadcastText(success, record, task, cfg), cfg);
|
|
8044
8269
|
}
|
|
8045
|
-
if (wanted === false) return;
|
|
8046
8270
|
const models = record && record.models && record.models.length ? record.models.join(", ") : task.models && task.models.length ? task.models.join(", ") : "\u672A\u77E5\u6A21\u578B";
|
|
8047
8271
|
const provider = record && record.provider || task.provider || "";
|
|
8048
8272
|
const startTs = record && record.startTime || task.startTime;
|
|
8049
8273
|
const endTs = record && record.endTime || Date.now();
|
|
8050
|
-
const tone = cardTone(cfg);
|
|
8051
8274
|
const durText = fmtDur(record && record.duration || endTs - startTs);
|
|
8052
|
-
const lines = ["\u4EFB\u52A1\uFF1A" + (record && record.title || task.title || "(\u65E0\u6807\u9898)")];
|
|
8053
|
-
if (tone !== "brief") lines.push("\u6A21\u578B\uFF1A" + models + (provider ? "\uFF08" + provider + "\uFF09" : ""));
|
|
8054
|
-
lines.push(tone === "brief" ? "\u8017\u65F6\uFF1A" + durText : "\u8017\u65F6\uFF1A" + durText + "\uFF08" + fmtTime2(startTs) + " \u2192 " + fmtTime2(endTs) + "\uFF09");
|
|
8055
|
-
if (tone === "detailed") {
|
|
8056
|
-
lines.push("\u56DE\u5408 " + (record && record.turns || task.turns || 0) + " \xB7 \u6B65\u9AA4 " + (record && record.steps || task.steps || 0) + (record && record.toolCalls || task.toolCalls ? " \xB7 \u5DE5\u5177 " + (record && record.toolCalls || task.toolCalls) + " \u6B21" : ""));
|
|
8057
|
-
lines.push("Token\uFF1A\u8F93\u5165 " + fmtNum2(record && record.inputTokens || task.inputTokens) + " / \u8F93\u51FA " + fmtNum2(record && record.outputTokens || task.outputTokens));
|
|
8058
|
-
if (record && record.lastText) lines.push("\u6458\u8981\uFF1A" + truncate2(record.lastText, 140));
|
|
8059
|
-
if (!success && record && record.errorMessage) lines.push("\u9519\u8BEF\uFF1A" + truncate2(record.errorMessage, 120));
|
|
8060
|
-
}
|
|
8061
8275
|
const title = success ? "\u4EFB\u52A1\u5B8C\u6210" : "\u4EFB\u52A1" + info.label;
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8276
|
+
const showTitle = record && record.title || task.title || "(\u65E0\u6807\u9898)";
|
|
8277
|
+
if (cardWanted) {
|
|
8278
|
+
const tone = cardTone(cfg);
|
|
8279
|
+
const lines = ["\u4EFB\u52A1\uFF1A" + showTitle];
|
|
8280
|
+
if (tone !== "brief") lines.push("\u6A21\u578B\uFF1A" + models + (provider ? "\uFF08" + provider + "\uFF09" : ""));
|
|
8281
|
+
lines.push(tone === "brief" ? "\u8017\u65F6\uFF1A" + durText : "\u8017\u65F6\uFF1A" + durText + "\uFF08" + fmtTime2(startTs) + " \u2192 " + fmtTime2(endTs) + "\uFF09");
|
|
8282
|
+
if (tone === "detailed") {
|
|
8283
|
+
lines.push("\u56DE\u5408 " + (record && record.turns || task.turns || 0) + " \xB7 \u6B65\u9AA4 " + (record && record.steps || task.steps || 0) + (record && record.toolCalls || task.toolCalls ? " \xB7 \u5DE5\u5177 " + (record && record.toolCalls || task.toolCalls) + " \u6B21" : ""));
|
|
8284
|
+
lines.push("Token\uFF1A\u8F93\u5165 " + fmtNum2(record && record.inputTokens || task.inputTokens) + " / \u8F93\u51FA " + fmtNum2(record && record.outputTokens || task.outputTokens));
|
|
8285
|
+
if (record && record.lastText) lines.push("\u6458\u8981\uFF1A" + truncate2(record.lastText, 140));
|
|
8286
|
+
if (!success && record && record.errorMessage) lines.push("\u9519\u8BEF\uFF1A" + truncate2(record.errorMessage, 120));
|
|
8287
|
+
}
|
|
8288
|
+
pushToast({
|
|
8289
|
+
id: ++toastSeqRef.current,
|
|
8290
|
+
kind: success ? "success" : info.cls === "err" ? "error" : "warn",
|
|
8291
|
+
title,
|
|
8292
|
+
body: lines.join("\n"),
|
|
8293
|
+
// 绑定会话:点卡片直达该会话;用户点进这个会话(侧栏选中)也视为
|
|
8294
|
+
// 看到了结果,巡检 effect 据此自动收起卡片。没看过就一直挂着。
|
|
8295
|
+
// sessionId 是权威标识(跳转/对账都用它),标题只作旧宿主回退。
|
|
8296
|
+
sessionId: task.sessionId || "",
|
|
8297
|
+
sessionTitle: showTitle
|
|
8298
|
+
});
|
|
8299
|
+
}
|
|
8300
|
+
if (soundWanted) playDoneSound(success, cfg.soundEffect);
|
|
8301
|
+
if (systemWanted && typeof document !== "undefined" && document.hidden && typeof Notification !== "undefined" && Notification.permission === "granted") {
|
|
8075
8302
|
try {
|
|
8076
8303
|
new Notification("dsh " + title, {
|
|
8077
|
-
body:
|
|
8304
|
+
body: showTitle + " \xB7 " + durText,
|
|
8078
8305
|
tag: "dsh-dock-notify-" + task.sessionId
|
|
8079
8306
|
});
|
|
8080
8307
|
} catch {
|
|
@@ -8102,11 +8329,115 @@ function NotifyOverlay(props) {
|
|
|
8102
8329
|
}
|
|
8103
8330
|
);
|
|
8104
8331
|
}
|
|
8332
|
+
var MATRIX_COLUMNS = [
|
|
8333
|
+
{ id: "card", label: "\u9875\u5185\u5361\u7247" },
|
|
8334
|
+
{ id: "sound", label: "\u63D0\u793A\u97F3" },
|
|
8335
|
+
{ id: "system", label: "\u7CFB\u7EDF\u901A\u77E5" },
|
|
8336
|
+
{ id: "voice", label: "\u8BED\u97F3\u64AD\u62A5" },
|
|
8337
|
+
{ id: "dingtalk", label: "\u9489\u9489" },
|
|
8338
|
+
{ id: "feishu", label: "\u98DE\u4E66" }
|
|
8339
|
+
];
|
|
8340
|
+
var MATRIX_EVENTS = [
|
|
8341
|
+
{ id: "complete", label: "\u5B8C\u6210", desc: "\u4EFB\u52A1\u6B63\u5E38\u7ED3\u675F" },
|
|
8342
|
+
{ id: "error", label: "\u5F02\u5E38", desc: "\u51FA\u9519 / \u4E2D\u6B62 / \u53D7\u963B / \u8FBE\u4E0A\u9650" },
|
|
8343
|
+
{ id: "confirm", label: "\u9700\u786E\u8BA4 / \u9700\u56DE\u7B54", desc: "\u5DE5\u5177\u7B49\u6279\u51C6\u3001\u63D0\u95EE\u7B49\u56DE\u7B54" },
|
|
8344
|
+
{ id: "stuck", label: "\u5361\u4F4F", desc: "\u7F16\u7A0B\u9636\u6BB5\u957F\u65F6\u95F4\u65E0\u6D3B\u52A8" }
|
|
8345
|
+
];
|
|
8346
|
+
var MATRIX_SUPPORT = {
|
|
8347
|
+
card: ["complete", "error", "confirm", "stuck"],
|
|
8348
|
+
sound: ["complete", "error", "confirm"],
|
|
8349
|
+
system: ["complete", "error", "confirm"],
|
|
8350
|
+
voice: ["complete", "error", "confirm", "stuck"],
|
|
8351
|
+
dingtalk: ["complete", "error"],
|
|
8352
|
+
feishu: ["complete", "error"]
|
|
8353
|
+
};
|
|
8354
|
+
var MODE_OPTIONS = [["brief", "\u7B80\u6D01"], ["medium", "\u9002\u4E2D"], ["detailed", "\u8BE6\u7EC6"]];
|
|
8355
|
+
function ModePicker(props) {
|
|
8356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-modes", children: MODE_OPTIONS.map(([value, label]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8357
|
+
"button",
|
|
8358
|
+
{
|
|
8359
|
+
type: "button",
|
|
8360
|
+
className: "dknt-miniswitch" + (props.value === value ? " on" : ""),
|
|
8361
|
+
title: props.title ? props.title + "\uFF08" + label + "\uFF09" : label,
|
|
8362
|
+
onClick: () => props.onChange(value),
|
|
8363
|
+
children: label
|
|
8364
|
+
},
|
|
8365
|
+
value
|
|
8366
|
+
)) });
|
|
8367
|
+
}
|
|
8368
|
+
function channelMasterOn(cfg, channel, voiceClientOn) {
|
|
8369
|
+
if (!cfg) return false;
|
|
8370
|
+
if (channel === "card") return cfg.notifyCards !== false;
|
|
8371
|
+
if (channel === "sound") return cfg.soundNotify !== false;
|
|
8372
|
+
if (channel === "system") return !!cfg.systemNotify;
|
|
8373
|
+
if (channel === "voice") return cfg.voiceNotify === true && voiceClientOn;
|
|
8374
|
+
if (channel === "dingtalk") return !!cfg.dingtalkEnabled;
|
|
8375
|
+
if (channel === "feishu") return !!cfg.feishuEnabled;
|
|
8376
|
+
return false;
|
|
8377
|
+
}
|
|
8378
|
+
function EventMatrix(props) {
|
|
8379
|
+
const { cfg, source, voiceClientOn, patch } = props;
|
|
8380
|
+
const toggle = (channel, event, on) => patch({ eventMatrix: withEventMatrix(cfg, channel, event, on) });
|
|
8381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-matrix-wrap", children: [
|
|
8382
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-matrix", children: [
|
|
8383
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-matrix-row dknt-matrix-head", children: [
|
|
8384
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-matrix-event", children: "\u901A\u77E5\u4E8B\u4EF6" }),
|
|
8385
|
+
MATRIX_COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-matrix-col" + (channelMasterOn(cfg, column.id, voiceClientOn) ? " on" : ""), children: [
|
|
8386
|
+
column.label,
|
|
8387
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("em", { children: channelMasterOn(cfg, column.id, voiceClientOn) ? "\u5F00" : "\u5173" })
|
|
8388
|
+
] }, column.id))
|
|
8389
|
+
] }),
|
|
8390
|
+
MATRIX_EVENTS.map((ev) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-matrix-row", children: [
|
|
8391
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-matrix-event", children: [
|
|
8392
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("b", { children: ev.label }),
|
|
8393
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: ev.desc })
|
|
8394
|
+
] }),
|
|
8395
|
+
MATRIX_COLUMNS.map((column) => {
|
|
8396
|
+
const supported = MATRIX_SUPPORT[column.id].indexOf(ev.id) !== -1;
|
|
8397
|
+
const serverOnly = source === "client" && (column.id === "dingtalk" || column.id === "feishu");
|
|
8398
|
+
if (!supported) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-cell dknt-cell-na", title: "\u8BE5\u6E20\u9053\u4E0D\u652F\u6301\u6B64\u4E8B\u4EF6", children: "\u2014" }, column.id);
|
|
8399
|
+
const on = eventEnabled(cfg, column.id, ev.id);
|
|
8400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8401
|
+
"button",
|
|
8402
|
+
{
|
|
8403
|
+
type: "button",
|
|
8404
|
+
className: "dknt-cell" + (on ? " on" : "") + (serverOnly ? " disabled" : ""),
|
|
8405
|
+
role: "checkbox",
|
|
8406
|
+
"aria-checked": on,
|
|
8407
|
+
disabled: serverOnly,
|
|
8408
|
+
title: serverOnly ? "\u7FA4\u673A\u5668\u4EBA\u63A8\u9001\u7531\u670D\u52A1\u7AEF\u6267\u884C\uFF0C\u8BF7\u5207\u6362\u5230\u300C\u670D\u52A1\u7AEF\u914D\u7F6E\u300D\u4FEE\u6539" : on ? "\u53D6\u6D88\u8BE5\u4E8B\u4EF6\u901A\u8FC7\u6B64\u6E20\u9053\u63D0\u9192" : "\u8BA9\u8BE5\u4E8B\u4EF6\u901A\u8FC7\u6B64\u6E20\u9053\u63D0\u9192",
|
|
8409
|
+
onClick: () => {
|
|
8410
|
+
if (!serverOnly) toggle(column.id, ev.id, !on);
|
|
8411
|
+
},
|
|
8412
|
+
children: on ? "\u2713" : ""
|
|
8413
|
+
},
|
|
8414
|
+
column.id
|
|
8415
|
+
);
|
|
8416
|
+
})
|
|
8417
|
+
] }, ev.id))
|
|
8418
|
+
] }),
|
|
8419
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-matrix-legend", children: [
|
|
8420
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
|
|
8421
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "dknt-dot on" }),
|
|
8422
|
+
" \u5DF2\u52FE\u9009"
|
|
8423
|
+
] }),
|
|
8424
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
|
|
8425
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("i", { className: "dknt-dot" }),
|
|
8426
|
+
" \u672A\u52FE\u9009"
|
|
8427
|
+
] }),
|
|
8428
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u300C\u2014\u300D= \u8BE5\u6E20\u9053\u4E0D\u652F\u6301\u6B64\u4E8B\u4EF6" }),
|
|
8429
|
+
source === "client" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u9489\u9489 / \u98DE\u4E66\u4E3A\u670D\u52A1\u7AEF\u63A8\u9001\uFF0C\u9700\u5207\u56DE\u300C\u670D\u52A1\u7AEF\u914D\u7F6E\u300D\u4FEE\u6539" }) : null
|
|
8430
|
+
] })
|
|
8431
|
+
] });
|
|
8432
|
+
}
|
|
8105
8433
|
function NotifyView(props) {
|
|
8106
8434
|
const snap = useNotify();
|
|
8107
8435
|
const voices = useLocalVoices();
|
|
8108
8436
|
const [voiceClientOn, setVoiceClientOn] = useVoiceClientEnabled();
|
|
8109
|
-
const [
|
|
8437
|
+
const [source, setSource] = useNotifyConfigSource();
|
|
8438
|
+
const [tab, setTab] = (0, import_react10.useState)("events");
|
|
8439
|
+
const [clientCfg, setClientCfg] = (0, import_react10.useState)(() => readClientNotifyConfig());
|
|
8440
|
+
const [serverDraft, setServerDraft] = (0, import_react10.useState)(null);
|
|
8110
8441
|
const [saveErr, setSaveErr] = (0, import_react10.useState)("");
|
|
8111
8442
|
const [testing, setTesting] = (0, import_react10.useState)(false);
|
|
8112
8443
|
const [testState, setTestState] = (0, import_react10.useState)(null);
|
|
@@ -8116,21 +8447,36 @@ function NotifyView(props) {
|
|
|
8116
8447
|
const pendingSavesRef = (0, import_react10.useRef)(0);
|
|
8117
8448
|
const editingWebhookRef = (0, import_react10.useRef)(false);
|
|
8118
8449
|
const editingFeishuRef = (0, import_react10.useRef)(false);
|
|
8450
|
+
const serverCfg = snap.status && snap.status.config;
|
|
8119
8451
|
(0, import_react10.useEffect)(() => {
|
|
8120
|
-
|
|
8121
|
-
if (!c) return;
|
|
8452
|
+
if (!serverCfg) return;
|
|
8122
8453
|
if (pendingSavesRef.current > 0 || editingWebhookRef.current || editingFeishuRef.current) return;
|
|
8123
|
-
if (
|
|
8124
|
-
cfgRef.current =
|
|
8125
|
-
|
|
8454
|
+
if (serverCfg !== cfgRef.current) {
|
|
8455
|
+
cfgRef.current = serverCfg;
|
|
8456
|
+
setServerDraft(Object.assign({}, serverCfg));
|
|
8126
8457
|
}
|
|
8127
8458
|
}, [snap.status]);
|
|
8459
|
+
(0, import_react10.useEffect)(() => {
|
|
8460
|
+
if (source !== "client" || clientCfg || !serverCfg) return;
|
|
8461
|
+
const clone = pickClientConfig(serverCfg);
|
|
8462
|
+
writeClientNotifyConfig(clone);
|
|
8463
|
+
setClientCfg(clone);
|
|
8464
|
+
}, [source, clientCfg, serverCfg]);
|
|
8128
8465
|
(0, import_react10.useEffect)(() => {
|
|
8129
8466
|
if (!notifyStore.snap.status) notifyStore.refresh();
|
|
8130
8467
|
}, []);
|
|
8468
|
+
const cfg = source === "client" ? clientCfg ? mergeClientNotifyConfig(serverCfg, clientCfg) : null : serverDraft || serverCfg;
|
|
8131
8469
|
const patch = (p) => {
|
|
8132
8470
|
setSaveErr("");
|
|
8133
|
-
|
|
8471
|
+
if (source === "client") {
|
|
8472
|
+
const base = clientCfg || (serverCfg ? pickClientConfig(serverCfg) : {});
|
|
8473
|
+
const next = Object.assign({}, base, p);
|
|
8474
|
+
writeClientNotifyConfig(next);
|
|
8475
|
+
setClientCfg(next);
|
|
8476
|
+
notifyStore.touch();
|
|
8477
|
+
return Promise.resolve();
|
|
8478
|
+
}
|
|
8479
|
+
setServerDraft(Object.assign({}, cfg, p));
|
|
8134
8480
|
pendingSavesRef.current++;
|
|
8135
8481
|
return rpcCall3("config", p).then((d) => {
|
|
8136
8482
|
pendingSavesRef.current--;
|
|
@@ -8140,6 +8486,22 @@ function NotifyView(props) {
|
|
|
8140
8486
|
setSaveErr("\u4FDD\u5B58\u5931\u8D25\uFF1A" + (e && e.message || String(e)));
|
|
8141
8487
|
});
|
|
8142
8488
|
};
|
|
8489
|
+
const chooseSource = (next) => {
|
|
8490
|
+
if (next === "client" && !clientCfg && serverCfg) {
|
|
8491
|
+
const clone = pickClientConfig(serverCfg);
|
|
8492
|
+
writeClientNotifyConfig(clone);
|
|
8493
|
+
setClientCfg(clone);
|
|
8494
|
+
}
|
|
8495
|
+
setSource(next);
|
|
8496
|
+
notifyStore.touch();
|
|
8497
|
+
};
|
|
8498
|
+
const copyFromServer = () => {
|
|
8499
|
+
if (!serverCfg) return;
|
|
8500
|
+
const clone = pickClientConfig(serverCfg);
|
|
8501
|
+
writeClientNotifyConfig(clone);
|
|
8502
|
+
setClientCfg(clone);
|
|
8503
|
+
notifyStore.touch();
|
|
8504
|
+
};
|
|
8143
8505
|
const saveWebhook = async () => {
|
|
8144
8506
|
if (!editingWebhookRef.current) return;
|
|
8145
8507
|
const hook = String(cfg.dingtalkWebhook || "").trim();
|
|
@@ -8148,7 +8510,7 @@ function NotifyView(props) {
|
|
|
8148
8510
|
const c = notifyStore.snap.status && notifyStore.snap.status.config;
|
|
8149
8511
|
if (c && c !== cfgRef.current) {
|
|
8150
8512
|
cfgRef.current = c;
|
|
8151
|
-
|
|
8513
|
+
setServerDraft(Object.assign({}, c));
|
|
8152
8514
|
}
|
|
8153
8515
|
};
|
|
8154
8516
|
const saveFeishuWebhook = async () => {
|
|
@@ -8159,7 +8521,7 @@ function NotifyView(props) {
|
|
|
8159
8521
|
const c = notifyStore.snap.status && notifyStore.snap.status.config;
|
|
8160
8522
|
if (c && c !== cfgRef.current) {
|
|
8161
8523
|
cfgRef.current = c;
|
|
8162
|
-
|
|
8524
|
+
setServerDraft(Object.assign({}, c));
|
|
8163
8525
|
}
|
|
8164
8526
|
};
|
|
8165
8527
|
const runDingtalkTest = async () => {
|
|
@@ -8173,7 +8535,7 @@ function NotifyView(props) {
|
|
|
8173
8535
|
notifyStore.applyConfig(d && d.config);
|
|
8174
8536
|
editingWebhookRef.current = false;
|
|
8175
8537
|
cfgRef.current = d && d.config || cfgRef.current;
|
|
8176
|
-
|
|
8538
|
+
setServerDraft(Object.assign({}, cfg, { dingtalkWebhook: hook }));
|
|
8177
8539
|
}
|
|
8178
8540
|
const r = await rpcCall3("test");
|
|
8179
8541
|
setTestState(r && r.sent ? { ok: true, msg: "\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u53BB\u7FA4\u91CC\u770B\u770B" } : { ok: false, msg: r && r.error || "\u53D1\u9001\u5931\u8D25" });
|
|
@@ -8194,7 +8556,7 @@ function NotifyView(props) {
|
|
|
8194
8556
|
notifyStore.applyConfig(d && d.config);
|
|
8195
8557
|
editingFeishuRef.current = false;
|
|
8196
8558
|
cfgRef.current = d && d.config || cfgRef.current;
|
|
8197
|
-
|
|
8559
|
+
setServerDraft(Object.assign({}, cfg, { feishuWebhook: hook }));
|
|
8198
8560
|
}
|
|
8199
8561
|
const r = await rpcCall3("test", { target: "feishu" });
|
|
8200
8562
|
setFeishuTestState(r && r.sent ? { ok: true, msg: "\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u53BB\u7FA4\u91CC\u770B\u770B" } : { ok: false, msg: r && r.error || "\u53D1\u9001\u5931\u8D25" });
|
|
@@ -8225,484 +8587,508 @@ function NotifyView(props) {
|
|
|
8225
8587
|
rows.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-note", children: snap.error ? "\u72B6\u6001\u4E0D\u53EF\u7528\uFF1A" + snap.error : snap.loading ? "\u6B63\u5728\u62C9\u53D6\u901A\u77E5\u72B6\u6001\u2026" : "\u7B49\u5F85\u901A\u77E5\u72B6\u6001" }, "load"));
|
|
8226
8588
|
} else {
|
|
8227
8589
|
rows.push(
|
|
8228
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-
|
|
8229
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-
|
|
8230
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-
|
|
8231
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-
|
|
8590
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-source", children: [
|
|
8591
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-source-info", children: [
|
|
8592
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-source-title", children: "\u914D\u7F6E\u6765\u6E90" }),
|
|
8593
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-source-sub", children: source === "server" ? "\u8BBE\u7F6E\u4FDD\u5B58\u5728\u670D\u52A1\u7AEF\uFF0C\u6240\u6709\u6D4F\u89C8\u5668/\u8BBE\u5907\u5171\u4EAB" : "\u8BBE\u7F6E\u53EA\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u4EBA" })
|
|
8232
8594
|
] }),
|
|
8233
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-
|
|
8234
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8235
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u9875\u5185\u5361\u7247" }),
|
|
8236
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8237
|
-
"button",
|
|
8238
|
-
{
|
|
8239
|
-
type: "button",
|
|
8240
|
-
className: "dknt-miniswitch" + (cfg.notifyCards !== false ? " on" : ""),
|
|
8241
|
-
onClick: () => patch({ notifyCards: cfg.notifyCards === false }),
|
|
8242
|
-
children: cfg.notifyCards !== false ? "\u5F00" : "\u5173"
|
|
8243
|
-
}
|
|
8244
|
-
),
|
|
8245
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u53F3\u4FA7\u901A\u77E5\u5361\u7247\u603B\u5F00\u5173\uFF1A\u5173\u95ED\u540E\u4E0B\u9762\u5404\u7C7B\u5361\u7247\uFF08\u5B8C\u6210 / \u5F02\u5E38 / \u9700\u786E\u8BA4 / \u5361\u4F4F\uFF09\u4E00\u5F8B\u4E0D\u5F39\uFF0C\u5DF2\u6302\u7740\u7684\u4E00\u5E76\u6536\u8D77\uFF1B\u8BED\u97F3\u64AD\u62A5\u3001\u63D0\u793A\u97F3\u3001\u7CFB\u7EDF\u901A\u77E5\u3001\u9489\u9489\u98DE\u4E66\u63A8\u9001\u4E0D\u53D7\u5F71\u54CD" })
|
|
8246
|
-
] }),
|
|
8247
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8248
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u5B8C\u6210\u901A\u77E5" }),
|
|
8249
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8250
|
-
"button",
|
|
8251
|
-
{
|
|
8252
|
-
type: "button",
|
|
8253
|
-
className: "dknt-miniswitch" + (cfg.notifyOnComplete ? " on" : ""),
|
|
8254
|
-
onClick: () => patch({ notifyOnComplete: !cfg.notifyOnComplete }),
|
|
8255
|
-
children: cfg.notifyOnComplete ? "\u5F00" : "\u5173"
|
|
8256
|
-
}
|
|
8257
|
-
),
|
|
8258
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u4EFB\u52A1\u6B63\u5E38\u5B8C\u6210\u65F6\u901A\u77E5" })
|
|
8259
|
-
] }),
|
|
8260
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8261
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u5F02\u5E38\u901A\u77E5" }),
|
|
8262
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8263
|
-
"button",
|
|
8264
|
-
{
|
|
8265
|
-
type: "button",
|
|
8266
|
-
className: "dknt-miniswitch" + (cfg.notifyOnError ? " on" : ""),
|
|
8267
|
-
onClick: () => patch({ notifyOnError: !cfg.notifyOnError }),
|
|
8268
|
-
children: cfg.notifyOnError ? "\u5F00" : "\u5173"
|
|
8269
|
-
}
|
|
8270
|
-
),
|
|
8271
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u51FA\u9519 / \u4E2D\u6B62 / \u8FBE\u8F93\u51FA\u4E0A\u9650\u65F6\u901A\u77E5" })
|
|
8272
|
-
] }),
|
|
8273
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8274
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u9700\u786E\u8BA4\u63D0\u9192" }),
|
|
8275
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8276
|
-
"button",
|
|
8277
|
-
{
|
|
8278
|
-
type: "button",
|
|
8279
|
-
className: "dknt-miniswitch" + (cfg.notifyOnConfirm !== false ? " on" : ""),
|
|
8280
|
-
onClick: () => patch({ notifyOnConfirm: cfg.notifyOnConfirm === false }),
|
|
8281
|
-
children: cfg.notifyOnConfirm !== false ? "\u5F00" : "\u5173"
|
|
8282
|
-
}
|
|
8283
|
-
),
|
|
8284
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u5DE5\u5177\u7B49\u4F60\u6279\u51C6\u3001\u6216\u4F1A\u8BDD\u63D0\u95EE\u7B49\u4F60\u9009\u7B54\u6848\u65F6\u5F39\u5361\u7247\u5E76\u54CD\u786E\u8BA4\u97F3\uFF1B\u5904\u7406\u5B8C\u81EA\u52A8\u6536\u8D77\uFF0C\u6CA1\u5904\u7406\u5B8C\u5C31\u4E00\u76F4\u663E\u793A\uFF08\u70B9\u5361\u7247\u76F4\u8FBE\u4F1A\u8BDD\uFF09\u3002\u8FD9\u4E24\u79CD\u300C\u505C\u5728\u539F\u5730\u7B49\u4EBA\u300D\u90FD\u4E0D\u7B97\u5361\u4F4F" })
|
|
8285
|
-
] }),
|
|
8286
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8287
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u5361\u4F4F\u63D0\u9192" }),
|
|
8288
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8289
|
-
"button",
|
|
8290
|
-
{
|
|
8291
|
-
type: "button",
|
|
8292
|
-
className: "dknt-miniswitch" + (cfg.notifyOnStuck !== false ? " on" : ""),
|
|
8293
|
-
onClick: () => patch({ notifyOnStuck: cfg.notifyOnStuck === false }),
|
|
8294
|
-
children: cfg.notifyOnStuck !== false ? "\u5F00" : "\u5173"
|
|
8295
|
-
}
|
|
8296
|
-
),
|
|
8297
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u7F16\u7A0B\u9636\u6BB5\u957F\u65F6\u95F4\u6CA1\u6709\u52A8\u9759\u65F6\u5F39\u5361\u7247\uFF0C\u5199\u660E\u662F\u4E3B\u4EFB\u52A1\u8FD8\u662F\u5B50\u4EFB\u52A1\u3001\u505C\u6EDE\u4E86\u591A\u4E45\u3001\u6700\u540E\u5728\u6267\u884C\u4EC0\u4E48\uFF1B\u6062\u590D\u6D3B\u52A8 / \u4EFB\u52A1\u7ED3\u675F\u81EA\u52A8\u6536\u8D77\uFF0C\u540C\u4E00\u505C\u70B9\u53EA\u5F39\u4E00\u6B21\u3002\u7B49\u6279\u51C6\u3001\u7B49\u56DE\u7B54\u3001\u547D\u4EE4\u8FD8\u5728\u8DD1\u3001\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587\u7684\u4F1A\u8BDD\u90FD\u4E0D\u7B97\u5361\u4F4F\uFF08\u90A3\u4E9B\u90FD\u662F\u5728\u5E72\u6D3B\uFF0C\u522B\u91CD\u590D\u8F70\u70B8\uFF09\uFF08\u8BED\u97F3\u64AD\u62A5\u8D70\u300C\u8BED\u97F3\u64AD\u62A5\u300D\u533A\u7684\u5361\u4F4F\u5F00\u5173\uFF0C\u4E92\u4E0D\u5E72\u6270\uFF09" })
|
|
8298
|
-
] })
|
|
8299
|
-
] })
|
|
8300
|
-
] }, "events"),
|
|
8301
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec", children: [
|
|
8302
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec-head", children: [
|
|
8303
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-title", children: "\u63D0\u9192\u65B9\u5F0F" }),
|
|
8304
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-sub", children: "\u9875\u5185\u5361\u7247\u3001\u63D0\u793A\u97F3\u3001\u6D4F\u89C8\u5668\u7CFB\u7EDF\u901A\u77E5\u53EF\u81EA\u7531\u7EC4\u5408" })
|
|
8305
|
-
] }),
|
|
8306
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-rows-narrow", children: [
|
|
8307
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8308
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u5361\u7247\u53E3\u5F84" }),
|
|
8309
|
-
[["brief", "\u7B80\u6D01"], ["medium", "\u9002\u4E2D"], ["detailed", "\u8BE6\u7EC6"]].map(([v, label]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8310
|
-
"button",
|
|
8311
|
-
{
|
|
8312
|
-
type: "button",
|
|
8313
|
-
className: "dknt-miniswitch" + (cardTone(cfg) === v ? " on" : ""),
|
|
8314
|
-
style: { marginRight: 6 },
|
|
8315
|
-
title: "\u53F3\u4FA7\u901A\u77E5\u5361\u7247\u6B63\u6587\u6309" + label + "\u6863\u663E\u793A",
|
|
8316
|
-
onClick: () => patch({ cardMode: v }),
|
|
8317
|
-
children: label
|
|
8318
|
-
},
|
|
8319
|
-
v
|
|
8320
|
-
)),
|
|
8321
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u53F3\u4FA7\u5361\u7247\u6B63\u6587\u5199\u591A\u5C11\uFF08\u4E0E\u5404\u7C7B\u578B\u5F00\u5173\u3001\u8BED\u97F3\u64AD\u62A5\u4E92\u4E0D\u5F71\u54CD\uFF09\uFF1A\u7B80\u6D01\uFF1D\u4EFB\u52A1\u4E0E\u8017\u65F6 / \u8C01\u5361\u4F4F\uFF1B\u9002\u4E2D\uFF1D\u52A0\u6A21\u578B\u3001\u8D77\u6B62\u65F6\u95F4\u3001\u505C\u6EDE\u65F6\u957F\uFF1B\u8BE6\u7EC6\uFF1D\u5168\u90E8\uFF08\u56DE\u5408\u6B65\u9AA4\u3001Token\u3001\u6458\u8981\u6216\u9519\u8BEF\u3001\u6700\u540E\u52A8\u4F5C\uFF09" })
|
|
8322
|
-
] }),
|
|
8323
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8324
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u5361\u7247\u6536\u7EB3" }),
|
|
8325
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u6240\u6709\u5361\u7247\u90FD\u4E0D\u8D85\u65F6\u81EA\u52A8\u6D88\u5931\uFF1A\u7ED3\u675F\u5361\u7247\u6CA1\u770B\u8FC7\u5C31\u4E00\u76F4\u6302\u7740\uFF08\u540E\u53F0\u8DD1\u5B8C\u7684\u5207\u56DE\u6765\u4E5F\u5728\uFF09\uFF0C\u70B9\u5361\u7247\u76F4\u8FBE\u5BF9\u5E94\u4F1A\u8BDD\uFF0C\u6216\u70B9\u8FDB\u8BE5\u4F1A\u8BDD\uFF0C\u5361\u7247\u81EA\u52A8\u6536\u8D77\uFF1B\u9700\u786E\u8BA4\u5361\u7247\u6302\u5230\u5BA1\u6279\u5904\u7406\u5B8C\uFF1B\u5361\u4F4F\u5361\u7247\u6302\u5230\u6062\u590D\u6D3B\u52A8\u30023 \u5F20\u53CA\u4EE5\u4E0A\u81EA\u52A8\u53E0\u653E\u6210\u6807\u9898\u6761\uFF0C\u9F20\u6807\u79FB\u4E0A\u53BB\u6574\u4F53\u5C55\u5F00\uFF1B\u8981\u6574\u4F53\u4E0D\u5F39\u770B\u4E0A\u9762\u300C\u9875\u5185\u5361\u7247\u300D\u603B\u5F00\u5173" })
|
|
8326
|
-
] }),
|
|
8327
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8328
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u7CFB\u7EDF\u901A\u77E5" }),
|
|
8329
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8330
|
-
"button",
|
|
8331
|
-
{
|
|
8332
|
-
type: "button",
|
|
8333
|
-
className: "dknt-miniswitch" + (cfg.systemNotify ? " on" : ""),
|
|
8334
|
-
onClick: () => enableSystemNotify(!cfg.systemNotify),
|
|
8335
|
-
children: cfg.systemNotify ? "\u5F00" : "\u5173"
|
|
8336
|
-
}
|
|
8337
|
-
),
|
|
8338
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: permNote })
|
|
8339
|
-
] }),
|
|
8340
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8341
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u63D0\u793A\u97F3" }),
|
|
8342
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8343
|
-
"button",
|
|
8344
|
-
{
|
|
8345
|
-
type: "button",
|
|
8346
|
-
className: "dknt-miniswitch" + (cfg.soundNotify !== false ? " on" : ""),
|
|
8347
|
-
onClick: () => patch({ soundNotify: cfg.soundNotify === false }),
|
|
8348
|
-
children: cfg.soundNotify !== false ? "\u5F00" : "\u5173"
|
|
8349
|
-
}
|
|
8350
|
-
),
|
|
8351
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u4EFB\u52A1\u7ED3\u675F/\u9700\u786E\u8BA4\u65F6\u64AD\u653E\uFF08\u8BD5\u542C\u4E3A\u5148\u64AD\u5B8C\u6210\u97F3\u3001\u540E\u64AD\u5F02\u5E38\u97F3\uFF09" })
|
|
8352
|
-
] }),
|
|
8353
|
-
cfg.soundNotify !== false ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-sounds", children: Object.keys(SOUND_LIBRARY).map((key) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
8595
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-seg", role: "group", "aria-label": "\u901A\u77E5\u914D\u7F6E\u6765\u6E90", children: [
|
|
8596
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8354
8597
|
"button",
|
|
8355
8598
|
{
|
|
8356
8599
|
type: "button",
|
|
8357
|
-
className: "dknt-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
] }),
|
|
8364
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8365
|
-
"span",
|
|
8366
|
-
{
|
|
8367
|
-
className: "dknt-sound-play",
|
|
8368
|
-
role: "button",
|
|
8369
|
-
tabIndex: 0,
|
|
8370
|
-
title: "\u8BD5\u542C " + SOUND_LIBRARY[key].name,
|
|
8371
|
-
onClick: (e) => {
|
|
8372
|
-
e.stopPropagation();
|
|
8373
|
-
previewSound(key);
|
|
8374
|
-
},
|
|
8375
|
-
onKeyDown: (e) => {
|
|
8376
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
8377
|
-
e.preventDefault();
|
|
8378
|
-
e.stopPropagation();
|
|
8379
|
-
previewSound(key);
|
|
8380
|
-
}
|
|
8381
|
-
},
|
|
8382
|
-
children: "\u25B6"
|
|
8383
|
-
}
|
|
8384
|
-
)
|
|
8385
|
-
]
|
|
8386
|
-
},
|
|
8387
|
-
key
|
|
8388
|
-
)) }) : null
|
|
8389
|
-
] })
|
|
8390
|
-
] }, "style"),
|
|
8391
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec", children: [
|
|
8392
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec-head", children: [
|
|
8393
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-title", children: "\u8BED\u97F3\u64AD\u62A5" }),
|
|
8394
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-sub", children: "\u4EFB\u52A1\u5B8C\u6210 / \u505C\u6B62 / \u9700\u8981\u6388\u6743 / \u9700\u56DE\u7B54 / \u5361\u4F4F\u65F6\u7528\u6D4F\u89C8\u5668\u8BED\u97F3\uFF08TTS\uFF09\u8BF4\u4E00\u53E5\u8BDD\uFF1B\u670D\u52A1\u7AEF\u603B\u5F00\u5173\uFF08\u8DE8\u6D4F\u89C8\u5668\uFF09\u4E0E\u672C\u673A\u5F00\u5173\uFF08\u5F53\u524D\u6D4F\u89C8\u5668\uFF09\u90FD\u5F00\u542F\u624D\u64AD\u62A5" }),
|
|
8395
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-sec-sw", children: [
|
|
8396
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-swlabel" + (cfg.voiceNotify ? " on" : ""), children: cfg.voiceNotify ? "\u670D\u52A1\u7AEF\uFF1A\u5DF2\u5F00\u542F" : "\u670D\u52A1\u7AEF\uFF1A\u5DF2\u5173\u95ED" }),
|
|
8397
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8398
|
-
"button",
|
|
8399
|
-
{
|
|
8400
|
-
type: "button",
|
|
8401
|
-
className: "dock-sw" + (cfg.voiceNotify ? " on" : ""),
|
|
8402
|
-
role: "switch",
|
|
8403
|
-
"aria-checked": cfg.voiceNotify,
|
|
8404
|
-
"aria-label": "\u5F00\u5173\u8BED\u97F3\u64AD\u62A5\uFF08\u670D\u52A1\u7AEF\u603B\u5F00\u5173\uFF09",
|
|
8405
|
-
title: cfg.voiceNotify ? "\u5173\u95ED\u8BED\u97F3\u64AD\u62A5\uFF08\u670D\u52A1\u7AEF\u603B\u5F00\u5173\uFF09" : "\u5F00\u542F\u8BED\u97F3\u64AD\u62A5\uFF08\u670D\u52A1\u7AEF\u603B\u5F00\u5173\uFF09",
|
|
8406
|
-
onClick: () => patch({ voiceNotify: !cfg.voiceNotify })
|
|
8407
|
-
}
|
|
8408
|
-
)
|
|
8409
|
-
] })
|
|
8410
|
-
] }),
|
|
8411
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8412
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u672C\u673A\u64AD\u62A5" }),
|
|
8600
|
+
className: "dknt-seg-btn" + (source === "server" ? " on" : ""),
|
|
8601
|
+
"aria-pressed": source === "server",
|
|
8602
|
+
onClick: () => chooseSource("server"),
|
|
8603
|
+
children: "\u670D\u52A1\u7AEF\u914D\u7F6E"
|
|
8604
|
+
}
|
|
8605
|
+
),
|
|
8413
8606
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8414
8607
|
"button",
|
|
8415
8608
|
{
|
|
8416
8609
|
type: "button",
|
|
8417
|
-
className: "dknt-
|
|
8418
|
-
|
|
8419
|
-
"
|
|
8420
|
-
|
|
8421
|
-
title: voiceClientOn ? "\u5173\u95ED\u672C\u673A\u8BED\u97F3\u64AD\u62A5" : "\u5F00\u542F\u672C\u673A\u8BED\u97F3\u64AD\u62A5",
|
|
8422
|
-
onClick: () => setVoiceClientOn(!voiceClientOn),
|
|
8423
|
-
children: voiceClientOn ? "\u5F00" : "\u5173"
|
|
8610
|
+
className: "dknt-seg-btn" + (source === "client" ? " on" : ""),
|
|
8611
|
+
"aria-pressed": source === "client",
|
|
8612
|
+
onClick: () => chooseSource("client"),
|
|
8613
|
+
children: "\u672C\u673A\u914D\u7F6E"
|
|
8424
8614
|
}
|
|
8425
|
-
)
|
|
8426
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: voiceClientOn ? "\u672C\u6D4F\u89C8\u5668\u4F1A\u64AD\u62A5\uFF08\u8BBE\u7F6E\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\uFF1B\u670D\u52A1\u7AEF\u603B\u5F00\u5173\u5173\u95ED\u65F6\u4E0D\u751F\u6548\uFF09" : "\u672C\u6D4F\u89C8\u5668\u4E0D\u64AD\u62A5\uFF08\u8BBE\u7F6E\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u6D4F\u89C8\u5668\uFF09" })
|
|
8615
|
+
)
|
|
8427
8616
|
] }),
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
"button",
|
|
8454
|
-
{
|
|
8455
|
-
type: "button",
|
|
8456
|
-
className: "dknt-miniswitch" + (on ? " on" : ""),
|
|
8457
|
-
style: { marginRight: 6 },
|
|
8458
|
-
title: key === "voiceOnStuck" ? "\u7F16\u7A0B\u9636\u6BB5\u957F\u65F6\u95F4\u6CA1\u6709\u52A8\u9759\u65F6\u64AD\u62A5\u4E00\u6B21\uFF08\u6062\u590D\u540E\u53EF\u518D\u62A5\uFF1B\u547D\u4EE4\u5728\u8DD1 / \u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587\u4E0D\u7B97\uFF09" : "",
|
|
8459
|
-
onClick: () => patch({ [key]: !on }),
|
|
8460
|
-
children: [
|
|
8461
|
-
label,
|
|
8462
|
-
on ? "\xB7\u5F00" : "\xB7\u5173"
|
|
8463
|
-
]
|
|
8464
|
-
},
|
|
8465
|
-
key
|
|
8466
|
-
)) })
|
|
8467
|
-
] }),
|
|
8468
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8469
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8BED\u901F" }),
|
|
8470
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8471
|
-
"input",
|
|
8472
|
-
{
|
|
8473
|
-
type: "range",
|
|
8474
|
-
min: "0.5",
|
|
8475
|
-
max: "2",
|
|
8476
|
-
step: "0.05",
|
|
8477
|
-
value: String(cfg.voiceRate || 1),
|
|
8478
|
-
"aria-label": "\u64AD\u62A5\u8BED\u901F",
|
|
8479
|
-
style: { width: 120, accentColor: "var(--dk-accent)" },
|
|
8480
|
-
onChange: (e) => patch({ voiceRate: Number(e.target.value) || 1 })
|
|
8481
|
-
}
|
|
8482
|
-
),
|
|
8483
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-row-sub", children: [
|
|
8484
|
-
Number(cfg.voiceRate || 1).toFixed(2),
|
|
8485
|
-
"\xD7\uFF08\u64AD\u62A5\u6BD4\u6B63\u6587\u6717\u8BFB\u7565\u5FEB\u66F4\u5229\u843D\uFF09"
|
|
8486
|
-
] })
|
|
8617
|
+
source === "client" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: "dknt-btn", onClick: copyFromServer, children: "\u4ECE\u670D\u52A1\u7AEF\u590D\u5236" }) : null
|
|
8618
|
+
] }, "source"),
|
|
8619
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-tabs", role: "tablist", "aria-label": "\u4EFB\u52A1\u901A\u77E5\u8BBE\u7F6E", children: [
|
|
8620
|
+
["events", "\u6309\u4E8B\u4EF6\u63D0\u9192"],
|
|
8621
|
+
["channels", "\u6309\u6E20\u9053\u8BBE\u7F6E"],
|
|
8622
|
+
["robots", "\u7FA4\u673A\u5668\u4EBA"]
|
|
8623
|
+
].map(([id, label]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8624
|
+
"button",
|
|
8625
|
+
{
|
|
8626
|
+
type: "button",
|
|
8627
|
+
role: "tab",
|
|
8628
|
+
"aria-selected": tab === id,
|
|
8629
|
+
className: "dknt-tab" + (tab === id ? " on" : ""),
|
|
8630
|
+
onClick: () => setTab(id),
|
|
8631
|
+
children: label
|
|
8632
|
+
},
|
|
8633
|
+
id
|
|
8634
|
+
)) }, "tabs")
|
|
8635
|
+
);
|
|
8636
|
+
if (tab === "events") {
|
|
8637
|
+
rows.push(
|
|
8638
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec", children: [
|
|
8639
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec-head", children: [
|
|
8640
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-title", children: "\u901A\u77E5\u4E8B\u4EF6" }),
|
|
8641
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-sub", children: "\u7EB5\u5411\u662F\u901A\u77E5\u4E8B\u4EF6\u3001\u6A2A\u5411\u662F\u901A\u77E5\u6E20\u9053\uFF1B\u52FE\u9009\u8868\u793A\u300C\u8FD9\u4E2A\u4E8B\u4EF6\u7528\u8FD9\u4E2A\u6E20\u9053\u63D0\u9192\u300D\u3002\u6E20\u9053\u7684\u603B\u5F00\u5173\u548C\u8BE6\u7EC6\u8BBE\u7F6E\u5728\u540C\u9875\u300C\u6309\u6E20\u9053\u8BBE\u7F6E\u300D\u3002" })
|
|
8487
8642
|
] }),
|
|
8488
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
"
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8643
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(EventMatrix, { cfg, source, voiceClientOn, patch }),
|
|
8644
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-note", children: "\u300C\u9700\u786E\u8BA4 / \u9700\u56DE\u7B54\u300D\u5305\u542B\u5DE5\u5177\u7B49\u5F85\u6279\u51C6\u4E0E\u4F1A\u8BDD\u63D0\u95EE\u7B49\u5F85\u56DE\u7B54\u4E24\u79CD\u300C\u505C\u5728\u539F\u5730\u7B49\u4EBA\u300D\uFF1B\u300C\u5361\u4F4F\u300D\u53EA\u5728\u7F16\u7A0B\u9636\u6BB5\u957F\u65F6\u95F4\u6CA1\u6709\u52A8\u9759\u65F6\u89E6\u53D1\uFF0C\u7B49\u6279\u51C6\u3001\u7B49\u56DE\u7B54\u3001\u547D\u4EE4\u5728\u8DD1\u3001\u6B63\u5728\u538B\u7F29\u4E0A\u4E0B\u6587\u90FD\u4E0D\u7B97\u5361\u4F4F\u3002" })
|
|
8645
|
+
] }, "events")
|
|
8646
|
+
);
|
|
8647
|
+
} else if (tab === "channels") {
|
|
8648
|
+
rows.push(
|
|
8649
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channels", children: [
|
|
8650
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel", children: [
|
|
8651
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-head", children: [
|
|
8652
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-title-wrap", children: [
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-title", children: "\u9875\u5185\u5361\u7247" }),
|
|
8654
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-sub", children: "\u53F3\u4FA7\u6D6E\u5C42\u901A\u77E5\u5361\uFF1B\u70B9\u5361\u7247\u76F4\u8FBE\u5BF9\u5E94\u4F1A\u8BDD" })
|
|
8655
|
+
] }),
|
|
8656
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8657
|
+
"button",
|
|
8658
|
+
{
|
|
8659
|
+
type: "button",
|
|
8660
|
+
className: "dock-sw" + (cfg.notifyCards !== false ? " on" : ""),
|
|
8661
|
+
role: "switch",
|
|
8662
|
+
"aria-checked": cfg.notifyCards !== false,
|
|
8663
|
+
"aria-label": "\u5F00\u5173\u9875\u5185\u5361\u7247",
|
|
8664
|
+
onClick: () => patch({ notifyCards: cfg.notifyCards === false })
|
|
8665
|
+
}
|
|
8666
|
+
)
|
|
8667
|
+
] }),
|
|
8668
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-body", children: [
|
|
8669
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8670
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u6B63\u6587\u53E3\u5F84" }),
|
|
8671
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ModePicker, { value: cardTone(cfg), title: "\u9875\u5185\u5361\u7247\u6B63\u6587", onChange: (v) => patch({ cardMode: v }) }),
|
|
8672
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u7B80\u6D01\uFF1D\u4EFB\u52A1\u4E0E\u8017\u65F6 / \u8C01\u5361\u4F4F\uFF1B\u9002\u4E2D\uFF1D\u52A0\u6A21\u578B\u3001\u8D77\u6B62\u65F6\u95F4\u3001\u505C\u6EDE\u65F6\u957F\uFF1B\u8BE6\u7EC6\uFF1D\u5168\u90E8\uFF08\u56DE\u5408\u6B65\u9AA4\u3001Token\u3001\u6458\u8981\u6216\u9519\u8BEF\u3001\u6700\u540E\u52A8\u4F5C\uFF09" })
|
|
8673
|
+
] }),
|
|
8674
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8675
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u5361\u7247\u6536\u7EB3" }),
|
|
8676
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u6240\u6709\u5361\u7247\u90FD\u4E0D\u8D85\u65F6\u81EA\u52A8\u6D88\u5931\uFF1A\u7ED3\u675F\u5361\u6CA1\u770B\u8FC7\u5C31\u4E00\u76F4\u6302\u7740\uFF0C\u70B9\u5361\u7247\u6216\u70B9\u8FDB\u4F1A\u8BDD\u540E\u6536\u8D77\uFF1B\u9700\u786E\u8BA4\u5361\u6302\u5230\u5904\u7406\u5B8C\uFF1B\u5361\u4F4F\u5361\u6302\u5230\u6062\u590D\u6D3B\u52A8\u30023 \u5F20\u53CA\u4EE5\u4E0A\u81EA\u52A8\u53E0\u653E\u6210\u6807\u9898\u6761\uFF0C\u9F20\u6807\u79FB\u4E0A\u53BB\u6574\u4F53\u5C55\u5F00\u3002" })
|
|
8677
|
+
] }),
|
|
8678
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8679
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u4E8B\u4EF6\u8303\u56F4" }),
|
|
8680
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u5728\u300C\u6309\u4E8B\u4EF6\u63D0\u9192\u300D\u7684\u9875\u5185\u5361\u7247\u5217\u91CC\u52FE\u9009\u3002" })
|
|
8681
|
+
] })
|
|
8506
8682
|
] })
|
|
8507
8683
|
] }),
|
|
8508
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-
|
|
8509
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
if (!v || !v.voiceURI) continue;
|
|
8524
|
-
if (/^zh/i.test(String(v.lang || ""))) zh.push(v);
|
|
8525
|
-
else other.push(v);
|
|
8526
|
-
}
|
|
8527
|
-
const groups = [];
|
|
8528
|
-
if (zh.length) groups.push(["\u4E2D\u6587\u97F3\u8272", zh]);
|
|
8529
|
-
if (other.length) groups.push(["\u5176\u4ED6\u97F3\u8272", other]);
|
|
8530
|
-
return groups.map(([gname, vs]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("optgroup", { label: gname, children: vs.map((v) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: v.voiceURI, children: (v.name || v.voiceURI) + "\uFF08" + (v.lang || "?") + "\uFF09" }, v.voiceURI)) }, gname));
|
|
8531
|
-
})()
|
|
8532
|
-
]
|
|
8533
|
-
}
|
|
8534
|
-
),
|
|
8535
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: voices.length ? "\u97F3\u8272\u662F\u672C\u673A\u6D4F\u89C8\u5668\u7ED9\u7684\uFF0C\u6362\u8BBE\u5907\u53EF\u80FD\u8981\u91CD\u9009\uFF1B\u672C\u673A\u627E\u4E0D\u5230\u6240\u9009\u97F3\u8272\u65F6\u81EA\u52A8\u6309\u8BED\u8A00\u56DE\u843D" : "\u672C\u673A\u6682\u672A\u8BFB\u5230\u97F3\u8272\uFF08\u7CFB\u7EDF\u8BED\u97F3\u672A\u88C5/\u672A\u542F\u7528\uFF09\uFF0C\u5C06\u6309\u8BED\u8A00\u81EA\u52A8\u6311" })
|
|
8536
|
-
] }),
|
|
8537
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8538
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8BD5\u542C" }),
|
|
8539
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8540
|
-
"button",
|
|
8541
|
-
{
|
|
8542
|
-
type: "button",
|
|
8543
|
-
className: "dknt-btn",
|
|
8544
|
-
disabled: !voiceSupported(),
|
|
8545
|
-
onClick: () => {
|
|
8546
|
-
const preview = Object.assign({}, cfg, { voiceNotify: true });
|
|
8547
|
-
speakVoice(endBroadcastText(true, { title: "\u793A\u4F8B\u4EFB\u52A1", duration: 125e3, turns: 3, steps: 9, toolCalls: 4, lastText: "\u597D\u7684\uFF0C\u4E09\u4EFD\u6587\u6863\u90FD\u5DF2\u66F4\u65B0\u5B8C\u6BD5\u3002" }, null, preview), preview);
|
|
8548
|
-
},
|
|
8549
|
-
children: "\u64AD\u4E00\u53E5"
|
|
8550
|
-
}
|
|
8551
|
-
),
|
|
8552
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8553
|
-
"button",
|
|
8554
|
-
{
|
|
8555
|
-
type: "button",
|
|
8556
|
-
className: "dknt-btn",
|
|
8557
|
-
disabled: !voiceSupported(),
|
|
8558
|
-
onClick: () => {
|
|
8559
|
-
const preview = Object.assign({}, cfg, { voiceNotify: true });
|
|
8560
|
-
speakVoice(confirmBroadcastText({ title: "\u793A\u4F8B\u4EFB\u52A1" }, { toolName: "pwsh" }, preview), preview);
|
|
8561
|
-
},
|
|
8562
|
-
children: "\u9700\u6388\u6743"
|
|
8563
|
-
}
|
|
8564
|
-
),
|
|
8565
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: voiceSupported() ? "\u6D4F\u89C8\u5668\u8BED\u97F3\u5408\u6210\uFF08\u4E0E\u3010\u8BED\u97F3\u6717\u8BFB\u3011\u540C\u4E00\u5957\u58F0\u97F3\uFF0C\u72EC\u7ACB\u5F00\u5173\uFF1B\u6253\u65AD\u5F0F\u2014\u2014\u64AD\u62A5\u4FE1\u65F6\u6B63\u5728\u6717\u8BFB\u7684\u6B63\u6587\u4F1A\u8BA9\u4F4D\uFF09" : "\u672C\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u8BED\u97F3\u5408\u6210\uFF08speechSynthesis \u4E0D\u53EF\u7528\uFF09" })
|
|
8566
|
-
] }),
|
|
8567
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8568
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8BED\u8A00" }),
|
|
8569
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
8570
|
-
"select",
|
|
8571
|
-
{
|
|
8572
|
-
className: "dknt-input",
|
|
8573
|
-
style: { maxWidth: 180 },
|
|
8574
|
-
value: cfg.voiceLang || "",
|
|
8575
|
-
"aria-label": "\u64AD\u62A5\u8BED\u8A00",
|
|
8576
|
-
onChange: (e) => patch({ voiceLang: e.target.value }),
|
|
8577
|
-
children: [
|
|
8578
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: "\u81EA\u52A8\uFF08\u4E2D\u6587\u4F18\u5148\uFF09" }),
|
|
8579
|
-
["zh-CN", "zh-TW", "en-US", "en-GB", "ja-JP", "ko-KR"].map((l) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: l, children: l }, l))
|
|
8580
|
-
]
|
|
8581
|
-
}
|
|
8582
|
-
),
|
|
8583
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u672A\u6307\u5B9A\u97F3\u8272\u65F6\u6309\u8BED\u8A00\u81EA\u52A8\u6311\uFF1B\u5DF2\u9009\u97F3\u8272\u7684\u8BED\u8A00\u4F1A\u8986\u76D6\u8FD9\u91CC" })
|
|
8584
|
-
] })
|
|
8585
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-note", children: "\u670D\u52A1\u7AEF\u603B\u5F00\u5173\u672A\u5F00\u542F\u2014\u2014\u4EFB\u52A1\u4E8B\u4EF6\u4E0D\u64AD\u62A5\u8BED\u97F3\uFF08\u63D0\u793A\u97F3\u3001\u7CFB\u7EDF\u901A\u77E5\u4E0D\u53D7\u5F71\u54CD\uFF09\uFF1B\u4E0A\u9762\u7684\u300C\u672C\u673A\u64AD\u62A5\u300D\u53EA\u51B3\u5B9A\u672C\u6D4F\u89C8\u5668\u662F\u5426\u51FA\u58F0\u3002" })
|
|
8586
|
-
] }, "voice"),
|
|
8587
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec", children: [
|
|
8588
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-sec-head", children: [
|
|
8589
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-title", children: "\u9489\u9489\u63A8\u9001" }),
|
|
8590
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-sub", children: "\u4EFB\u52A1\u7ED3\u675F\u63A8\u9001\u5230\u9489\u9489\u7FA4\u673A\u5668\u4EBA\uFF08\u5BBF\u4E3B\u76F4\u53D1\uFF0C\u6D4F\u89C8\u5668\u5173\u7740\u4E5F\u80FD\u63A8\uFF1B\u4E8B\u4EF6\u8DDF\u968F\u4E0A\u65B9\u5B8C\u6210/\u5F02\u5E38\u5F00\u5173\uFF09" }),
|
|
8591
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-sec-sw", children: [
|
|
8592
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-swlabel" + (cfg.dingtalkEnabled ? " on" : ""), children: cfg.dingtalkEnabled ? "\u5DF2\u5F00\u542F" : "\u5DF2\u5173\u95ED" }),
|
|
8593
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8594
|
-
"button",
|
|
8595
|
-
{
|
|
8596
|
-
type: "button",
|
|
8597
|
-
className: "dock-sw" + (cfg.dingtalkEnabled ? " on" : ""),
|
|
8598
|
-
role: "switch",
|
|
8599
|
-
"aria-checked": cfg.dingtalkEnabled,
|
|
8600
|
-
"aria-label": "\u5F00\u5173\u9489\u9489\u63A8\u9001",
|
|
8601
|
-
title: cfg.dingtalkEnabled ? "\u5173\u95ED\u9489\u9489\u63A8\u9001" : "\u5F00\u542F\u9489\u9489\u63A8\u9001",
|
|
8602
|
-
onClick: () => patch({ dingtalkEnabled: !cfg.dingtalkEnabled })
|
|
8603
|
-
}
|
|
8604
|
-
)
|
|
8605
|
-
] })
|
|
8606
|
-
] }),
|
|
8607
|
-
cfg.dingtalkEnabled ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-rows-narrow", children: [
|
|
8608
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row dknt-row-webhook", children: [
|
|
8609
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "Webhook" }),
|
|
8610
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8611
|
-
"input",
|
|
8612
|
-
{
|
|
8613
|
-
type: "text",
|
|
8614
|
-
className: "dknt-input",
|
|
8615
|
-
spellCheck: false,
|
|
8616
|
-
value: cfg.dingtalkWebhook || "",
|
|
8617
|
-
placeholder: "https://oapi.dingtalk.com/robot/send?access_token=\u2026",
|
|
8618
|
-
onChange: (e) => {
|
|
8619
|
-
editingWebhookRef.current = true;
|
|
8620
|
-
setCfg(Object.assign({}, cfg, { dingtalkWebhook: e.target.value }));
|
|
8684
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel", children: [
|
|
8685
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-head", children: [
|
|
8686
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-title-wrap", children: [
|
|
8687
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-title", children: "\u63D0\u793A\u97F3" }),
|
|
8688
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-sub", children: "\u4EFB\u52A1\u7ED3\u675F / \u9700\u786E\u8BA4\u65F6\u64AD\u653E\uFF0C6 \u79CD\u97F3\u6548\u53EF\u9009" })
|
|
8689
|
+
] }),
|
|
8690
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8691
|
+
"button",
|
|
8692
|
+
{
|
|
8693
|
+
type: "button",
|
|
8694
|
+
className: "dock-sw" + (cfg.soundNotify !== false ? " on" : ""),
|
|
8695
|
+
role: "switch",
|
|
8696
|
+
"aria-checked": cfg.soundNotify !== false,
|
|
8697
|
+
"aria-label": "\u5F00\u5173\u63D0\u793A\u97F3",
|
|
8698
|
+
onClick: () => patch({ soundNotify: cfg.soundNotify === false })
|
|
8621
8699
|
}
|
|
8622
|
-
|
|
8623
|
-
),
|
|
8624
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8625
|
-
"
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8700
|
+
)
|
|
8701
|
+
] }),
|
|
8702
|
+
cfg.soundNotify !== false ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-body", children: [
|
|
8703
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-sounds", children: Object.keys(SOUND_LIBRARY).map((key) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
8704
|
+
"button",
|
|
8705
|
+
{
|
|
8706
|
+
type: "button",
|
|
8707
|
+
className: "dknt-sound" + (cfg.soundEffect === key ? " on" : ""),
|
|
8708
|
+
onClick: () => patch({ soundEffect: key }),
|
|
8709
|
+
children: [
|
|
8710
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-sound-name", children: [
|
|
8711
|
+
SOUND_LIBRARY[key].name,
|
|
8712
|
+
cfg.soundEffect === key ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sound-cur", children: "\u2713" }) : null
|
|
8713
|
+
] }),
|
|
8714
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8715
|
+
"span",
|
|
8716
|
+
{
|
|
8717
|
+
className: "dknt-sound-play",
|
|
8718
|
+
role: "button",
|
|
8719
|
+
tabIndex: 0,
|
|
8720
|
+
title: "\u8BD5\u542C " + SOUND_LIBRARY[key].name,
|
|
8721
|
+
onClick: (e) => {
|
|
8722
|
+
e.stopPropagation();
|
|
8723
|
+
previewSound(key);
|
|
8724
|
+
},
|
|
8725
|
+
onKeyDown: (e) => {
|
|
8726
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
8727
|
+
e.preventDefault();
|
|
8728
|
+
e.stopPropagation();
|
|
8729
|
+
previewSound(key);
|
|
8730
|
+
}
|
|
8731
|
+
},
|
|
8732
|
+
children: "\u25B6"
|
|
8733
|
+
}
|
|
8734
|
+
)
|
|
8735
|
+
]
|
|
8736
|
+
},
|
|
8737
|
+
key
|
|
8738
|
+
)) }),
|
|
8739
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8740
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u4E8B\u4EF6\u8303\u56F4" }),
|
|
8741
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u5728\u300C\u6309\u4E8B\u4EF6\u63D0\u9192\u300D\u7684\u63D0\u793A\u97F3\u5217\u91CC\u52FE\u9009\uFF08\u652F\u6301\u5B8C\u6210 / \u5F02\u5E38 / \u9700\u786E\u8BA4\uFF1B\u5361\u4F4F\u6CA1\u6709\u63D0\u793A\u97F3\uFF09\u3002" })
|
|
8742
|
+
] })
|
|
8743
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-channel-off", children: "\u672A\u5F00\u542F\u2014\u2014\u4EFB\u52A1\u4E8B\u4EF6\u4E0D\u64AD\u653E\u63D0\u793A\u97F3\u3002" })
|
|
8642
8744
|
] }),
|
|
8643
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
"aria-checked": cfg.feishuEnabled,
|
|
8659
|
-
"aria-label": "\u5F00\u5173\u98DE\u4E66\u63A8\u9001",
|
|
8660
|
-
title: cfg.feishuEnabled ? "\u5173\u95ED\u98DE\u4E66\u63A8\u9001" : "\u5F00\u542F\u98DE\u4E66\u63A8\u9001",
|
|
8661
|
-
onClick: () => patch({ feishuEnabled: !cfg.feishuEnabled })
|
|
8662
|
-
}
|
|
8663
|
-
)
|
|
8664
|
-
] })
|
|
8665
|
-
] }),
|
|
8666
|
-
cfg.feishuEnabled ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-rows-narrow", children: [
|
|
8667
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row dknt-row-webhook", children: [
|
|
8668
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "Webhook" }),
|
|
8669
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8670
|
-
"input",
|
|
8671
|
-
{
|
|
8672
|
-
type: "text",
|
|
8673
|
-
className: "dknt-input",
|
|
8674
|
-
spellCheck: false,
|
|
8675
|
-
value: cfg.feishuWebhook || "",
|
|
8676
|
-
placeholder: "https://open.feishu.cn/open-apis/bot/v2/hook/\u2026",
|
|
8677
|
-
onChange: (e) => {
|
|
8678
|
-
editingFeishuRef.current = true;
|
|
8679
|
-
setCfg(Object.assign({}, cfg, { feishuWebhook: e.target.value }));
|
|
8745
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel", children: [
|
|
8746
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-head", children: [
|
|
8747
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-title-wrap", children: [
|
|
8748
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-title", children: "\u7CFB\u7EDF\u901A\u77E5" }),
|
|
8749
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-sub", children: "\u6D4F\u89C8\u5668\u7CFB\u7EDF\u901A\u77E5\uFF0C\u4EC5\u9875\u9762\u5728\u540E\u53F0\u65F6\u63A8\u9001" })
|
|
8750
|
+
] }),
|
|
8751
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8752
|
+
"button",
|
|
8753
|
+
{
|
|
8754
|
+
type: "button",
|
|
8755
|
+
className: "dock-sw" + (cfg.systemNotify ? " on" : ""),
|
|
8756
|
+
role: "switch",
|
|
8757
|
+
"aria-checked": cfg.systemNotify,
|
|
8758
|
+
"aria-label": "\u5F00\u5173\u7CFB\u7EDF\u901A\u77E5",
|
|
8759
|
+
onClick: () => enableSystemNotify(!cfg.systemNotify)
|
|
8680
8760
|
}
|
|
8681
|
-
|
|
8682
|
-
),
|
|
8683
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8684
|
-
"
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
}
|
|
8692
|
-
)
|
|
8761
|
+
)
|
|
8762
|
+
] }),
|
|
8763
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-body", children: [
|
|
8764
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8765
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u6743\u9650" }),
|
|
8766
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: permNote })
|
|
8767
|
+
] }),
|
|
8768
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8769
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u4E8B\u4EF6\u8303\u56F4" }),
|
|
8770
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u5728\u300C\u6309\u4E8B\u4EF6\u63D0\u9192\u300D\u7684\u7CFB\u7EDF\u901A\u77E5\u5217\u91CC\u52FE\u9009\uFF08\u652F\u6301\u5B8C\u6210 / \u5F02\u5E38 / \u9700\u786E\u8BA4\uFF1B\u5361\u4F4F\u6CA1\u6709\u7CFB\u7EDF\u901A\u77E5\uFF09\u3002" })
|
|
8771
|
+
] })
|
|
8772
|
+
] })
|
|
8693
8773
|
] }),
|
|
8694
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-
|
|
8695
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8774
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel", children: [
|
|
8775
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-head", children: [
|
|
8776
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-title-wrap", children: [
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-title", children: "\u8BED\u97F3\u64AD\u62A5" }),
|
|
8778
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-sub", children: "\u7528\u6D4F\u89C8\u5668\u8BED\u97F3\uFF08TTS\uFF09\u8BF4\u4E00\u53E5\u8BDD\uFF1B\u670D\u52A1\u7AEF\u603B\u5F00\u5173 + \u672C\u673A\u5F00\u5173\u90FD\u5F00\u624D\u64AD\u62A5" })
|
|
8779
|
+
] }),
|
|
8780
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-sec-sw", children: [
|
|
8781
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-swlabel" + (cfg.voiceNotify ? " on" : ""), children: cfg.voiceNotify ? "\u670D\u52A1\u7AEF\uFF1A\u5DF2\u5F00\u542F" : "\u670D\u52A1\u7AEF\uFF1A\u5DF2\u5173\u95ED" }),
|
|
8782
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8783
|
+
"button",
|
|
8784
|
+
{
|
|
8785
|
+
type: "button",
|
|
8786
|
+
className: "dock-sw" + (cfg.voiceNotify ? " on" : ""),
|
|
8787
|
+
role: "switch",
|
|
8788
|
+
"aria-checked": cfg.voiceNotify,
|
|
8789
|
+
"aria-label": "\u5F00\u5173\u8BED\u97F3\u64AD\u62A5\uFF08\u670D\u52A1\u7AEF\u603B\u5F00\u5173\uFF09",
|
|
8790
|
+
disabled: source === "client",
|
|
8791
|
+
title: source === "client" ? "\u670D\u52A1\u7AEF\u603B\u5F00\u5173\u9700\u5207\u6362\u5230\u300C\u670D\u52A1\u7AEF\u914D\u7F6E\u300D\u4FEE\u6539" : cfg.voiceNotify ? "\u5173\u95ED\u8BED\u97F3\u64AD\u62A5\uFF08\u670D\u52A1\u7AEF\u603B\u5F00\u5173\uFF09" : "\u5F00\u542F\u8BED\u97F3\u64AD\u62A5\uFF08\u670D\u52A1\u7AEF\u603B\u5F00\u5173\uFF09",
|
|
8792
|
+
onClick: () => {
|
|
8793
|
+
if (source !== "client") patch({ voiceNotify: !cfg.voiceNotify });
|
|
8794
|
+
}
|
|
8795
|
+
}
|
|
8796
|
+
)
|
|
8797
|
+
] })
|
|
8798
|
+
] }),
|
|
8799
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-body", children: [
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8801
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u672C\u673A\u64AD\u62A5" }),
|
|
8802
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8803
|
+
"button",
|
|
8804
|
+
{
|
|
8805
|
+
type: "button",
|
|
8806
|
+
className: "dknt-miniswitch" + (voiceClientOn ? " on" : ""),
|
|
8807
|
+
role: "switch",
|
|
8808
|
+
"aria-checked": voiceClientOn,
|
|
8809
|
+
"aria-label": "\u5F00\u5173\u672C\u673A\u8BED\u97F3\u64AD\u62A5",
|
|
8810
|
+
title: voiceClientOn ? "\u5173\u95ED\u672C\u673A\u8BED\u97F3\u64AD\u62A5" : "\u5F00\u542F\u672C\u673A\u8BED\u97F3\u64AD\u62A5",
|
|
8811
|
+
onClick: () => setVoiceClientOn(!voiceClientOn),
|
|
8812
|
+
children: voiceClientOn ? "\u5F00" : "\u5173"
|
|
8813
|
+
}
|
|
8814
|
+
),
|
|
8815
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: voiceClientOn ? "\u672C\u6D4F\u89C8\u5668\u4F1A\u64AD\u62A5\uFF08\u8BBE\u7F6E\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\uFF1B\u670D\u52A1\u7AEF\u603B\u5F00\u5173\u5173\u95ED\u65F6\u4E0D\u751F\u6548\uFF09" : "\u672C\u6D4F\u89C8\u5668\u4E0D\u64AD\u62A5\uFF08\u8BBE\u7F6E\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u6D4F\u89C8\u5668\uFF09" })
|
|
8816
|
+
] }),
|
|
8817
|
+
cfg.voiceNotify ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
8818
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8819
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u64AD\u62A5\u53E3\u5F84" }),
|
|
8820
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ModePicker, { value: voiceTone(cfg), title: "\u8BED\u97F3\u64AD\u62A5", onChange: (v) => patch({ voiceMode: v }) }),
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u7B80\u6D01\uFF1A\u4E00\u53E5\u300C\u4EFB\u52A1\u5B8C\u6210 / \u4EFB\u52A1\u505C\u6B62\u4E86 / \u4EFB\u52A1\u9700\u8981\u6388\u6743 / \u4E3B\u4EFB\u52A1\uFF08\u6216\u5B50\u4EFB\u52A1\uFF09\xB7\u6807\u9898 \u5361\u4F4F\u4E86\u300D\uFF1B\u9002\u4E2D\uFF1A\u70B9\u540D\u4EFB\u52A1\uFF0C\u7ED3\u675F\u5E26\u539F\u56E0\u4E0E\u8017\u65F6\u3001\u5361\u4F4F\u5E26\u505C\u6EDE\u65F6\u957F\uFF1B\u8BE6\u7EC6\uFF1A\u7ED3\u675F\u5E26\u56DE\u5408\u7EDF\u8BA1\u4E0E\u56DE\u590D\u6458\u8981\uFF0C\u9700\u6388\u6743\u5E26\u5DE5\u5177\u540D\uFF0C\u5361\u4F4F\u5E26\u6700\u540E\u52A8\u4F5C\u3002" })
|
|
8822
|
+
] }),
|
|
8823
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8824
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u64AD\u62A5\u4E8B\u4EF6" }),
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u5728\u300C\u6309\u4E8B\u4EF6\u63D0\u9192\u300D\u7684\u8BED\u97F3\u64AD\u62A5\u5217\u91CC\u52FE\u9009\uFF08\u652F\u6301\u5B8C\u6210 / \u5F02\u5E38 / \u9700\u786E\u8BA4 / \u5361\u4F4F\uFF09\u3002" })
|
|
8826
|
+
] }),
|
|
8827
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8828
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8BED\u901F" }),
|
|
8829
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8830
|
+
"input",
|
|
8831
|
+
{
|
|
8832
|
+
type: "range",
|
|
8833
|
+
min: "0.5",
|
|
8834
|
+
max: "2",
|
|
8835
|
+
step: "0.05",
|
|
8836
|
+
value: String(cfg.voiceRate || 1),
|
|
8837
|
+
"aria-label": "\u64AD\u62A5\u8BED\u901F",
|
|
8838
|
+
style: { width: 120, accentColor: "var(--dk-accent)" },
|
|
8839
|
+
onChange: (e) => patch({ voiceRate: Number(e.target.value) || 1 })
|
|
8840
|
+
}
|
|
8841
|
+
),
|
|
8842
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-row-sub", children: [
|
|
8843
|
+
Number(cfg.voiceRate || 1).toFixed(2),
|
|
8844
|
+
"\xD7\uFF08\u64AD\u62A5\u6BD4\u6B63\u6587\u6717\u8BFB\u7565\u5FEB\u66F4\u5229\u843D\uFF09"
|
|
8845
|
+
] })
|
|
8846
|
+
] }),
|
|
8847
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8848
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u97F3\u91CF" }),
|
|
8849
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8850
|
+
"input",
|
|
8851
|
+
{
|
|
8852
|
+
type: "range",
|
|
8853
|
+
min: "0",
|
|
8854
|
+
max: "1",
|
|
8855
|
+
step: "0.05",
|
|
8856
|
+
value: String(cfg.voiceVolume == null ? 1 : cfg.voiceVolume),
|
|
8857
|
+
"aria-label": "\u64AD\u62A5\u97F3\u91CF",
|
|
8858
|
+
style: { width: 120, accentColor: "var(--dk-accent)" },
|
|
8859
|
+
onChange: (e) => patch({ voiceVolume: Number(e.target.value) })
|
|
8860
|
+
}
|
|
8861
|
+
),
|
|
8862
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-row-sub", children: [
|
|
8863
|
+
Math.round((cfg.voiceVolume == null ? 1 : cfg.voiceVolume) * 100),
|
|
8864
|
+
"%"
|
|
8865
|
+
] })
|
|
8866
|
+
] }),
|
|
8867
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8868
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u97F3\u8272" }),
|
|
8869
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
8870
|
+
"select",
|
|
8871
|
+
{
|
|
8872
|
+
className: "dknt-input",
|
|
8873
|
+
style: { maxWidth: 260 },
|
|
8874
|
+
value: cfg.voiceURI || "",
|
|
8875
|
+
"aria-label": "\u64AD\u62A5\u97F3\u8272",
|
|
8876
|
+
onChange: (e) => patch({ voiceURI: e.target.value }),
|
|
8877
|
+
children: [
|
|
8878
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: "\u81EA\u52A8\uFF08\u6309\u8BED\u8A00\u6311\uFF09" }),
|
|
8879
|
+
(() => {
|
|
8880
|
+
const zh = [], other = [];
|
|
8881
|
+
for (const v of voices) {
|
|
8882
|
+
if (!v || !v.voiceURI) continue;
|
|
8883
|
+
if (/^zh/i.test(String(v.lang || ""))) zh.push(v);
|
|
8884
|
+
else other.push(v);
|
|
8885
|
+
}
|
|
8886
|
+
const groups = [];
|
|
8887
|
+
if (zh.length) groups.push(["\u4E2D\u6587\u97F3\u8272", zh]);
|
|
8888
|
+
if (other.length) groups.push(["\u5176\u4ED6\u97F3\u8272", other]);
|
|
8889
|
+
return groups.map(([gname, vs]) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("optgroup", { label: gname, children: vs.map((v) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: v.voiceURI, children: (v.name || v.voiceURI) + "\uFF08" + (v.lang || "?") + "\uFF09" }, v.voiceURI)) }, gname));
|
|
8890
|
+
})()
|
|
8891
|
+
]
|
|
8892
|
+
}
|
|
8893
|
+
),
|
|
8894
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: voices.length ? "\u97F3\u8272\u662F\u672C\u673A\u6D4F\u89C8\u5668\u7ED9\u7684\uFF0C\u6362\u8BBE\u5907\u53EF\u80FD\u8981\u91CD\u9009\uFF1B\u672C\u673A\u627E\u4E0D\u5230\u6240\u9009\u97F3\u8272\u65F6\u81EA\u52A8\u6309\u8BED\u8A00\u56DE\u843D" : "\u672C\u673A\u6682\u672A\u8BFB\u5230\u97F3\u8272\uFF08\u7CFB\u7EDF\u8BED\u97F3\u672A\u88C5/\u672A\u542F\u7528\uFF09\uFF0C\u5C06\u6309\u8BED\u8A00\u81EA\u52A8\u6311" })
|
|
8895
|
+
] }),
|
|
8896
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8BD5\u542C" }),
|
|
8898
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8899
|
+
"button",
|
|
8900
|
+
{
|
|
8901
|
+
type: "button",
|
|
8902
|
+
className: "dknt-btn",
|
|
8903
|
+
disabled: !voiceSupported(),
|
|
8904
|
+
onClick: () => {
|
|
8905
|
+
const preview = Object.assign({}, cfg, { voiceNotify: true });
|
|
8906
|
+
speakVoice(endBroadcastText(true, { title: "\u793A\u4F8B\u4EFB\u52A1", duration: 125e3, turns: 3, steps: 9, toolCalls: 4, lastText: "\u597D\u7684\uFF0C\u4E09\u4EFD\u6587\u6863\u90FD\u5DF2\u66F4\u65B0\u5B8C\u6BD5\u3002" }, null, preview), preview);
|
|
8907
|
+
},
|
|
8908
|
+
children: "\u64AD\u4E00\u53E5"
|
|
8909
|
+
}
|
|
8910
|
+
),
|
|
8911
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8912
|
+
"button",
|
|
8913
|
+
{
|
|
8914
|
+
type: "button",
|
|
8915
|
+
className: "dknt-btn",
|
|
8916
|
+
disabled: !voiceSupported(),
|
|
8917
|
+
onClick: () => {
|
|
8918
|
+
const preview = Object.assign({}, cfg, { voiceNotify: true });
|
|
8919
|
+
speakVoice(confirmBroadcastText({ title: "\u793A\u4F8B\u4EFB\u52A1" }, { toolName: "pwsh" }, preview), preview);
|
|
8920
|
+
},
|
|
8921
|
+
children: "\u9700\u6388\u6743"
|
|
8922
|
+
}
|
|
8923
|
+
),
|
|
8924
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: voiceSupported() ? "\u6D4F\u89C8\u5668\u8BED\u97F3\u5408\u6210\uFF08\u4E0E\u3010\u8BED\u97F3\u6717\u8BFB\u3011\u540C\u4E00\u5957\u58F0\u97F3\uFF0C\u72EC\u7ACB\u5F00\u5173\uFF1B\u6253\u65AD\u5F0F\u2014\u2014\u64AD\u62A5\u4FE1\u65F6\u6B63\u5728\u6717\u8BFB\u7684\u6B63\u6587\u4F1A\u8BA9\u4F4D\uFF09" : "\u672C\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u8BED\u97F3\u5408\u6210\uFF08speechSynthesis \u4E0D\u53EF\u7528\uFF09" })
|
|
8925
|
+
] }),
|
|
8926
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8927
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8BED\u8A00" }),
|
|
8928
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
8929
|
+
"select",
|
|
8930
|
+
{
|
|
8931
|
+
className: "dknt-input",
|
|
8932
|
+
style: { maxWidth: 180 },
|
|
8933
|
+
value: cfg.voiceLang || "",
|
|
8934
|
+
"aria-label": "\u64AD\u62A5\u8BED\u8A00",
|
|
8935
|
+
onChange: (e) => patch({ voiceLang: e.target.value }),
|
|
8936
|
+
children: [
|
|
8937
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: "\u81EA\u52A8\uFF08\u4E2D\u6587\u4F18\u5148\uFF09" }),
|
|
8938
|
+
["zh-CN", "zh-TW", "en-US", "en-GB", "ja-JP", "ko-KR"].map((l) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: l, children: l }, l))
|
|
8939
|
+
]
|
|
8940
|
+
}
|
|
8941
|
+
),
|
|
8942
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u672A\u6307\u5B9A\u97F3\u8272\u65F6\u6309\u8BED\u8A00\u81EA\u52A8\u6311\uFF1B\u5DF2\u9009\u97F3\u8272\u7684\u8BED\u8A00\u4F1A\u8986\u76D6\u8FD9\u91CC" })
|
|
8943
|
+
] })
|
|
8944
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-channel-off", children: "\u670D\u52A1\u7AEF\u603B\u5F00\u5173\u672A\u5F00\u542F\u2014\u2014\u4EFB\u52A1\u4E8B\u4EF6\u4E0D\u64AD\u62A5\u8BED\u97F3\uFF1B\u4E0A\u9762\u7684\u300C\u672C\u673A\u64AD\u62A5\u300D\u53EA\u51B3\u5B9A\u672C\u6D4F\u89C8\u5668\u662F\u5426\u51FA\u58F0\u3002" })
|
|
8945
|
+
] })
|
|
8946
|
+
] })
|
|
8947
|
+
] }, "channels")
|
|
8948
|
+
);
|
|
8949
|
+
} else {
|
|
8950
|
+
rows.push(
|
|
8951
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channels", children: [
|
|
8952
|
+
source === "client" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-note dknt-note-box", children: "\u7FA4\u673A\u5668\u4EBA\u63A8\u9001\u7531\u670D\u52A1\u7AEF\u6267\u884C\uFF0C\u59CB\u7EC8\u4F7F\u7528\u670D\u52A1\u7AEF\u914D\u7F6E\uFF1B\u8BF7\u5207\u6362\u5230\u300C\u670D\u52A1\u7AEF\u914D\u7F6E\u300D\u4FEE\u6539\u3002" }) : null,
|
|
8953
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel", children: [
|
|
8954
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-head", children: [
|
|
8955
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-title-wrap", children: [
|
|
8956
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-title", children: "\u9489\u9489\u63A8\u9001" }),
|
|
8957
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-sub", children: "\u4EFB\u52A1\u7ED3\u675F\u63A8\u9001\u5230\u9489\u9489\u7FA4\u673A\u5668\u4EBA\uFF08\u5BBF\u4E3B\u76F4\u53D1\uFF0C\u6D4F\u89C8\u5668\u5173\u7740\u4E5F\u80FD\u63A8\uFF09" })
|
|
8958
|
+
] }),
|
|
8959
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-sec-sw", children: [
|
|
8960
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-swlabel" + (cfg.dingtalkEnabled ? " on" : ""), children: cfg.dingtalkEnabled ? "\u5DF2\u5F00\u542F" : "\u5DF2\u5173\u95ED" }),
|
|
8961
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8962
|
+
"button",
|
|
8963
|
+
{
|
|
8964
|
+
type: "button",
|
|
8965
|
+
className: "dock-sw" + (cfg.dingtalkEnabled ? " on" : ""),
|
|
8966
|
+
role: "switch",
|
|
8967
|
+
"aria-checked": cfg.dingtalkEnabled,
|
|
8968
|
+
"aria-label": "\u5F00\u5173\u9489\u9489\u63A8\u9001",
|
|
8969
|
+
disabled: source === "client",
|
|
8970
|
+
onClick: () => {
|
|
8971
|
+
if (source !== "client") patch({ dingtalkEnabled: !cfg.dingtalkEnabled });
|
|
8972
|
+
}
|
|
8973
|
+
}
|
|
8974
|
+
)
|
|
8975
|
+
] })
|
|
8976
|
+
] }),
|
|
8977
|
+
source === "client" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-channel-off", children: "\u672C\u673A\u914D\u7F6E\u6A21\u5F0F\u4E0D\u4FEE\u6539\u7FA4\u673A\u5668\u4EBA\uFF1B\u5207\u56DE\u670D\u52A1\u7AEF\u914D\u7F6E\u540E\u53EF\u7F16\u8F91 Webhook\u3002" }) : !cfg.dingtalkEnabled ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-channel-off", children: "\u672A\u5F00\u542F\u2014\u2014\u4EFB\u52A1\u7ED3\u675F\u4E0D\u63A8\u9001\u9489\u9489\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-body", children: [
|
|
8978
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
8979
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u6D88\u606F\u53E3\u5F84" }),
|
|
8980
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ModePicker, { value: cfg.pushMode || "detailed", title: "\u9489\u9489\u6D88\u606F", onChange: (v) => patch({ pushMode: v }) }),
|
|
8981
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u7B80\u6D01\uFF1D\u4EFB\u52A1\u4E0E\u7ED3\u679C\uFF1B\u9002\u4E2D\uFF1D\u52A0\u6A21\u578B/\u8017\u65F6\uFF1B\u8BE6\u7EC6\uFF1D\u518D\u52A0\u56DE\u5408\u3001Token \u4E0E\u6458\u8981\u3002" })
|
|
8982
|
+
] }),
|
|
8983
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row dknt-row-webhook", children: [
|
|
8984
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "Webhook" }),
|
|
8985
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
8986
|
+
"input",
|
|
8987
|
+
{
|
|
8988
|
+
type: "text",
|
|
8989
|
+
className: "dknt-input",
|
|
8990
|
+
spellCheck: false,
|
|
8991
|
+
value: cfg.dingtalkWebhook || "",
|
|
8992
|
+
placeholder: "https://oapi.dingtalk.com/robot/send?access_token=\u2026",
|
|
8993
|
+
onChange: (e) => {
|
|
8994
|
+
editingWebhookRef.current = true;
|
|
8995
|
+
setServerDraft(Object.assign({}, cfg, { dingtalkWebhook: e.target.value }));
|
|
8996
|
+
}
|
|
8997
|
+
}
|
|
8998
|
+
),
|
|
8999
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
9000
|
+
"button",
|
|
9001
|
+
{
|
|
9002
|
+
type: "button",
|
|
9003
|
+
className: "dknt-btn",
|
|
9004
|
+
disabled: !editingWebhookRef.current,
|
|
9005
|
+
onClick: saveWebhook,
|
|
9006
|
+
children: editingWebhookRef.current ? "\u4FDD\u5B58" : "\u5DF2\u4FDD\u5B58"
|
|
9007
|
+
}
|
|
9008
|
+
)
|
|
9009
|
+
] }),
|
|
9010
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
9011
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8FDE\u901A\u6D4B\u8BD5" }),
|
|
9012
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: "dknt-btn", disabled: testing, onClick: runDingtalkTest, children: testing ? "\u53D1\u9001\u4E2D\u2026" : "\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F" }),
|
|
9013
|
+
testState ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-row-sub" + (testState.ok ? " dknt-ok" : " dknt-err"), children: [
|
|
9014
|
+
testState.ok ? "\u2713 " : "\u2717 ",
|
|
9015
|
+
testState.msg
|
|
9016
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u7528\u5F53\u524D\u4FDD\u5B58\u7684 Webhook \u53D1\u4E00\u6761\u6D4B\u8BD5\u6D88\u606F" })
|
|
9017
|
+
] }),
|
|
9018
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-note", children: "\u673A\u5668\u4EBA\u521B\u5EFA\uFF1A\u9489\u9489\u7FA4 \u2192 \u8BBE\u7F6E \u2192 \u667A\u80FD\u7FA4\u52A9\u624B \u2192 \u6DFB\u52A0\u673A\u5668\u4EBA \u2192 \u81EA\u5B9A\u4E49\uFF08Webhook\uFF09\uFF0C\u5B89\u5168\u8BBE\u7F6E\u9009\u300C\u81EA\u5B9A\u4E49\u5173\u952E\u8BCD\u300D\u586B\u300C\u4EFB\u52A1\u300D\u6216\u300Cdsh\u300D\uFF08\u63A8\u9001\u6807\u9898\u542B\u300C\u4EFB\u52A1\u300D\u5373\u53EF\u547D\u4E2D\uFF09\u3002" })
|
|
9019
|
+
] })
|
|
8701
9020
|
] }),
|
|
8702
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
9021
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel", children: [
|
|
9022
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-head", children: [
|
|
9023
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-title-wrap", children: [
|
|
9024
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-title", children: "\u98DE\u4E66\u63A8\u9001" }),
|
|
9025
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-channel-sub", children: "\u4EFB\u52A1\u7ED3\u675F\u4EE5\u5361\u7247\u5F62\u5F0F\u63A8\u9001\u5230\u98DE\u4E66\u7FA4\u673A\u5668\u4EBA\uFF08\u5BBF\u4E3B\u76F4\u53D1\uFF09" })
|
|
9026
|
+
] }),
|
|
9027
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-sec-sw", children: [
|
|
9028
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-sec-swlabel" + (cfg.feishuEnabled ? " on" : ""), children: cfg.feishuEnabled ? "\u5DF2\u5F00\u542F" : "\u5DF2\u5173\u95ED" }),
|
|
9029
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
9030
|
+
"button",
|
|
9031
|
+
{
|
|
9032
|
+
type: "button",
|
|
9033
|
+
className: "dock-sw" + (cfg.feishuEnabled ? " on" : ""),
|
|
9034
|
+
role: "switch",
|
|
9035
|
+
"aria-checked": cfg.feishuEnabled,
|
|
9036
|
+
"aria-label": "\u5F00\u5173\u98DE\u4E66\u63A8\u9001",
|
|
9037
|
+
disabled: source === "client",
|
|
9038
|
+
onClick: () => {
|
|
9039
|
+
if (source !== "client") patch({ feishuEnabled: !cfg.feishuEnabled });
|
|
9040
|
+
}
|
|
9041
|
+
}
|
|
9042
|
+
)
|
|
9043
|
+
] })
|
|
9044
|
+
] }),
|
|
9045
|
+
source === "client" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-channel-off", children: "\u672C\u673A\u914D\u7F6E\u6A21\u5F0F\u4E0D\u4FEE\u6539\u7FA4\u673A\u5668\u4EBA\uFF1B\u5207\u56DE\u670D\u52A1\u7AEF\u914D\u7F6E\u540E\u53EF\u7F16\u8F91 Webhook\u3002" }) : !cfg.feishuEnabled ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-channel-off", children: "\u672A\u5F00\u542F\u2014\u2014\u4EFB\u52A1\u7ED3\u675F\u4E0D\u63A8\u9001\u98DE\u4E66\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-channel-body", children: [
|
|
9046
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
9047
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u6D88\u606F\u53E3\u5F84" }),
|
|
9048
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ModePicker, { value: cfg.pushMode || "detailed", title: "\u98DE\u4E66\u6D88\u606F", onChange: (v) => patch({ pushMode: v }) }),
|
|
9049
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u7B80\u6D01\uFF1D\u4EFB\u52A1\u4E0E\u7ED3\u679C\uFF1B\u9002\u4E2D\uFF1D\u52A0\u6A21\u578B/\u8017\u65F6\uFF1B\u8BE6\u7EC6\uFF1D\u518D\u52A0\u56DE\u5408\u3001Token \u4E0E\u6458\u8981\u3002" })
|
|
9050
|
+
] }),
|
|
9051
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row dknt-row-webhook", children: [
|
|
9052
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "Webhook" }),
|
|
9053
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
9054
|
+
"input",
|
|
9055
|
+
{
|
|
9056
|
+
type: "text",
|
|
9057
|
+
className: "dknt-input",
|
|
9058
|
+
spellCheck: false,
|
|
9059
|
+
value: cfg.feishuWebhook || "",
|
|
9060
|
+
placeholder: "https://open.feishu.cn/open-apis/bot/v2/hook/\u2026",
|
|
9061
|
+
onChange: (e) => {
|
|
9062
|
+
editingFeishuRef.current = true;
|
|
9063
|
+
setServerDraft(Object.assign({}, cfg, { feishuWebhook: e.target.value }));
|
|
9064
|
+
}
|
|
9065
|
+
}
|
|
9066
|
+
),
|
|
9067
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
9068
|
+
"button",
|
|
9069
|
+
{
|
|
9070
|
+
type: "button",
|
|
9071
|
+
className: "dknt-btn",
|
|
9072
|
+
disabled: !editingFeishuRef.current,
|
|
9073
|
+
onClick: saveFeishuWebhook,
|
|
9074
|
+
children: editingFeishuRef.current ? "\u4FDD\u5B58" : "\u5DF2\u4FDD\u5B58"
|
|
9075
|
+
}
|
|
9076
|
+
)
|
|
9077
|
+
] }),
|
|
9078
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dknt-row", children: [
|
|
9079
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-label", children: "\u8FDE\u901A\u6D4B\u8BD5" }),
|
|
9080
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: "dknt-btn", disabled: feishuTesting, onClick: runFeishuTest, children: feishuTesting ? "\u53D1\u9001\u4E2D\u2026" : "\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F" }),
|
|
9081
|
+
feishuTestState ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "dknt-row-sub" + (feishuTestState.ok ? " dknt-ok" : " dknt-err"), children: [
|
|
9082
|
+
feishuTestState.ok ? "\u2713 " : "\u2717 ",
|
|
9083
|
+
feishuTestState.msg
|
|
9084
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-row-sub", children: "\u7528\u5F53\u524D\u4FDD\u5B58\u7684 Webhook \u53D1\u4E00\u6761\u6D4B\u8BD5\u6D88\u606F" })
|
|
9085
|
+
] }),
|
|
9086
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-note", children: "\u673A\u5668\u4EBA\u521B\u5EFA\uFF1A\u98DE\u4E66\u7FA4 \u2192 \u8BBE\u7F6E \u2192 \u7FA4\u673A\u5668\u4EBA \u2192 \u6DFB\u52A0\u673A\u5668\u4EBA \u2192 \u81EA\u5B9A\u4E49\u673A\u5668\u4EBA\uFF08\u83B7\u53D6 Webhook \u5730\u5740\uFF09\uFF1B\u5B89\u5168\u8BBE\u7F6E\u5982\u9009\u300C\u81EA\u5B9A\u4E49\u5173\u952E\u8BCD\u300D\u586B\u300C\u4EFB\u52A1\u300D\u6216\u300Cdsh\u300D\uFF08\u63A8\u9001\u6807\u9898\u542B\u300C\u4EFB\u52A1\u300D\u5373\u53EF\u547D\u4E2D\uFF09\u3002" })
|
|
9087
|
+
] })
|
|
9088
|
+
] })
|
|
9089
|
+
] }, "robots")
|
|
9090
|
+
);
|
|
9091
|
+
}
|
|
8706
9092
|
}
|
|
8707
9093
|
if (saveErr) rows.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dknt-note dknt-err", children: saveErr }, "err"));
|
|
8708
9094
|
rows.push(
|
|
@@ -8712,10 +9098,16 @@ function NotifyView(props) {
|
|
|
8712
9098
|
}
|
|
8713
9099
|
function NotifyStat(props) {
|
|
8714
9100
|
const snap = useNotify(props && props.ctx);
|
|
8715
|
-
const cfg = snap.status
|
|
9101
|
+
const cfg = snap.status ? effectiveNotifyConfig(snap.status.config) : null;
|
|
8716
9102
|
if (snap.error) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dknt-err", children: "\u901A\u77E5\u72B6\u6001\u4E0D\u53EF\u7528\uFF08\u5BBF\u4E3B\u9700\u91CD\u542F\u52A0\u8F7D\u901A\u77E5\u8DEF\u7531\uFF09" });
|
|
8717
9103
|
if (!cfg) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "\u7B49\u5F85\u901A\u77E5\u914D\u7F6E\u2026" });
|
|
8718
|
-
const
|
|
9104
|
+
const anyChannel = (event) => MATRIX_COLUMNS.some((column) => eventEnabled(cfg, column.id, event));
|
|
9105
|
+
const events = [
|
|
9106
|
+
anyChannel("complete") ? "\u5B8C\u6210" : "",
|
|
9107
|
+
anyChannel("error") ? "\u5F02\u5E38" : "",
|
|
9108
|
+
anyChannel("confirm") ? "\u9700\u786E\u8BA4/\u9700\u56DE\u7B54" : "",
|
|
9109
|
+
anyChannel("stuck") ? "\u5361\u4F4F" : ""
|
|
9110
|
+
].filter(Boolean);
|
|
8719
9111
|
const voiceMode = cfg.voiceMode === "detailed" ? "\xB7\u8BE6" : cfg.voiceMode === "medium" ? "\xB7\u9002" : "\xB7\u7B80";
|
|
8720
9112
|
const voice = !cfg.voiceNotify ? "" : voiceClientEnabled() ? "\u8BED\u97F3\u64AD\u62A5" + voiceMode : "\u8BED\u97F3\u64AD\u62A5\xB7\u672C\u673A\u5DF2\u5173";
|
|
8721
9113
|
const extras = [cfg.soundNotify !== false ? "\u63D0\u793A\u97F3" : "", cfg.systemNotify ? "\u7CFB\u7EDF\u901A\u77E5" : "", voice].filter(Boolean);
|
|
@@ -8765,6 +9157,48 @@ var css3 = [
|
|
|
8765
9157
|
".dknt-row-sub{font-size:11px;color:var(--dsw-alias-label-tertiary);}",
|
|
8766
9158
|
".dknt-miniswitch{cursor:pointer;flex:none;border:1px solid var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:999px;padding:1px 12px;font-family:inherit;font-size:11px;line-height:18px;}",
|
|
8767
9159
|
".dknt-miniswitch.on{color:var(--dsw-alias-state-success-primary);border-color:currentColor;}",
|
|
9160
|
+
// 配置来源与页签
|
|
9161
|
+
".dknt-source{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;padding:10px 12px;}",
|
|
9162
|
+
".dknt-source-info{display:flex;flex-direction:column;gap:2px;flex:1;min-width:180px;}",
|
|
9163
|
+
".dknt-source-title{font-weight:600;font-size:13px;color:var(--dsw-alias-label-primary);}",
|
|
9164
|
+
".dknt-source-sub{font-size:11px;color:var(--dsw-alias-label-tertiary);}",
|
|
9165
|
+
".dknt-seg{display:inline-flex;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;overflow:hidden;flex:none;}",
|
|
9166
|
+
".dknt-seg-btn{cursor:pointer;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;padding:5px 12px;}",
|
|
9167
|
+
".dknt-seg-btn + .dknt-seg-btn{border-left:1px solid var(--dsw-alias-border-l2);}",
|
|
9168
|
+
".dknt-seg-btn.on{background:var(--dk-accent-soft);color:var(--dk-accent);font-weight:600;}",
|
|
9169
|
+
".dknt-tabs{display:flex;gap:4px;border-bottom:1px solid var(--dsw-alias-border-l1);padding:0 2px;}",
|
|
9170
|
+
".dknt-tab{cursor:pointer;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:13px;padding:7px 12px;border-bottom:2px solid transparent;margin-bottom:-1px;}",
|
|
9171
|
+
".dknt-tab.on{color:var(--dk-accent);border-bottom-color:var(--dk-accent);font-weight:600;}",
|
|
9172
|
+
// 事件 × 渠道矩阵
|
|
9173
|
+
".dknt-matrix-wrap{overflow-x:auto;}",
|
|
9174
|
+
".dknt-matrix{display:flex;flex-direction:column;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;overflow:hidden;min-width:620px;}",
|
|
9175
|
+
".dknt-matrix-row{display:grid;grid-template-columns:minmax(150px,1.4fr) repeat(6,minmax(56px,1fr));align-items:center;}",
|
|
9176
|
+
".dknt-matrix-row:nth-child(even){background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 55%,transparent);}",
|
|
9177
|
+
".dknt-matrix-head{background:var(--dsw-alias-bg-layer-2);border-bottom:1px solid var(--dsw-alias-border-l1);}",
|
|
9178
|
+
".dknt-matrix-col{font-size:11px;font-weight:600;color:var(--dsw-alias-label-secondary);text-align:center;padding:7px 4px;display:flex;flex-direction:column;align-items:center;gap:1px;}",
|
|
9179
|
+
".dknt-matrix-col em{font-style:normal;font-size:10px;font-weight:400;color:var(--dsw-alias-label-tertiary);}",
|
|
9180
|
+
".dknt-matrix-col.on em{color:var(--dsw-alias-state-success-primary);}",
|
|
9181
|
+
".dknt-matrix-event{display:flex;flex-direction:column;gap:1px;padding:8px 10px;font-size:12px;color:var(--dsw-alias-label-primary);}",
|
|
9182
|
+
".dknt-matrix-event small{font-size:10px;color:var(--dsw-alias-label-tertiary);}",
|
|
9183
|
+
".dknt-cell{justify-self:center;cursor:pointer;width:24px;height:24px;border-radius:6px;border:1px solid var(--dsw-alias-border-l2);background:transparent;color:transparent;font-family:inherit;font-size:12px;line-height:1;display:inline-flex;align-items:center;justify-content:center;margin:5px 0;}",
|
|
9184
|
+
".dknt-cell.on{border-color:var(--dsw-alias-state-success-primary);background:color-mix(in srgb,var(--dsw-alias-state-success-primary) 14%,transparent);color:var(--dsw-alias-state-success-primary);}",
|
|
9185
|
+
".dknt-cell-na{cursor:default;border-style:dashed;color:var(--dsw-alias-label-tertiary);}",
|
|
9186
|
+
".dknt-cell.disabled{opacity:.4;cursor:not-allowed;}",
|
|
9187
|
+
".dknt-matrix-legend{display:flex;gap:12px;flex-wrap:wrap;padding-top:6px;font-size:10px;color:var(--dsw-alias-label-tertiary);}",
|
|
9188
|
+
".dknt-matrix-legend span{display:inline-flex;align-items:center;gap:4px;}",
|
|
9189
|
+
".dknt-dot{width:8px;height:8px;border-radius:50%;background:var(--dsw-alias-label-tertiary);display:inline-block;}",
|
|
9190
|
+
".dknt-dot.on{background:var(--dsw-alias-state-success-primary);}",
|
|
9191
|
+
// 渠道卡片
|
|
9192
|
+
".dknt-channels{display:flex;flex-direction:column;gap:10px;}",
|
|
9193
|
+
".dknt-channel{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1);overflow:hidden;}",
|
|
9194
|
+
".dknt-channel-head{display:flex;align-items:center;gap:10px;padding:10px 12px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 45%,transparent);border-bottom:1px solid var(--dsw-alias-border-l1);}",
|
|
9195
|
+
".dknt-channel-title-wrap{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;}",
|
|
9196
|
+
".dknt-channel-title{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary);}",
|
|
9197
|
+
".dknt-channel-sub{font-size:11px;color:var(--dsw-alias-label-tertiary);}",
|
|
9198
|
+
".dknt-channel-body{display:flex;flex-direction:column;gap:8px;padding:10px 12px;}",
|
|
9199
|
+
".dknt-channel-off{padding:10px 12px;font-size:12px;color:var(--dsw-alias-label-tertiary);}",
|
|
9200
|
+
".dknt-modes{display:inline-flex;gap:4px;flex:none;}",
|
|
9201
|
+
".dknt-note-box{border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:8px 10px;background:var(--dsw-alias-bg-layer-1);}",
|
|
8768
9202
|
// 音效选择卡(名称 + 播放键;选中态描边)
|
|
8769
9203
|
".dknt-sounds{display:flex;gap:6px;flex-wrap:wrap;}",
|
|
8770
9204
|
".dknt-sound{flex:1;min-width:104px;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-2);cursor:pointer;font-family:inherit;transition:border-color .15s var(--ds-ease-in-out);}",
|
|
@@ -8787,7 +9221,7 @@ var feature8 = {
|
|
|
8787
9221
|
name: "\u4EFB\u52A1\u901A\u77E5",
|
|
8788
9222
|
order: 140,
|
|
8789
9223
|
accent: "#f59e0b",
|
|
8790
|
-
description: "\u4EFB\u52A1\u5B8C\u6210/\u5F02\u5E38/\u9700\u786E\u8BA4\u901A\u77E5\uFF1A\u9875\u5185\u5361\u7247
|
|
9224
|
+
description: "\u4EFB\u52A1\u5B8C\u6210/\u5F02\u5E38/\u9700\u786E\u8BA4/\u9700\u56DE\u7B54/\u5361\u4F4F\u901A\u77E5\uFF1A\u670D\u52A1\u7AEF\u6216\u672C\u673A\u914D\u7F6E\u3001\u4E8B\u4EF6\xD7\u6E20\u9053\u52FE\u9009\u3001\u9875\u5185\u5361\u7247/\u63D0\u793A\u97F3/\u7CFB\u7EDF\u901A\u77E5/\u8BED\u97F3\u64AD\u62A5/\u9489\u9489\u98DE\u4E66\u63A8\u9001\uFF08\u5404\u81EA\u72EC\u7ACB\u5F00\u5173\uFF09",
|
|
8791
9225
|
css: css3,
|
|
8792
9226
|
View: NotifyView,
|
|
8793
9227
|
HomeStat: NotifyStat,
|
|
@@ -14203,7 +14637,7 @@ var feature12 = {
|
|
|
14203
14637
|
};
|
|
14204
14638
|
|
|
14205
14639
|
// src/client.jsx
|
|
14206
|
-
var DOCK_VERSION = "0.
|
|
14640
|
+
var DOCK_VERSION = "0.21.1";
|
|
14207
14641
|
var BUILTIN_FEATURES = [feature, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature11, feature12];
|
|
14208
14642
|
var PLANNED_FEATURES = [];
|
|
14209
14643
|
var PLANNED_NOTES = {};
|
|
@@ -14318,6 +14752,19 @@ var SHELL_CSS = [
|
|
|
14318
14752
|
".dockm-name{display:flex;align-items:center;gap:8px;font-weight:600;font-size:15px;}",
|
|
14319
14753
|
".dockm-desc{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.6;}",
|
|
14320
14754
|
".dockm-view{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:10px;}",
|
|
14755
|
+
".dockm-page{box-sizing:border-box;height:100%;display:flex;flex-direction:column;overflow:hidden;padding:16px 20px 0;}",
|
|
14756
|
+
".dockm-page-head{flex:none;display:flex;align-items:flex-start;gap:10px;padding-bottom:12px;border-bottom:1px solid var(--dsw-alias-border-l1);}",
|
|
14757
|
+
".dockm-page-body{flex:1;min-height:0;display:flex;}",
|
|
14758
|
+
".dockm-page-wide-btn{flex:none;margin-left:auto;display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 10px;border-radius:8px;border:1px solid var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-secondary);font-family:inherit;font-size:12px;cursor:pointer;}",
|
|
14759
|
+
".dockm-page-wide-btn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
|
|
14760
|
+
/* 面板页的左侧菜单收窄:给右侧列表/表格让出宽度,别留大片空白 */
|
|
14761
|
+
".dockm-page .dockm-nav{width:140px;padding:8px 6px;}",
|
|
14762
|
+
".dockm-page .dockm-nav-item{padding:7px 8px;font-size:12.5px;gap:6px;}",
|
|
14763
|
+
".dockm-page-body>.dockm-body{flex:1;min-height:0;}",
|
|
14764
|
+
".dockm-page-icon{flex:none;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:10px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);}",
|
|
14765
|
+
".dockm-page-titles{min-width:0;}",
|
|
14766
|
+
".dockm-page-title{font-size:17px;font-weight:600;color:var(--dsw-alias-label-primary);line-height:1.3;}",
|
|
14767
|
+
".dockm-page-sub{font-size:12px;color:var(--dsw-alias-label-tertiary);margin-top:2px;}",
|
|
14321
14768
|
".dockm-note{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.6;border-top:1px solid var(--dsw-alias-border-l1);padding-top:10px;}",
|
|
14322
14769
|
".dockm-err{color:var(--dsw-alias-state-error-primary);}",
|
|
14323
14770
|
".dockm-foot{margin-top:auto;display:flex;align-items:center;gap:8px;color:var(--dsw-alias-label-tertiary);font-size:11px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:10px;flex-wrap:wrap;}",
|
|
@@ -14349,7 +14796,19 @@ var SHELL_CSS = [
|
|
|
14349
14796
|
".dockm-foot-swlabel.on{color:var(--dsw-alias-state-success-primary);}",
|
|
14350
14797
|
// 窄屏:功能坞是一级工作台而不是被压扁的桌面弹窗。全屏承接安全区,导航改横向,
|
|
14351
14798
|
// 禁用桌面拖拽/缩放,所有导航和关闭动作保持至少 44px 的可点击面积。
|
|
14352
|
-
"@media (max-width:680px){.dockm-backdrop{align-items:stretch;justify-content:stretch;background:var(--dsw-alias-bg-layer-2);backdrop-filter:none}.dockm-dialog,.dockm-dialog.dockm-max{position:fixed!important;left:0!important;top:0!important;right:auto!important;bottom:auto!important;width:100dvw!important;height:100dvh!important;min-height:100dvh;border:0;border-radius:0;box-shadow:none}.dockm-dialog.dockm-min .dockm-body{display:flex}.dockm-head{min-height:60px;box-sizing:border-box;padding:calc(env(safe-area-inset-top) + 8px) 12px 8px;cursor:default;touch-action:manipulation}.dockm-sub,.dockm-win,.dockm-resize{display:none}.dockm-title{font-size:16px}.dockm-close{width:44px;height:44px;font-size:17px}.dockm-body{flex-direction:column;min-height:0}.dockm-nav{box-sizing:border-box;width:auto;max-width:100%;min-height:56px;flex-direction:row;gap:6px;padding:6px 10px;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--dsw-alias-border-l1);scrollbar-width:none;overscroll-behavior-x:contain}.dockm-nav::-webkit-scrollbar{display:none}.dockm-nav-item{flex:none;min-height:44px;padding:0 12px;font-size:13px;touch-action:manipulation}.dockm-nav-item .dockm-badge{display:none}.dockm-content{padding:16px max(16px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));gap:14px;overscroll-behavior:contain}.dockm-content-head{gap:5px}.dockm-name{font-size:16px}.dockm-desc{font-size:13px;line-height:1.55}.dockm-foot{padding-top:12px;font-size:11px}.dockm-foot-sw{width:100%;margin-left:0;justify-content:space-between}.dock-sw{width:44px;height:26px}.dock-sw::after{top:3px;left:3px;width:18px;height:18px}.dock-sw.on::after{transform:translateX(18px)}.dockh-grid{grid-template-columns:1fr;gap:10px}.dockh-card{padding:12px}.dockh-desc{font-size:13px}.dockh-go{font-size:12px}}",
|
|
14799
|
+
"@media (max-width:680px){.dockm-backdrop{align-items:stretch;justify-content:stretch;background:var(--dsw-alias-bg-layer-2);backdrop-filter:none}.dockm-dialog,.dockm-dialog.dockm-max{position:fixed!important;left:0!important;top:0!important;right:auto!important;bottom:auto!important;width:100dvw!important;height:100dvh!important;min-height:100dvh;border:0;border-radius:0;box-shadow:none}.dockm-dialog.dockm-min .dockm-body{display:flex}.dockm-head{min-height:60px;box-sizing:border-box;padding:calc(env(safe-area-inset-top) + 8px) 12px 8px;cursor:default;touch-action:manipulation}.dockm-sub,.dockm-win,.dockm-resize{display:none}.dockm-title{font-size:16px}.dockm-close{width:44px;height:44px;font-size:17px}.dockm-body{flex-direction:column;min-height:0}.dockm-nav{box-sizing:border-box;width:auto;max-width:100%;min-height:56px;flex-direction:row;gap:6px;padding:6px 10px;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--dsw-alias-border-l1);scrollbar-width:none;overscroll-behavior-x:contain}.dockm-nav::-webkit-scrollbar{display:none}.dockm-nav-item{flex:none;min-height:44px;padding:0 12px;font-size:13px;touch-action:manipulation}.dockm-nav-item .dockm-badge{display:none}.dockm-content{padding:16px max(16px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));gap:14px;overscroll-behavior:contain}.dockm-content-head{gap:5px}.dockm-name{font-size:16px}.dockm-desc{font-size:13px;line-height:1.55}.dockm-foot{padding-top:12px;font-size:11px}.dockm-foot-sw{width:100%;margin-left:0;justify-content:space-between}.dock-sw{width:44px;height:26px}.dock-sw::after{top:3px;left:3px;width:18px;height:18px}.dock-sw.on::after{transform:translateX(18px)}.dockh-grid{grid-template-columns:minmax(0,1fr);gap:10px;min-width:0}.dockh-card{padding:12px;box-sizing:border-box;min-width:0}.dockh-desc{font-size:13px}.dockh-go{font-size:12px}}",
|
|
14800
|
+
/* 手机端:功能坞弹层挂在 .overlayLayer(z20) 内,会被 z71 的侧栏抽屉盖住(只剩右侧一条)。\n 把 overlayLayer 在窄屏抬到抽屉之上,面板才能全屏覆盖——且不依赖【手机适配】模块是否启用。 */
|
|
14801
|
+
/* 只在「功能坞弹层真的打开」时抬 z 序(:has 精确到 .dockm-dialog),其余时候不碰 DSH 原生浮层 */
|
|
14802
|
+
'@media (max-width:767px){body:has(.dockm-dialog) [class*="overlayLayer"]{z-index:100 !important}}',
|
|
14803
|
+
/* 手机:功能坞面板页的左侧菜单改成横向可滚动条,占满整行;页头与内边距收紧,「全屏」按钮在手机上无意义(侧栏本就是抽屉)故隐藏 */
|
|
14804
|
+
"@media (max-width:767px){.dockm-page{padding:12px 12px 0}.dockm-page-head{gap:8px;padding-bottom:10px}.dockm-page-sub{display:none}.dockm-page-wide-btn{display:none}.dockm-page .dockm-nav{width:auto;max-width:100%;flex-direction:row;gap:6px;padding:8px 0;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--dsw-alias-border-l1);scrollbar-width:none}.dockm-page .dockm-nav::-webkit-scrollbar{display:none}.dockm-page .dockm-nav-item{flex:none;min-height:40px;padding:0 10px;font-size:12.5px}.dockm-page .dockm-page-body{flex-direction:column}.dockm-page .dockm-body{flex-direction:column;min-height:0}.dockm-page .dockm-content{padding:12px 0 16px;gap:12px}}",
|
|
14805
|
+
/* 手机自适应(≤767px,始终生效,不依赖任何功能开关):
|
|
14806
|
+
· 输入卡贴底(空会话时不再垂直居中留大片空白);
|
|
14807
|
+
· 输入卡里的「轮/步/token/缓存」状态条移到输入框上方,压成一行不溢出。 */
|
|
14808
|
+
'@media (max-width:767px){[class*="scrollBody"]>[class*="composerSeat"]{margin-top:auto!important;padding-bottom:0!important}[class*="composerSeat"] [class*="_dock"]{order:-1!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding:0 2px 6px!important;gap:6px!important;font-size:10px!important;overflow:hidden!important;flex-wrap:nowrap!important;white-space:nowrap!important}[class*="composerSeat"] [class*="_dock"]>*{min-width:0;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[class*="composerSeat"] [class*="_dock"]>*:first-child{flex:0 0 auto}[class*="composerSeat"] [class*="_row"]{gap:4px!important}}',
|
|
14809
|
+
/* 手机自适应:设置弹层内容给安全区内边距、会话滚动体留底部安全区、代码块横向滚动、
|
|
14810
|
+
行内代码可断行(窄屏不撑破版面)。 */
|
|
14811
|
+
'@media (max-width:767px){[role="dialog"][class*="panel"] [class*="options"]{padding-left:max(16px,env(safe-area-inset-left,0px))!important;padding-right:max(16px,env(safe-area-inset-right,0px))!important}[class*="scrollBody"]{padding-bottom:env(safe-area-inset-bottom,0px)!important}pre{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}code{overflow-wrap:anywhere}pre code{overflow-wrap:normal}}',
|
|
14353
14812
|
"@media (prefers-reduced-motion:reduce){.dockm-backdrop,.dockm-dialog{animation:none}.dockm-nav-item,.dockm-close,.dockm-win,.dock-sw{transition:none}}",
|
|
14354
14813
|
".dockh-desc{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.5;}",
|
|
14355
14814
|
".dockh-stat{color:var(--dsw-alias-label-tertiary);font-size:12px;border-top:1px solid var(--dsw-alias-border-l1);padding-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}",
|
|
@@ -14375,7 +14834,13 @@ var SHELL_CSS = [
|
|
|
14375
14834
|
".dockchip > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}",
|
|
14376
14835
|
".dockchip:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);}",
|
|
14377
14836
|
".dockchip .dockchip-dot{width:6px;height:6px;border-radius:50%;flex:none;}",
|
|
14378
|
-
".dockchip.err{color:var(--dsw-alias-state-error-primary);}"
|
|
14837
|
+
".dockchip.err{color:var(--dsw-alias-state-error-primary);}",
|
|
14838
|
+
/* 手机自适应:输入区工具行很窄——chip 字号/内距收紧、隐藏费用后缀与「余额」前缀,
|
|
14839
|
+
数值完整显示且工具行保持单行不换行(完整信息仍在 title 悬浮提示里)。 */
|
|
14840
|
+
".dockchip-pre-s{display:none;}",
|
|
14841
|
+
"@media (max-width:767px){.dockchip-row{max-width:min(216px,50cqw);gap:0}.dockchip-x{display:none}.dockchip-pre{display:none}.dockchip-ic{display:none}.dockchip-pre-s{display:inline}.dockchip{font-size:9.5px!important;line-height:16px!important;padding:0 1px!important;gap:2px!important}.dockchip .dockchip-dot{width:4px;height:4px}}",
|
|
14842
|
+
/* 手机触控基础:去点按蓝块、消双击缩放判定延迟;原生侧栏开关热区扩到 44×44(视觉不变)。 */
|
|
14843
|
+
`@media (max-width:767px){:is(button,[role="button"]){-webkit-tap-highlight-color:transparent;touch-action:manipulation}[data-sidebar-opener]{position:relative}[data-sidebar-opener]::after{content:'';position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%)}}`
|
|
14379
14844
|
].join("\n");
|
|
14380
14845
|
var dockCssTag = null;
|
|
14381
14846
|
var initialCssSchedule = null;
|
|
@@ -14431,37 +14896,139 @@ function DockIcon(props) {
|
|
|
14431
14896
|
import_react24.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
|
|
14432
14897
|
);
|
|
14433
14898
|
}
|
|
14434
|
-
function
|
|
14435
|
-
const wide = !!props.wide;
|
|
14436
|
-
const [open, setOpen] = import_react24.default.useState(panelNav.open);
|
|
14437
|
-
import_react24.default.useEffect(() => subscribePanel(() => setOpen(panelNav.open)), []);
|
|
14438
|
-
return import_react24.default.createElement("button", {
|
|
14439
|
-
type: "button",
|
|
14440
|
-
className: "docke2-btn" + (open ? " docke2-on" : "") + (wide ? "" : " docke2-rail"),
|
|
14441
|
-
title: "\u529F\u80FD\u575E",
|
|
14442
|
-
"aria-label": "\u529F\u80FD\u575E",
|
|
14443
|
-
"aria-expanded": open,
|
|
14444
|
-
onClick: () => setPanelOpen(!open)
|
|
14445
|
-
}, import_react24.default.createElement(DockIcon, { size: wide ? 16 : 18 }), wide ? import_react24.default.createElement("span", { className: "docke2-label" }, "\u529F\u80FD\u575E") : null);
|
|
14446
|
-
}
|
|
14447
|
-
function DockModal() {
|
|
14899
|
+
function DockWorkspace() {
|
|
14448
14900
|
const [nav, setNav] = import_react24.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
|
|
14449
14901
|
import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
|
|
14450
|
-
const open = nav.open || typeof document === "undefined";
|
|
14451
14902
|
const active = nav.active;
|
|
14452
|
-
const setActive = navigatePanel;
|
|
14453
14903
|
const navParams = nav.params;
|
|
14904
|
+
const setActive = navigatePanel;
|
|
14454
14905
|
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
14455
14906
|
useExternalVersion();
|
|
14907
|
+
const contentRef = import_react24.default.useRef(null);
|
|
14908
|
+
import_react24.default.useEffect(() => {
|
|
14909
|
+
if (contentRef.current) contentRef.current.scrollTop = 0;
|
|
14910
|
+
}, [active]);
|
|
14911
|
+
const MODULES = allModules();
|
|
14912
|
+
const isHome = active === "home";
|
|
14913
|
+
const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
|
|
14914
|
+
const st = mod ? stateOf(mod.id) : null;
|
|
14915
|
+
const View = mod ? mod.View : null;
|
|
14916
|
+
const viewNode = mod && View ? import_react24.default.createElement(
|
|
14917
|
+
"div",
|
|
14918
|
+
{ className: "dockm-view" },
|
|
14919
|
+
import_react24.default.createElement(
|
|
14920
|
+
FeatureBoundary,
|
|
14921
|
+
{ key: mod.id, label: mod.name },
|
|
14922
|
+
import_react24.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
|
|
14923
|
+
)
|
|
14924
|
+
) : null;
|
|
14925
|
+
const enabledCount = MODULES.filter((m) => {
|
|
14926
|
+
const s = stateOf(m.id);
|
|
14927
|
+
return !!(s && s.enabled);
|
|
14928
|
+
}).length;
|
|
14929
|
+
return import_react24.default.createElement(
|
|
14930
|
+
"div",
|
|
14931
|
+
{ className: "dockm-body" },
|
|
14932
|
+
import_react24.default.createElement(
|
|
14933
|
+
"nav",
|
|
14934
|
+
{ className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
|
|
14935
|
+
import_react24.default.createElement(
|
|
14936
|
+
"button",
|
|
14937
|
+
{
|
|
14938
|
+
type: "button",
|
|
14939
|
+
key: "home",
|
|
14940
|
+
className: "dockm-nav-item" + (isHome ? " on" : ""),
|
|
14941
|
+
onClick: () => setActive("home")
|
|
14942
|
+
},
|
|
14943
|
+
import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)),
|
|
14944
|
+
import_react24.default.createElement("span", null, "\u9996\u9875")
|
|
14945
|
+
),
|
|
14946
|
+
MODULES.map((m) => import_react24.default.createElement(
|
|
14947
|
+
"button",
|
|
14948
|
+
{
|
|
14949
|
+
type: "button",
|
|
14950
|
+
key: m.id,
|
|
14951
|
+
className: "dockm-nav-item" + (m.id === active ? " on" : ""),
|
|
14952
|
+
onClick: () => setActive(m.id)
|
|
14953
|
+
},
|
|
14954
|
+
import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
14955
|
+
import_react24.default.createElement("span", null, m.name),
|
|
14956
|
+
m.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14957
|
+
m.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
|
|
14958
|
+
))
|
|
14959
|
+
),
|
|
14960
|
+
import_react24.default.createElement(
|
|
14961
|
+
"div",
|
|
14962
|
+
{ className: "dockm-content", ref: contentRef },
|
|
14963
|
+
import_react24.default.createElement(
|
|
14964
|
+
"div",
|
|
14965
|
+
{ className: "dockm-content-head" },
|
|
14966
|
+
import_react24.default.createElement(
|
|
14967
|
+
"div",
|
|
14968
|
+
{ className: "dockm-name" },
|
|
14969
|
+
isHome ? import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)) : import_react24.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
|
|
14970
|
+
isHome ? "\u9996\u9875" : mod.name,
|
|
14971
|
+
!isHome && mod.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14972
|
+
!isHome && mod.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
|
|
14973
|
+
),
|
|
14974
|
+
import_react24.default.createElement(
|
|
14975
|
+
"div",
|
|
14976
|
+
{ className: "dockm-desc" },
|
|
14977
|
+
isHome ? "\u6240\u6709\u5B50\u529F\u80FD\u603B\u63FD\uFF1A\u8FD0\u884C\u72B6\u6001\u3001\u6982\u8981\u4E0E\u5FEB\u6377\u5F00\u5173\uFF0C\u70B9\u51FB\u5361\u7247\u8FDB\u5165\u5BF9\u5E94\u529F\u80FD\u9875\u3002" : mod.description
|
|
14978
|
+
)
|
|
14979
|
+
),
|
|
14980
|
+
isHome ? import_react24.default.createElement("div", { className: "dockm-view" }, import_react24.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react24.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react24.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react24.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
|
|
14981
|
+
import_react24.default.createElement(
|
|
14982
|
+
"div",
|
|
14983
|
+
{ className: "dockm-foot" },
|
|
14984
|
+
import_react24.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
|
|
14985
|
+
!isHome && mod && !mod.planned && st ? import_react24.default.createElement(
|
|
14986
|
+
"span",
|
|
14987
|
+
{ className: "dockm-foot-sw" },
|
|
14988
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
|
|
14989
|
+
import_react24.default.createElement("button", {
|
|
14990
|
+
type: "button",
|
|
14991
|
+
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
14992
|
+
role: "switch",
|
|
14993
|
+
"aria-checked": !!st.enabled,
|
|
14994
|
+
"aria-label": (st.enabled ? "\u505C\u7528" : "\u542F\u7528") + mod.name,
|
|
14995
|
+
title: st.enabled ? "\u505C\u7528\u300C" + mod.name + "\u300D" : "\u542F\u7528\u300C" + mod.name + "\u300D",
|
|
14996
|
+
onClick: () => {
|
|
14997
|
+
toggleFeature(mod.id);
|
|
14998
|
+
force();
|
|
14999
|
+
}
|
|
15000
|
+
})
|
|
15001
|
+
) : null,
|
|
15002
|
+
!isHome && mod && typeof mod.Chip === "function" ? import_react24.default.createElement(
|
|
15003
|
+
"span",
|
|
15004
|
+
{ className: "dockm-foot-sw" },
|
|
15005
|
+
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
15006
|
+
import_react24.default.createElement("button", {
|
|
15007
|
+
type: "button",
|
|
15008
|
+
className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
|
|
15009
|
+
role: "switch",
|
|
15010
|
+
"aria-checked": chipShown(mod.id),
|
|
15011
|
+
"aria-label": (chipShown(mod.id) ? "\u9690\u85CF" : "\u663E\u793A") + mod.name + "\u7684\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6",
|
|
15012
|
+
title: "\u63A7\u5236\u4F1A\u8BDD\u8F93\u5165\u533A\uFF08\u6A21\u578B\u9009\u62E9\u5668\u5DE6\u4FA7\uFF09\u662F\u5426\u663E\u793A\u672C\u529F\u80FD\u7684\u968F\u8EAB\u5C0F\u63A7\u4EF6",
|
|
15013
|
+
onClick: () => {
|
|
15014
|
+
setChipShown(mod.id, !chipShown(mod.id));
|
|
15015
|
+
force();
|
|
15016
|
+
}
|
|
15017
|
+
})
|
|
15018
|
+
) : null
|
|
15019
|
+
)
|
|
15020
|
+
)
|
|
15021
|
+
);
|
|
15022
|
+
}
|
|
15023
|
+
function DockModal() {
|
|
15024
|
+
const [nav, setNav] = import_react24.default.useState({ open: panelNav.open });
|
|
15025
|
+
import_react24.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
|
|
15026
|
+
const open = nav.open || typeof document === "undefined";
|
|
14456
15027
|
const [win, setWin] = import_react24.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
|
|
14457
15028
|
const dlgRef = import_react24.default.useRef(null);
|
|
14458
|
-
const contentRef = import_react24.default.useRef(null);
|
|
14459
15029
|
import_react24.default.useEffect(() => {
|
|
14460
15030
|
if (lastGeom.w) setWin({ mode: "normal", x: lastGeom.x, y: lastGeom.y, w: lastGeom.w, h: lastGeom.h });
|
|
14461
15031
|
}, []);
|
|
14462
|
-
import_react24.default.useEffect(() => {
|
|
14463
|
-
if (open && contentRef.current) contentRef.current.scrollTop = 0;
|
|
14464
|
-
}, [active, open]);
|
|
14465
15032
|
function beginDrag(e, type) {
|
|
14466
15033
|
if (win.mode !== "normal" || e.button !== 0) return;
|
|
14467
15034
|
if (type === "move" && e.target && e.target.closest && e.target.closest("button,select,input")) return;
|
|
@@ -14492,24 +15059,6 @@ function DockModal() {
|
|
|
14492
15059
|
window.addEventListener("pointerup", onUp);
|
|
14493
15060
|
}
|
|
14494
15061
|
if (!open) return null;
|
|
14495
|
-
const MODULES = allModules();
|
|
14496
|
-
const isHome = active === "home";
|
|
14497
|
-
const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
|
|
14498
|
-
const st = mod ? stateOf(mod.id) : null;
|
|
14499
|
-
const View = mod ? mod.View : null;
|
|
14500
|
-
const viewNode = mod && View ? import_react24.default.createElement(
|
|
14501
|
-
"div",
|
|
14502
|
-
{ className: "dockm-view" },
|
|
14503
|
-
import_react24.default.createElement(
|
|
14504
|
-
FeatureBoundary,
|
|
14505
|
-
{ key: mod.id, label: mod.name },
|
|
14506
|
-
import_react24.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
|
|
14507
|
-
)
|
|
14508
|
-
) : null;
|
|
14509
|
-
const enabledCount = MODULES.filter((m) => {
|
|
14510
|
-
const s = stateOf(m.id);
|
|
14511
|
-
return !!(s && s.enabled);
|
|
14512
|
-
}).length;
|
|
14513
15062
|
const dialogStyle = win.mode === "max" ? { position: "fixed", left: 10, top: 10, right: 10, bottom: 10, width: "auto", height: "auto" } : win.x != null || win.y != null || win.w != null || win.h != null ? {
|
|
14514
15063
|
position: "fixed",
|
|
14515
15064
|
left: win.x != null ? win.x : void 0,
|
|
@@ -14556,99 +15105,7 @@ function DockModal() {
|
|
|
14556
15105
|
import_react24.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
|
|
14557
15106
|
)
|
|
14558
15107
|
),
|
|
14559
|
-
import_react24.default.createElement(
|
|
14560
|
-
"div",
|
|
14561
|
-
{ className: "dockm-body" },
|
|
14562
|
-
import_react24.default.createElement(
|
|
14563
|
-
"nav",
|
|
14564
|
-
{ className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
|
|
14565
|
-
import_react24.default.createElement(
|
|
14566
|
-
"button",
|
|
14567
|
-
{
|
|
14568
|
-
type: "button",
|
|
14569
|
-
key: "home",
|
|
14570
|
-
className: "dockm-nav-item" + (isHome ? " on" : ""),
|
|
14571
|
-
onClick: () => setActive("home")
|
|
14572
|
-
},
|
|
14573
|
-
import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)),
|
|
14574
|
-
import_react24.default.createElement("span", null, "\u9996\u9875")
|
|
14575
|
-
),
|
|
14576
|
-
MODULES.map((m) => import_react24.default.createElement(
|
|
14577
|
-
"button",
|
|
14578
|
-
{
|
|
14579
|
-
type: "button",
|
|
14580
|
-
key: m.id,
|
|
14581
|
-
className: "dockm-nav-item" + (m.id === active ? " on" : ""),
|
|
14582
|
-
onClick: () => setActive(m.id)
|
|
14583
|
-
},
|
|
14584
|
-
import_react24.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
14585
|
-
import_react24.default.createElement("span", null, m.name),
|
|
14586
|
-
m.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14587
|
-
m.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
|
|
14588
|
-
))
|
|
14589
|
-
),
|
|
14590
|
-
import_react24.default.createElement(
|
|
14591
|
-
"div",
|
|
14592
|
-
{ className: "dockm-content", ref: contentRef },
|
|
14593
|
-
import_react24.default.createElement(
|
|
14594
|
-
"div",
|
|
14595
|
-
{ className: "dockm-content-head" },
|
|
14596
|
-
import_react24.default.createElement(
|
|
14597
|
-
"div",
|
|
14598
|
-
{ className: "dockm-name" },
|
|
14599
|
-
isHome ? import_react24.default.createElement("span", { className: "dockm-navhome" }, import_react24.default.createElement(DockIcon, null)) : import_react24.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
|
|
14600
|
-
isHome ? "\u9996\u9875" : mod.name,
|
|
14601
|
-
!isHome && mod.planned ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
14602
|
-
!isHome && mod.external ? import_react24.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
|
|
14603
|
-
),
|
|
14604
|
-
import_react24.default.createElement(
|
|
14605
|
-
"div",
|
|
14606
|
-
{ className: "dockm-desc" },
|
|
14607
|
-
isHome ? "\u6240\u6709\u5B50\u529F\u80FD\u603B\u63FD\uFF1A\u8FD0\u884C\u72B6\u6001\u3001\u6982\u8981\u4E0E\u5FEB\u6377\u5F00\u5173\uFF0C\u70B9\u51FB\u5361\u7247\u8FDB\u5165\u5BF9\u5E94\u529F\u80FD\u9875\u3002" : mod.description
|
|
14608
|
-
)
|
|
14609
|
-
),
|
|
14610
|
-
isHome ? import_react24.default.createElement("div", { className: "dockm-view" }, import_react24.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react24.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react24.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react24.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
|
|
14611
|
-
import_react24.default.createElement(
|
|
14612
|
-
"div",
|
|
14613
|
-
{ className: "dockm-foot" },
|
|
14614
|
-
import_react24.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
|
|
14615
|
-
!isHome && mod && !mod.planned && st ? import_react24.default.createElement(
|
|
14616
|
-
"span",
|
|
14617
|
-
{ className: "dockm-foot-sw" },
|
|
14618
|
-
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
|
|
14619
|
-
import_react24.default.createElement("button", {
|
|
14620
|
-
type: "button",
|
|
14621
|
-
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
14622
|
-
role: "switch",
|
|
14623
|
-
"aria-checked": !!st.enabled,
|
|
14624
|
-
"aria-label": (st.enabled ? "\u505C\u7528" : "\u542F\u7528") + mod.name,
|
|
14625
|
-
title: st.enabled ? "\u505C\u7528\u300C" + mod.name + "\u300D" : "\u542F\u7528\u300C" + mod.name + "\u300D",
|
|
14626
|
-
onClick: () => {
|
|
14627
|
-
toggleFeature(mod.id);
|
|
14628
|
-
force();
|
|
14629
|
-
}
|
|
14630
|
-
})
|
|
14631
|
-
) : null,
|
|
14632
|
-
!isHome && mod && typeof mod.Chip === "function" ? import_react24.default.createElement(
|
|
14633
|
-
"span",
|
|
14634
|
-
{ className: "dockm-foot-sw" },
|
|
14635
|
-
import_react24.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
14636
|
-
import_react24.default.createElement("button", {
|
|
14637
|
-
type: "button",
|
|
14638
|
-
className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
|
|
14639
|
-
role: "switch",
|
|
14640
|
-
"aria-checked": chipShown(mod.id),
|
|
14641
|
-
"aria-label": (chipShown(mod.id) ? "\u9690\u85CF" : "\u663E\u793A") + mod.name + "\u7684\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6",
|
|
14642
|
-
title: "\u63A7\u5236\u4F1A\u8BDD\u8F93\u5165\u533A\uFF08\u6A21\u578B\u9009\u62E9\u5668\u5DE6\u4FA7\uFF09\u662F\u5426\u663E\u793A\u672C\u529F\u80FD\u7684\u968F\u8EAB\u5C0F\u63A7\u4EF6",
|
|
14643
|
-
onClick: () => {
|
|
14644
|
-
setChipShown(mod.id, !chipShown(mod.id));
|
|
14645
|
-
force();
|
|
14646
|
-
}
|
|
14647
|
-
})
|
|
14648
|
-
) : null
|
|
14649
|
-
)
|
|
14650
|
-
)
|
|
14651
|
-
),
|
|
15108
|
+
import_react24.default.createElement(DockWorkspace, null),
|
|
14652
15109
|
win.mode === "normal" ? import_react24.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
|
|
14653
15110
|
)
|
|
14654
15111
|
);
|
|
@@ -14798,6 +15255,43 @@ function DockPanel(props) {
|
|
|
14798
15255
|
})
|
|
14799
15256
|
);
|
|
14800
15257
|
}
|
|
15258
|
+
function DockPage() {
|
|
15259
|
+
const ctx = ctxRef.current;
|
|
15260
|
+
const [wide, setWide] = import_react24.default.useState(false);
|
|
15261
|
+
const toggleWide = () => {
|
|
15262
|
+
try {
|
|
15263
|
+
const layout = ctx && typeof ctx.get === "function" ? ctx.get("layout") : null;
|
|
15264
|
+
if (layout && typeof layout.toggleSidebar === "function") {
|
|
15265
|
+
layout.toggleSidebar();
|
|
15266
|
+
setWide((v) => !v);
|
|
15267
|
+
}
|
|
15268
|
+
} catch (e) {
|
|
15269
|
+
}
|
|
15270
|
+
};
|
|
15271
|
+
return import_react24.default.createElement(
|
|
15272
|
+
"div",
|
|
15273
|
+
{ className: "dockm-page" + (wide ? " dockm-page-wide" : "") },
|
|
15274
|
+
import_react24.default.createElement(
|
|
15275
|
+
"div",
|
|
15276
|
+
{ className: "dockm-page-head" },
|
|
15277
|
+
import_react24.default.createElement("span", { className: "dockm-page-icon" }, import_react24.default.createElement(DockIcon, { size: 20 })),
|
|
15278
|
+
import_react24.default.createElement(
|
|
15279
|
+
"div",
|
|
15280
|
+
{ className: "dockm-page-titles" },
|
|
15281
|
+
import_react24.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
|
|
15282
|
+
import_react24.default.createElement("div", { className: "dockm-page-sub" }, "\u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4FA7\u680F\u56FE\u6807\u53EF\u5728\u300C\u66F4\u591A\u300D\u83DC\u5355\u91CC Pin \u5230\u9876\u90E8\uFF0C\u6216\u53D6\u6D88\u56FA\u5B9A\u6536\u8FDB\u66F4\u591A\u3002")
|
|
15283
|
+
),
|
|
15284
|
+
import_react24.default.createElement("button", {
|
|
15285
|
+
type: "button",
|
|
15286
|
+
className: "dockm-page-wide-btn",
|
|
15287
|
+
title: wide ? "\u8FD8\u539F\u4FA7\u680F\u5BBD\u5EA6" : "\u6536\u8D77\u5DE6\u4FA7\u680F\uFF0C\u5168\u5C4F\u663E\u793A\u529F\u80FD\u575E",
|
|
15288
|
+
"aria-label": wide ? "\u8FD8\u539F\u5BBD\u5EA6" : "\u5168\u5C4F",
|
|
15289
|
+
onClick: toggleWide
|
|
15290
|
+
}, wide ? "\u2750 \u8FD8\u539F" : "\u25A2 \u5168\u5C4F")
|
|
15291
|
+
),
|
|
15292
|
+
import_react24.default.createElement("div", { className: "dockm-page-body" }, import_react24.default.createElement(DockWorkspace, null))
|
|
15293
|
+
);
|
|
15294
|
+
}
|
|
14801
15295
|
function DockChips(props) {
|
|
14802
15296
|
const [, force] = import_react24.default.useReducer((n) => n + 1, 0);
|
|
14803
15297
|
import_react24.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
@@ -14857,9 +15351,13 @@ function apply(ctx) {
|
|
|
14857
15351
|
initFeatureState(BUILTIN_FEATURES.concat(PLANNED_FEATURES));
|
|
14858
15352
|
const slots = ctx.get("slots");
|
|
14859
15353
|
if (slots === void 0) return;
|
|
14860
|
-
slots.inject("sidebar.
|
|
14861
|
-
{ name: "sidebar.
|
|
14862
|
-
(props) => import_react24.default.createElement(
|
|
15354
|
+
slots.inject("sidebar.panellist", () => slots.register(
|
|
15355
|
+
{ name: "sidebar.panellist", id: "dsh-dock", order: 30, label: "\u529F\u80FD\u575E" },
|
|
15356
|
+
(props) => import_react24.default.createElement(DockIcon, { size: props && props.size || 18 })
|
|
15357
|
+
));
|
|
15358
|
+
slots.inject("main", () => slots.register(
|
|
15359
|
+
{ name: "main", key: "dsh-dock", label: "\u529F\u80FD\u575E" },
|
|
15360
|
+
() => import_react24.default.createElement(DockPage, null)
|
|
14863
15361
|
));
|
|
14864
15362
|
slots.inject("shell.overlay", () => slots.register(
|
|
14865
15363
|
{ name: "shell.overlay", id: "dsh-dock-panel", order: 21, label: "\u529F\u80FD\u575E\u9762\u677F" },
|