@camstack/addon-admin-ui 1.1.45 → 1.1.46

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.
Files changed (56) hide show
  1. package/dist/assets/{AddLocationWizard-Bvw9_2YN.js → AddLocationWizard-Vxap9jL1.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-DLYcF1eI.js → AddonCollectionPage-DA6EclNZ.js} +1 -1
  3. package/dist/assets/{Addons-BDiRSQCj.js → Addons-DMjAGbbb.js} +1 -1
  4. package/dist/assets/{AdminTabs-CY2rlSZx.js → AdminTabs-DqlRdTQB.js} +1 -1
  5. package/dist/assets/{BrokerForm-DrGabABg.js → BrokerForm-_9_mGwyg.js} +1 -1
  6. package/dist/assets/{Capabilities-CcpO8NTn.js → Capabilities-DE4Pc7Z2.js} +1 -1
  7. package/dist/assets/{CapabilityBadges-CYoWl0J1.js → CapabilityBadges-CfbiHE_6.js} +1 -1
  8. package/dist/assets/{Cluster-CpXN23Iz.js → Cluster-BeLHC-KP.js} +1 -1
  9. package/dist/assets/{Dashboard-Bo25XR8Q.js → Dashboard-CRTd5HlP.js} +1 -1
  10. package/dist/assets/{Data-Blw93_kT.js → Data-B4SUw-G0.js} +1 -1
  11. package/dist/assets/{DetectionIntelligence-Kl1XQi-o.js → DetectionIntelligence-Da4PM6M0.js} +1 -1
  12. package/dist/assets/{DeviceDetail-BAb02UMT.js → DeviceDetail-Cmk5C5Th.js} +1 -1
  13. package/dist/assets/{Devices-DcjotJtp.js → Devices-DibPwyAz.js} +1 -1
  14. package/dist/assets/{Identity-C2h8wn_8.js → Identity-B6qGliIc.js} +1 -1
  15. package/dist/assets/{IntegrationDetail-10_w9sQG.js → IntegrationDetail-y1-iNPHG.js} +1 -1
  16. package/dist/assets/{Integrations-CU-UBQ8j.js → Integrations-DGq-BPfe.js} +1 -1
  17. package/dist/assets/{Integrations-AjG9O0Zs.js → Integrations-kp9UnkPU.js} +1 -1
  18. package/dist/assets/{MyAccess-C92RXlCz.js → MyAccess-BsE6Obd1.js} +1 -1
  19. package/dist/assets/{Network-DrP265Eb.js → Network-C7bR7R-9.js} +1 -1
  20. package/dist/assets/{NotificationTargets-DFzihL8u.js → NotificationTargets-CEZXMrcx.js} +1 -1
  21. package/dist/assets/{Pipeline-DcmtJ_a1.js → Pipeline-DCA9wluM.js} +1 -1
  22. package/dist/assets/{ProviderIcon-CJ8-0ZH-.js → ProviderIcon-CF8jQdWS.js} +1 -1
  23. package/dist/assets/{ScanNetworkModal-CrN7Gcg1.js → ScanNetworkModal-Dc1sRsbP.js} +1 -1
  24. package/dist/assets/{ServerManagement-r1GIGpJa.js → ServerManagement-D9FWX6MF.js} +1 -1
  25. package/dist/assets/{Settings-IWs_JmTb.js → Settings-B0p4akBJ.js} +1 -1
  26. package/dist/assets/{Showroom-BvK9z4rI.js → Showroom-CuAtJEzY.js} +1 -1
  27. package/dist/assets/{build-cluster-graph-9hzchTfD.js → build-cluster-graph-eiMKfe7R.js} +1 -1
  28. package/dist/assets/circle-check-big-Wj05mtDu.js +1 -0
  29. package/dist/assets/{copy-B5w123s3.js → copy-DQa5xtYG.js} +1 -1
  30. package/dist/assets/{download-DWrwa5ZQ.js → download-D6edZWe6.js} +1 -1
  31. package/dist/assets/index-IlR8xZC4.js +4 -0
  32. package/dist/assets/{key-round-Bu_8dxr0.js → key-round-B1Od5eet.js} +1 -1
  33. package/dist/assets/{mf-entry-bootstrap-0-13dbf296.js → mf-entry-bootstrap-0-60f5dbcb.js} +1 -1
  34. package/dist/assets/{pencil-CMdxyxwT.js → pencil-CEi1Po6B.js} +1 -1
  35. package/dist/assets/plus-DDVx1X5A.js +1 -0
  36. package/dist/assets/{radio-BIgunYjc.js → radio-BOwW8bXt.js} +1 -1
  37. package/dist/assets/{refresh-cw-tNOo1uMj.js → refresh-cw-DVzwLp8Q.js} +1 -1
  38. package/dist/assets/{rotate-ccw-DclQoHZh.js → rotate-ccw-CC3AFgm0.js} +1 -1
  39. package/dist/assets/rotate-cw-CJ22Udq1.js +1 -0
  40. package/dist/assets/search-CYt2Lej3.js +1 -0
  41. package/dist/assets/{sparkles-Oe69VehF.js → sparkles-C6X4nfmI.js} +1 -1
  42. package/dist/assets/square-PoB0xSOP.js +1 -0
  43. package/dist/assets/{square-check-big-BbU9Wg7X.js → square-check-big-5DXE54DM.js} +1 -1
  44. package/dist/assets/{upload-noUat_HJ.js → upload-_HKspiVO.js} +1 -1
  45. package/dist/assets/{useDevice-DWAforOz.js → useDevice-D-wv2Yo3.js} +1 -1
  46. package/dist/assets/{wifi-BSE6EyYx.js → wifi--uPJYxH9.js} +1 -1
  47. package/dist/assets/{zap-C03h8r1S.js → zap-kgb-Y4I2.js} +1 -1
  48. package/dist/index.html +2 -2
  49. package/dist/server/addon.js +1 -1
  50. package/package.json +1 -1
  51. package/dist/assets/circle-check-big-DOB-ecd1.js +0 -1
  52. package/dist/assets/index-Da74gHj8.js +0 -4
  53. package/dist/assets/plus-1uqeoQzi.js +0 -1
  54. package/dist/assets/rotate-cw-DLAr4sQa.js +0 -1
  55. package/dist/assets/search-pN6xkGSc.js +0 -1
  56. package/dist/assets/square-BKeg-u96.js +0 -1
