xechat-dsh 0.1.1 → 0.2.3

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/lib/xechat-app.js CHANGED
@@ -73240,7 +73240,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
73240
73240
  if (!username) username = "User-" + Date.now().toString(36);
73241
73241
  return {
73242
73242
  action: "LOGIN",
73243
- body: { username, status: "FISHING", platform: "WEB", uuid: this._uuid(), pluginVersion: "", reconnected: false, token: this._adminToken() }
73243
+ body: { username, status: "FISHING", platform: "DSH", uuid: this._uuid(), pluginVersion: "", reconnected: false, token: this._adminToken() }
73244
73244
  };
73245
73245
  case "setstatus":
73246
73246
  const raw = parts[1];
@@ -74070,6 +74070,32 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
74070
74070
  }
74071
74071
  }
74072
74072
  });
74073
+ const PLATFORM_LABELS = {
74074
+ WEB: "浏览器",
74075
+ IDEA: "JetBrains IDEA",
74076
+ VSCODE: "VS Code",
74077
+ DSH: "DeepSeek Harness",
74078
+ COMMAND: "命令行"
74079
+ };
74080
+ const PLATFORM_ICONS = {
74081
+ WEB: '<svg class="pf-svg" style="vertical-align:-0.15em" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m.6-3h16.8M3.6 15h16.8"/><path d="M11.5 3a17 17 0 0 0 0 18m1-18a17 17 0 0 1 0 18"/></g></svg>',
74082
+ IDEA: '<svg class="pf-svg" style="vertical-align:-0.15em" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="m3.723 3.111h5v1.834h-1.39v6.277h1.39v1.834h-5v-1.834h1.444V4.945H3.723zm11.055 0H17v6.5c0 .612-.055 1.111-.222 1.556c-.167.444-.39.777-.723 1.11c-.277.279-.666.557-1.11.668a3.9 3.9 0 0 1-1.445.278c-.778 0-1.444-.167-1.944-.445a4.8 4.8 0 0 1-1.279-1.056l1.39-1.555a3.2 3.2 0 0 0 .833.722c.277.167.611.278.945.278c.389 0 .721-.111 1-.389c.221-.278.333-.667.333-1.278zM2.222 19.5h9V21h-9z"/></svg>',
74083
+ VSCODE: '<svg class="pf-svg" style="vertical-align:-0.15em" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M23.15 2.587L18.21.21a1.49 1.49 0 0 0-1.705.29l-9.46 8.63l-4.12-3.128a1 1 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12L.326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a1 1 0 0 0 1.276.057l4.12-3.128l9.46 8.63a1.49 1.49 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352m-5.146 14.861L10.826 12l7.178-5.448z"/></svg>',
74084
+ DSH: '<svg class="pf-svg" style="vertical-align:-0.15em" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M23.748 4.651c-.254-.124-.364.113-.512.233c-.051.04-.094.09-.137.137c-.372.397-.806.657-1.373.626c-.829-.046-1.537.214-2.163.848c-.133-.782-.575-1.248-1.247-1.548c-.352-.155-.708-.311-.955-.65c-.172-.24-.219-.509-.305-.774c-.055-.16-.11-.323-.293-.35c-.2-.031-.278.136-.356.276c-.313.572-.434 1.202-.422 1.84c.027 1.436.633 2.58 1.838 3.393c.137.094.172.187.129.323c-.082.28-.18.553-.266.833c-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836c.27-.098.094-.433-.778-.428c-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136a9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653c1.857 1.533 3.997 2.284 6.438 2.14c1.482-.085 3.132-.284 4.994-1.86c.47.234.962.328 1.78.398c.629.058 1.235-.031 1.705-.129c.735-.155.684-.836.418-.961c-2.155-1.004-1.682-.595-2.112-.926c1.095-1.295 2.768-3.598 3.284-6.733c.05-.346.115-.834.108-1.114c-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517c.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16c-.39.024-.32.472-.234.763c.09.288.207.487.371.74c.114.167.192.416-.113.603c-.673.416-1.842-.14-1.897-.168c-1.361-.801-2.5-1.86-3.301-3.306c-.775-1.393-1.225-2.888-1.299-4.482c-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774c.868.86 1.525 1.887 2.202 2.89c.72 1.066 1.494 2.082 2.48 2.915c.348.291.626.513.892.677c-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287a.3.3 0 0 1 .113.074a.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727c-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078a.253.253 0 0 1-.114-.358a1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016c.352.144.618.408 1.001.782c.392.451.462.576.685.915c.176.264.336.536.446.848c.066.194-.02.353-.25.45"/></svg>'
74085
+ };
74086
+ const PLATFORM_TOKEN_RE = /\{\{pf:([A-Z]+)\}\}/g;
74087
+ function platformSvg(p2) {
74088
+ return PLATFORM_ICONS[p2] || "";
74089
+ }
74090
+ function platformLabel(p2) {
74091
+ return PLATFORM_LABELS[p2] || p2 || "未知平台";
74092
+ }
74093
+ function platformMark(p2) {
74094
+ return PLATFORM_ICONS[p2] ? "{{pf:" + p2 + "}}" : "";
74095
+ }
74096
+ function parsePlatformMarkup(html) {
74097
+ return String(html || "").replace(PLATFORM_TOKEN_RE, (m2, key) => PLATFORM_ICONS[key] || "");
74098
+ }
74073
74099
  function _statusText(s2) {
74074
74100
  switch (s2) {
74075
74101
  case "FISHING":
@@ -74083,15 +74109,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
74083
74109
  }
74084
74110
  }
