@hivemagnus/magnus-ui 3.0.0 → 3.0.2
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/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
- package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/required-server-files.json +2 -2
- package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__06giq9g4me8eh._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08sgyyf_y8ab8._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__11pe-l2-ko65_._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_ardent_installations_page_tsx_0nvqgacugy6nf._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_agent-upgrade-view_ts_1nvhevz6hq0t2._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
- package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
- package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/static/chunks/{1_4ptlitrm5f-.js → 05oj34aih4am5.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{215cfit1tgz2o.js → 1kx48jg-4j5iv.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{3i3g_ym_8f0d3.js → 269qlvth5p8b4.js} +4 -4
- package/dist/app/apps/dashboard/.next/static/chunks/{2_48s79dhn63g.js → 2mmi4kuxeaoif.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{0ys--bqqe6t4s.js → 37rjo1mzfhwgp.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{0_n9q2hjh1o0m.js → 39iknwb_xeoy1.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{44dwe88hy6p-v.js → 3asqy-wi1vbta.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3s98rvw78e82w.js +1 -0
- package/dist/app/apps/dashboard/package.json +2 -2
- package/dist/app/apps/dashboard/server.js +1 -1
- package/package.json +2 -2
- package/dist/app/apps/dashboard/.next/static/chunks/3y_9v_-9n_gex.js +0 -1
- /package/dist/app/apps/dashboard/.next/static/{ywfB1_CLcZP5CETb_wqH0 → VctstYkAeZ_bmSUU1lySP}/_buildManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{ywfB1_CLcZP5CETb_wqH0 → VctstYkAeZ_bmSUU1lySP}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{ywfB1_CLcZP5CETb_wqH0 → VctstYkAeZ_bmSUU1lySP}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67683,e=>{"use strict";var a=e.i(43476),s=e.i(22016),r=e.i(64155),t=e.i(83902);e.s(["f",0,function({summary:e,showAction:n=!0}){let i=e.nodes.filter(e=>e.tailscale?.requiresRenewal).sort((e,a)=>e.tailscale?.expired!==a.tailscale?.expired?e.tailscale?.expired?-1:1:(e.tailscale?.daysRemaining??Number.MAX_SAFE_INTEGER)-(a.tailscale?.daysRemaining??Number.MAX_SAFE_INTEGER));if(0===i.length)return null;let l=i.some(e=>e.tailscale?.expired),o=l?t.f:r.f,c=l?{panel:"border-danger/40 bg-danger/5",rail:"bg-danger",icon:"bg-danger/10 text-danger",text:"text-danger",chip:"border-danger/30 text-danger",action:"border-danger/40 text-danger hover:bg-danger/10"}:{panel:"border-warning/40 bg-warning/5",rail:"bg-warning",icon:"bg-warning/10 text-warning",text:"text-warning",chip:"border-warning/30 text-warning",action:"border-warning/40 text-warning hover:bg-warning/10"};return(0,a.jsxs)("section",{id:"tailscale-renewal",role:"alert","aria-label":"Tailscale renewal alert",className:`relative overflow-hidden rounded border px-4 py-3 ${c.panel}`,children:[(0,a.jsx)("div",{className:`absolute inset-y-0 left-0 w-0.5 ${c.rail}`}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,a.jsx)("div",{className:`mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded ${c.icon}`,children:(0,a.jsx)(o,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-xs font-bold uppercase tracking-[0.14em] ${c.text}`,children:l?"Tailscale access expired":"Tailscale renewal due"}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-text-muted",children:[i.length," node ",1===i.length?"key needs":"keys need"," renewal within ",e.warningDays," days. Renew before tailnet access is interrupted."]}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:i.map(e=>(0,a.jsxs)("span",{title:e.tailscale?.keyExpiry?`Expires ${e.tailscale.keyExpiry}`:void 0,className:`inline-flex items-center gap-1 rounded border bg-background/40 px-2 py-0.5 font-mono text-[10px] ${c.chip}`,children:[(0,a.jsx)("span",{className:"font-semibold",children:e.name}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,a.jsx)("span",{children:e.tailscale?.expired?"expired":`${e.tailscale?.daysRemaining??"?"}d`})]},e.id))})]})]}),n&&(0,a.jsx)(s.default,{href:"/nodes#tailscale-renewal",className:`shrink-0 self-start rounded border px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider transition-colors sm:self-center ${c.action}`,children:"Review nodes"})]})]})}])},53721,e=>{"use strict";var a=e.i(43476),s=e.i(64155),r=e.i(46670),t=e.i(63646);e.s(["x",0,function({readiness:e}){return e?.status!=="not-ready"?null:(0,a.jsx)("span",{title:(0,t.K)(e),"data-testid":"upgrade-readiness-badge",children:(0,a.jsxs)(r.t,{variant:"warning",children:[(0,a.jsx)(s.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade blocked (",e.problems.length,")"]})})},"a",0,function({readiness:e}){return e?.status!=="not-ready"?null:(0,a.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-[11px]","data-testid":"upgrade-readiness-panel",children:[(0,a.jsxs)("p",{className:"flex items-center gap-2 font-bold uppercase tracking-wider text-warning",children:[(0,a.jsx)(s.f,{className:"h-3.5 w-3.5"})," This node could not take an agent upgrade now"]}),(0,a.jsx)("ul",{className:"mt-2 space-y-2",children:e.problems.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("p",{className:"font-medium text-text",children:[(0,a.jsx)("span",{className:"num",children:e.code}),": ",e.detail]}),(0,a.jsx)("p",{className:"text-text-muted",children:e.remedy})]},`${e.code}-${e.detail}`))})]})}])},46670,e=>{"use strict";var a=e.i(43476),s=e.i(78571);let r={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},t={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:i,dot:l=!1,pulse:o=!1}){return(0,a.jsxs)("span",{className:(0,s.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",r[n],i),children:[l&&(0,a.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,a.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",t[n])}),(0,a.jsx)("span",{className:(0,s.f)("relative inline-flex h-1.5 w-1.5 rounded-full",t[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{"use strict";var a=e.i(43476),s=e.i(56420);let r={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};r.node;let t=(0,s.f)(r);var n=e.i(75775),i=e.i(78571),l=e.i(3062),o=e.i(35084);let c={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},d={xs:"h-1",sm:"h-1.5",md:"h-2"};function x({value:e,max:s=100,tone:r,thresholds:t=o.q,label:n,size:l="xs",showValue:m=!1,valueLabel:u,glow:h,className:p,testId:g}){let f="number"==typeof e&&Number.isFinite(e),v=f?Math.max(0,Math.min(100,e/(s||1)*100)):0,j=r??(f?(0,o.Z)(v,t):"muted"),b=h||!r&&f&&v>=t.warn,N=u??(f?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,a.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",p),"data-testid":g,children:[(0,a.jsx)("div",{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":f?e:void 0,"aria-valuetext":N,className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,a.jsx)("div",{style:{"--meter":`${v}%`},className:(0,i.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",o.H[j],b&&c[j])})}),m&&(0,a.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",f?o.T[j]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function u({values:e,tone:s="primary",width:r=160,height:t=32,area:n=!0,max:l,percent:c=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:p,testId:g,label:f,stretch:v=!1}){let j=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,a.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",p),"data-testid":g,children:h});let b=o.v[s],N=l??(c?Math.max(100,...e):Math.max(...e,d??0)||1),w=t-4,y=r/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,_=e.map((e,a)=>[a*y,k(e)]),E=_.map(([e,a])=>`${e.toFixed(1)},${a.toFixed(1)}`).join(" "),C=_[_.length-1];return(0,a.jsxs)("svg",{width:v?"100%":r,height:t,viewBox:`0 0 ${r} ${t}`,preserveAspectRatio:v?"none":void 0,className:(0,i.f)("block overflow-visible",p),"data-testid":g,role:f?"img":void 0,"aria-label":f,"aria-hidden":!f||void 0,children:[n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:j,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,a.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,a.jsx)("polygon",{points:`0,${t} ${E} ${r},${t}`,fill:`url(#${j})`})]}),void 0!==d&&(0,a.jsx)("line",{x1:0,x2:r,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,a.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:E}),x&&!v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:C[0],cy:C[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,a.jsx)("circle",{cx:C[0],cy:C[1],r:2,fill:b})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:s,children:r,className:t,action:n,tone:i,corners:o=!1,...c}){return(0,a.jsx)(l.f,{...c,tone:i,corners:o,title:e,description:s,action:n,className:t,children:r})},"n",0,function({label:e,value:s,icon:r,trend:c,spark:d,meter:m,delta:h,tone:p="primary",className:g,testId:f}){let v=!h||h.value>=0===(h.positiveIsGood??!0);return(0,a.jsxs)(l.f,{tone:p,className:(0,i.f)("overflow-hidden",g),testId:f,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),r&&(0,a.jsx)("span",{className:"text-primary/60",children:r})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,a.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===p?"text-primary neon-text":o.T[p]),children:s}),h&&0!==h.value&&(0,a.jsxs)("span",{className:(0,i.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[h.value>0?(0,a.jsx)(n.f,{className:"h-3 w-3"}):(0,a.jsx)(t,{className:"h-3 w-3"}),Math.abs(h.value).toFixed(+!Number.isInteger(h.value)),h.unit]})]}),c&&(0,a.jsx)("div",{className:(0,i.f)("mt-1 text-[11px]",c.positive?"text-success":"text-danger"),children:c.value}),void 0!==m&&(0,a.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,a.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,a.jsx)(u,{values:d,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(35084);let t={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},i={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},l={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:o=!0,interactive:c=!0,hero:d=!1,title:x,description:m,icon:u,action:h,as:p="div",padding:g="md",testId:f,className:v,children:j,...b}){return(0,a.jsxs)(p,{...b,"data-testid":f??b["data-testid"],className:(0,s.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[g],o&&"panel-corners",o&&t[e],c&&"glow-hover",c&&n[e],c&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||h||u)&&(0,a.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[u&&(0,a.jsx)("span",{className:(0,s.f)("mt-0.5 shrink-0",r.T[e]),children:u}),(0,a.jsxs)("div",{className:"min-w-0",children:[x&&(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,a.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),h]}),j]})}])},73404,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(35084);e.s(["f",0,function({title:e,eyebrow:t,description:n,icon:i,actions:l,status:o,tone:c="primary",className:d,testId:x}){return(0,a.jsxs)("div",{"data-testid":x,className:(0,s.f)("flex flex-wrap items-end justify-between gap-4",d),children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i&&(0,a.jsx)("span",{"aria-hidden":"true",className:(0,s.f)("mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-panel border bg-surface","accent"===c?"border-accent/40 shadow-[0_0_14px_var(--color-glow-accent)]":"border-primary/40 shadow-[0_0_14px_var(--color-glow)]",r.T[c]),children:i}),(0,a.jsxs)("div",{className:"min-w-0",children:[t&&(0,a.jsxs)("p",{className:(0,s.f)("mb-1 text-[10px] font-medium uppercase tracking-[0.3em]",r.T[c],"opacity-80"),children:[(0,a.jsx)("span",{"aria-hidden":"true",children:"// "}),t]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("h1",{className:(0,s.f)("text-xl font-bold uppercase tracking-wider",r.T[c],r.z[c]),children:e}),o]}),n&&(0,a.jsx)("p",{className:"mt-1 max-w-3xl text-xs text-text-muted",children:n})]})]}),l&&(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:l})]})}])},63376,e=>{"use strict";var a=e.i(43476);e.s(["z",0,function({children:e,className:s}){return(0,a.jsx)("div",{className:`animate-page-in${s?` ${s}`:""}`,children:e})},"U",0,function({children:e,className:s}){return(0,a.jsx)("div",{className:s,children:e})}])},65369,e=>{"use strict";var a=e.i(43476),s=e.i(78571);function r({className:e}){return(0,a.jsx)("div",{"aria-hidden":"true",className:(0,s.f)("skeleton h-3 w-full",e)})}e.s(["l",0,r,"g",0,function({count:e=4,className:t}){return(0,a.jsx)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("grid gap-4 sm:grid-cols-2 lg:grid-cols-4",t),children:Array.from({length:e},(e,s)=>(0,a.jsxs)("div",{className:"panel-corners rounded-panel border border-border bg-surface p-5",children:[(0,a.jsx)(r,{className:"h-2 w-1/2"}),(0,a.jsx)(r,{className:"mt-4 h-7 w-2/3"}),(0,a.jsx)(r,{className:"mt-3 h-1 w-full opacity-60"})]},s))})},"F",0,function({rows:e=5,cols:t=4,className:n}){return(0,a.jsxs)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("overflow-hidden rounded-panel border border-border",n),children:[(0,a.jsx)("div",{className:"flex gap-4 border-b border-border bg-surface px-4 py-3",children:Array.from({length:t},(e,s)=>(0,a.jsx)(r,{className:"h-2 flex-1 opacity-60"},s))}),Array.from({length:e},(e,n)=>(0,a.jsx)("div",{className:"flex gap-4 border-b border-border/50 px-4 py-3 last:border-0",children:Array.from({length:t},(e,t)=>(0,a.jsx)(r,{className:(0,s.f)("h-3 flex-1",(n+t)%3==0&&"max-w-[60%]")},t))},n))]})},"Q",0,function({lines:e=3,className:t}){let n=["w-full","w-11/12","w-4/5","w-2/3","w-3/4"];return(0,a.jsx)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("space-y-2",t),children:Array.from({length:e},(e,s)=>(0,a.jsx)(r,{className:n[s%n.length]},s))})}])},75723,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(46670);let t={success:"bg-success shadow-[0_0_6px_var(--color-success)]",warning:"bg-warning shadow-[0_0_6px_var(--color-warning)]",danger:"bg-danger shadow-[0_0_6px_var(--color-danger)]",info:"bg-info shadow-[0_0_6px_var(--color-info)]",default:"bg-text-muted"},n={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",default:"bg-text-muted"},i=new Set(["ONLINE","RUNNING","ACTIVE","HEALTHY","CRITICAL","UPDATING","PROVISIONING"]);e.s(["f",0,function({status:e,pulse:l,size:o="sm",className:c,label:d}){let x=(0,r.k)(e),m=l??i.has(e.toUpperCase()),u="xs"===o?"h-1.5 w-1.5":"h-2 w-2";return(0,a.jsxs)("span",{className:(0,s.f)("relative inline-flex shrink-0",u,c),role:d?"img":void 0,"aria-label":d,"aria-hidden":!d||void 0,children:[m&&(0,a.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",n[x])}),(0,a.jsx)("span",{className:(0,s.f)("relative inline-flex rounded-full",u,t[x])})]})}])},71417,e=>{"use strict";e.s(["L",0,function(e){if(0===e)return"0 B";let a=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,a)).toFixed(1))} ${["B","KB","MB","GB","TB"][a]}`},"C",0,function(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}])},59439,e=>{e.v(a=>Promise.all(["static/chunks/1ixu-i6j99dj0.js"].map(a=>e.l(a))).then(()=>a(93309)))},37138,e=>{e.v(a=>Promise.all(["static/chunks/3h4dmpbixi6eo.js"].map(a=>e.l(a))).then(()=>a(99894)))},75775,e=>{"use strict";var a=e.i(56420);let s={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],75775)},57665,e=>{"use strict";var a=e.i(56420);let s={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],57665)},86207,14098,e=>{"use strict";var a=e.i(56420);let s={name:"refresh-ccw-dot",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],86207);var t=e.i(43476),n=e.i(71645),i=e.i(68759),l=e.i(32568),o=e.i(82983),c=e.i(41220),d=e.i(32781);e.s(["E",0,function({open:e,node:a,onClose:s,onSaved:r}){let[x,m]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(!0),[f,v]=(0,n.useState)(!1),[j,b]=(0,n.useState)(""),[N,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&(b(""),h(a?.role?.id??""),g(!0),w(!0),(async()=>{try{let e=await o.f.roles.list();m(e.data??[])}catch{b("Failed to load roles")}finally{w(!1)}})())},[e,a?.role?.id]);let y=async()=>{if(a){v(!0),b("");try{let e=a.role?.id;e&&e!==u&&await o.f.roles.unassign(e,{nodeIds:[a.id]}),u&&await o.f.roles.assign(u,{nodeIds:[a.id],defer:!p});let t=u?x.find(e=>e.id===u)??null:null;r(t),s()}catch(e){b(e instanceof Error?e.message:"Failed to assign role")}finally{v(!1)}}},k=async()=>{if(a?.role){v(!0),b("");try{await o.f.roles.unassign(a.role.id,{nodeIds:[a.id]}),r(null),s()}catch(e){b(e instanceof Error?e.message:"Failed to unassign role")}finally{v(!1)}}},_=()=>{b(""),v(!1),s()};return(0,t.jsx)(l.n,{open:e,onClose:_,title:a?.role?"Change Role":"Assign Role",description:a?`Node: ${a.name}`:"",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[N?(0,t.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===x.length?(0,t.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.G,{label:"Role",children:(0,t.jsxs)("select",{value:u,onChange:e=>h(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"",children:"— No role —"}),x.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),u&&(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:p,onChange:e=>g(e.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),j&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:j}),(0,t.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,t.jsx)("div",{children:a?.role&&(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:()=>void k(),disabled:f,children:"Unassign Role"})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:_,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void y(),disabled:f||!u||0===x.length,icon:f?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:f?"Saving…":a?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:e,node:a,onClose:s,onSaved:r}){let[x,m]=(0,n.useState)(""),[u,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(""),[f,v]=(0,n.useState)(!1),[j,b]=(0,n.useState)("");(0,n.useEffect)(()=>{if(a){m(a.name);try{let e=JSON.parse(a.tags);h(e.join(", "))}catch{h("")}g(a.status),b("")}},[a]);let N=async()=>{if(a&&x.trim()){v(!0),b("");try{let e=u.split(",").map(e=>e.trim()).filter(Boolean);await o.f.nodes.update(a.id,{name:x.trim(),tags:e,status:p.toUpperCase()}),r(),s()}catch(e){b(e instanceof Error?e.message:"Failed to update node")}finally{v(!1)}}},w=()=>{b(""),v(!1),s()};return(0,t.jsx)(l.n,{open:e,onClose:w,title:"Edit Node",description:a?`${a.hostname}`:"",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(l.G,{label:"Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),className:l.W})}),(0,t.jsx)(l.G,{label:"Status",children:(0,t.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,t.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,t.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,t.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,t.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),placeholder:"web, production, us-east",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),j&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:j}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void N(),disabled:f||!x.trim(),icon:f?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:f?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:e,onClose:a,onRegistered:s}){let[r,x]=(0,n.useState)(""),[m,u]=(0,n.useState)(""),[h,p]=(0,n.useState)("4100"),[g,f]=(0,n.useState)("linux"),[v,j]=(0,n.useState)("x86_64"),[b,N]=(0,n.useState)(""),[w,y]=(0,n.useState)(!1),[k,_]=(0,n.useState)(""),E=async()=>{if(r.trim()&&m.trim()){y(!0),_("");try{let e=b.split(",").map(e=>e.trim()).filter(Boolean);await o.f.nodes.register({name:r.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(h)||4100,os:g,arch:v,tags:e,agentVersion:"3.0.0"}),s(),C()}catch(e){_(e instanceof Error?e.message:"Failed to register node")}finally{y(!1)}}},C=()=>{x(""),u(""),p("4100"),f("linux"),j("x86_64"),N(""),_(""),y(!1),a()};return(0,t.jsx)(l.n,{open:e,onClose:C,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(l.G,{label:"Node Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:r,onChange:e=>x(e.target.value),placeholder:"web-server-01",className:l.W,autoFocus:!0})}),(0,t.jsx)(l.G,{label:"FQDN / Hostname",required:!0,children:(0,t.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),placeholder:"node-1.example.com",className:l.W})}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(l.G,{label:"Port",children:(0,t.jsx)("input",{type:"number",value:h,onChange:e=>p(e.target.value),className:l.W})}),(0,t.jsx)(l.G,{label:"OS",children:(0,t.jsxs)("select",{value:g,onChange:e=>f(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"linux",children:"Linux"}),(0,t.jsx)("option",{value:"darwin",children:"macOS"}),(0,t.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,t.jsx)(l.G,{label:"Architecture",children:(0,t.jsxs)("select",{value:v,onChange:e=>j(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,t.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,t.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:b,onChange:e=>N(e.target.value),placeholder:"web, production, us-east",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),k&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:k}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:C,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void E(),disabled:w||!r.trim()||!m.trim(),icon:w?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:w?"Registering…":"Register Node"})]})]})})}],14098)},83902,e=>{"use strict";var a=e.i(56420);let s={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],83902)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67683,e=>{"use strict";var a=e.i(43476),s=e.i(22016),r=e.i(64155),t=e.i(83902);e.s(["f",0,function({summary:e,showAction:n=!0}){let i=e.nodes.filter(e=>e.tailscale?.requiresRenewal).sort((e,a)=>e.tailscale?.expired!==a.tailscale?.expired?e.tailscale?.expired?-1:1:(e.tailscale?.daysRemaining??Number.MAX_SAFE_INTEGER)-(a.tailscale?.daysRemaining??Number.MAX_SAFE_INTEGER));if(0===i.length)return null;let l=i.some(e=>e.tailscale?.expired),o=l?t.f:r.f,c=l?{panel:"border-danger/40 bg-danger/5",rail:"bg-danger",icon:"bg-danger/10 text-danger",text:"text-danger",chip:"border-danger/30 text-danger",action:"border-danger/40 text-danger hover:bg-danger/10"}:{panel:"border-warning/40 bg-warning/5",rail:"bg-warning",icon:"bg-warning/10 text-warning",text:"text-warning",chip:"border-warning/30 text-warning",action:"border-warning/40 text-warning hover:bg-warning/10"};return(0,a.jsxs)("section",{id:"tailscale-renewal",role:"alert","aria-label":"Tailscale renewal alert",className:`relative overflow-hidden rounded border px-4 py-3 ${c.panel}`,children:[(0,a.jsx)("div",{className:`absolute inset-y-0 left-0 w-0.5 ${c.rail}`}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,a.jsx)("div",{className:`mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded ${c.icon}`,children:(0,a.jsx)(o,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-xs font-bold uppercase tracking-[0.14em] ${c.text}`,children:l?"Tailscale access expired":"Tailscale renewal due"}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-text-muted",children:[i.length," node ",1===i.length?"key needs":"keys need"," renewal within ",e.warningDays," days. Renew before tailnet access is interrupted."]}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:i.map(e=>(0,a.jsxs)("span",{title:e.tailscale?.keyExpiry?`Expires ${e.tailscale.keyExpiry}`:void 0,className:`inline-flex items-center gap-1 rounded border bg-background/40 px-2 py-0.5 font-mono text-[10px] ${c.chip}`,children:[(0,a.jsx)("span",{className:"font-semibold",children:e.name}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,a.jsx)("span",{children:e.tailscale?.expired?"expired":`${e.tailscale?.daysRemaining??"?"}d`})]},e.id))})]})]}),n&&(0,a.jsx)(s.default,{href:"/nodes#tailscale-renewal",className:`shrink-0 self-start rounded border px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider transition-colors sm:self-center ${c.action}`,children:"Review nodes"})]})]})}])},53721,e=>{"use strict";var a=e.i(43476),s=e.i(64155),r=e.i(46670),t=e.i(63646);e.s(["x",0,function({readiness:e}){return e?.status!=="not-ready"?null:(0,a.jsx)("span",{title:(0,t.K)(e),"data-testid":"upgrade-readiness-badge",children:(0,a.jsxs)(r.t,{variant:"warning",children:[(0,a.jsx)(s.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade blocked (",e.problems.length,")"]})})},"a",0,function({readiness:e}){return e?.status!=="not-ready"?null:(0,a.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-[11px]","data-testid":"upgrade-readiness-panel",children:[(0,a.jsxs)("p",{className:"flex items-center gap-2 font-bold uppercase tracking-wider text-warning",children:[(0,a.jsx)(s.f,{className:"h-3.5 w-3.5"})," This node could not take an agent upgrade now"]}),(0,a.jsx)("ul",{className:"mt-2 space-y-2",children:e.problems.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("p",{className:"font-medium text-text",children:[(0,a.jsx)("span",{className:"num",children:e.code}),": ",e.detail]}),(0,a.jsx)("p",{className:"text-text-muted",children:e.remedy})]},`${e.code}-${e.detail}`))})]})}])},46670,e=>{"use strict";var a=e.i(43476),s=e.i(78571);let r={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},t={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:i,dot:l=!1,pulse:o=!1}){return(0,a.jsxs)("span",{className:(0,s.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",r[n],i),children:[l&&(0,a.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,a.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",t[n])}),(0,a.jsx)("span",{className:(0,s.f)("relative inline-flex h-1.5 w-1.5 rounded-full",t[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{"use strict";var a=e.i(43476),s=e.i(56420);let r={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};r.node;let t=(0,s.f)(r);var n=e.i(75775),i=e.i(78571),l=e.i(3062),o=e.i(35084);let c={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},d={xs:"h-1",sm:"h-1.5",md:"h-2"};function x({value:e,max:s=100,tone:r,thresholds:t=o.q,label:n,size:l="xs",showValue:m=!1,valueLabel:u,glow:h,className:p,testId:g}){let f="number"==typeof e&&Number.isFinite(e),v=f?Math.max(0,Math.min(100,e/(s||1)*100)):0,j=r??(f?(0,o.Z)(v,t):"muted"),b=h||!r&&f&&v>=t.warn,N=u??(f?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,a.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",p),"data-testid":g,children:[(0,a.jsx)("div",{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":f?e:void 0,"aria-valuetext":N,className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,a.jsx)("div",{style:{"--meter":`${v}%`},className:(0,i.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",o.H[j],b&&c[j])})}),m&&(0,a.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",f?o.T[j]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function u({values:e,tone:s="primary",width:r=160,height:t=32,area:n=!0,max:l,percent:c=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:p,testId:g,label:f,stretch:v=!1}){let j=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,a.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",p),"data-testid":g,children:h});let b=o.v[s],N=l??(c?Math.max(100,...e):Math.max(...e,d??0)||1),w=t-4,y=r/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,_=e.map((e,a)=>[a*y,k(e)]),E=_.map(([e,a])=>`${e.toFixed(1)},${a.toFixed(1)}`).join(" "),C=_[_.length-1];return(0,a.jsxs)("svg",{width:v?"100%":r,height:t,viewBox:`0 0 ${r} ${t}`,preserveAspectRatio:v?"none":void 0,className:(0,i.f)("block overflow-visible",p),"data-testid":g,role:f?"img":void 0,"aria-label":f,"aria-hidden":!f||void 0,children:[n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:j,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,a.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,a.jsx)("polygon",{points:`0,${t} ${E} ${r},${t}`,fill:`url(#${j})`})]}),void 0!==d&&(0,a.jsx)("line",{x1:0,x2:r,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,a.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:E}),x&&!v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:C[0],cy:C[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,a.jsx)("circle",{cx:C[0],cy:C[1],r:2,fill:b})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:s,children:r,className:t,action:n,tone:i,corners:o=!1,...c}){return(0,a.jsx)(l.f,{...c,tone:i,corners:o,title:e,description:s,action:n,className:t,children:r})},"n",0,function({label:e,value:s,icon:r,trend:c,spark:d,meter:m,delta:h,tone:p="primary",className:g,testId:f}){let v=!h||h.value>=0===(h.positiveIsGood??!0);return(0,a.jsxs)(l.f,{tone:p,className:(0,i.f)("overflow-hidden",g),testId:f,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),r&&(0,a.jsx)("span",{className:"text-primary/60",children:r})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,a.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===p?"text-primary neon-text":o.T[p]),children:s}),h&&0!==h.value&&(0,a.jsxs)("span",{className:(0,i.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[h.value>0?(0,a.jsx)(n.f,{className:"h-3 w-3"}):(0,a.jsx)(t,{className:"h-3 w-3"}),Math.abs(h.value).toFixed(+!Number.isInteger(h.value)),h.unit]})]}),c&&(0,a.jsx)("div",{className:(0,i.f)("mt-1 text-[11px]",c.positive?"text-success":"text-danger"),children:c.value}),void 0!==m&&(0,a.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,a.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,a.jsx)(u,{values:d,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(35084);let t={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},i={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},l={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:o=!0,interactive:c=!0,hero:d=!1,title:x,description:m,icon:u,action:h,as:p="div",padding:g="md",testId:f,className:v,children:j,...b}){return(0,a.jsxs)(p,{...b,"data-testid":f??b["data-testid"],className:(0,s.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[g],o&&"panel-corners",o&&t[e],c&&"glow-hover",c&&n[e],c&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||h||u)&&(0,a.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[u&&(0,a.jsx)("span",{className:(0,s.f)("mt-0.5 shrink-0",r.T[e]),children:u}),(0,a.jsxs)("div",{className:"min-w-0",children:[x&&(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,a.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),h]}),j]})}])},73404,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(35084);e.s(["f",0,function({title:e,eyebrow:t,description:n,icon:i,actions:l,status:o,tone:c="primary",className:d,testId:x}){return(0,a.jsxs)("div",{"data-testid":x,className:(0,s.f)("flex flex-wrap items-end justify-between gap-4",d),children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i&&(0,a.jsx)("span",{"aria-hidden":"true",className:(0,s.f)("mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-panel border bg-surface","accent"===c?"border-accent/40 shadow-[0_0_14px_var(--color-glow-accent)]":"border-primary/40 shadow-[0_0_14px_var(--color-glow)]",r.T[c]),children:i}),(0,a.jsxs)("div",{className:"min-w-0",children:[t&&(0,a.jsxs)("p",{className:(0,s.f)("mb-1 text-[10px] font-medium uppercase tracking-[0.3em]",r.T[c],"opacity-80"),children:[(0,a.jsx)("span",{"aria-hidden":"true",children:"// "}),t]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("h1",{className:(0,s.f)("text-xl font-bold uppercase tracking-wider",r.T[c],r.z[c]),children:e}),o]}),n&&(0,a.jsx)("p",{className:"mt-1 max-w-3xl text-xs text-text-muted",children:n})]})]}),l&&(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:l})]})}])},63376,e=>{"use strict";var a=e.i(43476);e.s(["z",0,function({children:e,className:s}){return(0,a.jsx)("div",{className:`animate-page-in${s?` ${s}`:""}`,children:e})},"U",0,function({children:e,className:s}){return(0,a.jsx)("div",{className:s,children:e})}])},65369,e=>{"use strict";var a=e.i(43476),s=e.i(78571);function r({className:e}){return(0,a.jsx)("div",{"aria-hidden":"true",className:(0,s.f)("skeleton h-3 w-full",e)})}e.s(["l",0,r,"g",0,function({count:e=4,className:t}){return(0,a.jsx)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("grid gap-4 sm:grid-cols-2 lg:grid-cols-4",t),children:Array.from({length:e},(e,s)=>(0,a.jsxs)("div",{className:"panel-corners rounded-panel border border-border bg-surface p-5",children:[(0,a.jsx)(r,{className:"h-2 w-1/2"}),(0,a.jsx)(r,{className:"mt-4 h-7 w-2/3"}),(0,a.jsx)(r,{className:"mt-3 h-1 w-full opacity-60"})]},s))})},"F",0,function({rows:e=5,cols:t=4,className:n}){return(0,a.jsxs)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("overflow-hidden rounded-panel border border-border",n),children:[(0,a.jsx)("div",{className:"flex gap-4 border-b border-border bg-surface px-4 py-3",children:Array.from({length:t},(e,s)=>(0,a.jsx)(r,{className:"h-2 flex-1 opacity-60"},s))}),Array.from({length:e},(e,n)=>(0,a.jsx)("div",{className:"flex gap-4 border-b border-border/50 px-4 py-3 last:border-0",children:Array.from({length:t},(e,t)=>(0,a.jsx)(r,{className:(0,s.f)("h-3 flex-1",(n+t)%3==0&&"max-w-[60%]")},t))},n))]})},"Q",0,function({lines:e=3,className:t}){let n=["w-full","w-11/12","w-4/5","w-2/3","w-3/4"];return(0,a.jsx)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("space-y-2",t),children:Array.from({length:e},(e,s)=>(0,a.jsx)(r,{className:n[s%n.length]},s))})}])},75723,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(46670);let t={success:"bg-success shadow-[0_0_6px_var(--color-success)]",warning:"bg-warning shadow-[0_0_6px_var(--color-warning)]",danger:"bg-danger shadow-[0_0_6px_var(--color-danger)]",info:"bg-info shadow-[0_0_6px_var(--color-info)]",default:"bg-text-muted"},n={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",default:"bg-text-muted"},i=new Set(["ONLINE","RUNNING","ACTIVE","HEALTHY","CRITICAL","UPDATING","PROVISIONING"]);e.s(["f",0,function({status:e,pulse:l,size:o="sm",className:c,label:d}){let x=(0,r.k)(e),m=l??i.has(e.toUpperCase()),u="xs"===o?"h-1.5 w-1.5":"h-2 w-2";return(0,a.jsxs)("span",{className:(0,s.f)("relative inline-flex shrink-0",u,c),role:d?"img":void 0,"aria-label":d,"aria-hidden":!d||void 0,children:[m&&(0,a.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",n[x])}),(0,a.jsx)("span",{className:(0,s.f)("relative inline-flex rounded-full",u,t[x])})]})}])},71417,e=>{"use strict";e.s(["L",0,function(e){if(0===e)return"0 B";let a=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,a)).toFixed(1))} ${["B","KB","MB","GB","TB"][a]}`},"C",0,function(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}])},59439,e=>{e.v(a=>Promise.all(["static/chunks/1ixu-i6j99dj0.js"].map(a=>e.l(a))).then(()=>a(93309)))},37138,e=>{e.v(a=>Promise.all(["static/chunks/3h4dmpbixi6eo.js"].map(a=>e.l(a))).then(()=>a(99894)))},75775,e=>{"use strict";var a=e.i(56420);let s={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],75775)},57665,e=>{"use strict";var a=e.i(56420);let s={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],57665)},86207,14098,e=>{"use strict";var a=e.i(56420);let s={name:"refresh-ccw-dot",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],86207);var t=e.i(43476),n=e.i(71645),i=e.i(68759),l=e.i(32568),o=e.i(82983),c=e.i(41220),d=e.i(32781);e.s(["E",0,function({open:e,node:a,onClose:s,onSaved:r}){let[x,m]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(!0),[f,v]=(0,n.useState)(!1),[j,b]=(0,n.useState)(""),[N,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&(b(""),h(a?.role?.id??""),g(!0),w(!0),(async()=>{try{let e=await o.f.roles.list();m(e.data??[])}catch{b("Failed to load roles")}finally{w(!1)}})())},[e,a?.role?.id]);let y=async()=>{if(a){v(!0),b("");try{let e=a.role?.id;e&&e!==u&&await o.f.roles.unassign(e,{nodeIds:[a.id]}),u&&await o.f.roles.assign(u,{nodeIds:[a.id],defer:!p});let t=u?x.find(e=>e.id===u)??null:null;r(t),s()}catch(e){b(e instanceof Error?e.message:"Failed to assign role")}finally{v(!1)}}},k=async()=>{if(a?.role){v(!0),b("");try{await o.f.roles.unassign(a.role.id,{nodeIds:[a.id]}),r(null),s()}catch(e){b(e instanceof Error?e.message:"Failed to unassign role")}finally{v(!1)}}},_=()=>{b(""),v(!1),s()};return(0,t.jsx)(l.n,{open:e,onClose:_,title:a?.role?"Change Role":"Assign Role",description:a?`Node: ${a.name}`:"",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[N?(0,t.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===x.length?(0,t.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.G,{label:"Role",children:(0,t.jsxs)("select",{value:u,onChange:e=>h(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"",children:"— No role —"}),x.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),u&&(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:p,onChange:e=>g(e.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),j&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:j}),(0,t.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,t.jsx)("div",{children:a?.role&&(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:()=>void k(),disabled:f,children:"Unassign Role"})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:_,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void y(),disabled:f||!u||0===x.length,icon:f?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:f?"Saving…":a?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:e,node:a,onClose:s,onSaved:r}){let[x,m]=(0,n.useState)(""),[u,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(""),[f,v]=(0,n.useState)(!1),[j,b]=(0,n.useState)("");(0,n.useEffect)(()=>{if(a){m(a.name);try{let e=JSON.parse(a.tags);h(e.join(", "))}catch{h("")}g(a.status),b("")}},[a]);let N=async()=>{if(a&&x.trim()){v(!0),b("");try{let e=u.split(",").map(e=>e.trim()).filter(Boolean);await o.f.nodes.update(a.id,{name:x.trim(),tags:e,status:p.toUpperCase()}),r(),s()}catch(e){b(e instanceof Error?e.message:"Failed to update node")}finally{v(!1)}}},w=()=>{b(""),v(!1),s()};return(0,t.jsx)(l.n,{open:e,onClose:w,title:"Edit Node",description:a?`${a.hostname}`:"",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(l.G,{label:"Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),className:l.W})}),(0,t.jsx)(l.G,{label:"Status",children:(0,t.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,t.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,t.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,t.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,t.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),placeholder:"web, production, us-east",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),j&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:j}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void N(),disabled:f||!x.trim(),icon:f?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:f?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:e,onClose:a,onRegistered:s}){let[r,x]=(0,n.useState)(""),[m,u]=(0,n.useState)(""),[h,p]=(0,n.useState)("4100"),[g,f]=(0,n.useState)("linux"),[v,j]=(0,n.useState)("x86_64"),[b,N]=(0,n.useState)(""),[w,y]=(0,n.useState)(!1),[k,_]=(0,n.useState)(""),E=async()=>{if(r.trim()&&m.trim()){y(!0),_("");try{let e=b.split(",").map(e=>e.trim()).filter(Boolean);await o.f.nodes.register({name:r.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(h)||4100,os:g,arch:v,tags:e,agentVersion:"3.0.2"}),s(),C()}catch(e){_(e instanceof Error?e.message:"Failed to register node")}finally{y(!1)}}},C=()=>{x(""),u(""),p("4100"),f("linux"),j("x86_64"),N(""),_(""),y(!1),a()};return(0,t.jsx)(l.n,{open:e,onClose:C,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(l.G,{label:"Node Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:r,onChange:e=>x(e.target.value),placeholder:"web-server-01",className:l.W,autoFocus:!0})}),(0,t.jsx)(l.G,{label:"FQDN / Hostname",required:!0,children:(0,t.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),placeholder:"node-1.example.com",className:l.W})}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(l.G,{label:"Port",children:(0,t.jsx)("input",{type:"number",value:h,onChange:e=>p(e.target.value),className:l.W})}),(0,t.jsx)(l.G,{label:"OS",children:(0,t.jsxs)("select",{value:g,onChange:e=>f(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"linux",children:"Linux"}),(0,t.jsx)("option",{value:"darwin",children:"macOS"}),(0,t.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,t.jsx)(l.G,{label:"Architecture",children:(0,t.jsxs)("select",{value:v,onChange:e=>j(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,t.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,t.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:b,onChange:e=>N(e.target.value),placeholder:"web, production, us-east",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),k&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:k}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:C,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void E(),disabled:w||!r.trim()||!m.trim(),icon:w?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:w?"Registering…":"Register Node"})]})]})})}],14098)},83902,e=>{"use strict";var a=e.i(56420);let s={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],83902)}]);
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
`,document.head.appendChild(e)}if(t||o.current)return;let m=new a({cursorBlink:!0,scrollback:1e3,fontFamily:'"JetBrains Mono", "Fira Code", "Cascadia Code", monospace',fontSize:13,theme:{background:"#06060d",foreground:"#e0e0ec",cursor:"#00e5ff",cursorAccent:"#06060d",selectionBackground:"#00e5ff33",black:"#06060d",red:"#ff1744",green:"#00ff41",yellow:"#ffb300",blue:"#00b0ff",magenta:"#ff006e",cyan:"#00e5ff",white:"#e0e0ec",brightBlack:"#5a5a7a",brightRed:"#ff5252",brightGreen:"#69f0ae",brightYellow:"#ffd740",brightBlue:"#40c4ff",brightMagenta:"#ff4081",brightCyan:"#18ffff",brightWhite:"#ffffff"}}),f=new r;if(m.loadAddon(f),l.current=m,d.current=f,i.current&&(m.open(i.current),requestAnimationFrame(()=>{o.current||f.fit()})),t||o.current)return;let j=f.proposeDimensions(),b=j?.cols??120,y=j?.rows??30,N=n.hostname||n.ipAddress;m.write(`\x1b[38;2;138;138;171mConnecting to ${N} as ${N===n.hostname?n.hostname:n.ipAddress}...\x1b[0m\r
|
|
13
13
|
`);try{let e=await fetch("/api/terminal/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({host:N,cols:b,rows:y})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`HTTP ${e.status}`)}c.current=s=(await e.json()).sessionId}catch(s){if(t||o.current)return;let e=s instanceof Error?s.message:"Unknown error";m.write(`\r
|
|
14
14
|
\x1b[31mFailed to open session: ${e}\x1b[0m\r
|
|
15
|
-
`),x("error");return}if(t||o.current)return;x("connected");let v=new AbortController;u.current=v,(async()=>{try{let e=await fetch(`/api/terminal/stream?sessionId=${encodeURIComponent(s)}`,{signal:v.signal});if(!e.ok||!e.body){t||o.current||(m.write("\r\n\x1b[31mFailed to connect output stream\x1b[0m\r\n"),x("error"));return}let a=e.body.getReader();for(;;){let{done:e,value:s}=await a.read();if(e||t||o.current)break;s&&m.write(s)}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}t||o.current||(x("closed"),m.write("\r\n\x1b[38;2;138;138;171m── Session ended ──\x1b[0m\r\n"))})(),m.onData(e=>{!o.current&&c.current&&(p.current+=e,h.current||(h.current=setTimeout(g,16)))}),m.onResize(({cols:e,rows:t})=>{!o.current&&c.current&&fetch("/api/terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:c.current,cols:e,rows:t})}).catch(()=>{})})})();let s=()=>{d.current&&!o.current&&d.current.fit()};return window.addEventListener("resize",s),()=>{t=!0,window.removeEventListener("resize",s),f()}},[a,n,f,g]);let b=(0,s.useCallback)(()=>{f(),r()},[f,r]);return n?(0,t.jsx)(F.n,{open:a,onClose:b,title:`Terminal: ${n.name}`,description:"Interactive SSH session",icon:(0,t.jsx)(j.f,{className:"h-5 w-5 text-primary"}),className:"max-w-5xl",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{className:"absolute top-0 right-0 z-10 flex items-center gap-1.5 px-2 py-1",children:[(0,t.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${"connected"===m?"bg-success":"connecting"===m?"bg-warning animate-pulse":"error"===m?"bg-danger":"bg-text-muted"}`}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:m})]}),(0,t.jsx)("div",{ref:i,className:"h-[65vh] w-full rounded border border-border/50 bg-[#06060d] p-1 overflow-hidden"})]})}):null}var D=e.i(63376),q=e.i(67683),V=e.i(73404),L=e.i(51196),M=e.i(75723),G=e.i(2067),H=e.i(65369),J=e.i(51757);let W={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};W.node;let Y=(0,I.f)(W),Q={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};Q.node;let X=(0,I.f)(Q);var Z=e.i(83967),ee=e.i(63646);let et={pending:{label:"Queued",variant:"default"},requested:{label:"Installing",variant:"info"},watching:{label:"Watching",variant:"info"},ambiguous:{label:"Unknown",variant:"warning"},confirmed:{label:"Upgraded",variant:"success"},reverted:{label:"Reverted",variant:"danger"},failed:{label:"Failed",variant:"danger"},refused:{label:"Refused",variant:"warning"},skipped:{label:"Skipped",variant:"default"}};function es({open:e,onClose:a,onFinished:i}){let[d,c]=(0,s.useState)(null),[o,u]=(0,s.useState)(new Set),[m,x]=(0,s.useState)(null),[h,f]=(0,s.useState)(null),[j,b]=(0,s.useState)(!1),[y,N]=(0,s.useState)(null),[w,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),R=async e=>f(await (0,ee.s)(e)),E=(0,s.useCallback)(async()=>{f(null);try{let e=await l.f.agentUpgrades.eligibility();c(e),u(new Set(e.nodes.filter(e=>e.eligible).map(e=>e.nodeId))),x(e.latestRun??null)}catch(e){f(await (0,ee.s)(e))}},[]);(0,s.useEffect)(()=>{e&&(x(null),N(null),E())},[e,E]),(0,s.useEffect)(()=>{if(!m||"running"!==m.status)return;let e=window.setInterval(()=>{l.f.agentUpgrades.run(m.id).then(e=>{x(e),"running"!==e.status&&i?.()}).catch(async t=>{window.clearInterval(e),f((0,ee.c)(t)?`Upgrade run ${m.id} is no longer known to the server`:await (0,ee.s)(t)),(0,ee.c)(t)&&x(null)})},5e3);return()=>window.clearInterval(e)},[m,i]);let U=(0,s.useMemo)(()=>d?.nodes.filter(e=>e.eligible).length??0,[d]),I=d?.nodes.filter(e=>"MAJOR_VERSION"===e.code).length??0,$=d&&(!m||"running"!==m.status),A=async e=>{b(!0),f(null);try{x(await e())}catch(e){await R(e)}finally{b(!1)}},P=/^[1-9][0-9]{0,2}$/.test(C)?{maxFailures:Number(C)}:{},O=async()=>{k(!0),f(null);try{N(await l.f.agentUpgrades.check({version:d?.version,...o.size?{nodeIds:[...o]}:{}}))}catch(e){await R(e)}finally{k(!1)}},_=(e=!1)=>m&&A(()=>l.f.agentUpgrades.retry(m.id,e?{acknowledgeSuspicion:e}:{}));return(0,t.jsx)(F.n,{open:e,onClose:a,title:"Upgrade agents",icon:(0,t.jsx)(v.f,{className:"h-4 w-4"}),description:d?(0,ee.Q)(d):void 0,className:"max-h-[calc(100dvh-1.5rem)] max-w-4xl overflow-y-auto",children:(0,t.jsxs)("div",{className:"space-y-4 text-[11px]",children:[h&&(0,t.jsx)("div",{className:"rounded border border-danger/40 bg-danger/10 px-3 py-2 text-danger","data-testid":"agent-upgrade-error",children:h}),d&&!d.upgradesEnabled&&(0,t.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning",children:["Agent upgrades are off: ",d.disabledReason]}),!d&&!h&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin"})," Checking agents…"]}),m&&(0,t.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-run",children:[(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:["running"===m.status&&(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin text-primary"}),"succeeded"===m.status&&(0,t.jsx)(J.f,{className:"h-4 w-4 text-success"}),"partial"===m.status&&(0,t.jsx)(g.f,{className:"h-4 w-4 text-warning"}),("failed"===m.status||"interrupted"===m.status)&&(0,t.jsx)(Z.f,{className:"h-4 w-4 text-danger"}),"stopped"===m.status&&(0,t.jsx)(X,{className:"h-4 w-4 text-warning"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"running"===m.status?`Upgrading to ${m.version}${m.stopRequestedBy?" (stopping after the nodes in progress)":""}`:(0,ee.P)(m)})]}),"running"!==m.status&&m.message&&(0,t.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-run-message",children:m.message}),(m.warnings??[]).map(e=>(0,t.jsxs)("p",{className:"text-warning","data-testid":"agent-upgrade-warning",children:[e.name,": ",e.detail]},`${e.nodeId}-${e.code}`)),(0,t.jsxs)("details",{open:"running"===m.status,className:"group",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-text-muted",children:["running"===m.status?"Current rollout":"Previous rollout"," to ",m.version," · ",m.nodes.length," agent",1===m.nodes.length?"":"s"]}),(0,t.jsxs)("ul",{className:"mt-2 max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:[m.nodes.map(e=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("span",{className:"w-40 truncate font-medium text-text",children:[e.name,e.nodeId===(m.canaryNodeId??m.nodes[0]?.nodeId)?" (canary)":""]}),(0,t.jsxs)("span",{className:"num shrink-0 text-text-muted",children:[e.from," → ",m.version]}),(0,t.jsxs)(r.t,{variant:et[e.state]?.variant??"default",children:["requested"===e.state&&(0,t.jsx)(p.f,{className:"mr-1 inline h-3 w-3 animate-spin"}),"reverted"===e.state&&(0,t.jsx)(z.f,{className:"mr-1 inline h-3 w-3"}),et[e.state]?.label??e.state]}),(e.attempts??1)>1&&(0,t.jsxs)("span",{className:"num text-text-muted",children:["try ",e.attempts]}),(0,ee.b)(e)&&(0,t.jsx)("span",{className:"w-full break-words text-text-muted",children:(0,ee.b)(e)})]},e.nodeId)),(m.excluded??[]).map(e=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2 text-text-muted",title:e.reason,children:[(0,t.jsx)("span",{className:"w-40 truncate font-medium text-text",children:e.name}),(0,t.jsx)(r.t,{variant:"default",children:"Not included"}),(0,t.jsx)("span",{className:"w-full break-words text-text-muted",children:e.reason})]},`excluded-${e.nodeId}`))]})]}),"running"!==m.status&&(m.attention?.length??0)>0&&(0,t.jsxs)("div",{className:"space-y-2 rounded border border-warning/40 bg-warning/10 px-3 py-2","data-testid":"agent-upgrade-attention",children:[(0,t.jsx)("p",{className:"font-bold uppercase tracking-wider text-warning",children:"Needs attention"}),(0,t.jsx)("ul",{className:"max-h-48 space-y-2 overflow-y-auto",children:m.attention.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsxs)("p",{className:"font-medium text-text",children:[e.name,": ",(0,t.jsx)("span",{className:"num",children:e.code}),"release"===e.failureClass?" (points at the release)":"",e.unknownCode?" (unrecognised code)":""]}),e.detail&&(0,t.jsx)("p",{className:"text-text-muted",children:e.detail}),(0,t.jsx)("p",{className:"text-text",children:e.remedy})]},`${e.nodeId}-${e.code}`))})]})]}),y&&(0,t.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-check",children:[(0,t.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Check: ",y.eligible," ready, ",y.blocked," blocked",y.release.verified?"":`; target not verified: ${y.release.reason??"unknown"}`]}),(0,t.jsx)("ul",{className:"max-h-64 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:y.nodes.map(e=>(0,t.jsxs)("li",{className:"space-y-1 px-3 py-2",children:[(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"w-40 truncate font-medium text-text",children:e.name}),(0,t.jsx)(r.t,{variant:e.eligible?"success":e.preflight?.status==="blocked"?"danger":"default",children:e.eligible?"Ready":e.code??"Not eligible"}),(0,t.jsxs)("span",{className:"text-text-muted",children:["preflight ",e.preflight?.status??"not run"]})]}),!e.eligible&&e.reason&&(0,t.jsx)("p",{className:"text-text-muted",children:e.reason}),!e.eligible&&e.remedy&&(0,t.jsx)("p",{className:"text-text",children:e.remedy}),e.preflight?.problems.filter(t=>t.code!==e.code).map(e=>(0,t.jsxs)("p",{className:"text-text-muted",children:[(0,t.jsx)("span",{className:"num",children:e.code}),": ",e.detail,". ",(0,ee.V)(e.code)]},`${e.code}-${e.detail}`))]},e.nodeId))})]}),$&&(0,t.jsxs)("section",{className:"space-y-2","aria-label":"Current upgrade eligibility",children:[(0,t.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Target ",d.version,": ",U," ready, ",d.nodes.length-U," unavailable"]}),I>0&&(0,t.jsxs)("div",{className:"space-y-1 rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning","data-testid":"agent-upgrade-major-notice",children:[(0,t.jsxs)("p",{children:[I," agent",1===I?" requires":"s require"," a manual major-version upgrade to ",d.version,". This dialog only upgrades agents within their current major version."]}),(0,t.jsxs)("p",{children:["Read the ",(0,t.jsx)("a",{href:"https://github.com/ChefTaco/magnus/blob/main/UPGRADING.md#agents",target:"_blank",rel:"noreferrer",className:"underline",children:"agent upgrade guide"}),", then upgrade each affected node using its installation method. A successful rollout to an older version does not complete this upgrade."]})]}),0===U&&(0,t.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-empty",children:"No agents can be upgraded from this dialog right now. Review the reasons below; Check refreshes the readiness report."}),(0,t.jsxs)("ul",{className:"max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border","data-testid":"agent-upgrade-candidates",children:[d.nodes.map(e=>(0,t.jsx)("li",{className:"px-3 py-2",children:(0,t.jsxs)("label",{className:"flex items-start gap-3",children:[(0,t.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0","aria-label":`Upgrade ${e.name}`,checked:o.has(e.nodeId),disabled:!e.eligible||!d.upgradesEnabled,onChange:()=>{let t;return t=e.nodeId,u(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})}}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,t.jsx)("span",{className:"break-words font-medium text-text",children:e.name}),(0,t.jsxs)("span",{className:"num text-text-muted",children:[e.version,e.eligible?` → ${d.version}`:""]}),e.preflight&&"ok"!==e.preflight.status&&(0,t.jsxs)(r.t,{variant:"blocked"===e.preflight.status?"danger":"default",children:["preflight ",e.preflight.status]})]}),!e.eligible&&(0,t.jsx)("span",{className:"block break-words text-text-muted",children:e.reason})]})]})},e.nodeId)),0===d.nodes.length&&(0,t.jsx)("li",{className:"px-3 py-2 text-text-muted",children:"No nodes registered."})]})]}),(0,t.jsxs)("div",{className:"space-y-3 border-t border-border pt-3",children:[(0,t.jsx)("p",{className:"text-text-muted",children:"The first agent is a canary. Each agent switches back by itself if the new version does not report a heartbeat in time. Only evidence about the release stops the run: a failure on the canary, an integrity mismatch, or too many reverts. A problem of one node is recorded and the run goes on."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[$&&U>0&&(0,t.jsxs)("label",{className:"flex shrink-0 items-center gap-1 text-text-muted",title:"Reverts or failed installs that stop the run after its canary. Empty: the server's setting.",children:["Stop after",(0,t.jsx)("input",{className:"w-12 rounded border border-border bg-transparent px-1 py-0.5 text-text",inputMode:"numeric","aria-label":"Release failures that stop the run",value:C,onChange:e=>S(e.target.value),"data-testid":"agent-upgrade-max-failures"}),"failures"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:a,children:"Close"}),m?.status==="running"&&(0,t.jsx)(n.K,{variant:"danger",size:"sm",onClick:()=>void(m&&A(()=>l.f.agentUpgrades.stop(m.id))),"data-testid":"agent-upgrade-stop",disabled:j||!!m.stopRequestedBy,icon:(0,t.jsx)(X,{className:"h-3.5 w-3.5"}),children:"Stop"}),(0,ee.v)(m)&&d?.upgradesEnabled&&(0,t.jsxs)(n.K,{variant:"secondary",size:"sm",onClick:()=>void _(),"data-testid":"agent-upgrade-retry",disabled:j,icon:(0,t.jsx)(z.f,{className:"h-3.5 w-3.5"}),children:["Retry ",(0,ee.w)(m)," node",1===(0,ee.w)(m)?"":"s"]}),(0,ee.v)(m)&&d?.upgradesEnabled&&(m?.suspectedRelease||m?.excluded?.some(e=>"RETRY_HELD_SUSPECTED"===e.code))&&(0,t.jsx)(n.K,{variant:"danger",size:"sm",onClick:()=>void _(!0),"data-testid":"agent-upgrade-retry-acknowledged",disabled:j,title:"Each attempt on an older agent can strand another lease. Read the agent log first.",icon:(0,t.jsx)(z.f,{className:"h-3.5 w-3.5"}),children:"Retry older agents too"}),$&&(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void O(),"data-testid":"agent-upgrade-check-button",disabled:j||w,icon:w?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(Y,{className:"h-3.5 w-3.5"}),children:"Check"}),$&&(0,t.jsxs)(n.K,{variant:"primary",size:"sm",onClick:()=>void A(()=>l.f.agentUpgrades.start({nodeIds:[...o],version:d?.version,...d?.prerelease?{allowPrerelease:!0}:{},...P})),"data-testid":"agent-upgrade-start",disabled:j||0===o.size||!d?.upgradesEnabled,icon:j?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(v.f,{className:"h-3.5 w-3.5"}),children:["Upgrade ",o.size," agent",1===o.size?"":"s"]})]})]})]})]})})}var ea=e.i(53721);function er(e){try{let t=JSON.parse(e);if("string"==typeof t.deployError)return{label:"Deploy failed",message:t.deployError};if("string"==typeof t.upgradeError)return{label:"Upgrade failed",message:t.upgradeError};return null}catch{return null}}e.s(["default",0,function({initialNodes:e,initialTailscaleSummary:R}){let E,z,{activeNode:U}=(0,d.l)(),[I,$]=(0,s.useState)(e),[A,P]=(0,s.useState)((!!e.length||void 0===e)&&!1),[O,_]=(0,s.useState)(null),[T,F]=(0,s.useState)(!1),[J,W]=(0,s.useState)(!1);(0,s.useEffect)(()=>{"agents"===new URLSearchParams(window.location.search).get("upgrade")&&W(!0)},[]);let[Y,Q]=(0,s.useState)(null),[X,Z]=(0,s.useState)(null),[ee,et]=(0,s.useState)(!1),[en,ei]=(0,s.useState)([]),[el,ed]=(0,s.useState)(null),[ec,eo]=(0,s.useState)({}),[eu,em]=(0,s.useState)(null),[ex,ep]=(0,s.useState)(R),eh=(0,s.useRef)(null),eg=(0,s.useRef)({}),[ef,ej]=(0,s.useState)(e.length>0),eb=(0,s.useCallback)(async(e=!1)=>{try{e||P(!0),_(null);let[t,s,a]=await Promise.all([l.f.nodes.list(),l.f.nodes.systemUpdatesSummary().catch(()=>null),l.f.nodes.tailscaleSummary().catch(()=>null)]),r=t.data.map(e=>{if(e.role)return delete eg.current[e.id],e;let t=eg.current[e.id];return void 0!==t?{...e,role:t}:e});$(r),em(s?.data??null),ep(a?.data??null);let n=await Promise.all(r.map(async e=>{try{let t=await l.f.nodes.health(e.id);return[e.id,t.data]}catch{return[e.id,null]}}));eo(Object.fromEntries(n.filter(e=>null!==e[1])))}catch(a){let t=a instanceof Error?a.message:String(a),s="Failed to fetch"===t||t.includes("TypeError")||t.includes("NetworkError")||t.includes("ECONNREFUSED")||t.includes("timeout");e||_(s?`Control node unreachable (${U.name})`:t)}finally{e||P(!1)}},[U.name]);(0,s.useEffect)(()=>{if(ef){ej(!1),(async()=>{e.length>0&&eo(Object.fromEntries((await Promise.all(e.map(async e=>{try{let t=await l.f.nodes.health(e.id);return[e.id,t.data]}catch{return[e.id,null]}}))).filter(e=>null!==e[1])));try{let e=await l.f.nodes.systemUpdatesSummary();em(e.data)}catch{em(null)}try{let e=await l.f.nodes.tailscaleSummary();ep(e.data??null)}catch{ep(null)}})();return}$([]),_(null),ei([]),eo({}),em(null),ep(null),eg.current={},eb()},[U.id]),(0,s.useEffect)(()=>{let e=I.some(e=>"PROVISIONING"===e.status||e.agent?.status==="UPDATING");return e&&!eh.current?eh.current=setInterval(()=>{eb(!0)},4e3):!e&&eh.current&&(clearInterval(eh.current),eh.current=null),()=>{eh.current&&(clearInterval(eh.current),eh.current=null)}},[I,eb]);let ey=async e=>{if(confirm(`Delete node "${e.name}"? This will permanently remove it and all associated data.`))try{await l.f.nodes.delete(e.id),eb()}catch{}},eN=async()=>{et(!0),ei([]);try{let e=await l.f.discovery.scan(5e3);e.success&&Array.isArray(e.data)&&ei(e.data)}catch{}finally{et(!1)}};return(0,t.jsxs)(D.U,{className:"space-y-6",children:[(0,t.jsx)(D.z,{children:(0,t.jsx)(V.f,{title:"Nodes",eyebrow:"Fleet",description:"Manage your Magnus fleet nodes",status:I.length>0?(0,t.jsxs)("span",{className:"flex items-center gap-3 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.f,{status:"ONLINE",size:"xs"}),(0,t.jsx)("span",{className:"num",children:I.filter(e=>"ONLINE"===e.status).length})," online"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.f,{status:"OFFLINE",size:"xs",pulse:!1}),(0,t.jsx)("span",{className:"num",children:I.filter(e=>"OFFLINE"===e.status).length})," offline"]})]}):void 0,actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eb(),children:"Refresh"}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(v.f,{className:"h-3.5 w-3.5"}),onClick:()=>W(!0),"data-testid":"open-agent-upgrade",children:"Upgrade Agents"}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),onClick:()=>F(!0),children:"Register Node"})]})})}),(0,t.jsx)(D.z,{children:(0,t.jsx)(K,{})}),ex&&(0,t.jsx)(D.z,{children:(0,t.jsx)(q.f,{summary:ex,showAction:!1})}),eu&&(0,t.jsx)(D.z,{children:(0,t.jsx)("section",{className:"panel-corners overflow-hidden rounded-panel border border-border bg-surface","aria-label":"System update readiness",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-y divide-border/60 sm:grid-cols-4 sm:divide-y-0",children:[(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-3 px-4 py-3 sm:col-span-1",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-panel border border-primary/30 bg-primary/10 text-primary shadow-[0_0_10px_var(--color-glow)]",children:(0,t.jsx)(b.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Auto-update coverage"}),(0,t.jsxs)("p",{className:"num mt-0.5 text-sm font-semibold",children:[eu.enabled," / ",eu.reporting," enabled"]}),(0,t.jsx)(L.f,{className:"mt-1.5",value:eu.reporting>0?eu.enabled/eu.reporting*100:null,tone:eu.enabled===eu.reporting?"success":"warning",label:"Auto-update coverage"})]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Action needed"}),(0,t.jsx)("p",{className:`num mt-1 text-lg font-bold ${eu.actionNeeded?"text-warning glow-text-warning":"text-success"}`,children:eu.actionNeeded})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reboot debt"}),(0,t.jsxs)("p",{className:`num mt-1 flex items-center gap-1.5 text-lg font-bold ${eu.rebootRequired?"text-danger glow-text-danger":"text-success"}`,children:[eu.rebootRequired?(0,t.jsx)(y.f,{className:"h-4 w-4"}):null,eu.rebootRequired]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reporting"}),(0,t.jsxs)("p",{className:"num mt-1 text-lg font-bold",children:[eu.reporting," / ",eu.total]})]})]})})}),(0,t.jsx)(D.z,{children:(0,t.jsx)(a.N,{children:O?O.startsWith("Control node unreachable")?(0,t.jsx)(G.f,{tone:"warning",icon:(0,t.jsx)(x.f,{className:"h-5 w-5"}),title:O,description:"Cannot connect to this Control Node. Verify it is running and reachable.",action:(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void eb(),children:"Retry"})}):(0,t.jsx)(G.f,{tone:"danger",icon:(0,t.jsx)(h.f,{className:"h-5 w-5"}),title:"Error loading nodes",description:O,action:(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void eb(),children:"Retry"})}):A?(0,t.jsx)(H.F,{rows:6,cols:9,className:"border-0"}):0===I.length?(0,t.jsx)(G.f,{tone:"primary",icon:(0,t.jsx)(N.f,{className:"h-5 w-5"}),title:"No nodes registered",description:"Register your first Magnus node to get started.",action:(0,t.jsx)(n.K,{size:"sm",icon:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),onClick:()=>F(!0),children:"Register Node"})}):(0,t.jsx)("div",{className:"max-h-[70vh] overflow-auto",children:(0,t.jsxs)("table",{className:"w-full text-[11px]",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"sticky top-0 z-10 border-b border-primary/30 bg-surface/95 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted shadow-[0_1px_0_var(--color-primary),0_4px_12px_-6px_var(--color-glow)] backdrop-blur-sm",children:[(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Name"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Host"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Address"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Status"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Agent"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Role"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"CPU"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Memory"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Persistent Disk"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Updates"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Tailscale key"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Last Heartbeat"}),(0,t.jsx)("th",{className:"pb-3",children:"Actions"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:I.map(e=>{var s;let a=ec[e.id],l=(function(e){if(Array.isArray(e))return e;if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}})(a?.disks).filter(e=>"/"===e.mountPoint||"/home"===e.mountPoint||e.mountPoint.startsWith("/home/")||e.mountPoint.startsWith("/mnt/")||e.mountPoint.startsWith("/srv/")).filter(e=>!w.some(t=>e.mountPoint===t||e.mountPoint.startsWith(t))).filter(e=>!k.has((e.filesystemType??"").toLowerCase())).sort((e,t)=>t.usagePercent-e.usagePercent)[0]??null,d=l?(s=l.usagePercent)>=95?"critical":s>=80?"warning":"normal":null,c=eu?.nodes.find(t=>t.id===e.id)?.systemUpdates??null,o=ex?.nodes.find(t=>t.id===e.id)?.tailscale??null;return(0,t.jsxs)("tr",{className:"group/row relative transition-colors hover:bg-primary/[0.03] [&>td:first-child]:shadow-[inset_2px_0_0_transparent] hover:[&>td:first-child]:shadow-[inset_2px_0_0_var(--color-primary)]",children:[(0,t.jsx)("td",{className:"py-3 pl-2 pr-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(M.f,{status:e.status,size:"xs"}),"ONLINE"===e.status&&(0,t.jsx)("button",{onClick:()=>ed(e),title:`Open terminal on ${e.name}`,className:"flex h-6 w-6 items-center justify-center rounded border border-border/50 text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.default,{href:`/nodes/${e.id}`,className:"font-medium text-primary hover:text-primary-hover transition-colors",children:e.name})]})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.hostname}),(0,t.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:[e.ipAddress,":",e.port]}),(0,t.jsx)("td",{className:"py-3 pr-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(r.t,{variant:(0,r.k)(e.status),children:e.status}),("DEGRADED"===e.status||e.agent?.status==="ERROR")&&er(e.metadata)&&(0,t.jsx)("span",{title:`${er(e.metadata).label}: ${er(e.metadata).message}`,children:(0,t.jsx)(h.f,{className:"h-3.5 w-3.5 text-danger cursor-help"})}),"PROVISIONING"===e.status&&(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 text-info animate-spin"}),(0,t.jsx)(ea.x,{readiness:e.upgradeReadiness})]})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[e.agent?`v${e.agent.version}`:"—",e.agent?.status==="UPDATING"&&(0,t.jsx)(p.f,{className:"h-3 w-3 text-info animate-spin"})]})}),(0,t.jsx)("td",{className:"py-3 pr-4",children:e.role?(0,t.jsxs)("button",{className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary hover:bg-primary/10 hover:border-primary/50 transition-all cursor-pointer",onClick:()=>Z(e),title:"Change role",children:[(0,t.jsx)(f.f,{className:"h-3 w-3"}),e.role.name]}):(0,t.jsx)("button",{className:"text-[10px] text-text-muted hover:text-primary transition-colors cursor-pointer uppercase tracking-wider",onClick:()=>Z(e),children:"+ Assign"})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a?(0,t.jsx)(L.f,{value:a.cpuUsagePercent,label:`${e.name} CPU`,valueLabel:`${a.cpuUsagePercent.toFixed(1)}%`,showValue:!0,className:"w-28"}):"—"}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a?(0,t.jsxs)("div",{className:"w-36",children:[(0,t.jsx)(L.f,{value:a.memoryPercent,label:`${e.name} memory`,showValue:!0}),(0,t.jsxs)("span",{className:"num mt-0.5 block text-[10px] text-text-muted/80",children:[(a.memoryUsedBytes/0x40000000).toFixed(1)," / ",(a.memoryTotalBytes/0x40000000).toFixed(1)," GB"]})]}):"—"}),(0,t.jsx)("td",{className:"py-3 pr-4",children:l?(0,t.jsxs)("span",{className:"flex w-36 flex-col gap-0.5",title:`${l.mountPoint} filesystem is ${l.usagePercent}% used${"normal"===d?"":" — disk usage anomaly"}`,children:[(0,t.jsx)(L.f,{value:l.usagePercent,tone:"critical"===d?"danger":"warning"===d?"warning":"success",label:`${e.name} ${l.mountPoint} disk`,valueLabel:`${l.usagePercent.toFixed(0)}%`,glow:"normal"!==d,showValue:!0}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-text-muted",children:["normal"!==d&&(0,t.jsx)(g.f,{"aria-label":`${d} disk usage anomaly`,className:"critical"===d?"h-3 w-3 text-danger":"h-3 w-3 text-warning"}),l.mountPoint]})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,t.jsx)("td",{className:"py-3 pr-4",children:c?c.rebootRequired?(0,t.jsx)(r.t,{variant:"danger",children:"reboot required"}):"enabled"===c.automaticUpdates?(0,t.jsx)(r.t,{variant:"success",children:"automatic"}):"unsupported"===c.automaticUpdates?(0,t.jsx)(r.t,{variant:"default",children:"unsupported"}):(0,t.jsx)(r.t,{variant:"warning",children:"enable updates"}):(0,t.jsx)(r.t,{variant:"default",children:"awaiting agent"})}),(0,t.jsx)("td",{className:"py-3 pr-4",title:o?.keyExpiry?`Expires ${o.keyExpiry}`:void 0,children:o?o.expiryEnabled?o.expired?(0,t.jsx)(r.t,{variant:"danger",children:"expired"}):null===o.daysRemaining?(0,t.jsx)(r.t,{variant:"default",children:"unknown"}):o.requiresRenewal?(0,t.jsxs)(r.t,{variant:"warning",children:[o.daysRemaining,"d"]}):(0,t.jsxs)(r.t,{variant:"success",children:[o.daysRemaining,"d"]}):(0,t.jsx)(r.t,{variant:"success",children:"no expiry"}):(0,t.jsx)(r.t,{variant:"default",children:"awaiting agent"})}),(0,t.jsx)("td",{className:"num py-3 pr-4 text-text-muted",children:(0,i.C)(e.lastHeartbeatAt)}),(0,t.jsx)("td",{className:"py-3",children:(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(C.default,{href:`/nodes/${e.id}`,children:(0,t.jsx)(n.K,{variant:"ghost",size:"sm",children:"View"})}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>Q(e),children:(0,t.jsx)(u.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>void ey(e),children:(0,t.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})})]})})]},e.id)})})]})})})}),(0,t.jsx)(D.z,{children:(0,t.jsxs)(a.N,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x.f,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider",children:"Network Discovery"}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted",children:"— Unadopted agents found on the local network"})]}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:ee?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(x.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eN(),disabled:ee,children:ee?"Scanning…":"Scan Network"})]}),0===en.length?ee?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 py-6",children:[(0,t.jsxs)("div",{className:"relative h-16 w-16 overflow-hidden rounded-full border border-primary/30 shadow-[0_0_16px_var(--color-glow)]",children:[(0,t.jsx)("div",{className:"absolute inset-0 animate-sweep rounded-full bg-[conic-gradient(from_0deg,transparent_0deg,transparent_280deg,var(--color-primary)_360deg)] opacity-60"}),(0,t.jsx)("div",{className:"absolute inset-[30%] rounded-full border border-primary/20"})]}),(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wider text-primary",children:"Broadcasting discovery probe…"})]}):(0,t.jsx)(G.f,{compact:!0,icon:(0,t.jsx)(x.f,{className:"h-4 w-4"}),title:"No scan results yet",description:'Click "Scan Network" to discover unadopted agents on your network.'}):(E=en.filter(e=>!e.registered),z=en.filter(e=>e.registered),0===E.length?(0,t.jsxs)("div",{className:"py-6 text-center text-[11px] text-text-muted",children:["All ",z.length," discovered agent",1!==z.length?"s":""," already registered. No new nodes to adopt."]}):(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsxs)("table",{className:"w-full text-[11px]",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-primary/20 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted",children:[(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Hostname"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"IP Address"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Port"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Agent Version"}),(0,t.jsx)("th",{className:"pb-3",children:"Registration"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:E.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-surface-hover transition-colors",children:[(0,t.jsx)("td",{className:"py-3 pr-4 font-medium",children:e.fqdn||e.hostname}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.ip}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.port}),(0,t.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:["v",e.version]}),(0,t.jsx)("td",{className:"py-3 text-text-muted",children:"Use the reviewed key-only agent deploy runbook, then register the authenticated heartbeat."})]},`${e.ip}:${e.port}`))})]}),z.length>0&&(0,t.jsxs)("p",{className:"mt-3 text-xs text-text-muted",children:[z.length," already-registered agent",1!==z.length?"s":""," ","hidden from this list."]})]}))]})}),(0,t.jsx)(es,{open:J,onClose:()=>W(!1),onFinished:()=>void eb()}),(0,t.jsx)(S.M,{open:T,onClose:()=>F(!1),onRegistered:()=>void eb()}),(0,t.jsx)(S.F,{open:!!Y,node:Y,onClose:()=>Q(null),onSaved:()=>void eb()}),(0,t.jsx)(S.E,{open:!!X,node:X,onClose:()=>Z(null),onSaved:e=>{X&&(eg.current[X.id]=e,$(t=>t.map(t=>t.id===X.id?{...t,role:e}:t))),eb()}}),(0,t.jsx)(B,{open:!!el,onClose:()=>ed(null),node:el})]})}],86421)}]);
|
|
15
|
+
`),x("error");return}if(t||o.current)return;x("connected");let v=new AbortController;u.current=v,(async()=>{try{let e=await fetch(`/api/terminal/stream?sessionId=${encodeURIComponent(s)}`,{signal:v.signal});if(!e.ok||!e.body){t||o.current||(m.write("\r\n\x1b[31mFailed to connect output stream\x1b[0m\r\n"),x("error"));return}let a=e.body.getReader();for(;;){let{done:e,value:s}=await a.read();if(e||t||o.current)break;s&&m.write(s)}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}t||o.current||(x("closed"),m.write("\r\n\x1b[38;2;138;138;171m── Session ended ──\x1b[0m\r\n"))})(),m.onData(e=>{!o.current&&c.current&&(p.current+=e,h.current||(h.current=setTimeout(g,16)))}),m.onResize(({cols:e,rows:t})=>{!o.current&&c.current&&fetch("/api/terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:c.current,cols:e,rows:t})}).catch(()=>{})})})();let s=()=>{d.current&&!o.current&&d.current.fit()};return window.addEventListener("resize",s),()=>{t=!0,window.removeEventListener("resize",s),f()}},[a,n,f,g]);let b=(0,s.useCallback)(()=>{f(),r()},[f,r]);return n?(0,t.jsx)(F.n,{open:a,onClose:b,title:`Terminal: ${n.name}`,description:"Interactive SSH session",icon:(0,t.jsx)(j.f,{className:"h-5 w-5 text-primary"}),className:"max-w-5xl",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{className:"absolute top-0 right-0 z-10 flex items-center gap-1.5 px-2 py-1",children:[(0,t.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${"connected"===m?"bg-success":"connecting"===m?"bg-warning animate-pulse":"error"===m?"bg-danger":"bg-text-muted"}`}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:m})]}),(0,t.jsx)("div",{ref:i,className:"h-[65vh] w-full rounded border border-border/50 bg-[#06060d] p-1 overflow-hidden"})]})}):null}var D=e.i(63376),q=e.i(67683),V=e.i(73404),L=e.i(51196),M=e.i(75723),G=e.i(2067),H=e.i(65369),J=e.i(51757);let W={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};W.node;let Y=(0,I.f)(W),Q={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};Q.node;let X=(0,I.f)(Q);var Z=e.i(83967),ee=e.i(63646);let et={pending:{label:"Queued",variant:"default"},requested:{label:"Installing",variant:"info"},watching:{label:"Watching",variant:"info"},ambiguous:{label:"Unknown",variant:"warning"},confirmed:{label:"Upgraded",variant:"success"},reverted:{label:"Reverted",variant:"danger"},failed:{label:"Failed",variant:"danger"},refused:{label:"Refused",variant:"warning"},skipped:{label:"Skipped",variant:"default"}};function es({open:e,onClose:a,onFinished:i}){let[d,c]=(0,s.useState)(null),[o,u]=(0,s.useState)(new Set),[m,x]=(0,s.useState)(null),[h,f]=(0,s.useState)(null),[j,b]=(0,s.useState)(!1),[y,N]=(0,s.useState)(null),[w,k]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),R=async e=>f(await (0,ee.s)(e)),E=(0,s.useCallback)(async()=>{f(null);try{let e=await l.f.agentUpgrades.eligibility();c(e),u(new Set(e.nodes.filter(e=>e.eligible).map(e=>e.nodeId))),x(e.latestRun??null)}catch(e){f(await (0,ee.s)(e))}},[]);(0,s.useEffect)(()=>{e&&(x(null),N(null),E())},[e,E]),(0,s.useEffect)(()=>{if(!m||"running"!==m.status)return;let e=window.setInterval(()=>{l.f.agentUpgrades.run(m.id).then(e=>{x(e),"running"!==e.status&&i?.()}).catch(async t=>{window.clearInterval(e),f((0,ee.c)(t)?`Upgrade run ${m.id} is no longer known to the server`:await (0,ee.s)(t)),(0,ee.c)(t)&&x(null)})},5e3);return()=>window.clearInterval(e)},[m,i]);let U=(0,s.useMemo)(()=>d?.nodes.filter(e=>e.eligible).length??0,[d]),I=d?.nodes.filter(e=>"MAJOR_VERSION"===e.code).length??0,$=d&&(!m||"running"!==m.status),A=async e=>{b(!0),f(null);try{x(await e())}catch(e){await R(e)}finally{b(!1)}},P=/^[1-9][0-9]{0,2}$/.test(C)?{maxFailures:Number(C)}:{},O=async()=>{k(!0),f(null);try{N(await l.f.agentUpgrades.check({version:d?.version,...o.size?{nodeIds:[...o]}:{}}))}catch(e){await R(e)}finally{k(!1)}},_=(e=!1)=>m&&A(()=>l.f.agentUpgrades.retry(m.id,e?{acknowledgeSuspicion:e}:{}));return(0,t.jsx)(F.n,{open:e,onClose:a,title:"Upgrade agents",icon:(0,t.jsx)(v.f,{className:"h-4 w-4"}),description:d?(0,ee.Q)(d):void 0,className:"max-h-[calc(100dvh-1.5rem)] max-w-4xl overflow-y-auto",children:(0,t.jsxs)("div",{className:"space-y-4 text-[11px]",children:[h&&(0,t.jsx)("div",{className:"rounded border border-danger/40 bg-danger/10 px-3 py-2 text-danger","data-testid":"agent-upgrade-error",children:h}),d&&!d.upgradesEnabled&&(0,t.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning",children:["Agent upgrades are off: ",d.disabledReason]}),!d&&!h&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin"})," Checking agents…"]}),m&&(0,t.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-run",children:[(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:["running"===m.status&&(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin text-primary"}),"succeeded"===m.status&&(0,t.jsx)(J.f,{className:"h-4 w-4 text-success"}),"partial"===m.status&&(0,t.jsx)(g.f,{className:"h-4 w-4 text-warning"}),("failed"===m.status||"interrupted"===m.status)&&(0,t.jsx)(Z.f,{className:"h-4 w-4 text-danger"}),"stopped"===m.status&&(0,t.jsx)(X,{className:"h-4 w-4 text-warning"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"running"===m.status?`Upgrading to ${m.version}${m.stopRequestedBy?" (stopping after the nodes in progress)":""}`:(0,ee.P)(m)})]}),"running"!==m.status&&m.message&&(0,t.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-run-message",children:m.message}),(m.warnings??[]).map(e=>(0,t.jsxs)("p",{className:"text-warning","data-testid":"agent-upgrade-warning",children:[e.name,": ",e.detail]},`${e.nodeId}-${e.code}`)),(0,t.jsxs)("details",{open:"running"===m.status,className:"group",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-text-muted",children:["running"===m.status?"Current rollout":"Previous rollout"," to ",m.version," · ",m.nodes.length," agent",1===m.nodes.length?"":"s"]}),(0,t.jsxs)("ul",{className:"mt-2 max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:[m.nodes.map(e=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("span",{className:"w-40 truncate font-medium text-text",children:[e.name,e.nodeId===(m.canaryNodeId??m.nodes[0]?.nodeId)?" (canary)":""]}),(0,t.jsxs)("span",{className:"num shrink-0 text-text-muted",children:[e.from," → ",m.version]}),(0,t.jsxs)(r.t,{variant:et[e.state]?.variant??"default",children:["requested"===e.state&&(0,t.jsx)(p.f,{className:"mr-1 inline h-3 w-3 animate-spin"}),"reverted"===e.state&&(0,t.jsx)(z.f,{className:"mr-1 inline h-3 w-3"}),et[e.state]?.label??e.state]}),(e.attempts??1)>1&&(0,t.jsxs)("span",{className:"num text-text-muted",children:["try ",e.attempts]}),(0,ee.b)(e)&&(0,t.jsx)("span",{className:"w-full break-words text-text-muted",children:(0,ee.b)(e)})]},e.nodeId)),(m.excluded??[]).map(e=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2 text-text-muted",title:e.reason,children:[(0,t.jsx)("span",{className:"w-40 truncate font-medium text-text",children:e.name}),(0,t.jsx)(r.t,{variant:"default",children:"Not included"}),(0,t.jsx)("span",{className:"w-full break-words text-text-muted",children:e.reason})]},`excluded-${e.nodeId}`))]})]}),"running"!==m.status&&(m.attention?.length??0)>0&&(0,t.jsxs)("div",{className:"space-y-2 rounded border border-warning/40 bg-warning/10 px-3 py-2","data-testid":"agent-upgrade-attention",children:[(0,t.jsx)("p",{className:"font-bold uppercase tracking-wider text-warning",children:"Needs attention"}),(0,t.jsx)("ul",{className:"max-h-48 space-y-2 overflow-y-auto",children:m.attention.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsxs)("p",{className:"font-medium text-text",children:[e.name,": ",(0,t.jsx)("span",{className:"num",children:e.code}),"release"===e.failureClass?" (points at the release)":"",e.unknownCode?" (unrecognised code)":""]}),e.detail&&(0,t.jsx)("p",{className:"text-text-muted",children:e.detail}),(0,t.jsx)("p",{className:"text-text",children:e.remedy})]},`${e.nodeId}-${e.code}`))})]})]}),y&&(0,t.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-check",children:[(0,t.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Check: ",y.eligible," ready, ",y.blocked," blocked",y.release.verified?"":`; target not verified: ${y.release.reason??"unknown"}`]}),(0,t.jsx)("ul",{className:"max-h-64 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:y.nodes.map(e=>(0,t.jsxs)("li",{className:"space-y-1 px-3 py-2",children:[(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"w-40 truncate font-medium text-text",children:e.name}),(0,t.jsx)(r.t,{variant:e.eligible?"success":e.preflight?.status==="blocked"?"danger":"default",children:e.eligible?"Ready":e.code??"Not eligible"}),(0,t.jsxs)("span",{className:"text-text-muted",children:["preflight ",e.preflight?.status??"not run"]})]}),!e.eligible&&e.reason&&(0,t.jsx)("p",{className:"text-text-muted",children:e.reason}),!e.eligible&&e.remedy&&(0,t.jsx)("p",{className:"text-text",children:e.remedy}),e.preflight?.problems.filter(t=>t.code!==e.code).map(e=>(0,t.jsxs)("p",{className:"text-text-muted",children:[(0,t.jsx)("span",{className:"num",children:e.code}),": ",e.detail,". ",(0,ee.V)(e.code)]},`${e.code}-${e.detail}`))]},e.nodeId))})]}),$&&(0,t.jsxs)("section",{className:"space-y-2","aria-label":"Current upgrade eligibility",children:[(0,t.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Target ",d.version,": ",U," ready, ",d.nodes.length-U," unavailable"]}),I>0&&(0,t.jsxs)("div",{className:"space-y-1 rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning","data-testid":"agent-upgrade-major-notice",children:[(0,t.jsxs)("p",{children:[I," agent",1===I?" requires":"s require"," a manual major-version upgrade to ",d.version,". This dialog only upgrades agents within their current major version."]}),(0,t.jsxs)("p",{children:["Read the ",(0,t.jsx)("a",{href:"https://github.com/ChefTaco/magnus/blob/main/docs/NODE_CREDENTIALS.md#moving-agents-across-a-major-version",target:"_blank",rel:"noreferrer",className:"underline",children:"cross-major procedure"}),": from the server host, ",(0,t.jsxs)("code",{children:["magnus-server agents upgrade --to ",d.version," --allow-major"]})," moves keyed agents of 2.10.3 or later with a server-signed authorization; older agents take 2.10.3 first. A successful rollout to an older version does not complete this upgrade."]})]}),0===U&&(0,t.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-empty",children:"No agents can be upgraded from this dialog right now. Review the reasons below; Check refreshes the readiness report."}),(0,t.jsxs)("ul",{className:"max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border","data-testid":"agent-upgrade-candidates",children:[d.nodes.map(e=>(0,t.jsx)("li",{className:"px-3 py-2",children:(0,t.jsxs)("label",{className:"flex items-start gap-3",children:[(0,t.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0","aria-label":`Upgrade ${e.name}`,checked:o.has(e.nodeId),disabled:!e.eligible||!d.upgradesEnabled,onChange:()=>{let t;return t=e.nodeId,u(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})}}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,t.jsx)("span",{className:"break-words font-medium text-text",children:e.name}),(0,t.jsxs)("span",{className:"num text-text-muted",children:[e.version,e.eligible?` → ${d.version}`:""]}),e.preflight&&"ok"!==e.preflight.status&&(0,t.jsxs)(r.t,{variant:"blocked"===e.preflight.status?"danger":"default",children:["preflight ",e.preflight.status]})]}),!e.eligible&&(0,t.jsx)("span",{className:"block break-words text-text-muted",children:e.reason})]})]})},e.nodeId)),0===d.nodes.length&&(0,t.jsx)("li",{className:"px-3 py-2 text-text-muted",children:"No nodes registered."})]})]}),(0,t.jsxs)("div",{className:"space-y-3 border-t border-border pt-3",children:[(0,t.jsx)("p",{className:"text-text-muted",children:"The first agent is a canary. Each agent switches back by itself if the new version does not report a heartbeat in time. Only evidence about the release stops the run: a failure on the canary, an integrity mismatch, or too many reverts. A problem of one node is recorded and the run goes on."}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[$&&U>0&&(0,t.jsxs)("label",{className:"flex shrink-0 items-center gap-1 text-text-muted",title:"Reverts or failed installs that stop the run after its canary. Empty: the server's setting.",children:["Stop after",(0,t.jsx)("input",{className:"w-12 rounded border border-border bg-transparent px-1 py-0.5 text-text",inputMode:"numeric","aria-label":"Release failures that stop the run",value:C,onChange:e=>S(e.target.value),"data-testid":"agent-upgrade-max-failures"}),"failures"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:a,children:"Close"}),m?.status==="running"&&(0,t.jsx)(n.K,{variant:"danger",size:"sm",onClick:()=>void(m&&A(()=>l.f.agentUpgrades.stop(m.id))),"data-testid":"agent-upgrade-stop",disabled:j||!!m.stopRequestedBy,icon:(0,t.jsx)(X,{className:"h-3.5 w-3.5"}),children:"Stop"}),(0,ee.v)(m)&&d?.upgradesEnabled&&(0,t.jsxs)(n.K,{variant:"secondary",size:"sm",onClick:()=>void _(),"data-testid":"agent-upgrade-retry",disabled:j,icon:(0,t.jsx)(z.f,{className:"h-3.5 w-3.5"}),children:["Retry ",(0,ee.w)(m)," node",1===(0,ee.w)(m)?"":"s"]}),(0,ee.v)(m)&&d?.upgradesEnabled&&(m?.suspectedRelease||m?.excluded?.some(e=>"RETRY_HELD_SUSPECTED"===e.code))&&(0,t.jsx)(n.K,{variant:"danger",size:"sm",onClick:()=>void _(!0),"data-testid":"agent-upgrade-retry-acknowledged",disabled:j,title:"Each attempt on an older agent can strand another lease. Read the agent log first.",icon:(0,t.jsx)(z.f,{className:"h-3.5 w-3.5"}),children:"Retry older agents too"}),$&&(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void O(),"data-testid":"agent-upgrade-check-button",disabled:j||w,icon:w?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(Y,{className:"h-3.5 w-3.5"}),children:"Check"}),$&&(0,t.jsxs)(n.K,{variant:"primary",size:"sm",onClick:()=>void A(()=>l.f.agentUpgrades.start({nodeIds:[...o],version:d?.version,...d?.prerelease?{allowPrerelease:!0}:{},...P})),"data-testid":"agent-upgrade-start",disabled:j||0===o.size||!d?.upgradesEnabled,icon:j?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(v.f,{className:"h-3.5 w-3.5"}),children:["Upgrade ",o.size," agent",1===o.size?"":"s"]})]})]})]})]})})}var ea=e.i(53721);function er(e){try{let t=JSON.parse(e);if("string"==typeof t.deployError)return{label:"Deploy failed",message:t.deployError};if("string"==typeof t.upgradeError)return{label:"Upgrade failed",message:t.upgradeError};return null}catch{return null}}e.s(["default",0,function({initialNodes:e,initialTailscaleSummary:R}){let E,z,{activeNode:U}=(0,d.l)(),[I,$]=(0,s.useState)(e),[A,P]=(0,s.useState)((!!e.length||void 0===e)&&!1),[O,_]=(0,s.useState)(null),[T,F]=(0,s.useState)(!1),[J,W]=(0,s.useState)(!1);(0,s.useEffect)(()=>{"agents"===new URLSearchParams(window.location.search).get("upgrade")&&W(!0)},[]);let[Y,Q]=(0,s.useState)(null),[X,Z]=(0,s.useState)(null),[ee,et]=(0,s.useState)(!1),[en,ei]=(0,s.useState)([]),[el,ed]=(0,s.useState)(null),[ec,eo]=(0,s.useState)({}),[eu,em]=(0,s.useState)(null),[ex,ep]=(0,s.useState)(R),eh=(0,s.useRef)(null),eg=(0,s.useRef)({}),[ef,ej]=(0,s.useState)(e.length>0),eb=(0,s.useCallback)(async(e=!1)=>{try{e||P(!0),_(null);let[t,s,a]=await Promise.all([l.f.nodes.list(),l.f.nodes.systemUpdatesSummary().catch(()=>null),l.f.nodes.tailscaleSummary().catch(()=>null)]),r=t.data.map(e=>{if(e.role)return delete eg.current[e.id],e;let t=eg.current[e.id];return void 0!==t?{...e,role:t}:e});$(r),em(s?.data??null),ep(a?.data??null);let n=await Promise.all(r.map(async e=>{try{let t=await l.f.nodes.health(e.id);return[e.id,t.data]}catch{return[e.id,null]}}));eo(Object.fromEntries(n.filter(e=>null!==e[1])))}catch(a){let t=a instanceof Error?a.message:String(a),s="Failed to fetch"===t||t.includes("TypeError")||t.includes("NetworkError")||t.includes("ECONNREFUSED")||t.includes("timeout");e||_(s?`Control node unreachable (${U.name})`:t)}finally{e||P(!1)}},[U.name]);(0,s.useEffect)(()=>{if(ef){ej(!1),(async()=>{e.length>0&&eo(Object.fromEntries((await Promise.all(e.map(async e=>{try{let t=await l.f.nodes.health(e.id);return[e.id,t.data]}catch{return[e.id,null]}}))).filter(e=>null!==e[1])));try{let e=await l.f.nodes.systemUpdatesSummary();em(e.data)}catch{em(null)}try{let e=await l.f.nodes.tailscaleSummary();ep(e.data??null)}catch{ep(null)}})();return}$([]),_(null),ei([]),eo({}),em(null),ep(null),eg.current={},eb()},[U.id]),(0,s.useEffect)(()=>{let e=I.some(e=>"PROVISIONING"===e.status||e.agent?.status==="UPDATING");return e&&!eh.current?eh.current=setInterval(()=>{eb(!0)},4e3):!e&&eh.current&&(clearInterval(eh.current),eh.current=null),()=>{eh.current&&(clearInterval(eh.current),eh.current=null)}},[I,eb]);let ey=async e=>{if(confirm(`Delete node "${e.name}"? This will permanently remove it and all associated data.`))try{await l.f.nodes.delete(e.id),eb()}catch{}},eN=async()=>{et(!0),ei([]);try{let e=await l.f.discovery.scan(5e3);e.success&&Array.isArray(e.data)&&ei(e.data)}catch{}finally{et(!1)}};return(0,t.jsxs)(D.U,{className:"space-y-6",children:[(0,t.jsx)(D.z,{children:(0,t.jsx)(V.f,{title:"Nodes",eyebrow:"Fleet",description:"Manage your Magnus fleet nodes",status:I.length>0?(0,t.jsxs)("span",{className:"flex items-center gap-3 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.f,{status:"ONLINE",size:"xs"}),(0,t.jsx)("span",{className:"num",children:I.filter(e=>"ONLINE"===e.status).length})," online"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.f,{status:"OFFLINE",size:"xs",pulse:!1}),(0,t.jsx)("span",{className:"num",children:I.filter(e=>"OFFLINE"===e.status).length})," offline"]})]}):void 0,actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eb(),children:"Refresh"}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(v.f,{className:"h-3.5 w-3.5"}),onClick:()=>W(!0),"data-testid":"open-agent-upgrade",children:"Upgrade Agents"}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),onClick:()=>F(!0),children:"Register Node"})]})})}),(0,t.jsx)(D.z,{children:(0,t.jsx)(K,{})}),ex&&(0,t.jsx)(D.z,{children:(0,t.jsx)(q.f,{summary:ex,showAction:!1})}),eu&&(0,t.jsx)(D.z,{children:(0,t.jsx)("section",{className:"panel-corners overflow-hidden rounded-panel border border-border bg-surface","aria-label":"System update readiness",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-y divide-border/60 sm:grid-cols-4 sm:divide-y-0",children:[(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-3 px-4 py-3 sm:col-span-1",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-panel border border-primary/30 bg-primary/10 text-primary shadow-[0_0_10px_var(--color-glow)]",children:(0,t.jsx)(b.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Auto-update coverage"}),(0,t.jsxs)("p",{className:"num mt-0.5 text-sm font-semibold",children:[eu.enabled," / ",eu.reporting," enabled"]}),(0,t.jsx)(L.f,{className:"mt-1.5",value:eu.reporting>0?eu.enabled/eu.reporting*100:null,tone:eu.enabled===eu.reporting?"success":"warning",label:"Auto-update coverage"})]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Action needed"}),(0,t.jsx)("p",{className:`num mt-1 text-lg font-bold ${eu.actionNeeded?"text-warning glow-text-warning":"text-success"}`,children:eu.actionNeeded})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reboot debt"}),(0,t.jsxs)("p",{className:`num mt-1 flex items-center gap-1.5 text-lg font-bold ${eu.rebootRequired?"text-danger glow-text-danger":"text-success"}`,children:[eu.rebootRequired?(0,t.jsx)(y.f,{className:"h-4 w-4"}):null,eu.rebootRequired]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reporting"}),(0,t.jsxs)("p",{className:"num mt-1 text-lg font-bold",children:[eu.reporting," / ",eu.total]})]})]})})}),(0,t.jsx)(D.z,{children:(0,t.jsx)(a.N,{children:O?O.startsWith("Control node unreachable")?(0,t.jsx)(G.f,{tone:"warning",icon:(0,t.jsx)(x.f,{className:"h-5 w-5"}),title:O,description:"Cannot connect to this Control Node. Verify it is running and reachable.",action:(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void eb(),children:"Retry"})}):(0,t.jsx)(G.f,{tone:"danger",icon:(0,t.jsx)(h.f,{className:"h-5 w-5"}),title:"Error loading nodes",description:O,action:(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void eb(),children:"Retry"})}):A?(0,t.jsx)(H.F,{rows:6,cols:9,className:"border-0"}):0===I.length?(0,t.jsx)(G.f,{tone:"primary",icon:(0,t.jsx)(N.f,{className:"h-5 w-5"}),title:"No nodes registered",description:"Register your first Magnus node to get started.",action:(0,t.jsx)(n.K,{size:"sm",icon:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),onClick:()=>F(!0),children:"Register Node"})}):(0,t.jsx)("div",{className:"max-h-[70vh] overflow-auto",children:(0,t.jsxs)("table",{className:"w-full text-[11px]",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"sticky top-0 z-10 border-b border-primary/30 bg-surface/95 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted shadow-[0_1px_0_var(--color-primary),0_4px_12px_-6px_var(--color-glow)] backdrop-blur-sm",children:[(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Name"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Host"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Address"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Status"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Agent"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Role"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"CPU"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Memory"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Persistent Disk"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Updates"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Tailscale key"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Last Heartbeat"}),(0,t.jsx)("th",{className:"pb-3",children:"Actions"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:I.map(e=>{var s;let a=ec[e.id],l=(function(e){if(Array.isArray(e))return e;if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}})(a?.disks).filter(e=>"/"===e.mountPoint||"/home"===e.mountPoint||e.mountPoint.startsWith("/home/")||e.mountPoint.startsWith("/mnt/")||e.mountPoint.startsWith("/srv/")).filter(e=>!w.some(t=>e.mountPoint===t||e.mountPoint.startsWith(t))).filter(e=>!k.has((e.filesystemType??"").toLowerCase())).sort((e,t)=>t.usagePercent-e.usagePercent)[0]??null,d=l?(s=l.usagePercent)>=95?"critical":s>=80?"warning":"normal":null,c=eu?.nodes.find(t=>t.id===e.id)?.systemUpdates??null,o=ex?.nodes.find(t=>t.id===e.id)?.tailscale??null;return(0,t.jsxs)("tr",{className:"group/row relative transition-colors hover:bg-primary/[0.03] [&>td:first-child]:shadow-[inset_2px_0_0_transparent] hover:[&>td:first-child]:shadow-[inset_2px_0_0_var(--color-primary)]",children:[(0,t.jsx)("td",{className:"py-3 pl-2 pr-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(M.f,{status:e.status,size:"xs"}),"ONLINE"===e.status&&(0,t.jsx)("button",{onClick:()=>ed(e),title:`Open terminal on ${e.name}`,className:"flex h-6 w-6 items-center justify-center rounded border border-border/50 text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.default,{href:`/nodes/${e.id}`,className:"font-medium text-primary hover:text-primary-hover transition-colors",children:e.name})]})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.hostname}),(0,t.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:[e.ipAddress,":",e.port]}),(0,t.jsx)("td",{className:"py-3 pr-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(r.t,{variant:(0,r.k)(e.status),children:e.status}),("DEGRADED"===e.status||e.agent?.status==="ERROR")&&er(e.metadata)&&(0,t.jsx)("span",{title:`${er(e.metadata).label}: ${er(e.metadata).message}`,children:(0,t.jsx)(h.f,{className:"h-3.5 w-3.5 text-danger cursor-help"})}),"PROVISIONING"===e.status&&(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 text-info animate-spin"}),(0,t.jsx)(ea.x,{readiness:e.upgradeReadiness})]})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[e.agent?`v${e.agent.version}`:"—",e.agent?.status==="UPDATING"&&(0,t.jsx)(p.f,{className:"h-3 w-3 text-info animate-spin"})]})}),(0,t.jsx)("td",{className:"py-3 pr-4",children:e.role?(0,t.jsxs)("button",{className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary hover:bg-primary/10 hover:border-primary/50 transition-all cursor-pointer",onClick:()=>Z(e),title:"Change role",children:[(0,t.jsx)(f.f,{className:"h-3 w-3"}),e.role.name]}):(0,t.jsx)("button",{className:"text-[10px] text-text-muted hover:text-primary transition-colors cursor-pointer uppercase tracking-wider",onClick:()=>Z(e),children:"+ Assign"})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a?(0,t.jsx)(L.f,{value:a.cpuUsagePercent,label:`${e.name} CPU`,valueLabel:`${a.cpuUsagePercent.toFixed(1)}%`,showValue:!0,className:"w-28"}):"—"}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a?(0,t.jsxs)("div",{className:"w-36",children:[(0,t.jsx)(L.f,{value:a.memoryPercent,label:`${e.name} memory`,showValue:!0}),(0,t.jsxs)("span",{className:"num mt-0.5 block text-[10px] text-text-muted/80",children:[(a.memoryUsedBytes/0x40000000).toFixed(1)," / ",(a.memoryTotalBytes/0x40000000).toFixed(1)," GB"]})]}):"—"}),(0,t.jsx)("td",{className:"py-3 pr-4",children:l?(0,t.jsxs)("span",{className:"flex w-36 flex-col gap-0.5",title:`${l.mountPoint} filesystem is ${l.usagePercent}% used${"normal"===d?"":" — disk usage anomaly"}`,children:[(0,t.jsx)(L.f,{value:l.usagePercent,tone:"critical"===d?"danger":"warning"===d?"warning":"success",label:`${e.name} ${l.mountPoint} disk`,valueLabel:`${l.usagePercent.toFixed(0)}%`,glow:"normal"!==d,showValue:!0}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-text-muted",children:["normal"!==d&&(0,t.jsx)(g.f,{"aria-label":`${d} disk usage anomaly`,className:"critical"===d?"h-3 w-3 text-danger":"h-3 w-3 text-warning"}),l.mountPoint]})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,t.jsx)("td",{className:"py-3 pr-4",children:c?c.rebootRequired?(0,t.jsx)(r.t,{variant:"danger",children:"reboot required"}):"enabled"===c.automaticUpdates?(0,t.jsx)(r.t,{variant:"success",children:"automatic"}):"unsupported"===c.automaticUpdates?(0,t.jsx)(r.t,{variant:"default",children:"unsupported"}):(0,t.jsx)(r.t,{variant:"warning",children:"enable updates"}):(0,t.jsx)(r.t,{variant:"default",children:"awaiting agent"})}),(0,t.jsx)("td",{className:"py-3 pr-4",title:o?.keyExpiry?`Expires ${o.keyExpiry}`:void 0,children:o?o.expiryEnabled?o.expired?(0,t.jsx)(r.t,{variant:"danger",children:"expired"}):null===o.daysRemaining?(0,t.jsx)(r.t,{variant:"default",children:"unknown"}):o.requiresRenewal?(0,t.jsxs)(r.t,{variant:"warning",children:[o.daysRemaining,"d"]}):(0,t.jsxs)(r.t,{variant:"success",children:[o.daysRemaining,"d"]}):(0,t.jsx)(r.t,{variant:"success",children:"no expiry"}):(0,t.jsx)(r.t,{variant:"default",children:"awaiting agent"})}),(0,t.jsx)("td",{className:"num py-3 pr-4 text-text-muted",children:(0,i.C)(e.lastHeartbeatAt)}),(0,t.jsx)("td",{className:"py-3",children:(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(C.default,{href:`/nodes/${e.id}`,children:(0,t.jsx)(n.K,{variant:"ghost",size:"sm",children:"View"})}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>Q(e),children:(0,t.jsx)(u.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>void ey(e),children:(0,t.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})})]})})]},e.id)})})]})})})}),(0,t.jsx)(D.z,{children:(0,t.jsxs)(a.N,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x.f,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider",children:"Network Discovery"}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted",children:"— Unadopted agents found on the local network"})]}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:ee?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(x.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eN(),disabled:ee,children:ee?"Scanning…":"Scan Network"})]}),0===en.length?ee?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 py-6",children:[(0,t.jsxs)("div",{className:"relative h-16 w-16 overflow-hidden rounded-full border border-primary/30 shadow-[0_0_16px_var(--color-glow)]",children:[(0,t.jsx)("div",{className:"absolute inset-0 animate-sweep rounded-full bg-[conic-gradient(from_0deg,transparent_0deg,transparent_280deg,var(--color-primary)_360deg)] opacity-60"}),(0,t.jsx)("div",{className:"absolute inset-[30%] rounded-full border border-primary/20"})]}),(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wider text-primary",children:"Broadcasting discovery probe…"})]}):(0,t.jsx)(G.f,{compact:!0,icon:(0,t.jsx)(x.f,{className:"h-4 w-4"}),title:"No scan results yet",description:'Click "Scan Network" to discover unadopted agents on your network.'}):(E=en.filter(e=>!e.registered),z=en.filter(e=>e.registered),0===E.length?(0,t.jsxs)("div",{className:"py-6 text-center text-[11px] text-text-muted",children:["All ",z.length," discovered agent",1!==z.length?"s":""," already registered. No new nodes to adopt."]}):(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsxs)("table",{className:"w-full text-[11px]",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-primary/20 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted",children:[(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Hostname"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"IP Address"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Port"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Agent Version"}),(0,t.jsx)("th",{className:"pb-3",children:"Registration"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:E.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-surface-hover transition-colors",children:[(0,t.jsx)("td",{className:"py-3 pr-4 font-medium",children:e.fqdn||e.hostname}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.ip}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.port}),(0,t.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:["v",e.version]}),(0,t.jsx)("td",{className:"py-3 text-text-muted",children:"Use the reviewed key-only agent deploy runbook, then register the authenticated heartbeat."})]},`${e.ip}:${e.port}`))})]}),z.length>0&&(0,t.jsxs)("p",{className:"mt-3 text-xs text-text-muted",children:[z.length," already-registered agent",1!==z.length?"s":""," ","hidden from this list."]})]}))]})}),(0,t.jsx)(es,{open:J,onClose:()=>W(!1),onFinished:()=>void eb()}),(0,t.jsx)(S.M,{open:T,onClose:()=>F(!1),onRegistered:()=>void eb()}),(0,t.jsx)(S.F,{open:!!Y,node:Y,onClose:()=>Q(null),onSaved:()=>void eb()}),(0,t.jsx)(S.E,{open:!!X,node:X,onClose:()=>Z(null),onSaved:e=>{X&&(eg.current[X.id]=e,$(t=>t.map(t=>t.id===X.id?{...t,role:e}:t))),eb()}}),(0,t.jsx)(B,{open:!!el,onClose:()=>ed(null),node:el})]})}],86421)}]);
|