dsh-home-hosted 0.5.2 → 0.5.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/client.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -760,6 +760,6 @@ var module = { exports: {} }; var exports = module.exports;
|
|
|
760
760
|
.hh-tool-cards { grid-template-columns: minmax(0, 1fr); }
|
|
761
761
|
.hh-card-facts { grid-template-columns: minmax(0, 1fr); }
|
|
762
762
|
}
|
|
763
|
-
`;var f=require("react/jsx-runtime");function An({signal:e}){return(0,f.jsxs)("div",{className:"hh-signal","data-tone":e.tone,children:[(0,f.jsx)("span",{className:"hh-signal-dot","aria-hidden":"true"}),(0,f.jsx)("span",{className:"hh-signal-name",children:e.name}),(0,f.jsx)("span",{className:"hh-signal-state",children:e.state}),e.meta.length===0&&e.href===null?null:(0,f.jsxs)("span",{className:"hh-signal-meta",children:[e.meta,e.href===null?null:(0,f.jsxs)(f.Fragment,{children:[e.meta.length===0?null:" \xB7 ",(0,f.jsx)(re,{href:e.href,children:e.href})]})]})]})}function Vt(e){let t=We(e.t),{data:n,error:r,loading:o,refresh:a}=Ye(),[i,s]=(0,U.useState)(null),[u,c]=(0,U.useState)(null),[g,S]=(0,U.useState)(null),[L,F]=(0,U.useState)([]),[R,A]=(0,U.useState)(null),[W,V]=(0,U.useState)(0),x=(0,U.useRef)(null),B=g??n?.workspace??null,H=(0,U.useCallback)(async E=>{let v=await T("servers.list",{workspace:E});v.ok?(F(v.value),A(null)):A(v.error)},[]);(0,U.useEffect)(()=>{B!==null&&(x.current!==B&&(x.current=B,F([]),A(null)),H(B))},[B,W,H]);let M=(0,U.useCallback)((E,v)=>(c(E),s(null),(async()=>{try{let b=await v();return b.ok||s(b.error),b}catch(b){let $={code:"client",message:b instanceof Error?b.message:String(b)};return s($),{ok:!1,error:$}}finally{c(null),await a(),V(b=>b+1)}})()),[a]),G=(0,U.useCallback)(E=>{if(n===null)return;let v=pt(n.settings,E(n.settings));Object.keys(v).length!==0&&M("settings",()=>Ke(v))},[n,M]),K=n?.settings.uiStyle??"detailed",[oe,Q]=(0,U.useState)(K);(0,U.useEffect)(()=>{Q(K)},[K]);let ue=E=>{Q(E),G(v=>({...v,uiStyle:E}))};if(n===null)return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:De}),o?(0,f.jsx)(m,{children:t("loading")}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ge,{error:r??{code:"status",message:t("statusUnavailable")},title:t("errorTitle")}),(0,f.jsx)("div",{className:"hh-btn-row",children:(0,f.jsx)(y,{onClick:()=>{a()},children:t("retry")})})]})]});let j={t,status:n,run:M,updateSettings:G,busy:u,uiStyle:oe},h=B??n.workspace??"default";return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:De}),(0,f.jsxs)("header",{className:"hh-head",children:[(0,f.jsx)("h2",{className:"hh-title",children:t("tab")}),(0,f.jsx)("span",{className:"hh-head-spacer"}),(0,f.jsx)(ce,{value:oe,label:t("uiStyleLabel"),disabled:u==="settings",options:[{value:"detailed",label:t("uiStyleDetailed")},{value:"compact",label:t("uiStyleCompact")}],onChange:E=>ue(E)}),(0,f.jsx)(y,{variant:"ghost",icon:(0,f.jsx)(Qe,{size:13}),busy:u==="status.refresh",onClick:()=>{M("status.refresh",()=>T("status",{refresh:!0}))},children:t("refresh")})]}),(0,f.jsx)("div",{className:"hh-signals","data-busy":u!==null,children:Bt(n,t).map(E=>(0,f.jsx)(An,{signal:E},E.key))}),n.lastError===null?null:(0,f.jsx)(ge,{error:{code:"panel",message:n.lastError},title:t("errorTitle")}),(0,f.jsx)(ge,{error:r,title:t("errorTitle")}),(0,f.jsx)(ge,{error:i,title:t("errorTitle")}),(0,f.jsx)(
|
|
763
|
+
`;var f=require("react/jsx-runtime");function An({signal:e}){return(0,f.jsxs)("div",{className:"hh-signal","data-tone":e.tone,children:[(0,f.jsx)("span",{className:"hh-signal-dot","aria-hidden":"true"}),(0,f.jsx)("span",{className:"hh-signal-name",children:e.name}),(0,f.jsx)("span",{className:"hh-signal-state",children:e.state}),e.meta.length===0&&e.href===null?null:(0,f.jsxs)("span",{className:"hh-signal-meta",children:[e.meta,e.href===null?null:(0,f.jsxs)(f.Fragment,{children:[e.meta.length===0?null:" \xB7 ",(0,f.jsx)(re,{href:e.href,children:e.href})]})]})]})}function Vt(e){let t=We(e.t),{data:n,error:r,loading:o,refresh:a}=Ye(),[i,s]=(0,U.useState)(null),[u,c]=(0,U.useState)(null),[g,S]=(0,U.useState)(null),[L,F]=(0,U.useState)([]),[R,A]=(0,U.useState)(null),[W,V]=(0,U.useState)(0),x=(0,U.useRef)(null),B=g??n?.workspace??null,H=(0,U.useCallback)(async E=>{let v=await T("servers.list",{workspace:E});v.ok?(F(v.value),A(null)):A(v.error)},[]);(0,U.useEffect)(()=>{B!==null&&(x.current!==B&&(x.current=B,F([]),A(null)),H(B))},[B,W,H]);let M=(0,U.useCallback)((E,v)=>(c(E),s(null),(async()=>{try{let b=await v();return b.ok||s(b.error),b}catch(b){let $={code:"client",message:b instanceof Error?b.message:String(b)};return s($),{ok:!1,error:$}}finally{c(null),await a(),V(b=>b+1)}})()),[a]),G=(0,U.useCallback)(E=>{if(n===null)return;let v=pt(n.settings,E(n.settings));Object.keys(v).length!==0&&M("settings",()=>Ke(v))},[n,M]),K=n?.settings.uiStyle??"detailed",[oe,Q]=(0,U.useState)(K);(0,U.useEffect)(()=>{Q(K)},[K]);let ue=E=>{Q(E),G(v=>({...v,uiStyle:E}))};if(n===null)return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:De}),o?(0,f.jsx)(m,{children:t("loading")}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ge,{error:r??{code:"status",message:t("statusUnavailable")},title:t("errorTitle")}),(0,f.jsx)("div",{className:"hh-btn-row",children:(0,f.jsx)(y,{onClick:()=>{a()},children:t("retry")})})]})]});let j={t,status:n,run:M,updateSettings:G,busy:u,uiStyle:oe},h=B??n.workspace??"default";return(0,f.jsxs)("div",{className:"hh-root",children:[(0,f.jsx)("style",{children:De}),(0,f.jsxs)("header",{className:"hh-head",children:[(0,f.jsx)("h2",{className:"hh-title",children:t("tab")}),(0,f.jsx)("span",{className:"hh-head-spacer"}),(0,f.jsx)(ce,{value:oe,label:t("uiStyleLabel"),disabled:u==="settings",options:[{value:"detailed",label:t("uiStyleDetailed")},{value:"compact",label:t("uiStyleCompact")}],onChange:E=>ue(E)}),(0,f.jsx)(y,{variant:"ghost",icon:(0,f.jsx)(Qe,{size:13}),busy:u==="status.refresh",onClick:()=>{M("status.refresh",()=>T("status",{refresh:!0}))},children:t("refresh")})]}),(0,f.jsx)("div",{className:"hh-signals","data-busy":u!==null,children:Bt(n,t).map(E=>(0,f.jsx)(An,{signal:E},E.key))}),n.lastError===null?null:(0,f.jsx)(ge,{error:{code:"panel",message:n.lastError},title:t("errorTitle")}),(0,f.jsx)(ge,{error:r,title:t("errorTitle")}),(0,f.jsx)(ge,{error:i,title:t("errorTitle")}),(0,f.jsx)(Pt,{...j}),(0,f.jsx)(Tt,{...j}),(0,f.jsx)(Ct,{...j}),(0,f.jsx)(ft,{...j}),(0,f.jsx)(Ut,{...j,viewing:h,onView:S}),(0,f.jsx)(Ot,{...j,workspace:h,servers:L,serversError:R})]})}var In=["slots","locale"],Wt="[dsh-home-hosted]";function ie(e,t){t===void 0?console.warn(`${Wt} ${e}`):console.warn(`${Wt} ${e}`,t)}function $t(e,t){try{let n=e.get?.(t);if(n!=null)return n}catch{}try{let n=e[t];if(n!=null)return n}catch{}}function jt(e,t,n){if(typeof e.effect=="function")try{e.effect(t,n);return}catch(r){ie(`registering the effect "${n}" failed`,r);return}try{t()}catch(r){ie(`the effect "${n}" failed`,r)}}function Hn(e){try{let t=$t(e,"locale"),n=Ve(t);t===void 0?ie("the locale service is unavailable; the page keeps its bundled English copy"):jt(e,()=>{let o=[];try{o.push(t.register(ve,{en:Ne,zh:_e}))}catch(a){ie("registering the dictionaries failed",a)}return()=>{for(let a of o)try{a()}catch(i){ie("disposing a dictionary failed",i)}}},"dsh-home-hosted: dictionaries");let r=$t(e,"slots");if(r===void 0){ie("the slots service is unavailable; the settings section was not registered");return}jt(e,()=>{try{return r.inject("settings.section",()=>{try{return r.register({name:"settings.section",id:"home-hosted",order:60,label:()=>n("tab"),locale:ve,inject:()=>({t:n})},Vt)}catch(o){return ie("registering the settings section failed",o),()=>{}}})}catch(o){return ie("injecting into settings.section failed",o),()=>{}}},"dsh-home-hosted: settings section")}catch(t){ie("client bootstrap failed",t)}}
|
|
764
764
|
|
|
765
765
|
return module.exports; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-home-hosted",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "DeepSeek Harness (dsh) plugin: start your dsh web server automatically at boot, and manage home-hosted's panel and servers from inside dsh.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|