@@ -1 +1 @@
1
- import{Ci as e,Ei as t,Ir as n,Si as r,Ti as i,ea as a,wi as o}from"./src-nTmr96zw.js";import{I as s,Q as c,S as l,o as u,q as d,x as f}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as p}from"./refresh-cw-tNOo1uMj.js";import{t as m}from"./rotate-cw-DLAr4sQa.js";import{H as h,S as g,p as _,t as v}from"./index-Da74gHj8.js";import{t as y}from"./AdminPage-BwmGKnRf.js";var b=h(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),x=h(`hard-drive-download`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m16 6-4 4-4-4`,key:`6wukr`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),S=h(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]);c();var C=[[`serverManagement`,`getServerPackageStatus`]];function w({label:e,tone:t}){return f(`span`,{className:`inline-flex items-center rounded px-2 py-0.5 text-[11px] font-medium ${{neutral:`bg-surface-muted text-foreground-subtle`,ok:`bg-emerald-500/15 text-emerald-500`,info:`bg-sky-500/15 text-sky-500`,warn:`bg-amber-500/15 text-amber-500`,error:`bg-red-500/15 text-red-500`}[t]}`,children:e})}function T({label:e,value:t}){return l(`div`,{className:`flex items-center justify-between gap-4 text-sm`,children:[f(`span`,{className:`text-foreground-subtle`,children:e}),f(`span`,{className:`font-mono text-foreground`,children:t??`—`})]})}function E({node:n}){let{t:c}=v(),h=u(),_=a(),[y,E]=d(!1),D=n.isHub?void 0:{nodeId:n.id},O=o(D,{refetchInterval:1e4,enabled:n.isOnline,retry:1}),k=O.data??null,A=s(()=>{h.invalidateQueries({queryKey:C})},[h]),j=e({onSettled:A}),M=r({onSettled:A}),N=t({onSettled:A}),P=i({onSettled:A}),F=s(async()=>{k?.latestVersion!=null&&await _({title:c(`serverManagement.confirmUpdateTitle`,`Update node root package`),message:c(`serverManagement.confirmUpdateBody`,`Install {{pkg}}@{{version}} on node "{{node}}" and restart it to apply. The new version boots on probation: if it fails to reach ready, the node automatically rolls back to the current version. Requires an always-relaunching supervisor (Docker restart policy "unless-stopped" or "always"), otherwise the node stays down after exiting to apply.`,{pkg:k.packageName,version:k.latestVersion,node:n.name}),confirmLabel:c(`serverManagement.confirmUpdateAction`,`Update & restart`)})&&(await M.mutateAsync({version:k.latestVersion,...D})).restarting&&E(!0)},[M,_,n.name,D,k,c]),I=s(async()=>{k?.previousVersion!=null&&await _({title:c(`serverManagement.confirmRollbackTitle`,`Roll back node root package`),message:c(`serverManagement.confirmRollbackBody`,`Restart node "{{node}}" on the previous version ({{version}})?`,{node:n.name,version:k.previousVersion}),confirmLabel:c(`serverManagement.confirmRollbackAction`,`Roll back & restart`)})&&(await N.mutateAsync(D)).restarting&&E(!0)},[_,n.name,N,D,k,c]),L=s(async()=>{await _({title:c(`serverManagement.confirmRestartTitle`,`Restart node`),message:c(`serverManagement.confirmRestartBody`,`Restart node "{{node}}" now? The process exits and its supervisor relaunches it on the same version. In-flight requests to this node are dropped.`,{node:n.name}),confirmLabel:c(`serverManagement.confirmRestartAction`,`Restart`),variant:`warning`})&&(await P.mutateAsync(D)).restarting&&E(!0)},[_,n.name,P,D,c]),R=()=>{switch(k?.bootMode){case`data-root`:return{label:c(`serverManagement.bootDataRoot`,`runtime-updatable`),tone:`ok`};case`workspace`:return{label:c(`serverManagement.bootWorkspace`,`dev workspace`),tone:`info`};default:return{label:c(`serverManagement.bootBaked`,`baked image seed`),tone:`neutral`}}},z=()=>{if(k==null)return null;if(k.rolledBack!=null)return{label:c(`serverManagement.stateRolledBack`,`rolled back (update failed)`),tone:`error`};switch(k.updateState){case`checking`:return{label:c(`serverManagement.stateChecking`,`checking…`),tone:`info`};case`staging`:return{label:c(`serverManagement.stateStaging`,`updating…`),tone:`info`};case`pending-restart`:return{label:c(`serverManagement.statePending`,`restart pending`),tone:`warn`};case`awaiting-confirmation`:return{label:c(`serverManagement.stateAwaitingConfirmation`,`awaiting confirmation`),tone:`warn`};default:return k.updateAvailable?{label:c(`serverManagement.stateUpdateAvailable`,`update available`),tone:`warn`}:{label:c(`serverManagement.stateUpToDate`,`up to date`),tone:`ok`}}},B=k?.bootMode===`workspace`,V=n.isOnline&&k!=null&&!B&&k.updateAvailable&&k.updateState===`idle`&&!M.isPending,H=n.isOnline&&k!=null&&!B&&k.previousVersion!=null&&k.updateState===`idle`&&!N.isPending,U=n.isOnline&&k!=null&&k.updateState===`idle`&&!P.isPending,W=n.isOnline?z():null,G=k?.packageName??n.rootPackage?.name??(n.isHub?`@camstack/server`:`@camstack/agent`);return l(`div`,{className:`rounded-lg border border-border bg-surface p-4 space-y-4`,children:[l(`div`,{className:`flex items-center justify-between gap-3`,children:[l(`div`,{className:`flex items-center gap-2 min-w-0`,children:[f(`span`,{className:`text-sm font-medium text-foreground truncate`,children:n.name}),f(w,{label:n.isHub?c(`serverManagement.nodeHub`,`hub`):c(`serverManagement.nodeAgent`,`agent`),tone:n.isHub?`info`:`neutral`}),!n.isOnline&&f(w,{label:c(`serverManagement.nodeOffline`,`offline`),tone:`error`})]}),W!=null&&f(w,{...W})]}),l(`div`,{className:`flex items-center gap-2`,children:[f(`span`,{className:`font-mono text-xs text-foreground-subtle truncate`,children:G}),n.isOnline&&k!=null&&f(w,{...R()})]}),!n.isOnline&&f(T,{label:c(`serverManagement.lastReportedVersion`,`Last reported version`),value:n.rootPackage?.version??null}),n.isOnline&&O.isLoading&&l(`div`,{className:`flex items-center gap-2 text-sm text-foreground-subtle`,children:[f(g,{className:`h-4 w-4 animate-spin`}),c(`common.loading`,`Loading…`)]}),n.isOnline&&O.isError&&l(`div`,{className:`space-y-1.5`,children:[f(`p`,{className:`text-sm text-red-500`,children:c(`serverManagement.loadError`,`Could not load the node root-package status.`)}),n.rootPackage!=null&&f(T,{label:c(`serverManagement.lastReportedVersion`,`Last reported version`),value:n.rootPackage.version})]}),n.isOnline&&k!=null&&l(`div`,{className:`space-y-1.5`,children:[f(T,{label:c(`serverManagement.runningVersion`,`Running version`),value:k.runningVersion}),f(T,{label:c(`serverManagement.latestVersion`,`Latest on registry`),value:k.latestVersion}),f(T,{label:c(`serverManagement.previousVersion`,`Previous (rollback target)`),value:k.previousVersion}),f(T,{label:c(`serverManagement.seedVersion`,`Image seed version`),value:k.seedVersion}),f(T,{label:c(`serverManagement.nodeRuntimeVersion`,`Node.js runtime`),value:k.nodeRuntimeVersion}),k.pendingVersion!=null&&f(T,{label:c(`serverManagement.pendingVersion`,`Staged (applies on restart)`),value:k.pendingVersion})]}),n.isOnline&&k?.updateState===`awaiting-confirmation`&&f(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 p-2.5 text-xs text-amber-500`,children:c(`serverManagement.awaitingConfirmationWarning`,`This node restarted onto {{version}} and is confirming boot health — avoid restarting it now. Update and rollback are temporarily unavailable until the probation boot confirms; a manual restart during this window would auto-roll-back the update.`,{version:k.pendingVersion??k.runningVersion??``})}),n.isOnline&&k?.stateFileCorrupt===!0&&f(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 p-2.5 text-xs text-amber-500`,children:c(`serverManagement.stateCorruptWarning`,`The server-root state file on this node is corrupt — it booted from the baked seed and any installed data-directory versions are being ignored. Applying an update will rewrite the state file.`)}),n.isOnline&&k?.rolledBack!=null&&f(`div`,{className:`rounded border border-red-500/30 bg-red-500/10 p-2.5 text-xs text-red-400`,children:c(`serverManagement.rolledBackDetail`,`Update to {{from}} failed and was rolled back to {{to}}: {{reason}}`,{from:k.rolledBack.fromVersion,to:k.rolledBack.toVersion??c(`serverManagement.bakedSeed`,`the baked seed`),reason:k.rolledBack.reason})}),n.isOnline&&B&&f(`p`,{className:`text-xs text-foreground-subtle`,children:c(`serverManagement.workspaceNote`,`Development workspace detected — runtime updates are disabled (the dev loop resolves code from the workspace).`)}),y&&l(`div`,{className:`flex items-center gap-2 text-sm text-amber-500`,children:[f(g,{className:`h-4 w-4 animate-spin`}),c(`serverManagement.nodeRestarting`,`The node is restarting to apply the change…`)]}),n.isOnline&&l(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-surface-muted disabled:opacity-50`,disabled:j.isPending||k?.updateState===`staging`,onClick:()=>j.mutate(D),children:[j.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(p,{className:`h-3.5 w-3.5`}),c(`serverManagement.checkForUpdate`,`Check for update`)]}),V&&l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded bg-primary px-2.5 py-1.5 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50`,onClick:()=>void F(),children:[M.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(b,{className:`h-3.5 w-3.5`}),c(`serverManagement.updateTo`,`Update to {{version}}`,{version:k?.latestVersion??``})]}),H&&l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded border border-amber-500/40 px-2.5 py-1.5 text-xs font-medium text-amber-500 hover:bg-amber-500/10 disabled:opacity-50`,onClick:()=>void I(),children:[N.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(S,{className:`h-3.5 w-3.5`}),c(`serverManagement.rollback`,`Roll back to {{version}}`,{version:k?.previousVersion??``})]}),l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-surface-muted disabled:opacity-50`,disabled:!U,onClick:()=>void L(),children:[P.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(m,{className:`h-3.5 w-3.5`}),c(`serverManagement.restart`,`Restart`)]})]}),n.isOnline&&k?.lastCheckedAtMs!=null&&l(`p`,{className:`flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[f(x,{className:`h-3 w-3`}),c(`serverManagement.lastChecked`,`Last checked: {{when}}`,{when:new Date(k.lastCheckedAtMs).toLocaleString()})]})]})}var D={id:`hub`,name:`hub`,isHub:!0,isOnline:!0,rootPackage:null};function O(){let{t:e}=v(),t=a(),i=n(void 0,{refetchInterval:15e3}),o=[...(i.data??[]).map(e=>({id:e.id,name:e.name,isHub:e.isHub,isOnline:e.isOnline,rootPackage:e.rootPackage??null}))].sort((e,t)=>e.isHub===t.isHub?e.name.localeCompare(t.name):e.isHub?-1:1),c=o.length>0?o:[D],u=r(),[p,m]=d(!1),h=c.filter(e=>e.isOnline),x=s(async()=>{let n=[...h].sort((e,t)=>e.isHub===t.isHub?0:e.isHub?1:-1);if(await t({title:e(`serverManagement.confirmUpdateAllTitle`,`Update all nodes`),message:e(`serverManagement.confirmUpdateAllBody`,`Sequentially update every online node to its latest published version — agents first, the hub last. Each node installs its root package (only if newer than what it runs) and restarts on probation with automatic rollback; already-current nodes are skipped. The hub restarts last, so this page will reconnect afterwards.`),confirmLabel:e(`serverManagement.confirmUpdateAllAction`,`Update all & restart`),variant:`warning`})){m(!0);try{for(let e of n)try{await u.mutateAsync(e.isHub?{}:{nodeId:e.id})}catch{}}finally{m(!1)}}},[u,t,h,e]);return l(y,{icon:_,title:e(`serverManagement.title`,`Server management`),subtitle:e(`serverManagement.subtitle`,`Runtime-updatable root packages per node — updates install into each node’s data directory and apply on restart with automatic rollback.`),children:[i.isLoading&&l(`div`,{className:`flex items-center gap-2 text-sm text-foreground-subtle`,children:[f(g,{className:`h-4 w-4 animate-spin`}),e(`common.loading`,`Loading…`)]}),i.isError&&f(`p`,{className:`mb-3 text-sm text-red-500`,children:e(`serverManagement.topologyError`,`Could not load the cluster node list — showing the hub only.`)}),h.length>1&&l(`div`,{className:`mb-4 flex items-center gap-3 max-w-5xl`,children:[l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50`,disabled:p,onClick:()=>void x(),children:[p?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(b,{className:`h-3.5 w-3.5`}),e(`serverManagement.updateAll`,`Update all nodes`)]}),f(`span`,{className:`text-[11px] text-foreground-subtle`,children:e(`serverManagement.updateAllHint`,`Sequenced agents-first, hub-last — up-to-date nodes are skipped.`)})]}),f(`div`,{className:`grid gap-4 xl:grid-cols-2 max-w-5xl`,children:c.map(e=>f(E,{node:e},e.id))}),f(`p`,{className:`mt-4 max-w-5xl text-[11px] text-foreground-subtle`,children:e(`serverManagement.phase2Note`,`Phase 2: Update moves each node’s main process only (hub + docker agents) — addon runners stay on the /data/framework overlay and the Electron agent stays image-bound until later phases. Do not assume full-stack coherence from one Update click.`)})]})}export{O as ServerManagementPage};
1
+ import{Ci as e,Ei as t,Ir as n,Si as r,Ti as i,ea as a,wi as o}from"./src-nTmr96zw.js";import{I as s,Q as c,S as l,o as u,q as d,x as f}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as p}from"./refresh-cw-DVzwLp8Q.js";import{t as m}from"./rotate-cw-CJ22Udq1.js";import{H as h,S as g,p as _,t as v}from"./index-IlR8xZC4.js";import{t as y}from"./AdminPage-BwmGKnRf.js";var b=h(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),x=h(`hard-drive-download`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m16 6-4 4-4-4`,key:`6wukr`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),S=h(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]);c();var C=[[`serverManagement`,`getServerPackageStatus`]];function w({label:e,tone:t}){return f(`span`,{className:`inline-flex items-center rounded px-2 py-0.5 text-[11px] font-medium ${{neutral:`bg-surface-muted text-foreground-subtle`,ok:`bg-emerald-500/15 text-emerald-500`,info:`bg-sky-500/15 text-sky-500`,warn:`bg-amber-500/15 text-amber-500`,error:`bg-red-500/15 text-red-500`}[t]}`,children:e})}function T({label:e,value:t}){return l(`div`,{className:`flex items-center justify-between gap-4 text-sm`,children:[f(`span`,{className:`text-foreground-subtle`,children:e}),f(`span`,{className:`font-mono text-foreground`,children:t??`—`})]})}function E({node:n}){let{t:c}=v(),h=u(),_=a(),[y,E]=d(!1),D=n.isHub?void 0:{nodeId:n.id},O=o(D,{refetchInterval:1e4,enabled:n.isOnline,retry:1}),k=O.data??null,A=s(()=>{h.invalidateQueries({queryKey:C})},[h]),j=e({onSettled:A}),M=r({onSettled:A}),N=t({onSettled:A}),P=i({onSettled:A}),F=s(async()=>{k?.latestVersion!=null&&await _({title:c(`serverManagement.confirmUpdateTitle`,`Update node root package`),message:c(`serverManagement.confirmUpdateBody`,`Install {{pkg}}@{{version}} on node "{{node}}" and restart it to apply. The new version boots on probation: if it fails to reach ready, the node automatically rolls back to the current version. Requires an always-relaunching supervisor (Docker restart policy "unless-stopped" or "always"), otherwise the node stays down after exiting to apply.`,{pkg:k.packageName,version:k.latestVersion,node:n.name}),confirmLabel:c(`serverManagement.confirmUpdateAction`,`Update & restart`)})&&(await M.mutateAsync({version:k.latestVersion,...D})).restarting&&E(!0)},[M,_,n.name,D,k,c]),I=s(async()=>{k?.previousVersion!=null&&await _({title:c(`serverManagement.confirmRollbackTitle`,`Roll back node root package`),message:c(`serverManagement.confirmRollbackBody`,`Restart node "{{node}}" on the previous version ({{version}})?`,{node:n.name,version:k.previousVersion}),confirmLabel:c(`serverManagement.confirmRollbackAction`,`Roll back & restart`)})&&(await N.mutateAsync(D)).restarting&&E(!0)},[_,n.name,N,D,k,c]),L=s(async()=>{await _({title:c(`serverManagement.confirmRestartTitle`,`Restart node`),message:c(`serverManagement.confirmRestartBody`,`Restart node "{{node}}" now? The process exits and its supervisor relaunches it on the same version. In-flight requests to this node are dropped.`,{node:n.name}),confirmLabel:c(`serverManagement.confirmRestartAction`,`Restart`),variant:`warning`})&&(await P.mutateAsync(D)).restarting&&E(!0)},[_,n.name,P,D,c]),R=()=>{switch(k?.bootMode){case`data-root`:return{label:c(`serverManagement.bootDataRoot`,`runtime-updatable`),tone:`ok`};case`workspace`:return{label:c(`serverManagement.bootWorkspace`,`dev workspace`),tone:`info`};default:return{label:c(`serverManagement.bootBaked`,`baked image seed`),tone:`neutral`}}},z=()=>{if(k==null)return null;if(k.rolledBack!=null)return{label:c(`serverManagement.stateRolledBack`,`rolled back (update failed)`),tone:`error`};switch(k.updateState){case`checking`:return{label:c(`serverManagement.stateChecking`,`checking…`),tone:`info`};case`staging`:return{label:c(`serverManagement.stateStaging`,`updating…`),tone:`info`};case`pending-restart`:return{label:c(`serverManagement.statePending`,`restart pending`),tone:`warn`};case`awaiting-confirmation`:return{label:c(`serverManagement.stateAwaitingConfirmation`,`awaiting confirmation`),tone:`warn`};default:return k.updateAvailable?{label:c(`serverManagement.stateUpdateAvailable`,`update available`),tone:`warn`}:{label:c(`serverManagement.stateUpToDate`,`up to date`),tone:`ok`}}},B=k?.bootMode===`workspace`,V=n.isOnline&&k!=null&&!B&&k.updateAvailable&&k.updateState===`idle`&&!M.isPending,H=n.isOnline&&k!=null&&!B&&k.previousVersion!=null&&k.updateState===`idle`&&!N.isPending,U=n.isOnline&&k!=null&&k.updateState===`idle`&&!P.isPending,W=n.isOnline?z():null,G=k?.packageName??n.rootPackage?.name??(n.isHub?`@camstack/server`:`@camstack/agent`);return l(`div`,{className:`rounded-lg border border-border bg-surface p-4 space-y-4`,children:[l(`div`,{className:`flex items-center justify-between gap-3`,children:[l(`div`,{className:`flex items-center gap-2 min-w-0`,children:[f(`span`,{className:`text-sm font-medium text-foreground truncate`,children:n.name}),f(w,{label:n.isHub?c(`serverManagement.nodeHub`,`hub`):c(`serverManagement.nodeAgent`,`agent`),tone:n.isHub?`info`:`neutral`}),!n.isOnline&&f(w,{label:c(`serverManagement.nodeOffline`,`offline`),tone:`error`})]}),W!=null&&f(w,{...W})]}),l(`div`,{className:`flex items-center gap-2`,children:[f(`span`,{className:`font-mono text-xs text-foreground-subtle truncate`,children:G}),n.isOnline&&k!=null&&f(w,{...R()})]}),!n.isOnline&&f(T,{label:c(`serverManagement.lastReportedVersion`,`Last reported version`),value:n.rootPackage?.version??null}),n.isOnline&&O.isLoading&&l(`div`,{className:`flex items-center gap-2 text-sm text-foreground-subtle`,children:[f(g,{className:`h-4 w-4 animate-spin`}),c(`common.loading`,`Loading…`)]}),n.isOnline&&O.isError&&l(`div`,{className:`space-y-1.5`,children:[f(`p`,{className:`text-sm text-red-500`,children:c(`serverManagement.loadError`,`Could not load the node root-package status.`)}),n.rootPackage!=null&&f(T,{label:c(`serverManagement.lastReportedVersion`,`Last reported version`),value:n.rootPackage.version})]}),n.isOnline&&k!=null&&l(`div`,{className:`space-y-1.5`,children:[f(T,{label:c(`serverManagement.runningVersion`,`Running version`),value:k.runningVersion}),f(T,{label:c(`serverManagement.latestVersion`,`Latest on registry`),value:k.latestVersion}),f(T,{label:c(`serverManagement.previousVersion`,`Previous (rollback target)`),value:k.previousVersion}),f(T,{label:c(`serverManagement.seedVersion`,`Image seed version`),value:k.seedVersion}),f(T,{label:c(`serverManagement.nodeRuntimeVersion`,`Node.js runtime`),value:k.nodeRuntimeVersion}),k.pendingVersion!=null&&f(T,{label:c(`serverManagement.pendingVersion`,`Staged (applies on restart)`),value:k.pendingVersion})]}),n.isOnline&&k?.updateState===`awaiting-confirmation`&&f(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 p-2.5 text-xs text-amber-500`,children:c(`serverManagement.awaitingConfirmationWarning`,`This node restarted onto {{version}} and is confirming boot health — avoid restarting it now. Update and rollback are temporarily unavailable until the probation boot confirms; a manual restart during this window would auto-roll-back the update.`,{version:k.pendingVersion??k.runningVersion??``})}),n.isOnline&&k?.stateFileCorrupt===!0&&f(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 p-2.5 text-xs text-amber-500`,children:c(`serverManagement.stateCorruptWarning`,`The server-root state file on this node is corrupt — it booted from the baked seed and any installed data-directory versions are being ignored. Applying an update will rewrite the state file.`)}),n.isOnline&&k?.rolledBack!=null&&f(`div`,{className:`rounded border border-red-500/30 bg-red-500/10 p-2.5 text-xs text-red-400`,children:c(`serverManagement.rolledBackDetail`,`Update to {{from}} failed and was rolled back to {{to}}: {{reason}}`,{from:k.rolledBack.fromVersion,to:k.rolledBack.toVersion??c(`serverManagement.bakedSeed`,`the baked seed`),reason:k.rolledBack.reason})}),n.isOnline&&B&&f(`p`,{className:`text-xs text-foreground-subtle`,children:c(`serverManagement.workspaceNote`,`Development workspace detected — runtime updates are disabled (the dev loop resolves code from the workspace).`)}),y&&l(`div`,{className:`flex items-center gap-2 text-sm text-amber-500`,children:[f(g,{className:`h-4 w-4 animate-spin`}),c(`serverManagement.nodeRestarting`,`The node is restarting to apply the change…`)]}),n.isOnline&&l(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-surface-muted disabled:opacity-50`,disabled:j.isPending||k?.updateState===`staging`,onClick:()=>j.mutate(D),children:[j.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(p,{className:`h-3.5 w-3.5`}),c(`serverManagement.checkForUpdate`,`Check for update`)]}),V&&l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded bg-primary px-2.5 py-1.5 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50`,onClick:()=>void F(),children:[M.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(b,{className:`h-3.5 w-3.5`}),c(`serverManagement.updateTo`,`Update to {{version}}`,{version:k?.latestVersion??``})]}),H&&l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded border border-amber-500/40 px-2.5 py-1.5 text-xs font-medium text-amber-500 hover:bg-amber-500/10 disabled:opacity-50`,onClick:()=>void I(),children:[N.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(S,{className:`h-3.5 w-3.5`}),c(`serverManagement.rollback`,`Roll back to {{version}}`,{version:k?.previousVersion??``})]}),l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-surface-muted disabled:opacity-50`,disabled:!U,onClick:()=>void L(),children:[P.isPending?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(m,{className:`h-3.5 w-3.5`}),c(`serverManagement.restart`,`Restart`)]})]}),n.isOnline&&k?.lastCheckedAtMs!=null&&l(`p`,{className:`flex items-center gap-1.5 text-[11px] text-foreground-subtle`,children:[f(x,{className:`h-3 w-3`}),c(`serverManagement.lastChecked`,`Last checked: {{when}}`,{when:new Date(k.lastCheckedAtMs).toLocaleString()})]})]})}var D={id:`hub`,name:`hub`,isHub:!0,isOnline:!0,rootPackage:null};function O(){let{t:e}=v(),t=a(),i=n(void 0,{refetchInterval:15e3}),o=[...(i.data??[]).map(e=>({id:e.id,name:e.name,isHub:e.isHub,isOnline:e.isOnline,rootPackage:e.rootPackage??null}))].sort((e,t)=>e.isHub===t.isHub?e.name.localeCompare(t.name):e.isHub?-1:1),c=o.length>0?o:[D],u=r(),[p,m]=d(!1),h=c.filter(e=>e.isOnline),x=s(async()=>{let n=[...h].sort((e,t)=>e.isHub===t.isHub?0:e.isHub?1:-1);if(await t({title:e(`serverManagement.confirmUpdateAllTitle`,`Update all nodes`),message:e(`serverManagement.confirmUpdateAllBody`,`Sequentially update every online node to its latest published version — agents first, the hub last. Each node installs its root package (only if newer than what it runs) and restarts on probation with automatic rollback; already-current nodes are skipped. The hub restarts last, so this page will reconnect afterwards.`),confirmLabel:e(`serverManagement.confirmUpdateAllAction`,`Update all & restart`),variant:`warning`})){m(!0);try{for(let e of n)try{await u.mutateAsync(e.isHub?{}:{nodeId:e.id})}catch{}}finally{m(!1)}}},[u,t,h,e]);return l(y,{icon:_,title:e(`serverManagement.title`,`Server management`),subtitle:e(`serverManagement.subtitle`,`Runtime-updatable root packages per node — updates install into each node’s data directory and apply on restart with automatic rollback.`),children:[i.isLoading&&l(`div`,{className:`flex items-center gap-2 text-sm text-foreground-subtle`,children:[f(g,{className:`h-4 w-4 animate-spin`}),e(`common.loading`,`Loading…`)]}),i.isError&&f(`p`,{className:`mb-3 text-sm text-red-500`,children:e(`serverManagement.topologyError`,`Could not load the cluster node list — showing the hub only.`)}),h.length>1&&l(`div`,{className:`mb-4 flex items-center gap-3 max-w-5xl`,children:[l(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:opacity-90 disabled:opacity-50`,disabled:p,onClick:()=>void x(),children:[p?f(g,{className:`h-3.5 w-3.5 animate-spin`}):f(b,{className:`h-3.5 w-3.5`}),e(`serverManagement.updateAll`,`Update all nodes`)]}),f(`span`,{className:`text-[11px] text-foreground-subtle`,children:e(`serverManagement.updateAllHint`,`Sequenced agents-first, hub-last — up-to-date nodes are skipped.`)})]}),f(`div`,{className:`grid gap-4 xl:grid-cols-2 max-w-5xl`,children:c.map(e=>f(E,{node:e},e.id))}),f(`p`,{className:`mt-4 max-w-5xl text-[11px] text-foreground-subtle`,children:e(`serverManagement.phase2Note`,`Phase 2: Update moves each node’s main process only (hub + docker agents) — addon runners stay on the /data/framework overlay and the Electron agent stays image-bound until later phases. Do not assume full-stack coherence from one Update click.`)})]})}export{O as ServerManagementPage};
@@ -1 +1 @@
1
- import{Ir as e}from"./src-nTmr96zw.js";import{S as t,x as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{f as r}from"./index-Da74gHj8.js";import{t as i}from"./AdminPage-BwmGKnRf.js";import{t as a}from"./NodeAddonsSettingsPanel-B-nngyAf.js";function o(){let{data:o,isLoading:s}=e(void 0),c=(o??[]).find(e=>e.isHub&&e.isOnline),l=c?.addons.map(e=>e.id)??[];return n(i,{children:s?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`Loading hub topology…`}):c?l.length===0?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`No addons installed on the hub yet.`}):n(a,{nodeId:c.id,addonIds:l,level:`global`}):t(`div`,{className:`flex flex-col items-center justify-center text-muted-foreground text-sm gap-2 py-12`,children:[n(r,{className:`h-8 w-8 opacity-30`}),n(`p`,{children:`No online hub node found.`}),n(`p`,{className:`text-xs`,children:`Settings will appear once the hub is reachable.`})]})})}export{o as SettingsPage};
1
+ import{Ir as e}from"./src-nTmr96zw.js";import{S as t,x as n}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{f as r}from"./index-IlR8xZC4.js";import{t as i}from"./AdminPage-BwmGKnRf.js";import{t as a}from"./NodeAddonsSettingsPanel-B-nngyAf.js";function o(){let{data:o,isLoading:s}=e(void 0),c=(o??[]).find(e=>e.isHub&&e.isOnline),l=c?.addons.map(e=>e.id)??[];return n(i,{children:s?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`Loading hub topology…`}):c?l.length===0?n(`div`,{className:`text-muted-foreground text-sm py-12 text-center`,children:`No addons installed on the hub yet.`}):n(a,{nodeId:c.id,addonIds:l,level:`global`}):t(`div`,{className:`flex flex-col items-center justify-center text-muted-foreground text-sm gap-2 py-12`,children:[n(r,{className:`h-8 w-8 opacity-30`}),n(`p`,{children:`No online hub node found.`}),n(`p`,{className:`text-xs`,children:`Settings will appear once the hub is reachable.`})]})})}export{o as SettingsPage};
@@ -1 +1 @@
1
- import{Q as e,S as t,q as n,x as r}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as i}from"./CapabilityBadges-CYoWl0J1.js";import{t as a}from"./ProviderIcon-CJ8-0ZH-.js";import{t as o}from"./StatusBadge-Dcr2bw58.js";import{t as s}from"./FormBuilder-DmAaqS0P.js";e();function c({title:e,children:n}){return t(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`border-b border-border px-4 py-2.5`,children:r(`h2`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider`,children:e})}),r(`div`,{className:`p-4`,children:n})]})}function l({name:e,cssVar:n,hex:i}){return t(`div`,{className:`flex flex-col items-center gap-1.5`,children:[r(`div`,{className:`h-10 w-10 rounded-lg border border-border shadow-inner`,style:{backgroundColor:n?`var(${n})`:i}}),r(`span`,{className:`text-[10px] text-foreground-subtle text-center leading-tight`,children:e})]})}var u={sections:[{id:`demo`,title:`Demo Fields`,columns:2,fields:[{key:`name`,type:`text`,label:`Name`,placeholder:`Enter name`},{key:`count`,type:`number`,label:`Count`,min:0,max:100,unit:`items`},{key:`enabled`,type:`boolean`,label:`Enabled`},{key:`mode`,type:`select`,label:`Mode`,options:[{value:`a`,label:`Alpha`},{value:`b`,label:`Beta`}]},{key:`tags`,type:`tags`,label:`Tags`,span:2,suggestions:[`camera`,`zone`,`alert`]},{key:`confidence`,type:`slider`,label:`Confidence`,min:0,max:100,step:5,unit:`%`,span:2},{key:`info`,type:`info`,label:`Note`,content:`This is an informational message for the user.`,variant:`info`}]}]};function d(){let[e,d]=n({name:`Example`,count:10,enabled:!0,mode:`a`,tags:[`camera`],confidence:60});return t(`div`,{className:`p-6 space-y-6 max-w-5xl mx-auto`,children:[t(`div`,{className:`mb-6`,children:[r(`h1`,{className:`text-xl font-bold text-foreground`,children:`Component Showroom`}),r(`p`,{className:`text-sm text-foreground-subtle mt-1`,children:`All UI components at a glance`})]}),r(c,{title:`Typography`,children:t(`div`,{className:`space-y-3`,children:[r(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Heading 1 — Display title`}),r(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Heading 2 — Section title`}),r(`h3`,{className:`text-base font-semibold text-foreground`,children:`Heading 3 — Card title`}),r(`h4`,{className:`text-sm font-semibold text-foreground`,children:`Heading 4 — Sub-section`}),r(`p`,{className:`text-sm text-foreground`,children:`Body text — Regular paragraph content goes here. It uses the foreground color.`}),r(`p`,{className:`text-sm text-foreground-subtle`,children:`Subtle text — Secondary/descriptive text with reduced emphasis.`}),r(`p`,{className:`text-xs text-foreground-subtle uppercase tracking-wider font-semibold`,children:`Label / Caption`}),r(`p`,{className:`text-xs text-foreground-disabled`,children:`Disabled / placeholder text`})]})}),r(c,{title:`Colors`,children:t(`div`,{className:`flex flex-wrap gap-4`,children:[r(l,{name:`primary`,cssVar:`--color-primary`}),r(l,{name:`background`,cssVar:`--color-background`}),r(l,{name:`surface`,cssVar:`--color-surface`}),r(l,{name:`foreground`,cssVar:`--color-foreground`}),r(l,{name:`success`,cssVar:`--color-success`}),r(l,{name:`warning`,cssVar:`--color-warning`}),r(l,{name:`danger`,cssVar:`--color-danger`}),r(l,{name:`info`,cssVar:`--color-info`}),r(l,{name:`border`,cssVar:`--color-border`}),r(`div`,{className:`w-px`}),r(l,{name:`frigate`,hex:`#3b82f6`}),r(l,{name:`scrypted`,hex:`#a855f7`}),r(l,{name:`reolink`,hex:`#06b6d4`}),r(l,{name:`ha`,hex:`#22d3ee`}),r(l,{name:`rtsp`,hex:`#78716c`})]})}),r(c,{title:`Buttons`,children:t(`div`,{className:`flex flex-wrap gap-3`,children:[r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity`,children:`Primary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:`Secondary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors`,children:`Danger`}),r(`button`,{disabled:!0,className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed`,children:`Disabled`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors`,children:`Warning`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors`,children:`Success`})]})}),r(c,{title:`Inputs`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Text input`}),r(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`Type something...`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Number input`}),r(`input`,{type:`number`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`0`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Password input`}),r(`input`,{type:`password`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`••••••••`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Select`}),t(`select`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,children:[r(`option`,{children:`Option A`}),r(`option`,{children:`Option B`}),r(`option`,{children:`Option C`})]})]}),t(`div`,{className:`md:col-span-2`,children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Textarea`}),r(`textarea`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]`,placeholder:`Enter multi-line text...`,rows:3})]}),r(`div`,{children:t(`label`,{className:`flex items-center gap-2 cursor-pointer select-none`,children:[r(`input`,{type:`checkbox`,className:`h-3.5 w-3.5 rounded border-border accent-primary`,defaultChecked:!0}),r(`span`,{className:`text-xs font-medium text-foreground`,children:`Checkbox (checked)`})]})}),r(`div`,{children:t(`div`,{className:`flex items-center justify-between`,children:[r(`span`,{className:`text-xs font-medium text-foreground`,children:`Toggle switch`}),r(f,{})]})}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Slider`}),r(`input`,{type:`range`,className:`w-full h-1 accent-primary cursor-pointer`,min:0,max:100,defaultValue:60})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Tags example`}),r(`div`,{className:`flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]`,children:[`camera`,`zone`,`alert`].map(e=>r(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary`,children:e},e))})]})]})}),r(c,{title:`Badges`,children:t(`div`,{className:`space-y-3`,children:[t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`StatusBadge`}),r(`div`,{className:`flex flex-wrap gap-2`,children:[`running`,`stopped`,`error`,`online`,`offline`,`idle`].map(e=>r(o,{status:e},e))})]}),t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`CapabilityBadges`}),r(i,{capabilities:[`streaming`,`detection`,`recording`,`audio`]})]})]})}),r(c,{title:`Cards`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{className:`rounded-lg bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Surface card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-surface`. Default card background."})]}),t(`div`,{className:`rounded-lg border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Bordered card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `border border-border bg-surface`."})]}),t(`div`,{className:`rounded-lg border border-primary/30 bg-primary/5 p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-primary mb-1`,children:`Accent card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:`Highlighted with primary color.`})]}),t(`div`,{className:`rounded-lg bg-background p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Background card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-background`. Inset card."})]})]})}),r(c,{title:`Provider Icons`,children:r(`div`,{className:`flex flex-wrap gap-4`,children:[`frigate`,`scrypted`,`reolink`,`homeassistant`,`rtsp`,`onvif`].map(e=>r(a,{type:e,size:`lg`,showLabel:!0},e))})}),t(c,{title:`Form Builder Demo`,children:[r(s,{schema:u,values:e,onChange:d}),t(`details`,{className:`mt-3`,children:[r(`summary`,{className:`text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground`,children:`View current values`}),r(`pre`,{className:`mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto`,children:JSON.stringify(e,null,2)})]})]}),r(c,{title:`Info Boxes`,children:r(`div`,{className:`space-y-2`,children:[{variant:`info`,label:`Info`,content:`This is an informational message. Use it for tips and hints.`},{variant:`warning`,label:`Warning`,content:`This action may have side effects. Proceed with caution.`},{variant:`success`,label:`Success`,content:`Operation completed successfully. All systems are green.`},{variant:`danger`,label:`Danger`,content:`This operation is irreversible. Data will be permanently deleted.`}].map(({variant:e,label:n,content:i})=>{let a={info:{border:`border-info`,bg:`bg-info/5`,text:`text-info`},warning:{border:`border-warning`,bg:`bg-warning/5`,text:`text-warning`},success:{border:`border-success`,bg:`bg-success/5`,text:`text-success`},danger:{border:`border-danger`,bg:`bg-danger/5`,text:`text-danger`}}[e];return t(`div`,{className:`rounded-md border-l-4 px-3 py-2.5 ${a.border} ${a.bg}`,children:[r(`p`,{className:`text-xs font-semibold mb-0.5 ${a.text}`,children:n}),r(`p`,{className:`text-xs text-foreground-subtle leading-relaxed`,children:i})]},e)})})})]})}function f(){let[e,t]=n(!0);return r(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(e=>!e),className:[`relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer`,e?`bg-primary`:`bg-foreground-subtle/30`].join(` `),children:r(`span`,{className:[`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150`,e?`translate-x-4`:`translate-x-0.5`].join(` `)})})}export{d as ShowroomPage};
1
+ import{Q as e,S as t,q as n,x as r}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{t as i}from"./CapabilityBadges-CfbiHE_6.js";import{t as a}from"./ProviderIcon-CF8jQdWS.js";import{t as o}from"./StatusBadge-Dcr2bw58.js";import{t as s}from"./FormBuilder-DmAaqS0P.js";e();function c({title:e,children:n}){return t(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`border-b border-border px-4 py-2.5`,children:r(`h2`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider`,children:e})}),r(`div`,{className:`p-4`,children:n})]})}function l({name:e,cssVar:n,hex:i}){return t(`div`,{className:`flex flex-col items-center gap-1.5`,children:[r(`div`,{className:`h-10 w-10 rounded-lg border border-border shadow-inner`,style:{backgroundColor:n?`var(${n})`:i}}),r(`span`,{className:`text-[10px] text-foreground-subtle text-center leading-tight`,children:e})]})}var u={sections:[{id:`demo`,title:`Demo Fields`,columns:2,fields:[{key:`name`,type:`text`,label:`Name`,placeholder:`Enter name`},{key:`count`,type:`number`,label:`Count`,min:0,max:100,unit:`items`},{key:`enabled`,type:`boolean`,label:`Enabled`},{key:`mode`,type:`select`,label:`Mode`,options:[{value:`a`,label:`Alpha`},{value:`b`,label:`Beta`}]},{key:`tags`,type:`tags`,label:`Tags`,span:2,suggestions:[`camera`,`zone`,`alert`]},{key:`confidence`,type:`slider`,label:`Confidence`,min:0,max:100,step:5,unit:`%`,span:2},{key:`info`,type:`info`,label:`Note`,content:`This is an informational message for the user.`,variant:`info`}]}]};function d(){let[e,d]=n({name:`Example`,count:10,enabled:!0,mode:`a`,tags:[`camera`],confidence:60});return t(`div`,{className:`p-6 space-y-6 max-w-5xl mx-auto`,children:[t(`div`,{className:`mb-6`,children:[r(`h1`,{className:`text-xl font-bold text-foreground`,children:`Component Showroom`}),r(`p`,{className:`text-sm text-foreground-subtle mt-1`,children:`All UI components at a glance`})]}),r(c,{title:`Typography`,children:t(`div`,{className:`space-y-3`,children:[r(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Heading 1 — Display title`}),r(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Heading 2 — Section title`}),r(`h3`,{className:`text-base font-semibold text-foreground`,children:`Heading 3 — Card title`}),r(`h4`,{className:`text-sm font-semibold text-foreground`,children:`Heading 4 — Sub-section`}),r(`p`,{className:`text-sm text-foreground`,children:`Body text — Regular paragraph content goes here. It uses the foreground color.`}),r(`p`,{className:`text-sm text-foreground-subtle`,children:`Subtle text — Secondary/descriptive text with reduced emphasis.`}),r(`p`,{className:`text-xs text-foreground-subtle uppercase tracking-wider font-semibold`,children:`Label / Caption`}),r(`p`,{className:`text-xs text-foreground-disabled`,children:`Disabled / placeholder text`})]})}),r(c,{title:`Colors`,children:t(`div`,{className:`flex flex-wrap gap-4`,children:[r(l,{name:`primary`,cssVar:`--color-primary`}),r(l,{name:`background`,cssVar:`--color-background`}),r(l,{name:`surface`,cssVar:`--color-surface`}),r(l,{name:`foreground`,cssVar:`--color-foreground`}),r(l,{name:`success`,cssVar:`--color-success`}),r(l,{name:`warning`,cssVar:`--color-warning`}),r(l,{name:`danger`,cssVar:`--color-danger`}),r(l,{name:`info`,cssVar:`--color-info`}),r(l,{name:`border`,cssVar:`--color-border`}),r(`div`,{className:`w-px`}),r(l,{name:`frigate`,hex:`#3b82f6`}),r(l,{name:`scrypted`,hex:`#a855f7`}),r(l,{name:`reolink`,hex:`#06b6d4`}),r(l,{name:`ha`,hex:`#22d3ee`}),r(l,{name:`rtsp`,hex:`#78716c`})]})}),r(c,{title:`Buttons`,children:t(`div`,{className:`flex flex-wrap gap-3`,children:[r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity`,children:`Primary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:`Secondary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors`,children:`Danger`}),r(`button`,{disabled:!0,className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed`,children:`Disabled`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors`,children:`Warning`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors`,children:`Success`})]})}),r(c,{title:`Inputs`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Text input`}),r(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`Type something...`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Number input`}),r(`input`,{type:`number`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`0`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Password input`}),r(`input`,{type:`password`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`••••••••`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Select`}),t(`select`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,children:[r(`option`,{children:`Option A`}),r(`option`,{children:`Option B`}),r(`option`,{children:`Option C`})]})]}),t(`div`,{className:`md:col-span-2`,children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Textarea`}),r(`textarea`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]`,placeholder:`Enter multi-line text...`,rows:3})]}),r(`div`,{children:t(`label`,{className:`flex items-center gap-2 cursor-pointer select-none`,children:[r(`input`,{type:`checkbox`,className:`h-3.5 w-3.5 rounded border-border accent-primary`,defaultChecked:!0}),r(`span`,{className:`text-xs font-medium text-foreground`,children:`Checkbox (checked)`})]})}),r(`div`,{children:t(`div`,{className:`flex items-center justify-between`,children:[r(`span`,{className:`text-xs font-medium text-foreground`,children:`Toggle switch`}),r(f,{})]})}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Slider`}),r(`input`,{type:`range`,className:`w-full h-1 accent-primary cursor-pointer`,min:0,max:100,defaultValue:60})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Tags example`}),r(`div`,{className:`flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]`,children:[`camera`,`zone`,`alert`].map(e=>r(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary`,children:e},e))})]})]})}),r(c,{title:`Badges`,children:t(`div`,{className:`space-y-3`,children:[t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`StatusBadge`}),r(`div`,{className:`flex flex-wrap gap-2`,children:[`running`,`stopped`,`error`,`online`,`offline`,`idle`].map(e=>r(o,{status:e},e))})]}),t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`CapabilityBadges`}),r(i,{capabilities:[`streaming`,`detection`,`recording`,`audio`]})]})]})}),r(c,{title:`Cards`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{className:`rounded-lg bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Surface card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-surface`. Default card background."})]}),t(`div`,{className:`rounded-lg border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Bordered card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `border border-border bg-surface`."})]}),t(`div`,{className:`rounded-lg border border-primary/30 bg-primary/5 p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-primary mb-1`,children:`Accent card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:`Highlighted with primary color.`})]}),t(`div`,{className:`rounded-lg bg-background p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Background card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-background`. Inset card."})]})]})}),r(c,{title:`Provider Icons`,children:r(`div`,{className:`flex flex-wrap gap-4`,children:[`frigate`,`scrypted`,`reolink`,`homeassistant`,`rtsp`,`onvif`].map(e=>r(a,{type:e,size:`lg`,showLabel:!0},e))})}),t(c,{title:`Form Builder Demo`,children:[r(s,{schema:u,values:e,onChange:d}),t(`details`,{className:`mt-3`,children:[r(`summary`,{className:`text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground`,children:`View current values`}),r(`pre`,{className:`mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto`,children:JSON.stringify(e,null,2)})]})]}),r(c,{title:`Info Boxes`,children:r(`div`,{className:`space-y-2`,children:[{variant:`info`,label:`Info`,content:`This is an informational message. Use it for tips and hints.`},{variant:`warning`,label:`Warning`,content:`This action may have side effects. Proceed with caution.`},{variant:`success`,label:`Success`,content:`Operation completed successfully. All systems are green.`},{variant:`danger`,label:`Danger`,content:`This operation is irreversible. Data will be permanently deleted.`}].map(({variant:e,label:n,content:i})=>{let a={info:{border:`border-info`,bg:`bg-info/5`,text:`text-info`},warning:{border:`border-warning`,bg:`bg-warning/5`,text:`text-warning`},success:{border:`border-success`,bg:`bg-success/5`,text:`text-success`},danger:{border:`border-danger`,bg:`bg-danger/5`,text:`text-danger`}}[e];return t(`div`,{className:`rounded-md border-l-4 px-3 py-2.5 ${a.border} ${a.bg}`,children:[r(`p`,{className:`text-xs font-semibold mb-0.5 ${a.text}`,children:n}),r(`p`,{className:`text-xs text-foreground-subtle leading-relaxed`,children:i})]},e)})})})]})}function f(){let[e,t]=n(!0);return r(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(e=>!e),className:[`relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer`,e?`bg-primary`:`bg-foreground-subtle/30`].join(` `),children:r(`span`,{className:[`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150`,e?`translate-x-4`:`translate-x-0.5`].join(` `)})})}export{d as ShowroomPage};