74085
74111
  function _platformIcon(p2) {
74086
- switch (p2) {
74087
- case "IDEA":
74088
- return "☕";
74089
- case "WEB":
74090
- case "VSCODE":
74091
- return "🌐";
74092
- default:
74093
- return "";
74094
- }
74112
+ return platformMark(p2);
74095
74113
  }
74096
74114
  function _formatUserMessageHead(data) {
74097
74115
  const time = data.time || "";
@@ -74246,13 +74264,17 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
74246
74264
  on("history", (data) => {
74247
74265
  const msgList = data.msgList || [];
74248
74266
  if (!msgList.length) return;
74267
+ const firstUserMsg = msgList.find((x2) => x2 && x2.type === "USER");
74268
+ console.info(
74269
+ "[xechat-dsh][history] 共 " + msgList.length + " 条,首条用户帧 user=" + (firstUserMsg ? firstUserMsg.user ? "ok" : "missing" : "none")
74270
+ );
74249
74271
  const parsed = [];
74250
74272
  for (let i = 0; i < msgList.length; i++) {
74251
74273
  const item = msgList[i];
74252
74274
  if (item.type === "SYSTEM") {
74253
74275
  parsed.push({ text: stripSystemNullTag(item.body || ""), type: "system" });
74254
74276
  } else if (item.type === "USER") {
74255
- const userObj = item.body && item.body.user;
74277
+ const userObj = item.user || item.body && item.body.user;
74256
74278
  const maskStore = useMaskStore();
74257
74279
  const hit = maskStore.masked(userObj);
74258
74280
  if (hit) {
@@ -74264,7 +74286,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
74264
74286
  }
74265
74287
  const head = _formatUserMessageHead({
74266
74288
  time: item.time,
74267
- user: item.body && item.body.user
74289
+ user: userObj
74268
74290
  });
74269
74291
  const hText = item.body && item.body.content || "";
74270
74292
  const isImageMsg = item.body && item.body.msgType && String(item.body.msgType).toUpperCase() === "IMAGE";
@@ -82872,7 +82894,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
82872
82894
  const processed = props.content.replace(/!\[([^]]*)\]\(([^)]+)\)/g, (m2, alt, url) => {
82873
82895
  return `![${alt}](${resolveImageUrl(url)})`;
82874
82896
  });
82875
- return md.render(preprocessFont(processed));
82897
+ return parsePlatformMarkup(md.render(preprocessFont(processed)));
82876
82898
  });
82877
82899
  const isDirectImage = computed(() => {
82878
82900
  if (!props.fileName) return false;
@@ -83000,7 +83022,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
83000
83022
  };
83001
83023
  }
83002
83024
  };
83003
- const MarkdownMessage = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-24fc2d61"]]);
83025
+ const MarkdownMessage = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-2abd886a"]]);
83004
83026
  const STORAGE_KEY$2 = "xechat_text_styles";
83005
83027
  const BUILTIN_STYLES = [
83006
83028
  { id: "red", name: "红色文字", tag: '<span style="color:#ff4444">{text}</span>' },
@@ -95379,7 +95401,9 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
95379
95401
  body: {
95380
95402
  username,
95381
95403
  status: "FISHING",
95382
- platform: "WEB",
95404
+ // 本前端只跑在 DSH 桌面端(DeepSeek Harness 插件),固定上报 DSH,
95405
+ // 与浏览器打开的 xechat-web(WEB)、VS Code / IDEA 插件区分开
95406
+ platform: "DSH",
95383
95407
  uuid: deviceStore.uuid,
95384
95408
  pluginVersion: srv && srv.version || "",
95385
95409
  reconnected: false,
@@ -95413,7 +95437,9 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
95413
95437
  body: {
95414
95438
  username: saved2.username,
95415
95439
  status: saved2.status || "FISHING",
95416
- platform: "WEB",
95440
+ // 本前端只跑在 DSH 桌面端(DeepSeek Harness 插件),固定上报 DSH,
95441
+ // 与浏览器打开的 xechat-web(WEB)、VS Code / IDEA 插件区分开
95442
+ platform: "DSH",
95417
95443
  uuid: deviceStore.uuid,
95418
95444
  pluginVersion: srv && srv.version || "",
95419
95445
  reconnected: true,
@@ -96097,7 +96123,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
96097
96123
  };
96098
96124
  }
96099
96125
  };
96100
- const ChatPanel = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-d6a7f448"]]);
96126
+ const ChatPanel = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-698903a5"]]);
96101
96127
  const PALETTES = {
96102
96128
  dark: {
96103
96129
  /** iframe 背后的底色:页面加载中/空白时露出的颜色 */
@@ -101168,7 +101194,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101168
101194
  key: 0,
101169
101195
  class: "user-region"
101170
101196
  };
101171
- const _hoisted_8$2 = { class: "user-platform" };
101197
+ const _hoisted_8$2 = ["title", "innerHTML"];
101172
101198
  const _hoisted_9$2 = {
101173
101199
  key: 1,
101174
101200
  class: "user-actions"
@@ -101270,15 +101296,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101270
101296
  }
101271
101297
  }
101272
101298
  function platformIcon(p2) {
101273
- switch (p2) {
101274
- case "IDEA":
101275
- return "☕";
101276
- case "WEB":
101277
- case "VSCODE":
101278
- return "🌐";
101279
- default:
101280
- return "";
101281
- }
101299
+ return platformSvg(p2);
101282
101300
  }
