@jiyr0119/dsh-service-console 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dsh.plugin.json +1 -1
- package/lib/client.js +342 -167
- package/lib/host/config.js +19 -5
- package/lib/host/lifecycle.js +1 -0
- package/lib/host/process-inspector.js +2 -1
- package/lib/host/protection.js +41 -0
- package/lib/host/service-registry.js +14 -5
- package/lib/host/service-tool.js +158 -0
- package/lib/index.js +22 -3
- package/lib/types/client/ServiceConsole.d.ts +18 -8
- package/lib/types/client/dictionaries.d.ts +153 -2
- package/lib/types/client/index.d.ts +26 -7
- package/lib/types/host/config.d.ts +1 -0
- package/lib/types/host/process-inspector.d.ts +2 -0
- package/lib/types/host/protection.d.ts +21 -0
- package/lib/types/host/service-registry.d.ts +2 -1
- package/lib/types/host/service-tool.d.ts +6 -0
- package/lib/types/host/types.d.ts +2 -0
- package/manifest.json +1 -1
- package/package.json +6 -1
package/lib/client.js
CHANGED
|
@@ -27,9 +27,10 @@ window.__ModuleLoader__.load({
|
|
|
27
27
|
//#endregion
|
|
28
28
|
let react = require("react");
|
|
29
29
|
react = __toESM(react, 1);
|
|
30
|
+
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
30
31
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
31
32
|
//#region \0dsh-css:/home/runner/work/dsh-service-console/dsh-service-console/src/client/service-console.module.css.mjs
|
|
32
|
-
const css = ".PuSt5a_layer{z-index:100;pointer-events:none;position:fixed;inset:0}.PuSt5a_popup{background:var(--dsw-alias-bg-layer-2,#262626);border:1px solid var(--dsw-alias-border-inverted,#80808047);width:420px;box-shadow:var(--dsw-shadow-lv3,0 12px 32px #00000059);color:var(--dsw-alias-label-primary,#e8e8e8);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2,#80808066);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2,#80808099);pointer-events:auto;opacity:0;transform-origin:100% 0;border-radius:16px;flex-direction:column;font:13px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;transition:opacity .18s,transform .18s;display:flex;position:fixed;right:16px;overflow:hidden;transform:translateY(-8px)scale(.98)}.PuSt5a_popupOn{opacity:1;transform:translateY(0)scale(1)}@media (prefers-reduced-motion:reduce){.PuSt5a_popup{transition:none}}.PuSt5a_head{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;align-items:center;gap:8px;padding:14px 16px 12px 18px;display:flex}.PuSt5a_headIco{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;display:inline-flex}.PuSt5a_headTitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:15px;font-weight:600;overflow:hidden}.PuSt5a_icoBtn{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;display:inline-flex}.PuSt5a_icoBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#80808024);color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabs{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;gap:2px;padding:0 14px;display:flex}.PuSt5a_tab{height:36px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:10px 10px 0 0;flex:1;justify-content:center;align-items:center;gap:6px;font-size:12.5px;font-weight:500;display:inline-flex;position:relative}.PuSt5a_tab:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#80808014)}.PuSt5a_tabOn{color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabInd{background:var(--dsw-alias-state-business-primary,#4176e6);opacity:0;border-radius:999px;height:2px;transition:opacity .16s,transform .16s;position:absolute;bottom:-1px;left:24%;right:24%;transform:scaleX(.4)}.PuSt5a_tabOn .PuSt5a_tabInd{opacity:1;transform:scaleX(1)}.PuSt5a_tab:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (prefers-reduced-motion:reduce){.PuSt5a_tabInd{transition:none}}.PuSt5a_tabBody{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden auto}.PuSt5a_tabBody::-webkit-scrollbar{width:6px}.PuSt5a_tabBody::-webkit-scrollbar-thumb{background:var(--dsh-scrollbar-thumb);border-radius:3px}.PuSt5a_tabBody::-webkit-scrollbar-thumb:hover{background:var(--dsh-scrollbar-thumb-hover)}.PuSt5a_tabBody::-webkit-scrollbar-track{background:0 0}.PuSt5a_filterRow{align-items:center;gap:6px;padding:12px 16px 6px;display:flex}.PuSt5a_filter{min-width:0;height:30px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:1;padding:0 8px;font-size:12.5px}.PuSt5a_filter:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_filter::placeholder{color:var(--dsw-alias-label-caption,#8a8a8a)}.PuSt5a_filterClear{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.PuSt5a_filterClear:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_hintLine{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:6px;padding:4px 18px 8px;font-size:11px;display:flex}.PuSt5a_liveDot{background:var(--dsw-alias-state-success-primary,#55d187);width:7px;height:7px;box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-success-primary,#55d187) 18%, transparent);border-radius:50%;flex:none}.PuSt5a_row{border:1px solid var(--dsw-alias-border-l3,#80808026);background:var(--dsw-alias-bg-layer-1,#ffffff08);border-radius:12px;margin:0 12px 8px;padding:12px 16px;transition:background .12s,border-color .12s}.PuSt5a_row:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014);border-color:var(--dsw-alias-border-l2,#80808040)}.PuSt5a_rowMain{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}.PuSt5a_rowDot{flex-shrink:0;font-size:8px;line-height:1}.PuSt5a_rowName{letter-spacing:-.01em;word-break:break-word;font-size:13px;font-weight:600}.PuSt5a_rowMeta{color:var(--dsw-alias-label-secondary,#9a9a9a);font-variant-numeric:tabular-nums;word-break:break-all;font-size:11.5px}.PuSt5a_rowSub{color:var(--dsw-alias-label-secondary,#9a9a9a);word-break:break-all;margin-top:4px;font-size:11.5px;line-height:1.4}.PuSt5a_spacer{flex:1}.PuSt5a_badge{white-space:nowrap;border:1px solid;border-radius:999px;padding:1px 6px;font-size:10px;font-weight:500}.PuSt5a_rowBtn{border:1px solid var(--dsw-alias-border-l2,#8080804d);height:24px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0 7px;font-size:11px;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_rowAct{color:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:5px;flex:none;justify-content:center;align-items:center;width:22px;height:22px;text-decoration:none;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowAct:hover{color:var(--dsw-alias-state-business-primary,#4176e6);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_confirmRow{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 8%, transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 15%, transparent);border-radius:10px;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;padding:10px 12px;display:flex}.PuSt5a_confirmTxt{min-width:0;color:var(--dsw-alias-label-secondary,#b0b3ba);flex:1;font-size:12px}.PuSt5a_confirmOk{background:var(--dsw-alias-state-error-primary,#e5484d);color:#fff;height:26px;font:inherit;cursor:pointer;border:none;border-radius:7px;flex:none;padding:0 10px;font-size:11px;font-weight:500;transition:opacity .1s}.PuSt5a_confirmOk:hover{opacity:.85}.PuSt5a_confirmCancel{border:1px solid var(--dsw-alias-border-l2,#80808059);height:26px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:7px;flex:none;padding:0 10px;font-size:11px;transition:color .1s,background .1s}.PuSt5a_confirmCancel:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_detailBox{border:1px solid var(--dsw-alias-border-l2,#8080804d);background:var(--dsw-alias-bg-layer-1,#00000026);box-shadow:inset 3px 0 0 var(--dsw-alias-state-business-primary,#4176e6);border-radius:10px;margin-top:10px;padding:14px}.PuSt5a_detailHead{justify-content:space-between;align-items:center;margin-bottom:12px;font-size:12px;font-weight:600;display:flex}.PuSt5a_detailAccent{color:var(--dsw-alias-state-business-primary,#4176e6);letter-spacing:.12em;text-transform:uppercase;font-size:9px;font-weight:650}.PuSt5a_detailGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.PuSt5a_detailGrid>div{flex-direction:column;gap:3px;min-width:0;display:flex}.PuSt5a_detailLabel{color:var(--dsw-alias-label-caption,#7a7d85);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600}.PuSt5a_detailGrid code{overflow-wrap:anywhere;word-break:break-all;color:var(--dsw-alias-label-primary,#d8d9dc);font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.PuSt5a_evidenceBlock{border-top:1px solid var(--dsw-alias-border-l3,#80808026);margin-top:14px;padding-top:12px;overflow:hidden}.PuSt5a_evidenceItem{color:var(--dsw-alias-label-secondary,#8a8d95);gap:6px;margin-top:5px;font-size:11px;line-height:1.4;display:flex}.PuSt5a_evidenceArrow{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;font-size:10px}.PuSt5a_note{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:8px;padding:6px 16px;font-size:12px;display:flex}.PuSt5a_noteErr{color:var(--dsw-alias-state-error-primary,#e5484d);padding:6px 16px;font-size:12px}.PuSt5a_noteWarn{color:var(--dsw-alias-state-warn-primary,#e7b85d);padding:6px 16px;font-size:12px}.PuSt5a_okText{color:var(--dsw-alias-state-success-primary,#55d187);margin-top:4px;font-size:12px}.PuSt5a_errText{color:var(--dsw-alias-state-error-primary,#e5484d);margin-top:4px;font-size:12px}.PuSt5a_empty{color:var(--dsw-alias-label-secondary,#9a9a9a);padding:24px 18px;font-size:12.5px}.PuSt5a_spin{border:2px solid var(--dsw-alias-border-l2,#80808066);border-top-color:var(--dsw-alias-state-business-primary,#4176e6);border-radius:50%;flex:none;width:13px;height:13px;animation:.7s linear infinite PuSt5a_sc-spin}@keyframes PuSt5a_sc-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.PuSt5a_spin{animation-duration:1.6s}}.PuSt5a_headerBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:32px;color:var(--dsw-alias-label-primary,#e8e8e8);cursor:pointer;background:0 0;border-radius:18px;flex:none;justify-content:center;align-items:center;gap:4px;padding:6px 12px;font-size:13px;font-weight:400;line-height:20px;display:inline-flex}.PuSt5a_headerBtn span,.PuSt5a_headerBtn svg{flex:none}.PuSt5a_headerBtn span{white-space:nowrap}.PuSt5a_headerBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_headerBtnOn{color:var(--dsw-alias-state-business-primary,#4176e6);border-color:#4176e680}.PuSt5a_setPage{padding:8px 16px 28px}.PuSt5a_setSection{letter-spacing:.05em;text-transform:uppercase;color:var(--dsw-alias-label-caption,#8a8a8a);padding:10px 4px 6px;font-size:11px;font-weight:600}.PuSt5a_setRow{border-radius:12px;align-items:center;gap:12px;padding:9px 10px;display:flex}.PuSt5a_setRow:hover{background:var(--dsw-alias-interactive-bg-hover,#8080800f)}.PuSt5a_setInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.PuSt5a_setLabel{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:12.5px}.PuSt5a_setCap{color:var(--dsw-alias-label-caption,#8a8a8a);font-size:11px}.PuSt5a_setInput{width:80px;min-width:80px;height:28px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:none;padding:0 8px;font-size:12px}.PuSt5a_setInput:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_switch{border:1px solid var(--dsw-alias-border-l2,#80808066);background:var(--dsw-alias-interactive-bg-hover,#8080802e);cursor:pointer;border-radius:999px;flex:none;width:34px;height:20px;padding:0;transition:background .15s,border-color .15s;position:relative}.PuSt5a_switch:after{content:\"\";background:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}.PuSt5a_switch[aria-checked=true]{background:var(--dsw-alias-state-business-primary,#4176e6);border-color:#0000}.PuSt5a_switch[aria-checked=true]:after{background:#fff;transform:translate(14px)}@media (prefers-reduced-motion:reduce){.PuSt5a_switch,.PuSt5a_switch:after{transition:none}}.PuSt5a_prevBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:28px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0 10px;font-size:12px;display:inline-flex}.PuSt5a_prevBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_setFooter{justify-content:flex-end;padding:8px 4px 2px;display:flex}.PuSt5a_setNote{color:var(--dsw-alias-label-dimmed,#777);padding:2px 10px 8px;font-size:11px}.PuSt5a_starSection{border:1px solid var(--dsw-alias-border-l3,#80808026);background:var(--dsw-alias-bg-layer-1,#ffffff08);border-radius:12px;margin-top:12px;padding:12px 10px}.PuSt5a_starRow{align-items:center;gap:12px;display:flex}.PuSt5a_starInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.PuSt5a_starLabel{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:12.5px}.PuSt5a_starLink{color:var(--dsw-alias-state-business-primary,#4176e6);text-underline-offset:2px;white-space:nowrap;flex:none;font-size:12px;line-height:1.6;text-decoration:underline}.PuSt5a_starLink:hover{opacity:.85}.PuSt5a_rowBtn:focus-visible,.PuSt5a_headerBtn:focus-visible,.PuSt5a_icoBtn:focus-visible,.PuSt5a_prevBtn:focus-visible,.PuSt5a_filter:focus-visible,.PuSt5a_tab:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (width<=480px){.PuSt5a_popup{width:calc(100vw - 16px);right:8px}.PuSt5a_detailGrid{grid-template-columns:1fr}}";
|
|
33
|
+
const css = ".PuSt5a_layer{z-index:100;pointer-events:none;position:fixed;inset:0}.PuSt5a_popup{background:var(--dsw-alias-bg-layer-2,#262626);border:1px solid var(--dsw-alias-border-inverted,#80808047);width:420px;box-shadow:var(--dsw-shadow-lv3,0 12px 32px #00000059);color:var(--dsw-alias-label-primary,#e8e8e8);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2,#80808066);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2,#80808099);pointer-events:auto;opacity:0;transform-origin:100% 0;border-radius:16px;flex-direction:column;font:13px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;transition:opacity .18s,transform .18s;display:flex;position:fixed;right:16px;overflow:hidden;transform:translateY(-8px)scale(.98)}.PuSt5a_popupOn{opacity:1;transform:translateY(0)scale(1)}@media (prefers-reduced-motion:reduce){.PuSt5a_popup{transition:none}}.PuSt5a_head{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;align-items:center;gap:8px;padding:14px 16px 12px 18px;display:flex}.PuSt5a_headIco{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;display:inline-flex}.PuSt5a_headTitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:15px;font-weight:600;overflow:hidden}.PuSt5a_icoBtn{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;display:inline-flex}.PuSt5a_icoBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#80808024);color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabs{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;gap:2px;padding:0 14px;display:flex}.PuSt5a_tab{height:36px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:10px 10px 0 0;flex:1;justify-content:center;align-items:center;gap:6px;font-size:12.5px;font-weight:500;display:inline-flex;position:relative}.PuSt5a_tab:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#80808014)}.PuSt5a_tabOn{color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabInd{background:var(--dsw-alias-state-business-primary,#4176e6);opacity:0;border-radius:999px;height:2px;transition:opacity .16s,transform .16s;position:absolute;bottom:-1px;left:24%;right:24%;transform:scaleX(.4)}.PuSt5a_tabOn .PuSt5a_tabInd{opacity:1;transform:scaleX(1)}.PuSt5a_tab:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (prefers-reduced-motion:reduce){.PuSt5a_tabInd{transition:none}}.PuSt5a_tabBody{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden auto}.PuSt5a_tabBody::-webkit-scrollbar{width:6px}.PuSt5a_tabBody::-webkit-scrollbar-thumb{background:var(--dsh-scrollbar-thumb);border-radius:3px}.PuSt5a_tabBody::-webkit-scrollbar-thumb:hover{background:var(--dsh-scrollbar-thumb-hover)}.PuSt5a_tabBody::-webkit-scrollbar-track{background:0 0}.PuSt5a_filterRow{align-items:center;gap:6px;padding:12px 16px 6px;display:flex}.PuSt5a_filter{min-width:0;height:30px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:1;padding:0 8px;font-size:12.5px}.PuSt5a_filter:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_filter::placeholder{color:var(--dsw-alias-label-caption,#8a8a8a)}.PuSt5a_filterClear{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.PuSt5a_filterClear:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_segGroup{border:1px solid var(--dsw-alias-border-l2,#80808059);border-radius:8px;flex:none;gap:2px;padding:2px;display:inline-flex}.PuSt5a_segBtn{color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:6px 7px;font-size:11.5px;line-height:1;transition:color .1s,background .1s}.PuSt5a_segBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_segBtnOn,.PuSt5a_segBtnOn:hover{background:var(--dsw-alias-state-business-primary,#4176e6);color:#fff}@media (prefers-reduced-motion:reduce){.PuSt5a_segBtn{transition:none}}.PuSt5a_hintLine{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:6px;padding:4px 18px 8px;font-size:11px;display:flex}.PuSt5a_hintWarn{color:var(--dsw-alias-state-warn-primary,#e7b85d)}.PuSt5a_liveDot{background:var(--dsw-alias-state-success-primary,#55d187);width:7px;height:7px;box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-success-primary,#55d187) 18%, transparent);border-radius:50%;flex:none}.PuSt5a_row{border:1px solid var(--dsw-alias-border-l3,#80808026);background:var(--dsw-alias-bg-layer-1,#ffffff08);border-radius:12px;margin:0 12px 8px;padding:12px 16px;transition:background .12s,border-color .12s}.PuSt5a_row:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014);border-color:var(--dsw-alias-border-l2,#80808040)}.PuSt5a_rowMain{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}.PuSt5a_rowDot{flex-shrink:0;font-size:8px;line-height:1}.PuSt5a_rowName{letter-spacing:-.01em;word-break:break-word;font-size:13px;font-weight:600}.PuSt5a_rowMeta{color:var(--dsw-alias-label-secondary,#9a9a9a);font-variant-numeric:tabular-nums;word-break:break-all;font-size:11.5px}.PuSt5a_rowSub{color:var(--dsw-alias-label-secondary,#9a9a9a);word-break:break-all;margin-top:4px;font-size:11.5px;line-height:1.4}.PuSt5a_spacer{flex:1}.PuSt5a_badge{white-space:nowrap;border:1px solid;border-radius:999px;padding:1px 6px;font-size:10px;font-weight:500}.PuSt5a_rowBtn{border:1px solid var(--dsw-alias-border-l2,#8080804d);height:24px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0 7px;font-size:11px;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_rowAct{color:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:5px;flex:none;justify-content:center;align-items:center;width:22px;height:22px;text-decoration:none;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowAct:hover{color:var(--dsw-alias-state-business-primary,#4176e6);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_confirmRow{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 8%, transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 15%, transparent);border-radius:10px;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;padding:10px 12px;display:flex}.PuSt5a_confirmTxt{min-width:0;color:var(--dsw-alias-label-secondary,#b0b3ba);flex:1;font-size:12px}.PuSt5a_confirmOk{background:var(--dsw-alias-state-error-primary,#e5484d);color:#fff;height:26px;font:inherit;cursor:pointer;border:none;border-radius:7px;flex:none;padding:0 10px;font-size:11px;font-weight:500;transition:opacity .1s}.PuSt5a_confirmOk:hover{opacity:.85}.PuSt5a_confirmOk:disabled{opacity:.55;cursor:default}.PuSt5a_confirmCancel{border:1px solid var(--dsw-alias-border-l2,#80808059);height:26px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:7px;flex:none;padding:0 10px;font-size:11px;transition:color .1s,background .1s}.PuSt5a_confirmCancel:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_detailBox{border:1px solid var(--dsw-alias-border-l2,#8080804d);background:var(--dsw-alias-bg-layer-1,#00000026);box-shadow:inset 3px 0 0 var(--dsw-alias-state-business-primary,#4176e6);border-radius:10px;margin-top:10px;padding:14px}.PuSt5a_detailHead{justify-content:space-between;align-items:center;margin-bottom:12px;font-size:12px;font-weight:600;display:flex}.PuSt5a_detailAccent{color:var(--dsw-alias-state-business-primary,#4176e6);letter-spacing:.12em;text-transform:uppercase;font-size:9px;font-weight:650}.PuSt5a_detailGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.PuSt5a_detailGrid>div{flex-direction:column;gap:3px;min-width:0;display:flex}.PuSt5a_detailLabel{color:var(--dsw-alias-label-caption,#7a7d85);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600}.PuSt5a_detailGrid code{overflow-wrap:anywhere;word-break:break-all;color:var(--dsw-alias-label-primary,#d8d9dc);font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.PuSt5a_evidenceBlock{border-top:1px solid var(--dsw-alias-border-l3,#80808026);margin-top:14px;padding-top:12px;overflow:hidden}.PuSt5a_evidenceItem{color:var(--dsw-alias-label-secondary,#8a8d95);gap:6px;margin-top:5px;font-size:11px;line-height:1.4;display:flex}.PuSt5a_evidenceArrow{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;font-size:10px}.PuSt5a_note{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:8px;padding:6px 16px;font-size:12px;display:flex}.PuSt5a_noteErr{color:var(--dsw-alias-state-error-primary,#e5484d);padding:6px 16px;font-size:12px}.PuSt5a_noteWarn{color:var(--dsw-alias-state-warn-primary,#e7b85d);padding:6px 16px;font-size:12px}.PuSt5a_okText{color:var(--dsw-alias-state-success-primary,#55d187);margin-top:4px;font-size:12px}.PuSt5a_errText{color:var(--dsw-alias-state-error-primary,#e5484d);margin-top:4px;font-size:12px}.PuSt5a_empty{color:var(--dsw-alias-label-secondary,#9a9a9a);padding:24px 18px;font-size:12.5px}.PuSt5a_spin{border:2px solid var(--dsw-alias-border-l2,#80808066);border-top-color:var(--dsw-alias-state-business-primary,#4176e6);border-radius:50%;flex:none;width:13px;height:13px;animation:.7s linear infinite PuSt5a_sc-spin}@keyframes PuSt5a_sc-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.PuSt5a_spin{animation-duration:1.6s}}.PuSt5a_headerBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:32px;color:var(--dsw-alias-label-primary,#e8e8e8);cursor:pointer;background:0 0;border-radius:18px;flex:none;justify-content:center;align-items:center;gap:4px;padding:6px 12px;font-size:13px;font-weight:400;line-height:20px;display:inline-flex}.PuSt5a_headerBtn span,.PuSt5a_headerBtn svg{flex:none}.PuSt5a_headerBtn span{white-space:nowrap}.PuSt5a_headerBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_headerBtnOn{color:var(--dsw-alias-state-business-primary,#4176e6);border-color:#4176e680}.PuSt5a_setPage{padding:8px 16px 28px}.PuSt5a_setSection{letter-spacing:.05em;text-transform:uppercase;color:var(--dsw-alias-label-caption,#8a8a8a);padding:10px 4px 6px;font-size:11px;font-weight:600}.PuSt5a_setRow{border-radius:12px;align-items:center;gap:12px;padding:9px 10px;display:flex}.PuSt5a_setRow:hover{background:var(--dsw-alias-interactive-bg-hover,#8080800f)}.PuSt5a_setInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.PuSt5a_setLabel{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:12.5px}.PuSt5a_setCap{color:var(--dsw-alias-label-caption,#8a8a8a);font-size:11px}.PuSt5a_setInput{width:80px;min-width:80px;height:28px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:none;padding:0 8px;font-size:12px}.PuSt5a_setInput:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_setSelect{width:96px}.PuSt5a_switch{border:1px solid var(--dsw-alias-border-l2,#80808066);background:var(--dsw-alias-interactive-bg-hover,#8080802e);cursor:pointer;border-radius:999px;flex:none;width:34px;height:20px;padding:0;transition:background .15s,border-color .15s;position:relative}.PuSt5a_switch:after{content:\"\";background:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}.PuSt5a_switch[aria-checked=true]{background:var(--dsw-alias-state-business-primary,#4176e6);border-color:#0000}.PuSt5a_switch[aria-checked=true]:after{background:#fff;transform:translate(14px)}@media (prefers-reduced-motion:reduce){.PuSt5a_switch,.PuSt5a_switch:after{transition:none}}.PuSt5a_prevBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:28px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0 10px;font-size:12px;display:inline-flex}.PuSt5a_prevBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_setFooter{justify-content:flex-end;padding:8px 4px 2px;display:flex}.PuSt5a_setNote{color:var(--dsw-alias-label-dimmed,#777);padding:2px 10px 8px;font-size:11px}.PuSt5a_starSection{border:1px solid var(--dsw-alias-border-l3,#80808026);background:var(--dsw-alias-bg-layer-1,#ffffff08);border-radius:12px;margin-top:12px;padding:12px 10px}.PuSt5a_starRow{align-items:center;gap:12px;display:flex}.PuSt5a_starInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.PuSt5a_starLabel{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:12.5px}.PuSt5a_starLink{color:var(--dsw-alias-state-business-primary,#4176e6);text-underline-offset:2px;white-space:nowrap;flex:none;font-size:12px;line-height:1.6;text-decoration:underline}.PuSt5a_starLink:hover{opacity:.85}.PuSt5a_rowBtn:focus-visible,.PuSt5a_headerBtn:focus-visible,.PuSt5a_icoBtn:focus-visible,.PuSt5a_prevBtn:focus-visible,.PuSt5a_filter:focus-visible,.PuSt5a_tab:focus-visible,.PuSt5a_segBtn:focus-visible,.PuSt5a_confirmOk:focus-visible,.PuSt5a_confirmCancel:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (width<=480px){.PuSt5a_popup{width:calc(100vw - 16px);right:8px}.PuSt5a_detailGrid{grid-template-columns:1fr}}";
|
|
33
34
|
const tagId = "@jiyr0119/dsh-service-console/service-console.module.css";
|
|
34
35
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
35
36
|
const tag = document.createElement("style");
|
|
@@ -39,71 +40,76 @@ window.__ModuleLoader__.load({
|
|
|
39
40
|
document.head.appendChild(tag);
|
|
40
41
|
}
|
|
41
42
|
var service_console_module_css_default = {
|
|
42
|
-
"
|
|
43
|
-
"detailGrid": "PuSt5a_detailGrid",
|
|
44
|
-
"rowName": "PuSt5a_rowName",
|
|
43
|
+
"okText": "PuSt5a_okText",
|
|
45
44
|
"detailLabel": "PuSt5a_detailLabel",
|
|
46
|
-
"
|
|
45
|
+
"starSection": "PuSt5a_starSection",
|
|
47
46
|
"headerBtnOn": "PuSt5a_headerBtnOn",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"setLabel": "PuSt5a_setLabel",
|
|
57
|
-
"detailAccent": "PuSt5a_detailAccent",
|
|
58
|
-
"setFooter": "PuSt5a_setFooter",
|
|
59
|
-
"starLabel": "PuSt5a_starLabel",
|
|
47
|
+
"evidenceBlock": "PuSt5a_evidenceBlock",
|
|
48
|
+
"rowDot": "PuSt5a_rowDot",
|
|
49
|
+
"detailGrid": "PuSt5a_detailGrid",
|
|
50
|
+
"confirmCancel": "PuSt5a_confirmCancel",
|
|
51
|
+
"note": "PuSt5a_note",
|
|
52
|
+
"starRow": "PuSt5a_starRow",
|
|
53
|
+
"noteErr": "PuSt5a_noteErr",
|
|
54
|
+
"empty": "PuSt5a_empty",
|
|
60
55
|
"tabOn": "PuSt5a_tabOn",
|
|
61
|
-
"
|
|
56
|
+
"starLabel": "PuSt5a_starLabel",
|
|
57
|
+
"sc-spin": "PuSt5a_sc-spin",
|
|
58
|
+
"hintWarn": "PuSt5a_hintWarn",
|
|
62
59
|
"tabInd": "PuSt5a_tabInd",
|
|
63
|
-
"
|
|
64
|
-
"evidenceItem": "PuSt5a_evidenceItem",
|
|
65
|
-
"noteWarn": "PuSt5a_noteWarn",
|
|
66
|
-
"okText": "PuSt5a_okText",
|
|
60
|
+
"errText": "PuSt5a_errText",
|
|
67
61
|
"confirmTxt": "PuSt5a_confirmTxt",
|
|
68
|
-
"
|
|
69
|
-
"evidenceArrow": "PuSt5a_evidenceArrow",
|
|
70
|
-
"headerBtn": "PuSt5a_headerBtn",
|
|
62
|
+
"detailHead": "PuSt5a_detailHead",
|
|
71
63
|
"prevBtn": "PuSt5a_prevBtn",
|
|
64
|
+
"setFooter": "PuSt5a_setFooter",
|
|
65
|
+
"setRow": "PuSt5a_setRow",
|
|
66
|
+
"starInfo": "PuSt5a_starInfo",
|
|
67
|
+
"segBtnOn": "PuSt5a_segBtnOn",
|
|
68
|
+
"layer": "PuSt5a_layer",
|
|
72
69
|
"popup": "PuSt5a_popup",
|
|
70
|
+
"setPage": "PuSt5a_setPage",
|
|
71
|
+
"tabBody": "PuSt5a_tabBody",
|
|
72
|
+
"tabs": "PuSt5a_tabs",
|
|
73
|
+
"badge": "PuSt5a_badge",
|
|
74
|
+
"noteWarn": "PuSt5a_noteWarn",
|
|
75
|
+
"icoBtn": "PuSt5a_icoBtn",
|
|
76
|
+
"evidenceArrow": "PuSt5a_evidenceArrow",
|
|
77
|
+
"segBtn": "PuSt5a_segBtn",
|
|
78
|
+
"starLink": "PuSt5a_starLink",
|
|
79
|
+
"rowMain": "PuSt5a_rowMain",
|
|
73
80
|
"headIco": "PuSt5a_headIco",
|
|
74
|
-
"
|
|
75
|
-
"setRow": "PuSt5a_setRow",
|
|
81
|
+
"segGroup": "PuSt5a_segGroup",
|
|
76
82
|
"confirmRow": "PuSt5a_confirmRow",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"noteErr": "PuSt5a_noteErr",
|
|
81
|
-
"evidenceBlock": "PuSt5a_evidenceBlock",
|
|
82
|
-
"starInfo": "PuSt5a_starInfo",
|
|
83
|
-
"setInput": "PuSt5a_setInput",
|
|
84
|
-
"rowSub": "PuSt5a_rowSub",
|
|
83
|
+
"setSection": "PuSt5a_setSection",
|
|
84
|
+
"switch": "PuSt5a_switch",
|
|
85
|
+
"headerBtn": "PuSt5a_headerBtn",
|
|
85
86
|
"rowBtn": "PuSt5a_rowBtn",
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
87
|
+
"rowAct": "PuSt5a_rowAct",
|
|
88
|
+
"evidenceItem": "PuSt5a_evidenceItem",
|
|
89
|
+
"rowSub": "PuSt5a_rowSub",
|
|
89
90
|
"row": "PuSt5a_row",
|
|
90
|
-
"
|
|
91
|
+
"setCap": "PuSt5a_setCap",
|
|
91
92
|
"confirmOk": "PuSt5a_confirmOk",
|
|
92
|
-
"
|
|
93
|
-
"setSection": "PuSt5a_setSection",
|
|
94
|
-
"spacer": "PuSt5a_spacer",
|
|
95
|
-
"note": "PuSt5a_note",
|
|
96
|
-
"starSection": "PuSt5a_starSection",
|
|
97
|
-
"tabBody": "PuSt5a_tabBody",
|
|
98
|
-
"switch": "PuSt5a_switch",
|
|
99
|
-
"empty": "PuSt5a_empty",
|
|
100
|
-
"icoBtn": "PuSt5a_icoBtn",
|
|
93
|
+
"liveDot": "PuSt5a_liveDot",
|
|
101
94
|
"filterRow": "PuSt5a_filterRow",
|
|
95
|
+
"detailAccent": "PuSt5a_detailAccent",
|
|
102
96
|
"detailBox": "PuSt5a_detailBox",
|
|
103
|
-
"
|
|
97
|
+
"headTitle": "PuSt5a_headTitle",
|
|
104
98
|
"popupOn": "PuSt5a_popupOn",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
99
|
+
"setLabel": "PuSt5a_setLabel",
|
|
100
|
+
"filter": "PuSt5a_filter",
|
|
101
|
+
"setInfo": "PuSt5a_setInfo",
|
|
102
|
+
"rowMeta": "PuSt5a_rowMeta",
|
|
103
|
+
"setInput": "PuSt5a_setInput",
|
|
104
|
+
"head": "PuSt5a_head",
|
|
105
|
+
"setSelect": "PuSt5a_setSelect",
|
|
106
|
+
"rowName": "PuSt5a_rowName",
|
|
107
|
+
"spacer": "PuSt5a_spacer",
|
|
108
|
+
"tab": "PuSt5a_tab",
|
|
109
|
+
"setNote": "PuSt5a_setNote",
|
|
110
|
+
"hintLine": "PuSt5a_hintLine",
|
|
111
|
+
"spin": "PuSt5a_spin",
|
|
112
|
+
"filterClear": "PuSt5a_filterClear"
|
|
107
113
|
};
|
|
108
114
|
//#endregion
|
|
109
115
|
//#region src/client/ServiceConsole.tsx
|
|
@@ -116,22 +122,21 @@ window.__ModuleLoader__.load({
|
|
|
116
122
|
* - UI: 抽屉式面板 + Tab 栏(服务 / 设置),对标 workspace-explorer 视觉风格
|
|
117
123
|
*/
|
|
118
124
|
let timerCtx = null;
|
|
119
|
-
let
|
|
125
|
+
let localeSubscribe = null;
|
|
120
126
|
let tr = (k) => k;
|
|
121
127
|
function bindTimer(t) {
|
|
122
128
|
timerCtx = t;
|
|
123
129
|
}
|
|
124
130
|
function bindLocale(locale) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} catch {}
|
|
131
|
+
tr = locale.t;
|
|
132
|
+
localeSubscribe = locale.subscribe;
|
|
133
|
+
}
|
|
134
|
+
/** 动态错误码 → 词典键(err.<CODE>);未收录的码回退 fallback */
|
|
135
|
+
function trError(code, fallback) {
|
|
136
|
+
if (!code) return fallback;
|
|
137
|
+
const key = "err." + code;
|
|
138
|
+
const s = tr(key);
|
|
139
|
+
return s === key ? fallback : s;
|
|
135
140
|
}
|
|
136
141
|
async function api(path, payload) {
|
|
137
142
|
const res = await fetch("/dsh-sc/api/" + path, {
|
|
@@ -180,6 +185,22 @@ window.__ModuleLoader__.load({
|
|
|
180
185
|
unknown: "own.unknown",
|
|
181
186
|
protected: "own.protected"
|
|
182
187
|
};
|
|
188
|
+
/** API 字符串 → 归属级别(未知值降级为 unknown,不炸 UI) */
|
|
189
|
+
function ownershipLevel(v) {
|
|
190
|
+
return v === "conversation-confirmed" || v === "workspace-inferred" || v === "other-local" || v === "protected" ? v : "unknown";
|
|
191
|
+
}
|
|
192
|
+
const SCOPE_KEY = {
|
|
193
|
+
conversation: "scope.conversation",
|
|
194
|
+
workspace: "scope.workspace",
|
|
195
|
+
machine: "scope.machine"
|
|
196
|
+
};
|
|
197
|
+
const DEFAULT_CONFIG_UI = {
|
|
198
|
+
refreshInterval: 5e3,
|
|
199
|
+
defaultScope: "workspace",
|
|
200
|
+
gracefulTimeout: 3e3,
|
|
201
|
+
showUnknown: true,
|
|
202
|
+
forceKill: false
|
|
203
|
+
};
|
|
183
204
|
function measurePopup() {
|
|
184
205
|
const vh = window.innerHeight;
|
|
185
206
|
const header = document.querySelector("[data-slot=\"conversation.session.header\"]");
|
|
@@ -223,7 +244,7 @@ window.__ModuleLoader__.load({
|
|
|
223
244
|
})]
|
|
224
245
|
});
|
|
225
246
|
}
|
|
226
|
-
function ServiceConsoleSettings() {
|
|
247
|
+
function ServiceConsoleSettings({ onSaved }) {
|
|
227
248
|
const [config, setConfig] = react.useState(null);
|
|
228
249
|
react.useEffect(() => {
|
|
229
250
|
api("config", {}).then((res) => setConfig(res?.data?.config ?? null)).catch(() => {});
|
|
@@ -233,7 +254,10 @@ window.__ModuleLoader__.load({
|
|
|
233
254
|
action: "update",
|
|
234
255
|
patch
|
|
235
256
|
}).then((res) => {
|
|
236
|
-
if (res?.data)
|
|
257
|
+
if (res?.data) {
|
|
258
|
+
setConfig(res.data.config);
|
|
259
|
+
onSaved?.(res.data.config);
|
|
260
|
+
}
|
|
237
261
|
}).catch(() => {});
|
|
238
262
|
};
|
|
239
263
|
if (!config) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -250,6 +274,57 @@ window.__ModuleLoader__.load({
|
|
|
250
274
|
className: service_console_module_css_default.setSection,
|
|
251
275
|
children: tr("settings.general")
|
|
252
276
|
}),
|
|
277
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
278
|
+
className: service_console_module_css_default.setRow,
|
|
279
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
280
|
+
className: service_console_module_css_default.setInfo,
|
|
281
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
282
|
+
className: service_console_module_css_default.setLabel,
|
|
283
|
+
children: tr("settings.refreshInterval")
|
|
284
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
285
|
+
className: service_console_module_css_default.setCap,
|
|
286
|
+
children: tr("settings.refresh.desc")
|
|
287
|
+
})]
|
|
288
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
289
|
+
className: service_console_module_css_default.setInput + " " + service_console_module_css_default.setSelect,
|
|
290
|
+
value: config.refreshInterval,
|
|
291
|
+
onChange: (e) => updateConfig({ refreshInterval: parseInt(e.target.value, 10) }),
|
|
292
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
293
|
+
value: 0,
|
|
294
|
+
children: tr("settings.refreshOff")
|
|
295
|
+
}), [
|
|
296
|
+
2e3,
|
|
297
|
+
5e3,
|
|
298
|
+
1e4,
|
|
299
|
+
3e4
|
|
300
|
+
].map((n) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
301
|
+
value: n,
|
|
302
|
+
children: tr("settings.refreshN", { n: n / 1e3 })
|
|
303
|
+
}, n))]
|
|
304
|
+
})]
|
|
305
|
+
}),
|
|
306
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
307
|
+
className: service_console_module_css_default.setRow,
|
|
308
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
309
|
+
className: service_console_module_css_default.setInfo,
|
|
310
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
311
|
+
className: service_console_module_css_default.setLabel,
|
|
312
|
+
children: tr("settings.defaultScope")
|
|
313
|
+
})
|
|
314
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
315
|
+
className: service_console_module_css_default.setInput + " " + service_console_module_css_default.setSelect,
|
|
316
|
+
value: config.defaultScope,
|
|
317
|
+
onChange: (e) => updateConfig({ defaultScope: e.target.value }),
|
|
318
|
+
children: [
|
|
319
|
+
"conversation",
|
|
320
|
+
"workspace",
|
|
321
|
+
"machine"
|
|
322
|
+
].map((s) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
323
|
+
value: s,
|
|
324
|
+
children: tr(SCOPE_KEY[s])
|
|
325
|
+
}, s))
|
|
326
|
+
})]
|
|
327
|
+
}),
|
|
253
328
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
254
329
|
className: service_console_module_css_default.setRow,
|
|
255
330
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -265,6 +340,25 @@ window.__ModuleLoader__.load({
|
|
|
265
340
|
onBlur: (e) => updateConfig({ gracefulTimeout: parseInt(e.target.value, 10) })
|
|
266
341
|
})]
|
|
267
342
|
}),
|
|
343
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
344
|
+
className: service_console_module_css_default.setRow,
|
|
345
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
346
|
+
className: service_console_module_css_default.setInfo,
|
|
347
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
348
|
+
className: service_console_module_css_default.setLabel,
|
|
349
|
+
children: tr("settings.showUnknown")
|
|
350
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
351
|
+
className: service_console_module_css_default.setCap,
|
|
352
|
+
children: tr("settings.showUnknown.desc")
|
|
353
|
+
})]
|
|
354
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
355
|
+
type: "button",
|
|
356
|
+
role: "switch",
|
|
357
|
+
"aria-checked": config.showUnknown,
|
|
358
|
+
className: service_console_module_css_default.switch,
|
|
359
|
+
onClick: () => updateConfig({ showUnknown: !config.showUnknown })
|
|
360
|
+
})]
|
|
361
|
+
}),
|
|
268
362
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
269
363
|
className: service_console_module_css_default.setRow,
|
|
270
364
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -289,10 +383,7 @@ window.__ModuleLoader__.load({
|
|
|
289
383
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
290
384
|
type: "button",
|
|
291
385
|
className: service_console_module_css_default.prevBtn,
|
|
292
|
-
onClick: () => updateConfig({
|
|
293
|
-
gracefulTimeout: 3e3,
|
|
294
|
-
forceKill: false
|
|
295
|
-
}),
|
|
386
|
+
onClick: () => updateConfig({ ...DEFAULT_CONFIG_UI }),
|
|
296
387
|
children: tr("settings.restore")
|
|
297
388
|
})
|
|
298
389
|
}),
|
|
@@ -340,12 +431,22 @@ window.__ModuleLoader__.load({
|
|
|
340
431
|
});
|
|
341
432
|
const [confirming, setConfirming] = react.useState(null);
|
|
342
433
|
const [opResult, setOpResult] = react.useState(null);
|
|
434
|
+
const [toast, setToast] = react.useState(null);
|
|
435
|
+
const toastSeq = react.useRef(0);
|
|
436
|
+
const showToast = (text, tone) => setToast({
|
|
437
|
+
seq: ++toastSeq.current,
|
|
438
|
+
text,
|
|
439
|
+
tone
|
|
440
|
+
});
|
|
343
441
|
const [expanded, setExpanded] = react.useState(null);
|
|
344
442
|
const [config, setConfig] = react.useState(null);
|
|
443
|
+
const [scope, setScope] = react.useState("workspace");
|
|
444
|
+
const scopeTouched = react.useRef(false);
|
|
445
|
+
const [pending, setPending] = react.useState(false);
|
|
345
446
|
const [, setLangTick] = react.useState(0);
|
|
346
447
|
const timeoutRef = react.useRef(null);
|
|
347
448
|
react.useEffect(() => subscribeOpen(setOn), []);
|
|
348
|
-
react.useEffect(() =>
|
|
449
|
+
react.useEffect(() => localeSubscribe?.(() => setLangTick((n) => n + 1)), []);
|
|
349
450
|
react.useEffect(() => {
|
|
350
451
|
if (on) {
|
|
351
452
|
setClosing(false);
|
|
@@ -383,8 +484,14 @@ window.__ModuleLoader__.load({
|
|
|
383
484
|
timeoutRef.current?.();
|
|
384
485
|
}, []);
|
|
385
486
|
react.useEffect(() => {
|
|
386
|
-
|
|
387
|
-
|
|
487
|
+
if (!on) return;
|
|
488
|
+
api("config", {}).then((res) => {
|
|
489
|
+
const c = res?.data?.config ?? null;
|
|
490
|
+
if (!c) return;
|
|
491
|
+
setConfig(c);
|
|
492
|
+
if (!scopeTouched.current) setScope(c.defaultScope);
|
|
493
|
+
}).catch(() => {});
|
|
494
|
+
}, [on]);
|
|
388
495
|
const scan = react.useCallback(() => {
|
|
389
496
|
const at = (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
390
497
|
setView((v) => ({
|
|
@@ -429,8 +536,23 @@ window.__ModuleLoader__.load({
|
|
|
429
536
|
scan,
|
|
430
537
|
view.phase
|
|
431
538
|
]);
|
|
539
|
+
react.useEffect(() => {
|
|
540
|
+
if (!on || tab !== "services" || !config) return;
|
|
541
|
+
if (!config.refreshInterval || view.phase === "scanning") return;
|
|
542
|
+
const cancel = timerCtx?.timeout(() => scan(), config.refreshInterval);
|
|
543
|
+
return () => {
|
|
544
|
+
cancel?.();
|
|
545
|
+
};
|
|
546
|
+
}, [
|
|
547
|
+
on,
|
|
548
|
+
tab,
|
|
549
|
+
config,
|
|
550
|
+
view.phase,
|
|
551
|
+
scan
|
|
552
|
+
]);
|
|
432
553
|
if (!on && !closing) return null;
|
|
433
554
|
const runAction = (svc, action) => {
|
|
555
|
+
if (pending) return;
|
|
434
556
|
setConfirming({
|
|
435
557
|
id: svc.id,
|
|
436
558
|
action
|
|
@@ -438,29 +560,44 @@ window.__ModuleLoader__.load({
|
|
|
438
560
|
setOpResult(null);
|
|
439
561
|
};
|
|
440
562
|
const confirmAction = (svc, action) => {
|
|
563
|
+
if (pending) return;
|
|
564
|
+
setPending(true);
|
|
441
565
|
setConfirming(null);
|
|
442
566
|
api("services/" + action, { serviceId: svc.id }).then((res) => {
|
|
443
|
-
|
|
567
|
+
let ok;
|
|
568
|
+
let text;
|
|
569
|
+
if (res?.ok) {
|
|
570
|
+
ok = true;
|
|
571
|
+
text = action === "stop" ? tr("result.stopped") : tr("result.restarted");
|
|
572
|
+
} else {
|
|
573
|
+
ok = false;
|
|
574
|
+
text = trError(res?.error?.code ?? "", res?.error?.message || tr("result.error"));
|
|
575
|
+
}
|
|
576
|
+
setOpResult({
|
|
444
577
|
id: svc.id,
|
|
445
|
-
ok
|
|
446
|
-
text
|
|
578
|
+
ok,
|
|
579
|
+
text
|
|
447
580
|
});
|
|
448
|
-
|
|
449
|
-
const code = res?.error?.code ?? "";
|
|
450
|
-
setOpResult({
|
|
451
|
-
id: svc.id,
|
|
452
|
-
ok: false,
|
|
453
|
-
text: tr("err." + code) || res?.error?.message || tr("result.error")
|
|
454
|
-
});
|
|
455
|
-
}
|
|
581
|
+
showToast(text, ok ? "success" : void 0);
|
|
456
582
|
scan();
|
|
457
|
-
}).catch(() =>
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
583
|
+
}).catch(() => {
|
|
584
|
+
setOpResult({
|
|
585
|
+
id: svc.id,
|
|
586
|
+
ok: false,
|
|
587
|
+
text: "RPC error"
|
|
588
|
+
});
|
|
589
|
+
showToast("RPC error");
|
|
590
|
+
}).finally(() => setPending(false));
|
|
462
591
|
};
|
|
463
592
|
let rows = view.data?.services ?? [];
|
|
593
|
+
rows = rows.filter((s) => {
|
|
594
|
+
const l = ownershipLevel(s.ownership);
|
|
595
|
+
if (l === "protected") return true;
|
|
596
|
+
if (scope === "conversation") return l === "conversation-confirmed";
|
|
597
|
+
if (scope === "workspace") return l === "conversation-confirmed" || l === "workspace-inferred";
|
|
598
|
+
return true;
|
|
599
|
+
});
|
|
600
|
+
if (config && !config.showUnknown) rows = rows.filter((s) => ownershipLevel(s.ownership) !== "unknown");
|
|
464
601
|
if (query) {
|
|
465
602
|
const q = query.toLowerCase();
|
|
466
603
|
rows = rows.filter((s) => s.name.toLowerCase().includes(q) || String(s.pid).includes(q) || (s.commandSummary ?? "").toLowerCase().includes(q) || (s.cwd ?? "").toLowerCase().includes(q) || s.listeners.some((l) => String(l.port).includes(q)));
|
|
@@ -468,35 +605,60 @@ window.__ModuleLoader__.load({
|
|
|
468
605
|
const servicesBody = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
469
606
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
470
607
|
className: service_console_module_css_default.filterRow,
|
|
471
|
-
children: [
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
608
|
+
children: [
|
|
609
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
610
|
+
className: service_console_module_css_default.segGroup,
|
|
611
|
+
role: "group",
|
|
612
|
+
"aria-label": tr("settings.defaultScope"),
|
|
613
|
+
children: [
|
|
614
|
+
"conversation",
|
|
615
|
+
"workspace",
|
|
616
|
+
"machine"
|
|
617
|
+
].map((s) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
618
|
+
type: "button",
|
|
619
|
+
className: service_console_module_css_default.segBtn + (scope === s ? " " + service_console_module_css_default.segBtnOn : ""),
|
|
620
|
+
"aria-pressed": scope === s,
|
|
621
|
+
onClick: () => {
|
|
622
|
+
scopeTouched.current = true;
|
|
623
|
+
setScope(s);
|
|
624
|
+
},
|
|
625
|
+
children: tr(SCOPE_KEY[s])
|
|
626
|
+
}, s))
|
|
627
|
+
}),
|
|
628
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
629
|
+
className: service_console_module_css_default.filter,
|
|
630
|
+
type: "text",
|
|
631
|
+
value: query,
|
|
632
|
+
placeholder: tr("search.ph"),
|
|
633
|
+
onChange: (e) => setQuery(e.target.value)
|
|
634
|
+
}),
|
|
635
|
+
query !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
636
|
+
type: "button",
|
|
637
|
+
className: service_console_module_css_default.filterClear,
|
|
638
|
+
onClick: () => setQuery(""),
|
|
639
|
+
title: tr("action.cancel"),
|
|
640
|
+
"aria-label": tr("action.cancel"),
|
|
641
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
642
|
+
viewBox: "0 0 16 16",
|
|
643
|
+
width: 12,
|
|
644
|
+
height: 12,
|
|
645
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
646
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
647
|
+
fill: "none",
|
|
648
|
+
stroke: "currentColor",
|
|
649
|
+
strokeWidth: 1.5,
|
|
650
|
+
strokeLinecap: "round"
|
|
651
|
+
})
|
|
493
652
|
})
|
|
494
|
-
})
|
|
495
|
-
|
|
653
|
+
}) : null
|
|
654
|
+
]
|
|
496
655
|
}),
|
|
497
656
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
498
657
|
className: service_console_module_css_default.hintLine,
|
|
499
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: service_console_module_css_default.liveDot }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
658
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: service_console_module_css_default.liveDot }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
659
|
+
className: scope === "machine" ? service_console_module_css_default.hintWarn : void 0,
|
|
660
|
+
children: scope === "machine" ? "⚠ " + tr("scope.machineWarn") : tr("panel.subtitle")
|
|
661
|
+
})]
|
|
500
662
|
}),
|
|
501
663
|
view.phase === "scanning" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
502
664
|
className: service_console_module_css_default.note,
|
|
@@ -517,8 +679,9 @@ window.__ModuleLoader__.load({
|
|
|
517
679
|
className: service_console_module_css_default.empty,
|
|
518
680
|
children: tr("svc.noSvc")
|
|
519
681
|
}) : rows.map((svc) => {
|
|
520
|
-
const
|
|
521
|
-
const
|
|
682
|
+
const level = ownershipLevel(svc.ownership);
|
|
683
|
+
const badgeColor = OWNERSHIP_COLOR[level];
|
|
684
|
+
const badgeKey = OWNERSHIP_KEY[level];
|
|
522
685
|
const ports = svc.listeners.map((l) => String(l.port)).join(", ");
|
|
523
686
|
const url = svc.listeners.map((l) => l.url).filter(Boolean)[0] ?? null;
|
|
524
687
|
const canControl = !svc.protected;
|
|
@@ -589,7 +752,7 @@ window.__ModuleLoader__.load({
|
|
|
589
752
|
},
|
|
590
753
|
children: isConfirming && confirming.action === "stop" ? tr("confirm.stop") : tr("action.stop")
|
|
591
754
|
}) : null,
|
|
592
|
-
svc.restartable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
755
|
+
svc.restartable && canControl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
593
756
|
type: "button",
|
|
594
757
|
className: service_console_module_css_default.rowBtn,
|
|
595
758
|
onClick: (e) => {
|
|
@@ -635,8 +798,9 @@ window.__ModuleLoader__.load({
|
|
|
635
798
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
636
799
|
type: "button",
|
|
637
800
|
className: service_console_module_css_default.confirmOk,
|
|
801
|
+
disabled: pending,
|
|
638
802
|
onClick: () => confirmAction(svc, confirming.action),
|
|
639
|
-
children: tr("action.confirm")
|
|
803
|
+
children: pending ? tr("action.pending") : tr("action.confirm")
|
|
640
804
|
}),
|
|
641
805
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
642
806
|
type: "button",
|
|
@@ -706,10 +870,14 @@ window.__ModuleLoader__.load({
|
|
|
706
870
|
}, svc.id);
|
|
707
871
|
})
|
|
708
872
|
] });
|
|
709
|
-
const settingsBody = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ServiceConsoleSettings, {});
|
|
710
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
873
|
+
const settingsBody = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ServiceConsoleSettings, { onSaved: setConfig });
|
|
874
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
711
875
|
className: service_console_module_css_default.layer,
|
|
712
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.
|
|
876
|
+
children: [toast ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
|
877
|
+
text: toast.text,
|
|
878
|
+
tone: toast.tone,
|
|
879
|
+
onDone: () => setToast(null)
|
|
880
|
+
}, toast.seq) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
713
881
|
className: service_console_module_css_default.popup + (shown ? " " + service_console_module_css_default.popupOn : ""),
|
|
714
882
|
style: {
|
|
715
883
|
top: rect.top,
|
|
@@ -858,7 +1026,7 @@ window.__ModuleLoader__.load({
|
|
|
858
1026
|
children: tab === "services" ? servicesBody : settingsBody
|
|
859
1027
|
})
|
|
860
1028
|
]
|
|
861
|
-
})
|
|
1029
|
+
})]
|
|
862
1030
|
});
|
|
863
1031
|
}
|
|
864
1032
|
//#endregion
|
|
@@ -866,6 +1034,9 @@ window.__ModuleLoader__.load({
|
|
|
866
1034
|
/**
|
|
867
1035
|
* dsh-service-console — i18n 词典(对齐 DSH locale.register 机制)
|
|
868
1036
|
* 与 dsh-workspace-explorer 共享设计语言:flat key → template string with {vars}
|
|
1037
|
+
*
|
|
1038
|
+
* 类型化:ZH_DICT 的键集是词典权威(ConsoleKey);EN_DICT 必须同键集
|
|
1039
|
+
* (satisfies Record<ConsoleKey, string> —— 缺键/多键都是编译错误)。
|
|
869
1040
|
*/
|
|
870
1041
|
const ZH_DICT = {
|
|
871
1042
|
"plugin.name": "服务控制台",
|
|
@@ -888,6 +1059,7 @@ window.__ModuleLoader__.load({
|
|
|
888
1059
|
"action.detail": "详情",
|
|
889
1060
|
"action.confirm": "确认",
|
|
890
1061
|
"action.cancel": "取消",
|
|
1062
|
+
"action.pending": "处理中…",
|
|
891
1063
|
"confirm.stop": "确认停止?",
|
|
892
1064
|
"confirm.restart": "确认重启?",
|
|
893
1065
|
"confirm.txt": "确认对 {name} (pid {pid}) 执行 {action}?",
|
|
@@ -899,6 +1071,10 @@ window.__ModuleLoader__.load({
|
|
|
899
1071
|
"own.other": "本机其他",
|
|
900
1072
|
"own.unknown": "未知",
|
|
901
1073
|
"own.protected": "受保护",
|
|
1074
|
+
"scope.conversation": "本次对话",
|
|
1075
|
+
"scope.workspace": "当前工作区",
|
|
1076
|
+
"scope.machine": "本机",
|
|
1077
|
+
"scope.machineWarn": "本机范围可能影响其他项目的服务",
|
|
902
1078
|
"detail.title": "详情",
|
|
903
1079
|
"detail.serviceRecord": "SERVICE RECORD",
|
|
904
1080
|
"detail.serviceId": "SERVICE ID",
|
|
@@ -919,11 +1095,18 @@ window.__ModuleLoader__.load({
|
|
|
919
1095
|
"tab.settings": "设置",
|
|
920
1096
|
"settings.title": "面板设置",
|
|
921
1097
|
"settings.general": "通用",
|
|
1098
|
+
"settings.refreshInterval": "自动刷新间隔",
|
|
1099
|
+
"settings.refresh.desc": "面板打开时定期自动重新扫描",
|
|
1100
|
+
"settings.refreshOff": "关闭",
|
|
1101
|
+
"settings.refreshN": "{n} 秒",
|
|
1102
|
+
"settings.defaultScope": "默认范围",
|
|
1103
|
+
"settings.showUnknown": "显示未知服务",
|
|
1104
|
+
"settings.showUnknown.desc": "关闭后隐藏归属未知的服务",
|
|
922
1105
|
"settings.gracefulTimeout": "优雅超时 (ms)",
|
|
923
1106
|
"settings.forceKill": "允许强制终止",
|
|
924
1107
|
"settings.forceKill.desc": "优雅超时后发送 SIGKILL",
|
|
925
1108
|
"settings.restore": "恢复默认",
|
|
926
|
-
"settings.note": "
|
|
1109
|
+
"settings.note": "配置持久保存在 ~/.dsh/plugins/dsh-service-console/config.json。",
|
|
927
1110
|
"settings.nav": "Service Console",
|
|
928
1111
|
"star.developer": "开发者",
|
|
929
1112
|
"star.ask": "⭐ 顺手留颗 Star,作者能高兴一整天",
|
|
@@ -950,6 +1133,7 @@ window.__ModuleLoader__.load({
|
|
|
950
1133
|
"action.detail": "Detail",
|
|
951
1134
|
"action.confirm": "OK",
|
|
952
1135
|
"action.cancel": "Cancel",
|
|
1136
|
+
"action.pending": "Working…",
|
|
953
1137
|
"confirm.stop": "Confirm stop?",
|
|
954
1138
|
"confirm.restart": "Confirm restart?",
|
|
955
1139
|
"confirm.txt": "Run {action} on {name} (pid {pid})?",
|
|
@@ -961,6 +1145,10 @@ window.__ModuleLoader__.load({
|
|
|
961
1145
|
"own.other": "Other local",
|
|
962
1146
|
"own.unknown": "Unknown",
|
|
963
1147
|
"own.protected": "Protected",
|
|
1148
|
+
"scope.conversation": "This chat",
|
|
1149
|
+
"scope.workspace": "Workspace",
|
|
1150
|
+
"scope.machine": "This machine",
|
|
1151
|
+
"scope.machineWarn": "Machine scope may affect services of other projects",
|
|
964
1152
|
"detail.title": "Detail",
|
|
965
1153
|
"detail.serviceRecord": "SERVICE RECORD",
|
|
966
1154
|
"detail.serviceId": "SERVICE ID",
|
|
@@ -981,11 +1169,18 @@ window.__ModuleLoader__.load({
|
|
|
981
1169
|
"tab.settings": "Settings",
|
|
982
1170
|
"settings.title": "Panel settings",
|
|
983
1171
|
"settings.general": "General",
|
|
1172
|
+
"settings.refreshInterval": "Auto-refresh interval",
|
|
1173
|
+
"settings.refresh.desc": "Re-scan automatically while the panel is open",
|
|
1174
|
+
"settings.refreshOff": "Off",
|
|
1175
|
+
"settings.refreshN": "{n}s",
|
|
1176
|
+
"settings.defaultScope": "Default scope",
|
|
1177
|
+
"settings.showUnknown": "Show unknown services",
|
|
1178
|
+
"settings.showUnknown.desc": "Hide services with unknown ownership when off",
|
|
984
1179
|
"settings.gracefulTimeout": "Graceful timeout (ms)",
|
|
985
1180
|
"settings.forceKill": "Allow force kill",
|
|
986
1181
|
"settings.forceKill.desc": "Send SIGKILL after graceful timeout",
|
|
987
1182
|
"settings.restore": "Reset to defaults",
|
|
988
|
-
"settings.note": "
|
|
1183
|
+
"settings.note": "Saved to ~/.dsh/plugins/dsh-service-console/config.json — persists across restarts.",
|
|
989
1184
|
"settings.nav": "Service Console",
|
|
990
1185
|
"star.developer": "Developer",
|
|
991
1186
|
"star.ask": "⭐ Drop a Star if it helped — it makes the author's day",
|
|
@@ -993,66 +1188,46 @@ window.__ModuleLoader__.load({
|
|
|
993
1188
|
};
|
|
994
1189
|
//#endregion
|
|
995
1190
|
//#region src/client/index.tsx
|
|
996
|
-
/**
|
|
997
|
-
* dsh-service-console — Client 入口(原生包 v2)
|
|
998
|
-
*
|
|
999
|
-
* 架构对齐 dsh-workspace-explorer:
|
|
1000
|
-
* - 通过 locale.register + locale.bind 实现国际化(而非硬编码 TEXTS)
|
|
1001
|
-
* - 通过 webServer JSON 路由调用 Host(fetch 直连,不走 host.call / LLM)
|
|
1002
|
-
* - 注册 DSH 设置壳的 settings.section 页
|
|
1003
|
-
* - 注册 shell.overlay 抽屉面板 + header 入口按钮
|
|
1004
|
-
*/
|
|
1005
1191
|
const NS = "dsh-service-console";
|
|
1006
|
-
let
|
|
1192
|
+
let labelT = null;
|
|
1193
|
+
function labelFn(key) {
|
|
1194
|
+
return labelT ? labelT(key) : key;
|
|
1195
|
+
}
|
|
1007
1196
|
//#endregion
|
|
1008
1197
|
module.exports = {
|
|
1009
|
-
inject: [
|
|
1198
|
+
inject: [
|
|
1199
|
+
"slots",
|
|
1200
|
+
"timer",
|
|
1201
|
+
"locale"
|
|
1202
|
+
],
|
|
1010
1203
|
apply(ctx) {
|
|
1011
1204
|
bindTimer(ctx.timer);
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
});
|
|
1024
|
-
bindLocale(locale);
|
|
1025
|
-
const bound = locale.bind(NS);
|
|
1026
|
-
labelFn = (key) => {
|
|
1027
|
-
const s = bound(key);
|
|
1028
|
-
return typeof s === "string" && s !== key ? s : key;
|
|
1029
|
-
};
|
|
1030
|
-
locale.subscribe(() => {
|
|
1031
|
-
const b = locale.bind(NS);
|
|
1032
|
-
labelFn = (key) => {
|
|
1033
|
-
const s = b(key);
|
|
1034
|
-
return typeof s === "string" && s !== key ? s : key;
|
|
1035
|
-
};
|
|
1036
|
-
});
|
|
1037
|
-
} catch (err) {
|
|
1038
|
-
console.warn("[dsh-sc] locale init failed, fallback zh", String(err));
|
|
1039
|
-
}
|
|
1040
|
-
slots.inject("conversation.session.header.utilities", () => slots.register({
|
|
1205
|
+
const locale = ctx.locale;
|
|
1206
|
+
ctx.effect(() => locale.register(NS, {
|
|
1207
|
+
zh: ZH_DICT,
|
|
1208
|
+
en: EN_DICT
|
|
1209
|
+
}));
|
|
1210
|
+
labelT = locale.bind(NS);
|
|
1211
|
+
bindLocale({
|
|
1212
|
+
t: labelT,
|
|
1213
|
+
subscribe: (fn) => locale.subscribe(fn)
|
|
1214
|
+
});
|
|
1215
|
+
ctx.effect(() => ctx.slots.inject("conversation.session.header.utilities", () => ctx.slots.register({
|
|
1041
1216
|
name: "conversation.session.header.utilities",
|
|
1042
1217
|
id: "dsh-service-console",
|
|
1043
1218
|
order: 25,
|
|
1044
1219
|
label: () => labelFn("plugin.name")
|
|
1045
|
-
},
|
|
1046
|
-
slots.inject("shell.overlay", () => slots.register({
|
|
1220
|
+
}, ServiceConsoleEntry)));
|
|
1221
|
+
ctx.effect(() => ctx.slots.inject("shell.overlay", () => ctx.slots.register({
|
|
1047
1222
|
name: "shell.overlay",
|
|
1048
1223
|
id: "dsh-service-console-panel"
|
|
1049
|
-
},
|
|
1050
|
-
slots.inject("settings.section", () => slots.register({
|
|
1224
|
+
}, ServiceConsolePanel)));
|
|
1225
|
+
ctx.effect(() => ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
1051
1226
|
name: "settings.section",
|
|
1052
1227
|
id: "dsh-service-console",
|
|
1053
1228
|
order: 35,
|
|
1054
1229
|
label: () => labelFn("plugin.name")
|
|
1055
|
-
},
|
|
1230
|
+
}, ServiceConsoleSettings)));
|
|
1056
1231
|
}
|
|
1057
1232
|
};
|
|
1058
1233
|
return module.exports;
|