101283
101301
  return (_ctx, _cache) => {
101284
101302
  const _component_el_tag = resolveComponent("el-tag");
@@ -101322,7 +101340,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101322
101340
  createBaseVNode("span", _hoisted_5$3, toDisplayString(statusIcon(u2.status)), 1),
101323
101341
  createBaseVNode("span", _hoisted_6$2, toDisplayString(u2.username), 1),
101324
101342
  u2.displayRegion ? (openBlock(), createElementBlock("span", _hoisted_7$2, "[" + toDisplayString(u2.displayRegion) + "]", 1)) : createCommentVNode("", true),
101325
- createBaseVNode("span", _hoisted_8$2, toDisplayString(platformIcon(u2.platform)), 1),
101343
+ createBaseVNode("span", {
101344
+ class: "user-platform",
101345
+ title: unref(platformLabel)(u2.platform),
101346
+ innerHTML: platformIcon(u2.platform)
101347
+ }, null, 8, _hoisted_8$2),
101326
101348
  canManage(u2) ? (openBlock(), createElementBlock("span", _hoisted_9$2, [
101327
101349
  createBaseVNode("button", {
101328
101350
  class: normalizeClass(["op-btn", { off: !hasPermit(u2, PERMIT_SEND_FILE) }]),
@@ -101350,7 +101372,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101350
101372
  };
101351
101373
  }
101352
101374
  };
101353
- const OnlineUsersPanel = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-77e47042"]]);
101375
+ const OnlineUsersPanel = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-a8a21ed8"]]);
101354
101376
  const _hoisted_1$2 = { class: "style-editor" };
101355
101377
  const _hoisted_2$2 = { class: "editor-header" };
101356
101378
  const _hoisted_3$2 = { class: "header-left" };
@@ -101650,40 +101672,104 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101650
101672
  const StyleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-02c4e5e7"]]);
101651
101673
  const _hoisted_1$1 = { class: "settings-panel" };
101652
101674
  const _hoisted_2$1 = { class: "settings-body" };
101653
- const _hoisted_3$1 = { class: "setting-row" };
101654
- const _hoisted_4$1 = { class: "setting-row" };
101655
- const _hoisted_5$1 = { class: "setting-row" };
101656
- const _hoisted_6 = { class: "setting-row" };
101657
- const _hoisted_7 = { class: "slider-wrap" };
101675
+ const _hoisted_3$1 = {
101676
+ key: 0,
101677
+ class: "setting-block"
101678
+ };
101679
+ const _hoisted_4$1 = { class: "setting-inline" };
101680
+ const _hoisted_5$1 = { class: "setting-inline" };
101681
+ const _hoisted_6 = { class: "setting-hint" };
101682
+ const _hoisted_7 = { class: "setting-row" };
101658
101683
  const _hoisted_8 = { class: "setting-row" };
101659
- const _hoisted_9 = { class: "slider-wrap" };
101660
- const _hoisted_10 = { class: "slider-value" };
101684
+ const _hoisted_9 = { class: "setting-row" };
101685
+ const _hoisted_10 = { class: "setting-row" };
101661
101686
  const _hoisted_11 = { class: "setting-row" };
101662
101687
  const _hoisted_12 = { class: "slider-wrap" };
101663
- const _hoisted_13 = { class: "slider-value" };
101664
- const _hoisted_14 = { class: "setting-block" };
101665
- const _hoisted_15 = { class: "shortcut-actions" };
101666
- const _hoisted_16 = ["onClick"];
101667
- const _hoisted_17 = ["onClick"];
101668
- const _hoisted_18 = {
101688
+ const _hoisted_13 = { class: "setting-row" };
101689
+ const _hoisted_14 = { class: "slider-wrap" };
101690
+ const _hoisted_15 = { class: "slider-value" };
101691
+ const _hoisted_16 = { class: "setting-row" };
101692
+ const _hoisted_17 = { class: "slider-wrap" };
101693
+ const _hoisted_18 = { class: "slider-value" };
101694
+ const _hoisted_19 = { class: "setting-block" };
101695
+ const _hoisted_20 = { class: "shortcut-actions" };
101696
+ const _hoisted_21 = ["onClick"];
101697
+ const _hoisted_22 = ["onClick"];
101698
+ const _hoisted_23 = {
101669
101699
  key: 0,
101670
101700
  class: "shortcut-hint"
101671
101701
  };
101672
- const _hoisted_19 = { class: "setting-block" };
101673
- const _hoisted_20 = { class: "setting-inline" };
101674
- const _hoisted_21 = { class: "inline-label" };
101675
- const _hoisted_22 = { class: "setting-inline" };
101676
- const _hoisted_23 = { class: "inline-label" };
101677
- const _hoisted_24 = { class: "setting-row" };
101678
- const _hoisted_25 = {
101679
- key: 0,
101702
+ const _hoisted_24 = { class: "setting-block" };
101703
+ const _hoisted_25 = { class: "setting-inline" };
101704
+ const _hoisted_26 = { class: "inline-label" };
101705
+ const _hoisted_27 = { class: "setting-inline" };
101706
+ const _hoisted_28 = { class: "inline-label" };
101707
+ const _hoisted_29 = { class: "setting-row" };
101708
+ const _hoisted_30 = {
101709
+ key: 1,
101680
101710
  class: "setting-row"
101681
101711
  };
101682
- const _hoisted_26 = { style: { "color": "var(--text-secondary)" } };
101712
+ const _hoisted_31 = { style: { "color": "var(--text-secondary)" } };
101713
+ const DOCK_LAYOUT_KEY = "xechat-dsh:layout";
101714
+ const DOCK_EVENT_LAYOUT = "xechat-dsh:layout";
101715
+ const DOCK_EVENT_SET = "xechat-dsh:set-size";
101716
+ const DOCK_EVENT_OPEN = "xechat-dsh:open-size-settings";
101683
101717
  const _sfc_main$1 = {
101684
101718
  __name: "SettingsPanel",
101685
101719
  setup(__props) {
101686
101720
  const settingsStore = useSettingsStore();
101721
+ const isDsh = typeof window !== "undefined" && (!!window.__XECHAT_DSH_EMBEDDED__ || typeof document !== "undefined" && !!document.querySelector("[data-xechat-dsh]"));
101722
+ const dockLimits = /* @__PURE__ */ ref({ minWidth: 280, maxWidth: 720, minHeight: 240, maxHeight: 800 });
101723
+ const dockWidthDraft = /* @__PURE__ */ ref("380");
101724
+ const dockHeightDraft = /* @__PURE__ */ ref("");
101725
+ const dockEditing = /* @__PURE__ */ ref(false);
101726
+ function onDockLayoutEvent(e) {
101727
+ const d2 = e && e.detail;
101728
+ if (!d2) return;
101729
+ if (typeof d2.minWidth === "number") {
101730
+ dockLimits.value = {
101731
+ minWidth: d2.minWidth,
101732
+ maxWidth: d2.maxWidth,
101733
+ minHeight: d2.minHeight,
101734
+ maxHeight: d2.maxHeight
101735
+ };
101736
+ }
101737
+ if (dockEditing.value) return;
101738
+ if (typeof d2.width === "number") dockWidthDraft.value = String(d2.width);
101739
+ dockHeightDraft.value = d2.height === null || d2.height === void 0 ? "" : String(d2.height);
101740
+ }
101741
+ function onDockInputBlur() {
101742
+ dockEditing.value = false;
101743
+ applyDockSize();
101744
+ }
101745
+ function applyDockSize() {
101746
+ const w2 = String(dockWidthDraft.value).trim();
101747
+ const h2 = String(dockHeightDraft.value).trim();
101748
+ window.dispatchEvent(new CustomEvent(DOCK_EVENT_SET, {
101749
+ detail: {
101750
+ width: w2 === "" ? void 0 : Number(w2),
101751
+ height: h2 === "" ? null : Number(h2)
101752
+ }
101753
+ }));
101754
+ }
101755
+ function resetDockSize() {
101756
+ dockWidthDraft.value = "380";
101757
+ dockHeightDraft.value = "";
101758
+ window.dispatchEvent(new CustomEvent(DOCK_EVENT_SET, { detail: { width: 380, height: null } }));
101759
+ }
101760
+ function openDockSizePanel() {
101761
+ window.dispatchEvent(new CustomEvent(DOCK_EVENT_OPEN));
101762
+ }
101763
+ function readDockLayoutFromStorage() {
101764
+ try {
101765
+ const raw = localStorage.getItem(DOCK_LAYOUT_KEY);
101766
+ if (!raw) return;
101767
+ const l2 = JSON.parse(raw);
101768
+ if (typeof l2.width === "number") dockWidthDraft.value = String(l2.width);
101769
+ dockHeightDraft.value = typeof l2.height === "number" ? String(l2.height) : "";
101770
+ } catch (e) {
101771
+ }
101772
+ }
101687
101773
  const pluginOpacity = computed({
101688
101774
  get: () => settingsStore.pluginOpacity,
101689
101775
  set: (val) => settingsStore.setPluginOpacity(val)
@@ -101753,9 +101839,14 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101753
101839
  }
101754
101840
  onMounted(() => {
101755
101841
  window.addEventListener("keydown", onShortcutKeydown, true);
101842
+ if (isDsh) {
101843
+ window.addEventListener(DOCK_EVENT_LAYOUT, onDockLayoutEvent);
101844
+ readDockLayoutFromStorage();
101845
+ }
101756
101846
  });
101757
101847
  onBeforeUnmount(() => {
101758
101848
  window.removeEventListener("keydown", onShortcutKeydown, true);
101849
+ if (isDsh) window.removeEventListener(DOCK_EVENT_LAYOUT, onDockLayoutEvent);
101759
101850
  window.__xechatShortcutRecording = false;
101760
101851
  });
101761
101852
  const localPanicUrl = /* @__PURE__ */ ref(settingsStore.panicUrl);
@@ -101767,72 +101858,134 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101767
101858
  settingsStore.setAdminToken(val || "");
101768
101859
  }
101769
101860
  return (_ctx, _cache) => {
101770
- const _component_el_switch = resolveComponent("el-switch");
101861
+ const _component_el_input = resolveComponent("el-input");
101771
101862
  const _component_el_button = resolveComponent("el-button");
101863
+ const _component_el_switch = resolveComponent("el-switch");
101772
101864
  const _component_el_radio_button = resolveComponent("el-radio-button");
101773
101865
  const _component_el_radio_group = resolveComponent("el-radio-group");
101774
101866
  const _component_el_slider = resolveComponent("el-slider");
101775
101867
  const _component_InfoFilled = resolveComponent("InfoFilled");
101776
101868
  const _component_el_icon = resolveComponent("el-icon");
101777
101869
  const _component_el_tooltip = resolveComponent("el-tooltip");
101778
- const _component_el_input = resolveComponent("el-input");
101779
101870
  const _component_el_tag = resolveComponent("el-tag");
101780
101871
  const _component_el_form_item = resolveComponent("el-form-item");
101781
101872
  return openBlock(), createElementBlock("div", _hoisted_1$1, [
101782
- _cache[30] || (_cache[30] = createBaseVNode("div", { class: "panel-header" }, [
101873
+ _cache[41] || (_cache[41] = createBaseVNode("div", { class: "panel-header" }, [
101783
101874
  createBaseVNode("span", { class: "panel-title" }, "设置")
101784
101875
  ], -1)),
101785
101876
  createBaseVNode("div", _hoisted_2$1, [
101786
- createBaseVNode("div", _hoisted_3$1, [
101787
- _cache[8] || (_cache[8] = createBaseVNode("span", null, "主题", -1)),
101877
+ unref(isDsh) ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
101878
+ _cache[18] || (_cache[18] = createBaseVNode("div", { class: "block-title" }, "面板尺寸", -1)),
101879
+ createBaseVNode("div", _hoisted_4$1, [
101880
+ _cache[12] || (_cache[12] = createBaseVNode("div", { class: "inline-label" }, [
101881
+ createBaseVNode("span", null, "宽度 (px)")
101882
+ ], -1)),
101883
+ createVNode(_component_el_input, {
101884
+ modelValue: dockWidthDraft.value,
101885
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dockWidthDraft.value = $event),
101886
+ type: "number",
101887
+ min: dockLimits.value.minWidth,
101888
+ max: dockLimits.value.maxWidth,
101889
+ placeholder: "380",
101890
+ onFocus: _cache[1] || (_cache[1] = ($event) => dockEditing.value = true),
101891
+ onBlur: onDockInputBlur,
101892
+ onChange: applyDockSize,
101893
+ onKeyup: withKeys(applyDockSize, ["enter"])
101894
+ }, null, 8, ["modelValue", "min", "max"])
101895
+ ]),
101896
+ createBaseVNode("div", _hoisted_5$1, [
101897
+ _cache[13] || (_cache[13] = createBaseVNode("div", { class: "inline-label" }, [
101898
+ createBaseVNode("span", null, "高度 (px)")
101899
+ ], -1)),
101900
+ createVNode(_component_el_input, {
101901
+ modelValue: dockHeightDraft.value,
101902
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => dockHeightDraft.value = $event),
101903
+ type: "number",
101904
+ min: dockLimits.value.minHeight,
101905
+ max: dockLimits.value.maxHeight,
101906
+ placeholder: "留空 = 铺满",
101907
+ onFocus: _cache[3] || (_cache[3] = ($event) => dockEditing.value = true),
101908
+ onBlur: onDockInputBlur,
101909
+ onChange: applyDockSize,
101910
+ onKeyup: withKeys(applyDockSize, ["enter"])
101911
+ }, null, 8, ["modelValue", "min", "max"])
101912
+ ]),
101913
+ createBaseVNode("div", _hoisted_6, [
101914
+ createTextVNode(" 宽度 " + toDisplayString(dockLimits.value.minWidth) + "–" + toDisplayString(dockLimits.value.maxWidth) + " px,高度 " + toDisplayString(dockLimits.value.minHeight) + "–" + toDisplayString(dockLimits.value.maxHeight) + " px; 高度留空表示铺满窗口。回车或失焦立即生效。", 1),
101915
+ _cache[14] || (_cache[14] = createBaseVNode("br", null, null, -1)),
101916
+ _cache[15] || (_cache[15] = createTextVNode(" 也可以拖动面板左边缘(调宽)、上边缘或下边缘(调高)的拖拽条。 ", -1))
101917
+ ]),
101918
+ createBaseVNode("div", _hoisted_7, [
101919
+ createVNode(_component_el_button, {
101920
+ size: "small",
101921
+ onClick: resetDockSize
101922
+ }, {
101923
+ default: withCtx(() => [..._cache[16] || (_cache[16] = [
101924
+ createTextVNode("恢复默认", -1)
101925
+ ])]),
101926
+ _: 1
101927
+ }),
101928
+ createVNode(_component_el_button, {
101929
+ size: "small",
101930
+ onClick: openDockSizePanel
101931
+ }, {
101932
+ default: withCtx(() => [..._cache[17] || (_cache[17] = [
101933
+ createTextVNode("在侧栏打开尺寸浮层", -1)
101934
+ ])]),
101935
+ _: 1
101936
+ })
101937
+ ])
101938
+ ])) : createCommentVNode("", true),
101939
+ createBaseVNode("div", _hoisted_8, [
101940
+ _cache[19] || (_cache[19] = createBaseVNode("span", null, "主题", -1)),
101788
101941
  createVNode(_component_el_switch, {
101789
101942
  "model-value": unref(isDark),
101790
- onChange: _cache[0] || (_cache[0] = ($event) => unref(toggleTheme)()),
101943
+ onChange: _cache[4] || (_cache[4] = ($event) => unref(toggleTheme)()),
101791
101944
  "active-text": "暗色",
101792
101945
  "inactive-text": "亮色"
101793
101946
  }, null, 8, ["model-value"])
101794
101947
  ]),
101795
- createBaseVNode("div", _hoisted_4$1, [
101796
- _cache[10] || (_cache[10] = createBaseVNode("span", null, "文字样式", -1)),
101948
+ createBaseVNode("div", _hoisted_9, [
101949
+ _cache[21] || (_cache[21] = createBaseVNode("span", null, "文字样式", -1)),
101797
101950
  createVNode(_component_el_button, {
101798
101951
  size: "small",
101799
- onClick: _cache[1] || (_cache[1] = ($event) => unref(state).currentRoute = "style-editor")
101952
+ onClick: _cache[5] || (_cache[5] = ($event) => unref(state).currentRoute = "style-editor")
101800
101953
  }, {
101801
- default: withCtx(() => [..._cache[9] || (_cache[9] = [
101954
+ default: withCtx(() => [..._cache[20] || (_cache[20] = [
101802
101955
  createTextVNode(" 管理 ", -1)
101803
101956
  ])]),
101804
101957
  _: 1
101805
101958
  })
101806
101959
  ]),
101807
- createBaseVNode("div", _hoisted_5$1, [
101808
- _cache[15] || (_cache[15] = createBaseVNode("span", null, "浏览器配色", -1)),
101960
+ createBaseVNode("div", _hoisted_10, [
101961
+ _cache[26] || (_cache[26] = createBaseVNode("span", null, "浏览器配色", -1)),
101809
101962
  createVNode(_component_el_radio_group, {
101810
101963
  modelValue: browserTheme.value,
101811
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => browserTheme.value = $event),
101964
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => browserTheme.value = $event),
101812
101965
  size: "small",
101813
101966
  onChange: onBrowserThemeChange
101814
101967
  }, {
101815
101968
  default: withCtx(() => [
101816
101969
  createVNode(_component_el_radio_button, { value: "auto" }, {
101817
- default: withCtx(() => [..._cache[11] || (_cache[11] = [
101970
+ default: withCtx(() => [..._cache[22] || (_cache[22] = [
101818
101971
  createTextVNode("跟随主题", -1)
101819
101972
  ])]),
101820
101973
  _: 1
101821
101974
  }),
101822
101975
  createVNode(_component_el_radio_button, { value: "dark" }, {
101823
- default: withCtx(() => [..._cache[12] || (_cache[12] = [
101976
+ default: withCtx(() => [..._cache[23] || (_cache[23] = [
101824
101977
  createTextVNode("深色", -1)
101825
101978
  ])]),
101826
101979
  _: 1
101827
101980
  }),
101828
101981
  createVNode(_component_el_radio_button, { value: "light" }, {
101829
- default: withCtx(() => [..._cache[13] || (_cache[13] = [
101982
+ default: withCtx(() => [..._cache[24] || (_cache[24] = [
101830
101983
  createTextVNode("浅色", -1)
101831
101984
  ])]),
101832
101985
  _: 1
101833
101986
  }),
101834
101987
  createVNode(_component_el_radio_button, { value: "off" }, {
101835
- default: withCtx(() => [..._cache[14] || (_cache[14] = [
101988
+ default: withCtx(() => [..._cache[25] || (_cache[25] = [
101836
101989
  createTextVNode("不做处理", -1)
101837
101990
  ])]),
101838
101991
  _: 1
@@ -101841,12 +101994,12 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101841
101994
  _: 1
101842
101995
  }, 8, ["modelValue"])
101843
101996
  ]),
101844
- createBaseVNode("div", _hoisted_6, [
101845
- _cache[16] || (_cache[16] = createBaseVNode("span", null, "网页降亮", -1)),
101846
- createBaseVNode("div", _hoisted_7, [
101997
+ createBaseVNode("div", _hoisted_11, [
101998
+ _cache[27] || (_cache[27] = createBaseVNode("span", null, "网页降亮", -1)),
101999
+ createBaseVNode("div", _hoisted_12, [
101847
102000
  createVNode(_component_el_slider, {
101848
102001
  modelValue: browserDim.value,
101849
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => browserDim.value = $event),
102002
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => browserDim.value = $event),
101850
102003
  min: 0,
101851
102004
  max: 0.6,
101852
102005
  step: 0.05,
@@ -101854,70 +102007,70 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101854
102007
  }, null, 8, ["modelValue", "format-tooltip"])
101855
102008
  ])
101856
102009
  ]),
101857
- _cache[29] || (_cache[29] = createBaseVNode("div", { class: "setting-hint" }, " 内置浏览器是 iframe,跨源站点受同源策略保护,插件无法改写其内部元素, 因此这里只能给容器着色并加一层降亮遮罩,无法像 DarkReader 那样逐元素反色。 ", -1)),
101858
- createBaseVNode("div", _hoisted_8, [
101859
- _cache[17] || (_cache[17] = createBaseVNode("span", null, "插件透明度", -1)),
101860
- createBaseVNode("div", _hoisted_9, [
102010
+ _cache[40] || (_cache[40] = createBaseVNode("div", { class: "setting-hint" }, " 内置浏览器是 iframe,跨源站点受同源策略保护,插件无法改写其内部元素, 因此这里只能给容器着色并加一层降亮遮罩,无法像 DarkReader 那样逐元素反色。 ", -1)),
102011
+ createBaseVNode("div", _hoisted_13, [
102012
+ _cache[28] || (_cache[28] = createBaseVNode("span", null, "插件透明度", -1)),
102013
+ createBaseVNode("div", _hoisted_14, [
101861
102014
  createVNode(_component_el_slider, {
101862
102015
  modelValue: pluginOpacity.value,
101863
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => pluginOpacity.value = $event),
102016
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => pluginOpacity.value = $event),
101864
102017
  min: 0,
101865
102018
  max: 1,
101866
102019
  step: 0.05,
101867
102020
  "format-tooltip": (v2) => Math.round(v2 * 100) + "%",
101868
102021
  style: { "width": "130px" }
101869
102022
  }, null, 8, ["modelValue", "format-tooltip"]),
101870
- createBaseVNode("span", _hoisted_10, toDisplayString(Math.round(pluginOpacity.value * 100)) + "%", 1)
102023
+ createBaseVNode("span", _hoisted_15, toDisplayString(Math.round(pluginOpacity.value * 100)) + "%", 1)
101871
102024
  ])
101872
102025
  ]),
101873
- createBaseVNode("div", _hoisted_11, [
101874
- _cache[18] || (_cache[18] = createBaseVNode("span", null, "游戏面板透明度", -1)),
101875
- createBaseVNode("div", _hoisted_12, [
102026
+ createBaseVNode("div", _hoisted_16, [
102027
+ _cache[29] || (_cache[29] = createBaseVNode("span", null, "游戏面板透明度", -1)),
102028
+ createBaseVNode("div", _hoisted_17, [
101876
102029
  createVNode(_component_el_slider, {
101877
102030
  modelValue: gamePanelOpacity.value,
101878
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => gamePanelOpacity.value = $event),
102031
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => gamePanelOpacity.value = $event),
101879
102032
  min: 0.1,
101880
102033
  max: 1,
101881
102034
  step: 0.05,
101882
102035
  "format-tooltip": (v2) => Math.round(v2 * 100) + "%",
101883
102036
  style: { "width": "130px" }
101884
102037
  }, null, 8, ["modelValue", "format-tooltip"]),
101885
- createBaseVNode("span", _hoisted_13, toDisplayString(Math.round(gamePanelOpacity.value * 100)) + "%", 1)
102038
+ createBaseVNode("span", _hoisted_18, toDisplayString(Math.round(gamePanelOpacity.value * 100)) + "%", 1)
101886
102039
  ]),
101887
- _cache[19] || (_cache[19] = createBaseVNode("div", { style: { "font-size": "11px", "color": "var(--el-text-color-secondary)", "margin-top": "4px", "width": "100%", "text-align": "right" } }, " 游戏播放时面板透明度 ", -1))
102040
+ _cache[30] || (_cache[30] = createBaseVNode("div", { style: { "font-size": "11px", "color": "var(--el-text-color-secondary)", "margin-top": "4px", "width": "100%", "text-align": "right" } }, " 游戏播放时面板透明度 ", -1))
101888
102041
  ]),
101889
- createBaseVNode("div", _hoisted_14, [
101890
- _cache[20] || (_cache[20] = createBaseVNode("div", { class: "block-title" }, "快捷键", -1)),
102042
+ createBaseVNode("div", _hoisted_19, [
102043
+ _cache[31] || (_cache[31] = createBaseVNode("div", { class: "block-title" }, "快捷键", -1)),
101891
102044
  (openBlock(), createElementBlock(Fragment, null, renderList(shortcutItems, (item) => {
101892
102045
  return createBaseVNode("div", {
101893
102046
  key: item.type,
101894
102047
  class: "shortcut-row"
101895
102048
  }, [
101896
102049
  createBaseVNode("span", null, toDisplayString(item.label), 1),
101897
- createBaseVNode("div", _hoisted_15, [
102050
+ createBaseVNode("div", _hoisted_20, [
101898
102051
  createBaseVNode("button", {
101899
102052
  class: normalizeClass(["shortcut-btn", { recording: recordingShortcut.value === item.type }]),
101900
102053
  onClick: ($event) => startRecording(item.type)
101901
- }, toDisplayString(recordingShortcut.value === item.type ? "按下新组合键..." : unref(formatShortcut)(unref(settingsStore)[item.getter])), 11, _hoisted_16),
102054
+ }, toDisplayString(recordingShortcut.value === item.type ? "按下新组合键..." : unref(formatShortcut)(unref(settingsStore)[item.getter])), 11, _hoisted_21),
101902
102055
  createBaseVNode("button", {
101903
102056
  class: "shortcut-reset",
101904
102057
  title: "恢复默认",
101905
102058
  onClick: ($event) => unref(settingsStore)[item.setter](DEFAULT_SHORTCUTS[item.type])
101906
- }, "默认", 8, _hoisted_17)
102059
+ }, "默认", 8, _hoisted_22)
101907
102060
  ])
101908
102061
  ]);
101909
102062
  }), 64)),
101910
- recordingShortcut.value ? (openBlock(), createElementBlock("div", _hoisted_18, " 请按下新的组合键(建议 Ctrl+Alt+主键,避免使用 Shift 以免键位漂移),按 Esc 取消 ")) : createCommentVNode("", true)
102063
+ recordingShortcut.value ? (openBlock(), createElementBlock("div", _hoisted_23, " 请按下新的组合键(建议 Ctrl+Alt+主键,避免使用 Shift 以免键位漂移),按 Esc 取消 ")) : createCommentVNode("", true)
101911
102064
  ]),
101912
- createBaseVNode("div", _hoisted_19, [
101913
- createBaseVNode("div", _hoisted_20, [
101914
- createBaseVNode("div", _hoisted_21, [
101915
- _cache[22] || (_cache[22] = createBaseVNode("span", null, "紧急模式", -1)),
102065
+ createBaseVNode("div", _hoisted_24, [
102066
+ createBaseVNode("div", _hoisted_25, [
102067
+ createBaseVNode("div", _hoisted_26, [
102068
+ _cache[33] || (_cache[33] = createBaseVNode("span", null, "紧急模式", -1)),
101916
102069
  createVNode(_component_el_tooltip, {
101917
102070
  placement: "top",
101918
102071
  effect: "dark"
101919
102072
  }, {
101920
- content: withCtx(() => [..._cache[21] || (_cache[21] = [
102073
+ content: withCtx(() => [..._cache[32] || (_cache[32] = [
101921
102074
  createTextVNode(" 按下快捷键全屏显示伪装内容(图片或网页),再按一次恢复摸鱼页面", -1),
101922
102075
  createBaseVNode("br", null, null, -1),
101923
102076
  createTextVNode(" 以 .png/.jpg/.gif/.webp 等图片扩展名结尾的地址按图片展示,其余按网页加载 ", -1)
@@ -101935,20 +102088,20 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101935
102088
  ]),
101936
102089
  createVNode(_component_el_input, {
101937
102090
  modelValue: localPanicUrl.value,
101938
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => localPanicUrl.value = $event),
102091
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => localPanicUrl.value = $event),
101939
102092
  placeholder: "图片 URL / 网页地址",
101940
102093
  clearable: "",
101941
102094
  onChange: onPanicUrlChange
101942
102095
  }, null, 8, ["modelValue"])
101943
102096
  ]),
101944
- createBaseVNode("div", _hoisted_22, [
101945
- createBaseVNode("div", _hoisted_23, [
101946
- _cache[24] || (_cache[24] = createBaseVNode("span", null, "管理员 Token", -1)),
102097
+ createBaseVNode("div", _hoisted_27, [
102098
+ createBaseVNode("div", _hoisted_28, [
102099
+ _cache[35] || (_cache[35] = createBaseVNode("span", null, "管理员 Token", -1)),
101947
102100
  createVNode(_component_el_tooltip, {
101948
102101
  placement: "top",
101949
102102
  effect: "dark"
101950
102103
  }, {
101951
- content: withCtx(() => [..._cache[23] || (_cache[23] = [
102104
+ content: withCtx(() => [..._cache[34] || (_cache[34] = [
101952
102105
  createTextVNode(" 与服务端 application.yml 的 token 一致时,登录后获得管理员权限", -1),
101953
102106
  createBaseVNode("br", null, null, -1),
101954
102107
  createTextVNode(" 登录时随 LOGIN 帧上报;修改后需重新登录(#login)生效 ", -1)
@@ -101966,7 +102119,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101966
102119
  ]),
101967
102120
  createVNode(_component_el_input, {
101968
102121
  modelValue: localAdminToken.value,
101969
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => localAdminToken.value = $event),
102122
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => localAdminToken.value = $event),
101970
102123
  type: "password",
101971
102124
  "show-password": "",
101972
102125
  clearable: "",
@@ -101981,17 +102134,17 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
101981
102134
  type: "success",
101982
102135
  size: "small"
101983
102136
  }, {
101984
- default: withCtx(() => [..._cache[25] || (_cache[25] = [
102137
+ default: withCtx(() => [..._cache[36] || (_cache[36] = [
101985
102138
  createTextVNode("WebSocket", -1)
101986
102139
  ])]),
101987
102140
  _: 1
101988
102141
  }),
101989
- _cache[26] || (_cache[26] = createBaseVNode("div", { style: { "font-size": "11px", "color": "var(--el-text-color-secondary)", "margin-top": "4px" } }, " xechat-dsh 仅支持 WebSocket,服务端地址由 #login 指定 ", -1))
102142
+ _cache[37] || (_cache[37] = createBaseVNode("div", { style: { "font-size": "11px", "color": "var(--el-text-color-secondary)", "margin-top": "4px" } }, " xechat-dsh 仅支持 WebSocket,服务端地址由 #login 指定 ", -1))
101990
102143
  ]),
101991
102144
  _: 1
101992
102145
  }),
101993
- createBaseVNode("div", _hoisted_24, [
101994
- _cache[27] || (_cache[27] = createBaseVNode("span", null, "在线状态", -1)),
102146
+ createBaseVNode("div", _hoisted_29, [
102147
+ _cache[38] || (_cache[38] = createBaseVNode("span", null, "在线状态", -1)),
101995
102148
  createVNode(_component_el_tag, {
101996
102149
  type: unref(state).online ? "success" : "info",
101997
102150
  size: "small"
@@ -102002,16 +102155,16 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
102002
102155
  _: 1
102003
102156
  }, 8, ["type"])
102004
102157
  ]),
102005
- unref(state).username ? (openBlock(), createElementBlock("div", _hoisted_25, [
102006
- _cache[28] || (_cache[28] = createBaseVNode("span", null, "用户名", -1)),
102007
- createBaseVNode("span", _hoisted_26, toDisplayString(unref(state).username), 1)
102158
+ unref(state).username ? (openBlock(), createElementBlock("div", _hoisted_30, [
102159
+ _cache[39] || (_cache[39] = createBaseVNode("span", null, "用户名", -1)),
102160
+ createBaseVNode("span", _hoisted_31, toDisplayString(unref(state).username), 1)
102008
102161
  ])) : createCommentVNode("", true)
102009
102162
  ])
102010
102163
  ]);
102011
102164
  };
102012
102165
  }
102013
102166
  };
102014
- const SettingsPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-297e7ab3"]]);
102167
+ const SettingsPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-e4f41080"]]);
102015
102168
  const _hoisted_1 = { class: "nav-buttons" };
102016
102169
  const _hoisted_2 = { class: "nav-bottom" };
102017
102170
  const _hoisted_3 = ["src"];