@hivemagnus/magnus-ui 2.3.2 → 2.3.4
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/auth/hive/callback/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/login/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/me/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/close/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/input/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/resize/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/stream/route.js.nft.json +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 +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 +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/1q96_modules_lucide-react_dist_esm_icons_shield-exclamation-point_mjs_1tkr7n-tgo96-._.js +3 -0
- 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/{[root-of-the-server]__0wsvm9s-rtmzo._.js → [root-of-the-server]__1puyk1oobvatz._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0hkl39n6k8s99._.js → [root-of-the-server]__1qgn9450v696_._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{_1ircn2sooizal._.js → _0_1zoskz6tg4y._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0sfwhwcsjtppm._.js +3 -0
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{_0f89fican-_s9._.js → _11ouppxul_ebs._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1ml_bvfb1fitq._.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/_20ln5i8p8muqj._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_anomalies_page_tsx_1oqqex9du4yhn._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_codex_page_tsx_113aas0vmxegr._.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_dashboard-client_tsx_0o_8papeie86c._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_fleet-readiness_page_tsx_129clnb6oplu7._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_governor_operations_page_tsx_1tvdkgil8mlgk._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_mission-control_page_tsx_0crgxncex_u3w._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_[nodeId]_page_tsx_1q7fqu18oklzc._.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_orchestra_web-gateway_page_tsx_1fz12np0wk27t._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_roles_roles-client_tsx_1ivvp_kqt5io0._.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_components_nodes_tailscale-expiry-alert_tsx_1ll2-i32ej6c2._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_1w0trtqcl9-wn._.js +3 -0
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{node_modules_@xterm_1aplmmrj23vvx._.js → node_modules_@xterm_120daugm414or._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1z36d7pdfx5zy._.js +3 -0
- 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/{0diifaom2d_cn.js → 07uou-f2ig2z3.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/0c34_gunccud3.css +2 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{3wlr0q6eslb1s.js → 0ibqtgsjczdnv.js} +2 -2
- package/dist/app/apps/dashboard/.next/static/chunks/{0jd62jw1t6xu7.js → 0lday6tat45ag.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1uj8oezn_z82c.js → 1kjl44-64ume7.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{2h6o1ta-xcjtp.js → 215cfit1tgz2o.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{2a69e_72vy07_.js → 23o8zfgrdxuhk.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{16c5-2kp51fpp.js → 2_wq3vs7ksij9.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{028ezuxrvvye_.js → 2lk4ailve7631.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{3153ier_x5pc9.js → 2lulmsr2vjuw5.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{2qb_oa0x7ddra.js → 2m2mtcd712njt.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{0s7_jk-g-mgvd.js → 2z81u6bbdg2cn.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{20pxbw2tl9z3c.js → 323du6s7y2l-o.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{2p26kwyyzgqph.js → 37pb0l96d03rk.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3gd78w81m3ouh.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{2p-sasidykf0f.js → 3qq-otw-t-6b0.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1hcdglofzkp3n.js → 3y_9v_-9n_gex.js} +1 -1
- package/dist/app/apps/dashboard/package.json +8 -8
- package/dist/app/apps/dashboard/server.js +1 -1
- package/package.json +8 -8
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0wh_e2bpxcaf4._.js +0 -3
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_138fu3pss1hww._.js +0 -3
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1wnnq70cs49fi._.js +0 -3
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_shield-alert_mjs_171qztcjn79hl._.js +0 -3
- package/dist/app/apps/dashboard/.next/static/chunks/0fy1-ohtdf-xm.css +0 -2
- package/dist/app/apps/dashboard/.next/static/chunks/11d-a975loj77.js +0 -1
- /package/dist/app/apps/dashboard/.next/static/{6eytCNzYv1-SVfKHYgOWN → 87A-2Gig81uwP9pLfHdYV}/_buildManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{6eytCNzYv1-SVfKHYgOWN → 87A-2Gig81uwP9pLfHdYV}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{6eytCNzYv1-SVfKHYgOWN → 87A-2Gig81uwP9pLfHdYV}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5525,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(93999),r=e.i(3062),i=e.i(54149),l=e.i(51196),d=e.i(75723),c=e.i(2067),o=e.i(65369),m=e.i(56420);let x={name:"chart-line",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],aliases:["line-chart"]};x.node;let u=(0,m.f)(x);var p=e.i(82983),h=e.i(78571),g=e.i(21176);let f=["1h","6h","24h"];function j({nodeId:e,height:a=180}){let[n,r]=(0,s.useState)("1h"),[i,l]=(0,s.useState)(null),[d,o]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=!1;o(!1);let s=async()=>{try{let[s,a]=await Promise.all([p.f.get(`nodes/${e}/health/timeseries?metric=cpu&period=${n}`),p.f.get(`nodes/${e}/health/timeseries?metric=memory&period=${n}`)]);if(t)return;let r=s.data??{timestamps:[],values:[]},i=a.data??{timestamps:[],values:[]},d=new Map;r.timestamps.forEach((e,t)=>{let s=Date.parse(e);d.set(s,{t:s,cpu:r.values[t]??null,mem:null})}),i.timestamps.forEach((e,t)=>{let s=Date.parse(e),a=d.get(s)??{t:s,cpu:null,mem:null};a.mem=i.values[t]??null,d.set(s,a)}),l([...d.values()].sort((e,t)=>e.t-t.t))}catch{t||(l([]),o(!0))}};s();let a=setInterval(()=>void s(),6e4);return()=>{t=!0,clearInterval(a)}},[e,n]),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col","data-testid":"node-metrics-chart",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-text-muted",children:"CPU / memory history"}),(0,t.jsx)("div",{role:"group","aria-label":"History period",className:"flex rounded-chip border border-border bg-bg p-0.5",children:f.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>r(e),"aria-pressed":n===e,className:(0,h.f)("rounded-chip px-2 py-0.5 text-[10px] uppercase tracking-wider transition-colors",n===e?"bg-primary/15 text-primary shadow-[0_0_8px_var(--color-glow)]":"text-text-muted hover:text-text"),children:e},e))})]}),null===i?(0,t.jsx)("div",{className:"skeleton w-full",style:{height:a}}):i.length<2?(0,t.jsx)(c.f,{compact:!0,icon:(0,t.jsx)(u,{className:"h-4 w-4"}),title:d?"History unavailable":"Not enough samples yet",description:d?"The health timeseries endpoint did not answer.":`No health snapshots in the last ${n}.`,tone:d?"warning":"muted",className:"flex-1"}):(0,t.jsx)(g.f,{data:i,xKey:"t",percent:!0,height:a,formatX:e=>new Date(Number(e)).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),series:[{key:"cpu",label:"CPU",tone:"primary"},{key:"mem",label:"Memory",tone:"accent"}]})]})}var N=e.i(95925);let v={name:"shield-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]};v.node;let y=(0,m.f)(v);var b=e.i(46670);function w({metadata:e}){let s=function(e){let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return}return t?.agentSelfUpgrade}(e);return s?s.upgrade?.state==="reverted"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," reverted"]})}):s.upgrade?.state==="failed"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," failed"]})}):s.enabled?null:(0,t.jsx)("span",{title:s.reason??void 0,"data-testid":"agent-self-upgrade-off",children:(0,t.jsxs)(b.t,{variant:"default",children:[(0,t.jsx)(y,{className:"mr-1 inline h-3 w-3"}),"Self-upgrade off"]})}):null}var k=e.i(53721),S=e.i(57108),$=e.i(68759),C=e.i(32568),A=e.i(71417),P=e.i(15281),U=e.i(59659),I=e.i(9347),_=e.i(25398),E=e.i(99847),M=e.i(32781),R=e.i(82022),D=e.i(84026),F=e.i(71567),O=e.i(94371),L=e.i(20851),z=e.i(66595);let T={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};T.node;let H=(0,m.f)(T);var B=e.i(86207),q=e.i(57665),K=e.i(41220),G=e.i(14098),J=e.i(4139),V=e.i(41120),W=e.i(82954),Q=e.i(79432),Z=e.i(62368),X=e.i(53138),Y=e.i(51757),ee=e.i(83967),et=e.i(74544);let es=[{id:"apt-update",label:"apt update",command:"sudo",args:["apt","update"],icon:(0,t.jsx)(Z.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:120},{id:"apt-upgrade",label:"apt upgrade",command:"sudo",args:["apt","upgrade","-y"],icon:(0,t.jsx)(V.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will upgrade all packages on the node. Continue?",timeoutSeconds:300},{id:"magnus-status",label:"magnus status",command:"systemctl",args:["status","magnus-agent","--no-pager"],icon:(0,t.jsx)(Q.f,{className:"h-3.5 w-3.5"}),variant:"primary",timeoutSeconds:15},{id:"magnus-update",label:"magnus update",command:"sudo",args:["systemctl","restart","magnus-agent"],icon:(0,t.jsx)(W.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will restart the Magnus agent. Continue?",timeoutSeconds:30},{id:"dmesg",label:"dmesg",command:"sudo",args:["dmesg","--time-format=reltime","-T"],icon:(0,t.jsx)(X.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:15},{id:"reboot",label:"Reboot",command:"sudo",args:["reboot"],icon:(0,t.jsx)(q.f,{className:"h-3.5 w-3.5"}),variant:"danger",confirm:"Are you sure you want to REBOOT this node? It will go offline temporarily.",timeoutSeconds:10}];function ea({nodeId:e,nodeStatus:a}){let[n,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(null),[x,u]=(0,s.useState)(null),h="ONLINE"!==a,g=async t=>{if(!t.confirm||confirm(t.confirm)){c(t),m(null),u(null),l(!0),r(!0);try{let s=await p.f.quickCommand.exec(e,{command:t.command,args:t.args,timeoutSeconds:t.timeoutSeconds});m(s.data)}catch(e){u(e instanceof Error?e.message:"Command execution failed")}finally{l(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"rounded border border-border bg-surface p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted mr-2",children:[(0,t.jsx)(J.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"Quick Commands"})]}),es.map(e=>(0,t.jsx)($.K,{variant:e.variant,size:"sm",icon:e.icon,disabled:h,onClick:()=>void g(e),children:e.label},e.id)),h&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:"Node must be ONLINE to run commands"})]})}),(0,t.jsx)(C.n,{open:n,onClose:()=>r(!1),title:d?.label??"Command",description:d?`${d.command} ${(d.args??[]).join(" ")}`:void 0,icon:(0,t.jsx)(J.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.f,{className:"h-4 w-4 animate-spin text-primary"}),(0,t.jsx)("span",{className:"text-xs text-primary",children:"Executing…"})]}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsx)("span",{className:"text-xs text-danger",children:"Error"})]}):o?(0,t.jsxs)(t.Fragment,{children:[0===o.exitCode?(0,t.jsx)(Y.f,{className:"h-4 w-4 text-success"}):(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsxs)("span",{className:`text-xs ${0===o.exitCode?"text-success":"text-danger"}`,children:["Exit code: ",o.exitCode]}),(0,t.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1 ml-auto",children:[(0,t.jsx)(et.f,{className:"h-3 w-3"}),(o.durationMs/1e3).toFixed(2),"s"]})]}):null}),x&&(0,t.jsx)("div",{className:"rounded bg-danger/10 border border-danger/30 p-3",children:(0,t.jsx)("p",{className:"text-xs text-danger",children:x})}),o&&(0,t.jsxs)("div",{className:"space-y-3",children:[o.stdout&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stdout"}),(0,t.jsx)("pre",{className:"max-h-80 overflow-auto rounded bg-bg border border-border p-3 text-xs text-success whitespace-pre-wrap",children:o.stdout})]}),o.stderr&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stderr"}),(0,t.jsx)("pre",{className:"max-h-40 overflow-auto rounded bg-bg border border-danger/20 p-3 text-xs text-danger whitespace-pre-wrap",children:o.stderr})]}),!o.stdout&&!o.stderr&&(0,t.jsx)("p",{className:"text-xs text-text-muted italic",children:"No output captured"}),o.truncated&&(0,t.jsx)("p",{className:"text-xs text-warning",children:"⚠ Output was truncated (exceeded 1MB)"})]}),i&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(M.f,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-2"}),(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Executing command on remote node…"})]})}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Close"})})]})})]})}var en=e.i(55427),er=e.i(28623);let ei={workhorse:{name:"Workhorse",emoji:"🐴",description:"Steady, reliable, never complains.",accent:"success"},"drama-queen":{name:"Drama Queen",emoji:"🎭",description:"High variance, loves spiking CPU for attention.",accent:"warning"},"zen-master":{name:"Zen Master",emoji:"🧘",description:"Low usage, mind always clear, never stressed.",accent:"info"},sprinter:{name:"Sprinter",emoji:"⚡",description:"Bursts of intense activity followed by calm recovery.",accent:"info"},groundhog:{name:"Groundhog",emoji:"🌀",description:"Keeps rebooting — might see its own shadow again.",accent:"warning"},ghost:{name:"Ghost",emoji:"👻",description:"Often unreachable. Is it even there?",accent:"danger"},marathoner:{name:"Marathoner",emoji:"🏃",description:"Long uptime, steady pace, built to last.",accent:"success"},rookie:{name:"Rookie",emoji:"🌱",description:"Not enough history yet — still finding its rhythm.",accent:"default"}};function el(e){return 0===e.length?0:e.reduce((e,t)=>e+t,0)/e.length}function ed({node:e}){let[a,r]=(0,s.useState)([]),[i,l]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(0);(0,s.useEffect)(()=>{let t=!1;return(async()=>{l(!0),c(null);try{let s=await p.f.get(`nodes/${e.id}/health/history?limit=100`);if(t)return;let a=s.data,n=[];Array.isArray(a)?n=a:a?.items&&(n=a.items),r([...n].reverse())}catch(e){t||(r([]),c(e instanceof Error?e.message:"Failed to load history"))}finally{t||l(!1)}})(),()=>{t=!0}},[e.id,o]);let x=(0,s.useMemo)(()=>{let t,s,n,r,i,l,d,c,o;return t=a.map(e=>e.cpuUsagePercent).filter(e=>Number.isFinite(e)),s=a.map(e=>e.memoryPercent).filter(e=>Number.isFinite(e)),n=el(t),r=function(e){if(e.length<2)return 0;let t=el(e);return Math.sqrt(e.reduce((e,s)=>e+(s-t)*(s-t),0)/(e.length-1))}(t),i=el(s),l=t.filter(e=>e>80).length,d="rookie",c=ei[d="OFFLINE"===e.status||e.lastHeartbeatAt&&Date.now()-new Date(e.lastHeartbeatAt).getTime()>6e5?"ghost":a.length<3?"rookie":r>25||l/Math.max(1,t.length)>.25?l/Math.max(1,t.length)>.4?"drama-queen":"sprinter":n<15&&r<10?"zen-master":n>40&&n<75&&r<15?"workhorse":n<40&&r<15&&a.length>20?"marathoner":"workhorse"]??ei.rookie??{name:"Rookie",emoji:"🌱",description:"",accent:"default"},o=function(e,t,s){var a;let n,r=Math.floor(Date.now()/6048e5);for(let t=0;t<e.id.length;t++)r=31*r+e.id.charCodeAt(t)|0;let i={workhorse:[`Steady as they come — averaging ${s.cpuAvg.toFixed(0)}% CPU without a single complaint this week.`,`The dependable one. ${e.hostname} just keeps grinding through the workload.`,`Quietly productive at ~${s.cpuAvg.toFixed(0)}% CPU. Gets the job done and asks for nothing.`],"drama-queen":[`Lives for the spotlight — ${s.spikes} CPU spikes this week and counting.`,`${e.hostname} likes to keep things interesting with a \xb1${s.cpuSD.toFixed(0)}% swing.`,"A connoisseur of chaos. Never a dull moment with this one."],"zen-master":[`Practices minimalism. Barely breaks a sweat at ${s.cpuAvg.toFixed(0)}% CPU.`,`${e.hostname} is in its happy place — calm, cool, collected.`,"Achieving enlightenment one idle cycle at a time."],sprinter:[`Bursts of energy, then recovery. ${s.spikes} sprints logged this week.`,`${e.hostname} runs hot, then cools down. Classic sprinter cadence.`,"Lives in intervals — full throttle, then full zen."],groundhog:["Déjà vu all over again. Might want to check the uptime.",`${e.hostname} keeps hitting the reset button.`],ghost:["Hasn't been seen in a while. Anyone home?",`${e.hostname} is currently out of contact. Check the heartbeat.`],marathoner:[`In it for the long haul — ${s.samples} data points of pure consistency.`,`${e.hostname} doesn't sprint. It endures.`],rookie:["Still new around here — gathering experience.",`${e.hostname} is just getting started. Check back soon.`]};return n=Math.abs(r)%(a=i[t.name.toLowerCase().replace(" ","-")]??i.rookie??["…"]).length,a[n]}(e,c,{cpuAvg:n,cpuSD:r,memAvg:i,samples:t.length,spikes:l}),{archetype:c,archetypeKey:d,bio:o,stats:{cpuAvg:n,cpuStdDev:r,memAvg:i,samples:t.length,spikes:l}}},[e,a]),u=a.map(e=>e.cpuUsagePercent).slice(-40),h=a.map(e=>e.memoryPercent).slice(-40);return(0,t.jsx)(n.N,{title:"Personality",action:(0,t.jsx)("button",{onClick:()=>m(e=>e+1),className:"text-text-muted hover:text-text transition p-1",title:"Refresh personality","data-testid":"node-personality-refresh",children:(0,t.jsx)(V.f,{className:"h-3.5 w-3.5"})}),children:(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"node-personality-card","data-archetype":x.archetypeKey,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-accent/40 bg-bg text-2xl shadow-[0_0_16px_var(--color-glow-accent)]","aria-hidden":"true",children:x.archetype.emoji}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{"data-testid":"node-archetype-badge",children:(0,t.jsx)(b.t,{variant:x.archetype.accent,children:x.archetype.name})}),i&&(0,t.jsx)("span",{className:"text-xs text-text-muted italic",children:"analyzing…"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:x.archetype.description})]})]}),(0,t.jsx)(er.f,{className:"h-4 w-4 text-accent mt-1"})]}),(0,t.jsxs)("blockquote",{className:"border-l-2 border-accent/40 pl-3 text-sm italic text-text","data-testid":"node-personality-bio",children:["“",x.bio,"”"]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t border-border/30",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"CPU trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.cpuAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:u,tone:"primary",percent:!0,stretch:!0,threshold:80,testId:"node-personality-cpu-sparkline",label:`CPU trend, average ${x.stats.cpuAvg.toFixed(0)}%`})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"Memory trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.memAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:h,tone:"accent",percent:!0,stretch:!0,threshold:80,testId:"node-personality-mem-sparkline",label:`Memory trend, average ${x.stats.memAvg.toFixed(0)}%`})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-[11px] text-text-muted",children:[(0,t.jsxs)("span",{children:[x.stats.samples," samples"]}),(0,t.jsxs)("span",{children:["σ ",x.stats.cpuStdDev.toFixed(1),"%"]}),(0,t.jsxs)("span",{children:[x.stats.spikes," spikes"]}),d&&(0,t.jsxs)("span",{className:"text-warning",children:["· ",d]})]})]})})}let ec={name:"fan",size:24,node:[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]]};ec.node;let eo=(0,m.f)(ec);var em=e.i(71028);let ex={name:"thermometer",size:24,node:[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]};ex.node;let eu=(0,m.f)(ex);function ep(e,t){let s=e.map(e=>({timestamp:new Date(e.sampledAt).getTime(),value:t(e)})).filter(e=>null!==e.value);if(0===s.length)return"";let a=s[0].timestamp,n=Math.max(1,s.at(-1).timestamp-a);return s.map(({timestamp:e,value:t})=>{let s=104-.88*Math.max(0,Math.min(100,t));return`${((e-a)/n*600).toFixed(1)},${s.toFixed(1)}`}).join(" ")}function eh(e,t="%"){return null===e?"not reported":`${e.toFixed(1)}${t}`}function eg({telemetry:e}){let s=e?.latest??null,a=s?.devices??[],r=ep(e?.history??[],e=>e.maxUtilizationPercent),i=ep(e?.history??[],e=>e.maxFanPercent);return(0,t.jsx)(n.N,{title:"GPU telemetry",description:"30-second load and cooling history",action:s?(0,t.jsxs)(b.t,{variant:"default",children:["sampled ",(0,A.C)(s.sampledAt)]}):void 0,children:s&&0!==a.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:a.map(e=>(0,t.jsxs)("div",{className:"rounded-panel border border-border/70 bg-surface-raised/60 p-3 transition-colors hover:border-primary/30",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-text",children:e.name}),(0,t.jsxs)("p",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:[e.vendor," · gpu ",e.index]})]}),100===e.fanPercent&&(0,t.jsx)(b.t,{variant:"danger",children:"fan saturated"})]}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(em.f,{className:"h-3 w-3"}),"Load"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-primary",children:eh(e.utilizationPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eo,{className:"h-3 w-3"}),"Fan"]}),(0,t.jsx)("dd",{className:`mt-1 num text-sm ${100===e.fanPercent?"text-danger glow-text-danger":"text-warning"}`,children:eh(e.fanPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eu,{className:"h-3 w-3"}),"Temp"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-text",children:eh(e.temperatureCelsius,"°C")})]})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsx)(l.f,{value:e.utilizationPercent,tone:"primary",label:`${e.name} load`}),(0,t.jsx)(l.f,{value:e.fanPercent,thresholds:{warn:80,crit:100},label:`${e.name} fan`})]})]},`${e.vendor}-${e.uuid??e.index}`))}),(0,t.jsxs)("div",{className:"panel-corners rounded-panel border border-border/70 bg-bg/60 p-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-text-muted",children:"Host maximum · last 24 hours"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-primary shadow-[0_0_4px_var(--color-primary)]"}),"load"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-warning"}),"fan"]})]})]}),(0,t.jsxs)("svg",{viewBox:"0 0 600 112",className:"h-28 w-full",role:"img","aria-label":"GPU load and fan percentage over the last 24 hours",children:[(0,t.jsx)("line",{x1:"0",y1:"16",x2:"600",y2:"16",stroke:"var(--color-danger)",strokeOpacity:"0.45",strokeDasharray:"5 5"}),(0,t.jsx)("line",{x1:"0",y1:"60",x2:"600",y2:"60",stroke:"currentColor",strokeOpacity:"0.12"}),(0,t.jsx)("line",{x1:"0",y1:"104",x2:"600",y2:"104",stroke:"currentColor",strokeOpacity:"0.2"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gpu-load-fill",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"var(--color-primary)",stopOpacity:"0.35"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"var(--color-primary)",stopOpacity:"0"})]})}),r&&(0,t.jsx)("polygon",{points:`0,104 ${r} 600,104`,fill:"url(#gpu-load-fill)"}),r&&(0,t.jsx)("polyline",{points:r,fill:"none",stroke:"var(--color-primary)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),i&&(0,t.jsx)("polyline",{points:i,fill:"none",stroke:"var(--color-warning)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})]}),(0,t.jsxs)("div",{className:"mt-1 flex justify-between num text-[9px] text-text-muted",children:[(0,t.jsx)("span",{children:"24h ago"}),(0,t.jsx)("span",{children:"100% saturation line"}),(0,t.jsx)("span",{children:"now"})]})]})]}):(0,t.jsx)("div",{className:"rounded-panel border border-dashed border-border px-4 py-6 text-center text-xs text-text-muted",children:s?.status==="error"?"The GPU probe did not complete. Magnus will retry on the next heartbeat.":"No supported NVIDIA or AMD GPU was detected in the latest sample."})})}function ef(e){if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e??[]}function ej(e){if(!e)return[];if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e}function eN(e){return!!(e&&"not_installed"!==e.status)}function ev(e){let t=e.status.toLowerCase();return t.includes("enabled")&&!t.includes("not enabled")&&!t.includes("disabled")}function ey(e,t){let s=e.filter(ev).find(e=>{let s=`${e.slug} ${e.pluginType} ${e.metadata?.description??""}`.toLowerCase();return"search"===t?/\b(search|web)\b/.test(s):/\b(crawl|browser|firecrawl|browserbase|browser-use)\b/.test(s)});return s?`${s.slug}${s.version?` ${s.version}`:""}`:"none enabled"}e.s(["default",0,function(){var e,m;let x,u,h,g=(0,a.useParams)(),f=(0,a.useRouter)(),[N,v]=(0,s.useState)(null),[y,T]=(0,s.useState)(null),[J,V]=(0,s.useState)([]),[W,Q]=(0,s.useState)(null),[Z,X]=(0,s.useState)(!0),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(!1),[en,er]=(0,s.useState)([]),[ei,el]=(0,s.useState)({}),[ec,eo]=(0,s.useState)(null),[em,ex]=(0,s.useState)(!1),[eu,ep]=(0,s.useState)(null),[eh,ev]=(0,s.useState)(null),[eb,ew]=(0,s.useState)(null),[ek,eS]=(0,s.useState)(!1),[e$,eC]=(0,s.useState)(null),[eA,eP]=(0,s.useState)(!1),[eU,eI]=(0,s.useState)(!1),[e_,eE]=(0,s.useState)(null),[eM,eR]=(0,s.useState)(!1),[eD,eF]=(0,s.useState)(null),[eO,eL]=(0,s.useState)(null),[ez,eT]=(0,s.useState)(!1),eH=(0,s.useRef)(null),eB=(0,s.useRef)(void 0),eq=(0,s.useCallback)(async(e=!1)=>{try{e||X(!0);let[t,s,a,n,r]=await Promise.all([p.f.nodes.get(g.nodeId),p.f.nodes.health(g.nodeId).catch(()=>null),p.f.nodes.forecast(g.nodeId).catch(()=>null),p.f.hermes.installations().catch(()=>null),p.f.nodes.gpu(g.nodeId).catch(()=>null)]),i=t.data;i.role||void 0===eB.current?i.role&&(eB.current=i.role):i.role=eB.current,v(i),s&&T(s.data),V(a?.data?.forecasts??[]),Q(r?.data??null);let l=n?.data??[];eo(l.find(e=>e.nodeId===i.id)??l.find(e=>e.hostname===i.hostname||e.hostname===i.ipAddress)??null);try{let e=await p.f.roles.applications.list({nodeId:g.nodeId});er(e.data??[])}catch{}}catch{}finally{e||X(!1)}},[g.nodeId]);(0,s.useEffect)(()=>{eq()},[eq]);let eK=async()=>{if(N&&confirm(`Deploy Hermes Agent to "${N.name}"?`)){eR(!0),eF(null),eL(null);try{let e,t=await p.f.hermes.deploy({nodeId:N.id,hermesHome:"~/.hermes",hermesBin:"hermes",installMethod:"official-script",dashboardPort:9119,enableDashboard:!0,enableDashboardTui:!0,startGateway:!0},(e="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),`hermes-node-deploy-${Date.now()}-${e}`));eF(`Hermes Agent deployment started. Job ${t.data?.id.slice(0,10)}...`),eq(!0)}catch(e){eL(e instanceof Error?e.message:"Hermes Agent deployment failed")}finally{eR(!1)}}};(0,s.useEffect)(()=>{let e=N?.status==="PROVISIONING"||N?.agent?.status==="UPDATING"||!!(eD&&!eN(ec));return e&&!eH.current?eH.current=setInterval(()=>{eq(!0)},4e3):!e&&eH.current&&(clearInterval(eH.current),eH.current=null),()=>{eH.current&&(clearInterval(eH.current),eH.current=null)}},[N?.status,N?.agent?.status,N?.agent?.version,eq,eD,ec]);let eG=async()=>{if(N&&confirm(`Delete node "${N.name}"? This will permanently remove it and all associated data.`))try{await p.f.nodes.delete(N.id),f.push("/nodes")}catch{}},eJ=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){ex(!0),ep(null);try{let e='version_or_na() { local cmd="$1"; shift; if command -v "$cmd" >/dev/null 2>&1; then ("$@" 2>/dev/null || "$cmd" --version 2>/dev/null || "$cmd" -v 2>/dev/null || echo "unknown") | head -n 1; else echo "not installed"; fi; }; echo "node=$(version_or_na node node --version)"; echo "npm=$(version_or_na npm npm --version)"; echo "python3=$(version_or_na python3 python3 --version)"; echo "redis=$(version_or_na redis-cli redis-cli --version)"; echo "docker=$(version_or_na docker docker --version)"; echo "tailscale=$(version_or_na tailscale tailscale version)"; agent_manifest=/opt/magnus-agent/node_modules/@hivemagnus/magnus-agent/package.json; [ -f "$agent_manifest" ] || agent_manifest=/opt/magnus-agent/package.json; if [ -f "$agent_manifest" ]; then echo "magnus-agent=$(node -e \'process.stdout.write(require(process.argv[1]).version)\' "$agent_manifest" 2>/dev/null || echo unknown)"; else echo "magnus-agent=not installed"; fi'.replace(/'/g,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:60})).data.stdout??"").trim(),s=Object.fromEntries(t.split("\n").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let[t,...s]=e.split("=");return[t,s.join("=").trim()||"unknown"]}));el(s)}catch(e){ep(e instanceof Error?e.message:"Failed to load software revisions")}finally{ex(!1)}}},[N?.id,N?.status]),eV=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){eS(!0),eC(null);try{let e="set -euo pipefail; (sudo apt-get update -qq || apt-get update -qq) >/dev/null 2>&1; apt list --upgradable 2>/dev/null | sed '1d' | sed '/^Listing/d' | wc -l".replace(/'/g,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:180})).data.stdout??"").trim(),s=Number.parseInt(t.split("\n").at(-1)??"",10);ev(Number.isFinite(s)?s:null),ew(new Date().toISOString())}catch(e){eC(e instanceof Error?e.message:"Failed to refresh apt updates")}finally{eS(!1)}}},[N?.id,N?.status]),eW=async()=>{if(N&&confirm(`Run apt upgrade on "${N.name}"?`)){eP(!0);try{let e=`apt-upgrade-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,t=(await p.f.commands.dispatch({nodeIds:[N.id],command:"sudo",args:["apt","upgrade","-y"],timeoutSeconds:1800,idempotencyKey:e},e)).data,s=t.commands?.[0]?.id;alert(s?`APT Upgrade dispatched (command ${s.slice(0,12)}…). Check Commands for progress.`:"APT Upgrade dispatched. Check Commands for progress."),await eV()}catch(e){alert(`APT Upgrade failed to dispatch: ${e instanceof Error?e.message:String(e)}`)}finally{eP(!1)}}},eQ=async()=>{if(N&&confirm(`Enable unattended apt update and apt upgrade on "${N.name}"? Magnus will install unattended-upgrades and enable the apt timers.`)){eI(!0),eE(null);try{await p.f.nodes.enableSystemUpdates(N.id),await eq(!0)}catch(e){eE(e instanceof Error?e.message:"Failed to enable automatic updates")}finally{eI(!1)}}};if((0,s.useEffect)(()=>{eJ(),eV()},[eJ,eV]),(0,s.useEffect)(()=>{if(!N||"ONLINE"!==N.status)return;let e=setInterval(()=>{eV()},36e5);return()=>clearInterval(e)},[N,eV]),Z)return(0,t.jsxs)("div",{className:"space-y-6","aria-busy":"true",children:[(0,t.jsx)("div",{className:"skeleton h-56 w-full rounded-panel opacity-70"}),(0,t.jsx)(o.g,{}),(0,t.jsx)("span",{className:"sr-only",children:"Loading node details…"})]});if(!N)return(0,t.jsx)(c.f,{tone:"accent",icon:(0,t.jsx)(K.f,{className:"h-5 w-5"}),title:"Node not found",description:"It may have been decommissioned or belong to another control node.",action:(0,t.jsx)($.K,{variant:"secondary",size:"sm",onClick:()=>f.push("/nodes"),children:"Back to nodes"}),className:"mt-12"});let eZ=eN(ec)?Array.isArray(ec.rawStatus?.skills)?ec.rawStatus.skills:[]:[],eX=eN(ec)?Array.isArray(ec.rawStatus?.plugins)?ec.rawStatus.plugins:[]:[],eY=eZ.filter(e=>e.enabled),e0=ec?.configuration?.modelProvider??"unknown",e1=ec?.configuration?.modelName??"unknown",e2=ey(eX,"search"),e3=ey(eX,"crawl"),e5=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.installed||!["active","inactive","failed","not_installed","unknown"].includes(t.serviceStatus)||!["enabled","disabled","static","unknown"].includes(t.enabled)||null!==t.version&&"string"!=typeof t.version||!Array.isArray(t.managerAddresses))return null;return t}catch{return null}}(y?.wazuh),e4=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.supported||"string"!=typeof t.platform||!["enabled","disabled","partial","unsupported","unknown"].includes(t.automaticUpdates??"")||"boolean"!=typeof t.rebootRequired||!Array.isArray(t.timers)||!Array.isArray(t.rebootRequiredPackages))return null;return{...t,fullUpgradePolicyEnabled:!0===t.fullUpgradePolicyEnabled}}catch{return null}}(y?.systemUpdates);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(r.f,{hero:!0,padding:"lg",tone:"ONLINE"===N.status?"primary":"OFFLINE"===N.status?"danger":"warning",testId:"node-cockpit",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>f.push("/nodes"),"aria-label":"Back to nodes",children:(0,t.jsx)(I.f,{className:"h-4 w-4"})}),(0,t.jsx)(d.f,{status:N.status}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold text-primary glow-text-primary",children:N.name}),(0,t.jsxs)("p",{className:"num mt-1 truncate text-xs text-text-muted",children:[N.hostname,":",N.port,N.agent&&(0,t.jsxs)("span",{className:"ml-3 text-primary/70",children:["agent v",N.agent.version]}),y?.source&&(0,t.jsxs)("span",{className:"ml-3 uppercase tracking-wider",children:["source: ",y.source]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(N.status),children:N.status}),N.agent?.status==="UPDATING"&&(0,t.jsxs)(b.t,{variant:"info",children:[(0,t.jsx)(M.f,{className:"h-3 w-3 animate-spin mr-1 inline"}),"Upgrading…"]}),(0,t.jsx)(w,{metadata:N.metadata}),(0,t.jsx)(k.x,{readiness:N.upgradeReadiness}),(0,t.jsx)($.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(P.f,{className:"h-3.5 w-3.5"}),onClick:()=>ee(!0),children:"Edit"}),(0,t.jsx)($.K,{variant:"danger",size:"sm",icon:(0,t.jsx)(U.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eG(),children:"Delete"})]})]}),N.upgradeReadiness?.status==="not-ready"&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(k.a,{readiness:N.upgradeReadiness})}),(0,t.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[auto_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:justify-start",children:[(0,t.jsx)(i.f,{value:y?.cpuUsagePercent??null,label:"CPU Usage",size:128,testId:"node-gauge-cpu"}),(0,t.jsx)(i.f,{value:y?.memoryPercent??null,label:"Memory",size:128,sublabel:y?`${(0,A.L)(y.memoryUsedBytes)}`:void 0,testId:"node-gauge-memory"}),(h=(y?ef(y.disks):[]).reduce((e,t)=>!e||t.usagePercent>e.usagePercent?t:e,null),(0,t.jsx)(i.f,{value:h?.usagePercent??null,label:"Disk",size:128,thresholds:{warn:80,crit:90},sublabel:h?.mountPoint,testId:"node-gauge-disk"}))]}),(0,t.jsx)(j,{nodeId:N.id,height:170})]})]}),("DEGRADED"===N.status||N.agent?.status==="ERROR")&&(()=>{try{let e=JSON.parse(N.metadata),s="string"==typeof e.deployError?e.deployError:null,a="string"==typeof e.upgradeError?e.upgradeError:null,n=s??a;if(n)return(0,t.jsx)("div",{className:"rounded-panel border border-danger/40 bg-danger/5 p-4 shadow-[inset_3px_0_0_var(--color-danger),0_0_20px_var(--color-glow-danger)]",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(E.f,{className:"h-5 w-5 text-danger shrink-0 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:s?"Deploy Failed":"Agent Upgrade Failed"}),(0,t.jsx)("pre",{className:"mt-1 text-xs text-text-muted whitespace-pre-wrap font-mono",children:n})]})]})})}catch{}return null})(),"PROVISIONING"===N.status&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(M.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Deploying agent… Status will update automatically."})]})}),N.agent?.status==="UPDATING"&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(M.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Agent upgrade in progress… Status will update automatically."})]})}),(0,t.jsx)(ea,{nodeId:N.id,nodeStatus:N.status}),(0,t.jsx)(eg,{telemetry:W}),(0,t.jsx)(ed,{node:{id:N.id,name:N.name,hostname:N.hostname,status:N.status,lastHeartbeatAt:N.lastHeartbeatAt}}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"Node Information",children:(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[[["OS",N.os],["Architecture",N.arch],["Address",`${N.ipAddress}:${N.port}`],["Tags",(()=>{try{let e=JSON.parse(N.tags);return e.length?e.join(", "):"—"}catch{return"—"}})()]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Agent Version"}),(0,t.jsx)("dd",{className:"font-medium flex items-center gap-1.5",children:N.agent?.version??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Role"}),(0,t.jsx)("dd",{className:"font-medium",children:N.role?(0,t.jsxs)("button",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/20 transition-colors cursor-pointer",onClick:()=>es(!0),title:"Change role",children:[(0,t.jsx)(D.f,{className:"h-3 w-3"}),N.role.name]}):(0,t.jsx)("button",{className:"text-xs text-text-muted hover:text-primary transition-colors cursor-pointer",onClick:()=>es(!0),children:"+ Assign Role"})})]}),[["Agent Status",N.agent?.status??"—"],["Last Heartbeat",(0,A.C)(N.lastHeartbeatAt)]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Cockpit"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cockpitAvailable?(0,t.jsxs)("a",{href:`https://${N.ipAddress}:9090`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Available",(0,t.jsx)(R.f,{className:"h-3 w-3"})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"Not Available"})})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"CPU Cores"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cpuCores??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Memory Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y?`${(0,A.L)(y.memoryUsedBytes)} / ${(0,A.L)(y.memoryTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Swap Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y&&y.swapTotalBytes?`${(0,A.L)(y.swapUsedBytes??0)} / ${(0,A.L)(y.swapTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Last Health Sample"}),(0,t.jsx)("dd",{className:"font-medium",children:y?(0,A.C)(y.timestamp):"—"})]})]})}),(0,t.jsx)(n.N,{title:"Hermes Agent",description:eN(ec)?ec.displayName??ec.hostname:"No Hermes Agent installed or found",action:eN(ec)?(0,t.jsx)(b.t,{variant:(0,b.k)(ec.status),children:ec.status}):void 0,children:eN(ec)?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.version??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Home"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:ec.hermesHome})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Dashboard"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(ec.dashboardStatus),children:ec.dashboardStatus}),(0,t.jsx)("span",{className:"font-mono text-xs",children:(u=""===(x=(m=ec).dashboardHost.trim().toLowerCase().replace(/^\[|\]$/g,""))||"0.0.0.0"===x||"127.0.0.1"===x||"localhost"===x||"::"===x||"::1"===x?m.hostname:m.dashboardHost,`${u}:${m.dashboardPort}`)})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Gateway"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:(0,b.k)(ec.gatewayStatus),children:ec.gatewayStatus})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"API Server"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.apiServerEnabled?`${ec.apiServerHost}:${ec.apiServerPort??"—"}`:"disabled"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Primary Provider"}),(0,t.jsxs)("dd",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(b.t,{variant:"unknown"===e0?"warning":"success",children:e0}),ec.configuration?.magnusRouterConfigured&&(0,t.jsx)(b.t,{variant:"success",children:"Magnus routed"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Default Model"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:e1})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"OpenAI Runtime"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:ec.configuration?.openaiRuntime==="codex_app_server"?"success":"warning",children:ec.configuration?.openaiRuntime==="codex_app_server"?"Codex app-server":"Hermes default"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Web Search"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(z.f,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e2})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Crawling"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(H,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e3})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Memory"}),(0,t.jsxs)("dd",{className:"mt-1",children:[(0,t.jsx)(b.t,{variant:ec.configuration?.hiveMemConfigured?"success":"warning",children:ec.configuration?.memoryProvider??"not configured"}),(0,t.jsx)(S.f,{configuration:ec.configuration})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Skills"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsxs)("button",{type:"button",onClick:()=>eT(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-text hover:border-primary/60 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:0===eZ.length,children:[(0,t.jsx)(L.f,{className:"h-3.5 w-3.5"}),function(e){if(0===e.length)return"0 synced";let t=e.filter(e=>e.enabled).length;return`${t} enabled / ${e.length} total`}(eZ)]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Last Sync"}),(0,t.jsx)("dd",{className:"text-xs",children:(0,A.C)(ec.lastSyncedAt)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[ec.configuration?.modelBaseUrl&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Base URL: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.modelBaseUrl})]}),ec.configuration?.configPath&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Config: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.configPath})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(ec.profiles??[]).slice(0,6).map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-text-muted",children:[(0,t.jsx)(F.f,{className:"h-3 w-3"}),e.name]},e.id)),(ec.profiles?.length??0)===0&&(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"No profiles synced"})]}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:(0,t.jsx)(R.f,{className:"h-3.5 w-3.5"}),onClick:()=>f.push(`/orchestra/web-gateway?installationId=${encodeURIComponent(ec.id)}`),children:"Open Dashboard"})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No Hermes Agent is installed or currently detected on this node."}),eD&&(0,t.jsx)("p",{className:"text-xs text-success",children:eD}),eO&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eO}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:eM?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(O.f,{className:"h-3.5 w-3.5"}),disabled:!N||"ONLINE"!==N.status||eM,onClick:()=>void eK(),children:eM?"Starting Deployment...":"Deploy Hermes Agent"}),N?.status!=="ONLINE"&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Bring the Magnus agent online before starting automated Hermes deployment."})]})}),(0,t.jsx)(n.N,{title:"Service Checks",children:y&&ej(y.services).length>0?(0,t.jsx)("div",{className:"space-y-2 text-sm",children:ej(y.services).slice(0,8).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded border border-border px-2 py-1.5",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name}),(0,t.jsx)(b.t,{variant:"active"===e.status?"success":"failed"===e.status?"danger":"default",children:e.status})]},e.name))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No service checks available from this node yet."})})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"System Update Readiness",description:"Automatic apt policy and reboot state from the latest heartbeat",action:e4?(0,t.jsx)(b.t,{variant:e4.rebootRequired?"danger":"enabled"===e4.automaticUpdates?"success":"warning",children:e4.rebootRequired?"reboot required":e4.automaticUpdates.replace("_"," ")}):void 0,children:e4?(0,t.jsxs)("div",{className:"space-y-4",children:[e4.rebootRequired&&(0,t.jsxs)("div",{className:"flex gap-3 rounded border border-danger/30 bg-danger/10 p-3",children:[(0,t.jsx)(q.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-danger"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:"Restart needed to finish installed updates"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e4.rebootRequiredPackages.length?e4.rebootRequiredPackages.slice(0,5).join(", "):"The operating system has set the reboot-required marker."})]})]}),(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Platform"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e4.platform})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Automatic updates"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:"enabled"===e4.automaticUpdates?"success":"warning",children:e4.automaticUpdates})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"unattended-upgrades"}),(0,t.jsx)("dd",{children:e4.unattendedUpgradesInstalled?"installed":"not installed"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"full apt upgrade policy"}),(0,t.jsx)("dd",{children:e4.fullUpgradePolicyEnabled?"enabled":"not enabled"})]}),e4.timers.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"font-mono text-[11px] text-text-muted",children:e.name}),(0,t.jsx)("dd",{className:"font-mono text-[11px]",children:e.state})]},e.name))]}),e4.supported&&"enabled"!==e4.automaticUpdates&&(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eU,onClick:()=>void eQ(),children:[eU?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(B.f,{className:"h-3.5 w-3.5"}),eU?"Enabling…":"Enable automatic updates"]}),e_&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e_})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Update posture will appear after agent v1.6.0 reports its first heartbeat."})}),(0,t.jsx)(n.N,{title:"Wazuh Agent",description:"Endpoint-security posture from the latest node heartbeat",action:e5?(0,t.jsx)(b.t,{variant:"active"===(e=e5.serviceStatus)?"success":"failed"===e?"danger":"inactive"===e?"warning":"default",children:e5.serviceStatus.replace("_"," ")}):void 0,children:e5?(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Installation"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:e5.installed?"success":"default",children:e5.installed?"installed":"not installed"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Startup"}),(0,t.jsx)("dd",{className:"font-medium",children:e5.enabled})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e5.version??"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Managers"}),(0,t.jsx)("dd",{className:"mt-1 font-mono text-xs break-all",children:e5.managerAddresses.length?e5.managerAddresses.join(", "):"—"})]})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Wazuh posture will appear after this host reports a current Magnus agent heartbeat."})}),(0,t.jsx)(n.N,{title:"Disk Usage",children:y&&ef(y.disks).length?(0,t.jsx)("div",{className:"space-y-3",children:ef(y.disks).map(e=>(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted",children:e.mountPoint}),(0,t.jsxs)("span",{className:"num",children:[(0,A.L)(e.usedBytes)," / ",(0,A.L)(e.totalBytes)]})]}),(0,t.jsx)(l.f,{value:e.usagePercent,thresholds:{warn:80,crit:90},size:"sm",label:`${e.mountPoint} disk usage`,showValue:!0,className:"mt-1"})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No disk data available"})}),(0,t.jsx)(n.N,{title:"Capacity Forecast",description:"Per-volume 30-day growth trend and estimated time to full",children:J.length?(0,t.jsx)("div",{className:"space-y-3",children:J.map(e=>(0,t.jsxs)("div",{className:"rounded border border-border/50 p-3 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-mono text-text",children:e.mountPoint}),(0,t.jsx)(b.t,{variant:null!==e.daysUntilFull&&e.daysUntilFull<=14?"danger":null!==e.daysUntilFull&&e.daysUntilFull<=30?"warning":"default",children:null===e.daysUntilFull?e.growthRatePerDay>0?"trend uncertain":"stable/shrinking":`${e.daysUntilFull}d to full`})]}),(0,t.jsxs)("div",{className:"mt-2 text-text-muted",children:[e.currentUsagePercent.toFixed(1),"% used · ",(0,A.L)(Math.abs(e.growthRatePerDay)),"/day ",e.growthRatePerDay>=0?"growth":"reclaimed"," · confidence ",(100*e.confidence).toFixed(0),"%"]}),(0,t.jsx)("p",{className:"mt-2 text-text-muted",children:e.recommendation})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"At least three retained samples are needed for a capacity forecast."})}),(0,t.jsxs)(n.N,{title:"Software Revisions",description:"Major runtime versions and package update status",action:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>void eJ(),children:(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${em?"animate-spin":""}`})}),children:[(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[["node","npm","python3","redis","docker","tailscale","magnus-agent"].map(e=>(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("dt",{className:"text-text-muted uppercase text-xs tracking-wide",children:e}),(0,t.jsx)("dd",{className:"font-mono text-right text-xs break-all",children:ei[e]??(em?"Loading…":"—")})]},e)),eu&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eu})]}),(0,t.jsxs)("div",{className:"mt-4 border-t border-border pt-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:"APT Updates"}),(0,t.jsx)(b.t,{variant:eh&&eh>0?"warning":"success",children:ek?"Checking…":`${eh??"—"} pending`})]}),(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Refreshed hourly via apt update",eb?` • Last check: ${(0,A.C)(eb)}`:""]}),e$&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e$}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)($.K,{size:"sm",variant:"secondary",disabled:"ONLINE"!==N.status||ek,onClick:()=>void eV(),children:[(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${ek?"animate-spin":""}`}),"Refresh"]}),(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eA,onClick:()=>void eW(),children:[eA?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):null,eA?"Dispatching…":"APT Upgrade"]})]})]})]})]})]}),en.length>0&&(0,t.jsx)(n.N,{title:"Role Applications",children:(0,t.jsx)("div",{className:"space-y-4",children:en.map(e=>(0,t.jsxs)("div",{className:"rounded-lg border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.f,{className:"h-4 w-4 text-primary"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["apply"===e.action?"Apply":"Remove",": ",e.role?.name??"Unknown"]})]}),(0,t.jsx)(b.t,{variant:"completed"===e.status?"success":"failed"===e.status?"danger":"running"===e.status?"info":"default",children:e.status})]}),e.error&&(0,t.jsx)("div",{className:"mb-2 rounded border border-danger/30 bg-danger/10 px-2 py-1 text-xs text-danger font-mono",children:e.error}),(0,t.jsx)("div",{className:"space-y-1",children:e.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"completed"===e.status?"text-success":"failed"===e.status?"text-danger":"running"===e.status?"text-info":"skipped"===e.status?"text-text-muted/50":"text-text-muted",children:["completed"===e.status&&"✓","failed"===e.status&&"✗","running"===e.status&&"⟳","skipped"===e.status&&"—","pending"===e.status&&"○"]}),(0,t.jsx)("span",{className:"skipped"===e.status?"text-text-muted/50 line-through":"",children:e.name}),e.error&&(0,t.jsx)("span",{className:"text-danger ml-2 truncate max-w-xs",title:e.error,children:e.error})]},e.name))}),(0,t.jsxs)("div",{className:"mt-2 text-[10px] text-text-muted",children:[e.startedAt?`Started: ${(0,A.C)(e.startedAt)}`:"",e.completedAt?` — Completed: ${(0,A.C)(e.completedAt)}`:""]})]},e.id))})}),(0,t.jsx)(C.n,{open:ez,onClose:()=>eT(!1),title:"Hermes Skills",description:`${eY.length} enabled on ${N.name}`,icon:(0,t.jsx)(L.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Enabled"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eY.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Total"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eZ.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Sources"}),(0,t.jsx)("p",{className:"mt-1 text-sm font-mono",children:Array.from(new Set(eZ.map(e=>e.source))).filter(Boolean).join(", ")||"unknown"})]})]}),(0,t.jsxs)("div",{className:"max-h-[55vh] overflow-auto rounded border border-border",children:[(0,t.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,t.jsx)("thead",{className:"sticky top-0 bg-surface text-[10px] uppercase tracking-wide text-text-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Skill"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Category"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border",children:eZ.slice().sort((e,t)=>Number(t.enabled)-Number(e.enabled)||e.slug.localeCompare(t.slug)).map(e=>(0,t.jsxs)("tr",{className:"bg-bg/20",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono",children:e.slug}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.category??"uncategorized"}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.source}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b.t,{variant:e.enabled?"success":"default",children:e.enabled?"enabled":"disabled"})})]},`${e.slug}-${e.source}`))})]}),0===eZ.length&&(0,t.jsx)("div",{className:"p-6 text-sm text-text-muted",children:"No synced Hermes skills were reported for this node."})]})]})}),(0,t.jsx)(G.F,{open:Y,node:N,onClose:()=>ee(!1),onSaved:()=>void eq()}),(0,t.jsx)(G.E,{open:et,node:N?{id:N.id,name:N.name,role:N.role}:null,onClose:()=>es(!1),onSaved:e=>{eB.current=e,N&&v({...N,role:e}),eq()}})]})}],5525)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5525,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(93999),r=e.i(3062),i=e.i(54149),l=e.i(51196),d=e.i(75723),c=e.i(2067),o=e.i(65369),m=e.i(56420);let x={name:"chart-line",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],aliases:["line-chart"]};x.node;let u=(0,m.f)(x);var p=e.i(82983),h=e.i(78571),g=e.i(21176);let f=["1h","6h","24h"];function j({nodeId:e,height:a=180}){let[n,r]=(0,s.useState)("1h"),[i,l]=(0,s.useState)(null),[d,o]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=!1;o(!1);let s=async()=>{try{let[s,a]=await Promise.all([p.f.get(`nodes/${e}/health/timeseries?metric=cpu&period=${n}`),p.f.get(`nodes/${e}/health/timeseries?metric=memory&period=${n}`)]);if(t)return;let r=s.data??{timestamps:[],values:[]},i=a.data??{timestamps:[],values:[]},d=new Map;r.timestamps.forEach((e,t)=>{let s=Date.parse(e);d.set(s,{t:s,cpu:r.values[t]??null,mem:null})}),i.timestamps.forEach((e,t)=>{let s=Date.parse(e),a=d.get(s)??{t:s,cpu:null,mem:null};a.mem=i.values[t]??null,d.set(s,a)}),l([...d.values()].sort((e,t)=>e.t-t.t))}catch{t||(l([]),o(!0))}};s();let a=setInterval(()=>void s(),6e4);return()=>{t=!0,clearInterval(a)}},[e,n]),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col","data-testid":"node-metrics-chart",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-text-muted",children:"CPU / memory history"}),(0,t.jsx)("div",{role:"group","aria-label":"History period",className:"flex rounded-chip border border-border bg-bg p-0.5",children:f.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>r(e),"aria-pressed":n===e,className:(0,h.f)("rounded-chip px-2 py-0.5 text-[10px] uppercase tracking-wider transition-colors",n===e?"bg-primary/15 text-primary shadow-[0_0_8px_var(--color-glow)]":"text-text-muted hover:text-text"),children:e},e))})]}),null===i?(0,t.jsx)("div",{className:"skeleton w-full",style:{height:a}}):i.length<2?(0,t.jsx)(c.f,{compact:!0,icon:(0,t.jsx)(u,{className:"h-4 w-4"}),title:d?"History unavailable":"Not enough samples yet",description:d?"The health timeseries endpoint did not answer.":`No health snapshots in the last ${n}.`,tone:d?"warning":"muted",className:"flex-1"}):(0,t.jsx)(g.f,{data:i,xKey:"t",percent:!0,height:a,formatX:e=>new Date(Number(e)).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),series:[{key:"cpu",label:"CPU",tone:"primary"},{key:"mem",label:"Memory",tone:"accent"}]})]})}var N=e.i(95925);let v={name:"shield-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]};v.node;let y=(0,m.f)(v);var b=e.i(46670);function w({metadata:e}){let s=function(e){let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return}return t?.agentSelfUpgrade}(e);return s?s.upgrade?.state==="reverted"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," reverted"]})}):s.upgrade?.state==="failed"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," failed"]})}):s.enabled?null:(0,t.jsx)("span",{title:s.reason??void 0,"data-testid":"agent-self-upgrade-off",children:(0,t.jsxs)(b.t,{variant:"default",children:[(0,t.jsx)(y,{className:"mr-1 inline h-3 w-3"}),"Self-upgrade off"]})}):null}var k=e.i(53721),S=e.i(57108),$=e.i(68759),C=e.i(32568),A=e.i(71417),P=e.i(15281),U=e.i(59659),I=e.i(9347),_=e.i(25398),E=e.i(92026),M=e.i(32781),R=e.i(82022),D=e.i(84026),F=e.i(71567),O=e.i(94371),L=e.i(20851),z=e.i(66595);let T={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};T.node;let H=(0,m.f)(T);var B=e.i(86207),q=e.i(57665),K=e.i(41220),G=e.i(14098),J=e.i(4139),V=e.i(41120),W=e.i(82954),Q=e.i(79432),Z=e.i(62368),X=e.i(64155),Y=e.i(51757),ee=e.i(83967),et=e.i(74544);let es=[{id:"apt-update",label:"apt update",command:"sudo",args:["apt","update"],icon:(0,t.jsx)(Z.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:120},{id:"apt-upgrade",label:"apt upgrade",command:"sudo",args:["apt","upgrade","-y"],icon:(0,t.jsx)(V.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will upgrade all packages on the node. Continue?",timeoutSeconds:300},{id:"magnus-status",label:"magnus status",command:"systemctl",args:["status","magnus-agent","--no-pager"],icon:(0,t.jsx)(Q.f,{className:"h-3.5 w-3.5"}),variant:"primary",timeoutSeconds:15},{id:"magnus-update",label:"magnus update",command:"sudo",args:["systemctl","restart","magnus-agent"],icon:(0,t.jsx)(W.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will restart the Magnus agent. Continue?",timeoutSeconds:30},{id:"dmesg",label:"dmesg",command:"sudo",args:["dmesg","--time-format=reltime","-T"],icon:(0,t.jsx)(X.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:15},{id:"reboot",label:"Reboot",command:"sudo",args:["reboot"],icon:(0,t.jsx)(q.f,{className:"h-3.5 w-3.5"}),variant:"danger",confirm:"Are you sure you want to REBOOT this node? It will go offline temporarily.",timeoutSeconds:10}];function ea({nodeId:e,nodeStatus:a}){let[n,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(null),[x,u]=(0,s.useState)(null),h="ONLINE"!==a,g=async t=>{if(!t.confirm||confirm(t.confirm)){c(t),m(null),u(null),l(!0),r(!0);try{let s=await p.f.quickCommand.exec(e,{command:t.command,args:t.args,timeoutSeconds:t.timeoutSeconds});m(s.data)}catch(e){u(e instanceof Error?e.message:"Command execution failed")}finally{l(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"rounded border border-border bg-surface p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted mr-2",children:[(0,t.jsx)(J.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"Quick Commands"})]}),es.map(e=>(0,t.jsx)($.K,{variant:e.variant,size:"sm",icon:e.icon,disabled:h,onClick:()=>void g(e),children:e.label},e.id)),h&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:"Node must be ONLINE to run commands"})]})}),(0,t.jsx)(C.n,{open:n,onClose:()=>r(!1),title:d?.label??"Command",description:d?`${d.command} ${(d.args??[]).join(" ")}`:void 0,icon:(0,t.jsx)(J.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.f,{className:"h-4 w-4 animate-spin text-primary"}),(0,t.jsx)("span",{className:"text-xs text-primary",children:"Executing…"})]}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsx)("span",{className:"text-xs text-danger",children:"Error"})]}):o?(0,t.jsxs)(t.Fragment,{children:[0===o.exitCode?(0,t.jsx)(Y.f,{className:"h-4 w-4 text-success"}):(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsxs)("span",{className:`text-xs ${0===o.exitCode?"text-success":"text-danger"}`,children:["Exit code: ",o.exitCode]}),(0,t.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1 ml-auto",children:[(0,t.jsx)(et.f,{className:"h-3 w-3"}),(o.durationMs/1e3).toFixed(2),"s"]})]}):null}),x&&(0,t.jsx)("div",{className:"rounded bg-danger/10 border border-danger/30 p-3",children:(0,t.jsx)("p",{className:"text-xs text-danger",children:x})}),o&&(0,t.jsxs)("div",{className:"space-y-3",children:[o.stdout&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stdout"}),(0,t.jsx)("pre",{className:"max-h-80 overflow-auto rounded bg-bg border border-border p-3 text-xs text-success whitespace-pre-wrap",children:o.stdout})]}),o.stderr&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stderr"}),(0,t.jsx)("pre",{className:"max-h-40 overflow-auto rounded bg-bg border border-danger/20 p-3 text-xs text-danger whitespace-pre-wrap",children:o.stderr})]}),!o.stdout&&!o.stderr&&(0,t.jsx)("p",{className:"text-xs text-text-muted italic",children:"No output captured"}),o.truncated&&(0,t.jsx)("p",{className:"text-xs text-warning",children:"⚠ Output was truncated (exceeded 1MB)"})]}),i&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(M.f,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-2"}),(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Executing command on remote node…"})]})}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Close"})})]})})]})}var en=e.i(55427),er=e.i(28623);let ei={workhorse:{name:"Workhorse",emoji:"🐴",description:"Steady, reliable, never complains.",accent:"success"},"drama-queen":{name:"Drama Queen",emoji:"🎭",description:"High variance, loves spiking CPU for attention.",accent:"warning"},"zen-master":{name:"Zen Master",emoji:"🧘",description:"Low usage, mind always clear, never stressed.",accent:"info"},sprinter:{name:"Sprinter",emoji:"⚡",description:"Bursts of intense activity followed by calm recovery.",accent:"info"},groundhog:{name:"Groundhog",emoji:"🌀",description:"Keeps rebooting — might see its own shadow again.",accent:"warning"},ghost:{name:"Ghost",emoji:"👻",description:"Often unreachable. Is it even there?",accent:"danger"},marathoner:{name:"Marathoner",emoji:"🏃",description:"Long uptime, steady pace, built to last.",accent:"success"},rookie:{name:"Rookie",emoji:"🌱",description:"Not enough history yet — still finding its rhythm.",accent:"default"}};function el(e){return 0===e.length?0:e.reduce((e,t)=>e+t,0)/e.length}function ed({node:e}){let[a,r]=(0,s.useState)([]),[i,l]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(0);(0,s.useEffect)(()=>{let t=!1;return(async()=>{l(!0),c(null);try{let s=await p.f.get(`nodes/${e.id}/health/history?limit=100`);if(t)return;let a=s.data,n=[];Array.isArray(a)?n=a:a?.items&&(n=a.items),r([...n].reverse())}catch(e){t||(r([]),c(e instanceof Error?e.message:"Failed to load history"))}finally{t||l(!1)}})(),()=>{t=!0}},[e.id,o]);let x=(0,s.useMemo)(()=>{let t,s,n,r,i,l,d,c,o;return t=a.map(e=>e.cpuUsagePercent).filter(e=>Number.isFinite(e)),s=a.map(e=>e.memoryPercent).filter(e=>Number.isFinite(e)),n=el(t),r=function(e){if(e.length<2)return 0;let t=el(e);return Math.sqrt(e.reduce((e,s)=>e+(s-t)*(s-t),0)/(e.length-1))}(t),i=el(s),l=t.filter(e=>e>80).length,d="rookie",c=ei[d="OFFLINE"===e.status||e.lastHeartbeatAt&&Date.now()-new Date(e.lastHeartbeatAt).getTime()>6e5?"ghost":a.length<3?"rookie":r>25||l/Math.max(1,t.length)>.25?l/Math.max(1,t.length)>.4?"drama-queen":"sprinter":n<15&&r<10?"zen-master":n>40&&n<75&&r<15?"workhorse":n<40&&r<15&&a.length>20?"marathoner":"workhorse"]??ei.rookie??{name:"Rookie",emoji:"🌱",description:"",accent:"default"},o=function(e,t,s){var a;let n,r=Math.floor(Date.now()/6048e5);for(let t=0;t<e.id.length;t++)r=31*r+e.id.charCodeAt(t)|0;let i={workhorse:[`Steady as they come — averaging ${s.cpuAvg.toFixed(0)}% CPU without a single complaint this week.`,`The dependable one. ${e.hostname} just keeps grinding through the workload.`,`Quietly productive at ~${s.cpuAvg.toFixed(0)}% CPU. Gets the job done and asks for nothing.`],"drama-queen":[`Lives for the spotlight — ${s.spikes} CPU spikes this week and counting.`,`${e.hostname} likes to keep things interesting with a \xb1${s.cpuSD.toFixed(0)}% swing.`,"A connoisseur of chaos. Never a dull moment with this one."],"zen-master":[`Practices minimalism. Barely breaks a sweat at ${s.cpuAvg.toFixed(0)}% CPU.`,`${e.hostname} is in its happy place — calm, cool, collected.`,"Achieving enlightenment one idle cycle at a time."],sprinter:[`Bursts of energy, then recovery. ${s.spikes} sprints logged this week.`,`${e.hostname} runs hot, then cools down. Classic sprinter cadence.`,"Lives in intervals — full throttle, then full zen."],groundhog:["Déjà vu all over again. Might want to check the uptime.",`${e.hostname} keeps hitting the reset button.`],ghost:["Hasn't been seen in a while. Anyone home?",`${e.hostname} is currently out of contact. Check the heartbeat.`],marathoner:[`In it for the long haul — ${s.samples} data points of pure consistency.`,`${e.hostname} doesn't sprint. It endures.`],rookie:["Still new around here — gathering experience.",`${e.hostname} is just getting started. Check back soon.`]};return n=Math.abs(r)%(a=i[t.name.toLowerCase().replace(" ","-")]??i.rookie??["…"]).length,a[n]}(e,c,{cpuAvg:n,cpuSD:r,memAvg:i,samples:t.length,spikes:l}),{archetype:c,archetypeKey:d,bio:o,stats:{cpuAvg:n,cpuStdDev:r,memAvg:i,samples:t.length,spikes:l}}},[e,a]),u=a.map(e=>e.cpuUsagePercent).slice(-40),h=a.map(e=>e.memoryPercent).slice(-40);return(0,t.jsx)(n.N,{title:"Personality",action:(0,t.jsx)("button",{onClick:()=>m(e=>e+1),className:"text-text-muted hover:text-text transition p-1",title:"Refresh personality","data-testid":"node-personality-refresh",children:(0,t.jsx)(V.f,{className:"h-3.5 w-3.5"})}),children:(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"node-personality-card","data-archetype":x.archetypeKey,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-accent/40 bg-bg text-2xl shadow-[0_0_16px_var(--color-glow-accent)]","aria-hidden":"true",children:x.archetype.emoji}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{"data-testid":"node-archetype-badge",children:(0,t.jsx)(b.t,{variant:x.archetype.accent,children:x.archetype.name})}),i&&(0,t.jsx)("span",{className:"text-xs text-text-muted italic",children:"analyzing…"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:x.archetype.description})]})]}),(0,t.jsx)(er.f,{className:"h-4 w-4 text-accent mt-1"})]}),(0,t.jsxs)("blockquote",{className:"border-l-2 border-accent/40 pl-3 text-sm italic text-text","data-testid":"node-personality-bio",children:["“",x.bio,"”"]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t border-border/30",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"CPU trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.cpuAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:u,tone:"primary",percent:!0,stretch:!0,threshold:80,testId:"node-personality-cpu-sparkline",label:`CPU trend, average ${x.stats.cpuAvg.toFixed(0)}%`})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"Memory trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.memAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:h,tone:"accent",percent:!0,stretch:!0,threshold:80,testId:"node-personality-mem-sparkline",label:`Memory trend, average ${x.stats.memAvg.toFixed(0)}%`})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-[11px] text-text-muted",children:[(0,t.jsxs)("span",{children:[x.stats.samples," samples"]}),(0,t.jsxs)("span",{children:["σ ",x.stats.cpuStdDev.toFixed(1),"%"]}),(0,t.jsxs)("span",{children:[x.stats.spikes," spikes"]}),d&&(0,t.jsxs)("span",{className:"text-warning",children:["· ",d]})]})]})})}let ec={name:"fan",size:24,node:[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]]};ec.node;let eo=(0,m.f)(ec);var em=e.i(71028);let ex={name:"thermometer",size:24,node:[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]};ex.node;let eu=(0,m.f)(ex);function ep(e,t){let s=e.map(e=>({timestamp:new Date(e.sampledAt).getTime(),value:t(e)})).filter(e=>null!==e.value);if(0===s.length)return"";let a=s[0].timestamp,n=Math.max(1,s.at(-1).timestamp-a);return s.map(({timestamp:e,value:t})=>{let s=104-.88*Math.max(0,Math.min(100,t));return`${((e-a)/n*600).toFixed(1)},${s.toFixed(1)}`}).join(" ")}function eh(e,t="%"){return null===e?"not reported":`${e.toFixed(1)}${t}`}function eg({telemetry:e}){let s=e?.latest??null,a=s?.devices??[],r=ep(e?.history??[],e=>e.maxUtilizationPercent),i=ep(e?.history??[],e=>e.maxFanPercent);return(0,t.jsx)(n.N,{title:"GPU telemetry",description:"30-second load and cooling history",action:s?(0,t.jsxs)(b.t,{variant:"default",children:["sampled ",(0,A.C)(s.sampledAt)]}):void 0,children:s&&0!==a.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:a.map(e=>(0,t.jsxs)("div",{className:"rounded-panel border border-border/70 bg-surface-raised/60 p-3 transition-colors hover:border-primary/30",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-text",children:e.name}),(0,t.jsxs)("p",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:[e.vendor," · gpu ",e.index]})]}),100===e.fanPercent&&(0,t.jsx)(b.t,{variant:"danger",children:"fan saturated"})]}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(em.f,{className:"h-3 w-3"}),"Load"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-primary",children:eh(e.utilizationPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eo,{className:"h-3 w-3"}),"Fan"]}),(0,t.jsx)("dd",{className:`mt-1 num text-sm ${100===e.fanPercent?"text-danger glow-text-danger":"text-warning"}`,children:eh(e.fanPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eu,{className:"h-3 w-3"}),"Temp"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-text",children:eh(e.temperatureCelsius,"°C")})]})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsx)(l.f,{value:e.utilizationPercent,tone:"primary",label:`${e.name} load`}),(0,t.jsx)(l.f,{value:e.fanPercent,thresholds:{warn:80,crit:100},label:`${e.name} fan`})]})]},`${e.vendor}-${e.uuid??e.index}`))}),(0,t.jsxs)("div",{className:"panel-corners rounded-panel border border-border/70 bg-bg/60 p-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-text-muted",children:"Host maximum · last 24 hours"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-primary shadow-[0_0_4px_var(--color-primary)]"}),"load"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-warning"}),"fan"]})]})]}),(0,t.jsxs)("svg",{viewBox:"0 0 600 112",className:"h-28 w-full",role:"img","aria-label":"GPU load and fan percentage over the last 24 hours",children:[(0,t.jsx)("line",{x1:"0",y1:"16",x2:"600",y2:"16",stroke:"var(--color-danger)",strokeOpacity:"0.45",strokeDasharray:"5 5"}),(0,t.jsx)("line",{x1:"0",y1:"60",x2:"600",y2:"60",stroke:"currentColor",strokeOpacity:"0.12"}),(0,t.jsx)("line",{x1:"0",y1:"104",x2:"600",y2:"104",stroke:"currentColor",strokeOpacity:"0.2"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gpu-load-fill",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"var(--color-primary)",stopOpacity:"0.35"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"var(--color-primary)",stopOpacity:"0"})]})}),r&&(0,t.jsx)("polygon",{points:`0,104 ${r} 600,104`,fill:"url(#gpu-load-fill)"}),r&&(0,t.jsx)("polyline",{points:r,fill:"none",stroke:"var(--color-primary)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),i&&(0,t.jsx)("polyline",{points:i,fill:"none",stroke:"var(--color-warning)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})]}),(0,t.jsxs)("div",{className:"mt-1 flex justify-between num text-[9px] text-text-muted",children:[(0,t.jsx)("span",{children:"24h ago"}),(0,t.jsx)("span",{children:"100% saturation line"}),(0,t.jsx)("span",{children:"now"})]})]})]}):(0,t.jsx)("div",{className:"rounded-panel border border-dashed border-border px-4 py-6 text-center text-xs text-text-muted",children:s?.status==="error"?"The GPU probe did not complete. Magnus will retry on the next heartbeat.":"No supported NVIDIA or AMD GPU was detected in the latest sample."})})}function ef(e){if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e??[]}function ej(e){if(!e)return[];if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e}function eN(e){return!!(e&&"not_installed"!==e.status)}function ev(e){let t=e.status.toLowerCase();return t.includes("enabled")&&!t.includes("not enabled")&&!t.includes("disabled")}function ey(e,t){let s=e.filter(ev).find(e=>{let s=`${e.slug} ${e.pluginType} ${e.metadata?.description??""}`.toLowerCase();return"search"===t?/\b(search|web)\b/.test(s):/\b(crawl|browser|firecrawl|browserbase|browser-use)\b/.test(s)});return s?`${s.slug}${s.version?` ${s.version}`:""}`:"none enabled"}e.s(["default",0,function(){var e,m;let x,u,h,g=(0,a.useParams)(),f=(0,a.useRouter)(),[N,v]=(0,s.useState)(null),[y,T]=(0,s.useState)(null),[J,V]=(0,s.useState)([]),[W,Q]=(0,s.useState)(null),[Z,X]=(0,s.useState)(!0),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(!1),[en,er]=(0,s.useState)([]),[ei,el]=(0,s.useState)({}),[ec,eo]=(0,s.useState)(null),[em,ex]=(0,s.useState)(!1),[eu,ep]=(0,s.useState)(null),[eh,ev]=(0,s.useState)(null),[eb,ew]=(0,s.useState)(null),[ek,eS]=(0,s.useState)(!1),[e$,eC]=(0,s.useState)(null),[eA,eP]=(0,s.useState)(!1),[eU,eI]=(0,s.useState)(!1),[e_,eE]=(0,s.useState)(null),[eM,eR]=(0,s.useState)(!1),[eD,eF]=(0,s.useState)(null),[eO,eL]=(0,s.useState)(null),[ez,eT]=(0,s.useState)(!1),eH=(0,s.useRef)(null),eB=(0,s.useRef)(void 0),eq=(0,s.useCallback)(async(e=!1)=>{try{e||X(!0);let[t,s,a,n,r]=await Promise.all([p.f.nodes.get(g.nodeId),p.f.nodes.health(g.nodeId).catch(()=>null),p.f.nodes.forecast(g.nodeId).catch(()=>null),p.f.hermes.installations().catch(()=>null),p.f.nodes.gpu(g.nodeId).catch(()=>null)]),i=t.data;i.role||void 0===eB.current?i.role&&(eB.current=i.role):i.role=eB.current,v(i),s&&T(s.data),V(a?.data?.forecasts??[]),Q(r?.data??null);let l=n?.data??[];eo(l.find(e=>e.nodeId===i.id)??l.find(e=>e.hostname===i.hostname||e.hostname===i.ipAddress)??null);try{let e=await p.f.roles.applications.list({nodeId:g.nodeId});er(e.data??[])}catch{}}catch{}finally{e||X(!1)}},[g.nodeId]);(0,s.useEffect)(()=>{eq()},[eq]);let eK=async()=>{if(N&&confirm(`Deploy Hermes Agent to "${N.name}"?`)){eR(!0),eF(null),eL(null);try{let e,t=await p.f.hermes.deploy({nodeId:N.id,hermesHome:"~/.hermes",hermesBin:"hermes",installMethod:"official-script",dashboardPort:9119,enableDashboard:!0,enableDashboardTui:!0,startGateway:!0},(e="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),`hermes-node-deploy-${Date.now()}-${e}`));eF(`Hermes Agent deployment started. Job ${t.data?.id.slice(0,10)}...`),eq(!0)}catch(e){eL(e instanceof Error?e.message:"Hermes Agent deployment failed")}finally{eR(!1)}}};(0,s.useEffect)(()=>{let e=N?.status==="PROVISIONING"||N?.agent?.status==="UPDATING"||!!(eD&&!eN(ec));return e&&!eH.current?eH.current=setInterval(()=>{eq(!0)},4e3):!e&&eH.current&&(clearInterval(eH.current),eH.current=null),()=>{eH.current&&(clearInterval(eH.current),eH.current=null)}},[N?.status,N?.agent?.status,N?.agent?.version,eq,eD,ec]);let eG=async()=>{if(N&&confirm(`Delete node "${N.name}"? This will permanently remove it and all associated data.`))try{await p.f.nodes.delete(N.id),f.push("/nodes")}catch{}},eJ=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){ex(!0),ep(null);try{let e='version_or_na() { local cmd="$1"; shift; if command -v "$cmd" >/dev/null 2>&1; then ("$@" 2>/dev/null || "$cmd" --version 2>/dev/null || "$cmd" -v 2>/dev/null || echo "unknown") | head -n 1; else echo "not installed"; fi; }; echo "node=$(version_or_na node node --version)"; echo "npm=$(version_or_na npm npm --version)"; echo "python3=$(version_or_na python3 python3 --version)"; echo "redis=$(version_or_na redis-cli redis-cli --version)"; echo "docker=$(version_or_na docker docker --version)"; echo "tailscale=$(version_or_na tailscale tailscale version)"; agent_manifest=/opt/magnus-agent/node_modules/@hivemagnus/magnus-agent/package.json; [ -f "$agent_manifest" ] || agent_manifest=/opt/magnus-agent/package.json; if [ -f "$agent_manifest" ]; then echo "magnus-agent=$(node -e \'process.stdout.write(require(process.argv[1]).version)\' "$agent_manifest" 2>/dev/null || echo unknown)"; else echo "magnus-agent=not installed"; fi'.replace(/'/g,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:60})).data.stdout??"").trim(),s=Object.fromEntries(t.split("\n").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let[t,...s]=e.split("=");return[t,s.join("=").trim()||"unknown"]}));el(s)}catch(e){ep(e instanceof Error?e.message:"Failed to load software revisions")}finally{ex(!1)}}},[N?.id,N?.status]),eV=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){eS(!0),eC(null);try{let e="set -euo pipefail; (sudo apt-get update -qq || apt-get update -qq) >/dev/null 2>&1; apt list --upgradable 2>/dev/null | sed '1d' | sed '/^Listing/d' | wc -l".replace(/'/g,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:180})).data.stdout??"").trim(),s=Number.parseInt(t.split("\n").at(-1)??"",10);ev(Number.isFinite(s)?s:null),ew(new Date().toISOString())}catch(e){eC(e instanceof Error?e.message:"Failed to refresh apt updates")}finally{eS(!1)}}},[N?.id,N?.status]),eW=async()=>{if(N&&confirm(`Run apt upgrade on "${N.name}"?`)){eP(!0);try{let e=`apt-upgrade-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,t=(await p.f.commands.dispatch({nodeIds:[N.id],command:"sudo",args:["apt","upgrade","-y"],timeoutSeconds:1800,idempotencyKey:e},e)).data,s=t.commands?.[0]?.id;alert(s?`APT Upgrade dispatched (command ${s.slice(0,12)}…). Check Commands for progress.`:"APT Upgrade dispatched. Check Commands for progress."),await eV()}catch(e){alert(`APT Upgrade failed to dispatch: ${e instanceof Error?e.message:String(e)}`)}finally{eP(!1)}}},eQ=async()=>{if(N&&confirm(`Enable unattended apt update and apt upgrade on "${N.name}"? Magnus will install unattended-upgrades and enable the apt timers.`)){eI(!0),eE(null);try{await p.f.nodes.enableSystemUpdates(N.id),await eq(!0)}catch(e){eE(e instanceof Error?e.message:"Failed to enable automatic updates")}finally{eI(!1)}}};if((0,s.useEffect)(()=>{eJ(),eV()},[eJ,eV]),(0,s.useEffect)(()=>{if(!N||"ONLINE"!==N.status)return;let e=setInterval(()=>{eV()},36e5);return()=>clearInterval(e)},[N,eV]),Z)return(0,t.jsxs)("div",{className:"space-y-6","aria-busy":"true",children:[(0,t.jsx)("div",{className:"skeleton h-56 w-full rounded-panel opacity-70"}),(0,t.jsx)(o.g,{}),(0,t.jsx)("span",{className:"sr-only",children:"Loading node details…"})]});if(!N)return(0,t.jsx)(c.f,{tone:"accent",icon:(0,t.jsx)(K.f,{className:"h-5 w-5"}),title:"Node not found",description:"It may have been decommissioned or belong to another control node.",action:(0,t.jsx)($.K,{variant:"secondary",size:"sm",onClick:()=>f.push("/nodes"),children:"Back to nodes"}),className:"mt-12"});let eZ=eN(ec)?Array.isArray(ec.rawStatus?.skills)?ec.rawStatus.skills:[]:[],eX=eN(ec)?Array.isArray(ec.rawStatus?.plugins)?ec.rawStatus.plugins:[]:[],eY=eZ.filter(e=>e.enabled),e0=ec?.configuration?.modelProvider??"unknown",e1=ec?.configuration?.modelName??"unknown",e2=ey(eX,"search"),e3=ey(eX,"crawl"),e5=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.installed||!["active","inactive","failed","not_installed","unknown"].includes(t.serviceStatus)||!["enabled","disabled","static","unknown"].includes(t.enabled)||null!==t.version&&"string"!=typeof t.version||!Array.isArray(t.managerAddresses))return null;return t}catch{return null}}(y?.wazuh),e4=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.supported||"string"!=typeof t.platform||!["enabled","disabled","partial","unsupported","unknown"].includes(t.automaticUpdates??"")||"boolean"!=typeof t.rebootRequired||!Array.isArray(t.timers)||!Array.isArray(t.rebootRequiredPackages))return null;return{...t,fullUpgradePolicyEnabled:!0===t.fullUpgradePolicyEnabled}}catch{return null}}(y?.systemUpdates);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(r.f,{hero:!0,padding:"lg",tone:"ONLINE"===N.status?"primary":"OFFLINE"===N.status?"danger":"warning",testId:"node-cockpit",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>f.push("/nodes"),"aria-label":"Back to nodes",children:(0,t.jsx)(I.f,{className:"h-4 w-4"})}),(0,t.jsx)(d.f,{status:N.status}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold text-primary glow-text-primary",children:N.name}),(0,t.jsxs)("p",{className:"num mt-1 truncate text-xs text-text-muted",children:[N.hostname,":",N.port,N.agent&&(0,t.jsxs)("span",{className:"ml-3 text-primary/70",children:["agent v",N.agent.version]}),y?.source&&(0,t.jsxs)("span",{className:"ml-3 uppercase tracking-wider",children:["source: ",y.source]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(N.status),children:N.status}),N.agent?.status==="UPDATING"&&(0,t.jsxs)(b.t,{variant:"info",children:[(0,t.jsx)(M.f,{className:"h-3 w-3 animate-spin mr-1 inline"}),"Upgrading…"]}),(0,t.jsx)(w,{metadata:N.metadata}),(0,t.jsx)(k.x,{readiness:N.upgradeReadiness}),(0,t.jsx)($.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(P.f,{className:"h-3.5 w-3.5"}),onClick:()=>ee(!0),children:"Edit"}),(0,t.jsx)($.K,{variant:"danger",size:"sm",icon:(0,t.jsx)(U.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eG(),children:"Delete"})]})]}),N.upgradeReadiness?.status==="not-ready"&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(k.a,{readiness:N.upgradeReadiness})}),(0,t.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[auto_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:justify-start",children:[(0,t.jsx)(i.f,{value:y?.cpuUsagePercent??null,label:"CPU Usage",size:128,testId:"node-gauge-cpu"}),(0,t.jsx)(i.f,{value:y?.memoryPercent??null,label:"Memory",size:128,sublabel:y?`${(0,A.L)(y.memoryUsedBytes)}`:void 0,testId:"node-gauge-memory"}),(h=(y?ef(y.disks):[]).reduce((e,t)=>!e||t.usagePercent>e.usagePercent?t:e,null),(0,t.jsx)(i.f,{value:h?.usagePercent??null,label:"Disk",size:128,thresholds:{warn:80,crit:90},sublabel:h?.mountPoint,testId:"node-gauge-disk"}))]}),(0,t.jsx)(j,{nodeId:N.id,height:170})]})]}),("DEGRADED"===N.status||N.agent?.status==="ERROR")&&(()=>{try{let e=JSON.parse(N.metadata),s="string"==typeof e.deployError?e.deployError:null,a="string"==typeof e.upgradeError?e.upgradeError:null,n=s??a;if(n)return(0,t.jsx)("div",{className:"rounded-panel border border-danger/40 bg-danger/5 p-4 shadow-[inset_3px_0_0_var(--color-danger),0_0_20px_var(--color-glow-danger)]",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(E.f,{className:"h-5 w-5 text-danger shrink-0 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:s?"Deploy Failed":"Agent Upgrade Failed"}),(0,t.jsx)("pre",{className:"mt-1 text-xs text-text-muted whitespace-pre-wrap font-mono",children:n})]})]})})}catch{}return null})(),"PROVISIONING"===N.status&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(M.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Deploying agent… Status will update automatically."})]})}),N.agent?.status==="UPDATING"&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(M.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Agent upgrade in progress… Status will update automatically."})]})}),(0,t.jsx)(ea,{nodeId:N.id,nodeStatus:N.status}),(0,t.jsx)(eg,{telemetry:W}),(0,t.jsx)(ed,{node:{id:N.id,name:N.name,hostname:N.hostname,status:N.status,lastHeartbeatAt:N.lastHeartbeatAt}}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"Node Information",children:(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[[["OS",N.os],["Architecture",N.arch],["Address",`${N.ipAddress}:${N.port}`],["Tags",(()=>{try{let e=JSON.parse(N.tags);return e.length?e.join(", "):"—"}catch{return"—"}})()]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Agent Version"}),(0,t.jsx)("dd",{className:"font-medium flex items-center gap-1.5",children:N.agent?.version??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Role"}),(0,t.jsx)("dd",{className:"font-medium",children:N.role?(0,t.jsxs)("button",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/20 transition-colors cursor-pointer",onClick:()=>es(!0),title:"Change role",children:[(0,t.jsx)(D.f,{className:"h-3 w-3"}),N.role.name]}):(0,t.jsx)("button",{className:"text-xs text-text-muted hover:text-primary transition-colors cursor-pointer",onClick:()=>es(!0),children:"+ Assign Role"})})]}),[["Agent Status",N.agent?.status??"—"],["Last Heartbeat",(0,A.C)(N.lastHeartbeatAt)]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Cockpit"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cockpitAvailable?(0,t.jsxs)("a",{href:`https://${N.ipAddress}:9090`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Available",(0,t.jsx)(R.f,{className:"h-3 w-3"})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"Not Available"})})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"CPU Cores"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cpuCores??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Memory Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y?`${(0,A.L)(y.memoryUsedBytes)} / ${(0,A.L)(y.memoryTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Swap Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y&&y.swapTotalBytes?`${(0,A.L)(y.swapUsedBytes??0)} / ${(0,A.L)(y.swapTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Last Health Sample"}),(0,t.jsx)("dd",{className:"font-medium",children:y?(0,A.C)(y.timestamp):"—"})]})]})}),(0,t.jsx)(n.N,{title:"Hermes Agent",description:eN(ec)?ec.displayName??ec.hostname:"No Hermes Agent installed or found",action:eN(ec)?(0,t.jsx)(b.t,{variant:(0,b.k)(ec.status),children:ec.status}):void 0,children:eN(ec)?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.version??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Home"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:ec.hermesHome})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Dashboard"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(ec.dashboardStatus),children:ec.dashboardStatus}),(0,t.jsx)("span",{className:"font-mono text-xs",children:(u=""===(x=(m=ec).dashboardHost.trim().toLowerCase().replace(/^\[|\]$/g,""))||"0.0.0.0"===x||"127.0.0.1"===x||"localhost"===x||"::"===x||"::1"===x?m.hostname:m.dashboardHost,`${u}:${m.dashboardPort}`)})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Gateway"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:(0,b.k)(ec.gatewayStatus),children:ec.gatewayStatus})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"API Server"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.apiServerEnabled?`${ec.apiServerHost}:${ec.apiServerPort??"—"}`:"disabled"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Primary Provider"}),(0,t.jsxs)("dd",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(b.t,{variant:"unknown"===e0?"warning":"success",children:e0}),ec.configuration?.magnusRouterConfigured&&(0,t.jsx)(b.t,{variant:"success",children:"Magnus routed"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Default Model"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:e1})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"OpenAI Runtime"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:ec.configuration?.openaiRuntime==="codex_app_server"?"success":"warning",children:ec.configuration?.openaiRuntime==="codex_app_server"?"Codex app-server":"Hermes default"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Web Search"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(z.f,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e2})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Crawling"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(H,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e3})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Memory"}),(0,t.jsxs)("dd",{className:"mt-1",children:[(0,t.jsx)(b.t,{variant:ec.configuration?.hiveMemConfigured?"success":"warning",children:ec.configuration?.memoryProvider??"not configured"}),(0,t.jsx)(S.f,{configuration:ec.configuration})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Skills"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsxs)("button",{type:"button",onClick:()=>eT(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-text hover:border-primary/60 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:0===eZ.length,children:[(0,t.jsx)(L.f,{className:"h-3.5 w-3.5"}),function(e){if(0===e.length)return"0 synced";let t=e.filter(e=>e.enabled).length;return`${t} enabled / ${e.length} total`}(eZ)]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Last Sync"}),(0,t.jsx)("dd",{className:"text-xs",children:(0,A.C)(ec.lastSyncedAt)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[ec.configuration?.modelBaseUrl&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Base URL: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.modelBaseUrl})]}),ec.configuration?.configPath&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Config: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.configPath})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(ec.profiles??[]).slice(0,6).map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-text-muted",children:[(0,t.jsx)(F.f,{className:"h-3 w-3"}),e.name]},e.id)),(ec.profiles?.length??0)===0&&(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"No profiles synced"})]}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:(0,t.jsx)(R.f,{className:"h-3.5 w-3.5"}),onClick:()=>f.push(`/orchestra/web-gateway?installationId=${encodeURIComponent(ec.id)}`),children:"Open Dashboard"})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No Hermes Agent is installed or currently detected on this node."}),eD&&(0,t.jsx)("p",{className:"text-xs text-success",children:eD}),eO&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eO}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:eM?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(O.f,{className:"h-3.5 w-3.5"}),disabled:!N||"ONLINE"!==N.status||eM,onClick:()=>void eK(),children:eM?"Starting Deployment...":"Deploy Hermes Agent"}),N?.status!=="ONLINE"&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Bring the Magnus agent online before starting automated Hermes deployment."})]})}),(0,t.jsx)(n.N,{title:"Service Checks",children:y&&ej(y.services).length>0?(0,t.jsx)("div",{className:"space-y-2 text-sm",children:ej(y.services).slice(0,8).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded border border-border px-2 py-1.5",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name}),(0,t.jsx)(b.t,{variant:"active"===e.status?"success":"failed"===e.status?"danger":"default",children:e.status})]},e.name))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No service checks available from this node yet."})})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"System Update Readiness",description:"Automatic apt policy and reboot state from the latest heartbeat",action:e4?(0,t.jsx)(b.t,{variant:e4.rebootRequired?"danger":"enabled"===e4.automaticUpdates?"success":"warning",children:e4.rebootRequired?"reboot required":e4.automaticUpdates.replace("_"," ")}):void 0,children:e4?(0,t.jsxs)("div",{className:"space-y-4",children:[e4.rebootRequired&&(0,t.jsxs)("div",{className:"flex gap-3 rounded border border-danger/30 bg-danger/10 p-3",children:[(0,t.jsx)(q.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-danger"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:"Restart needed to finish installed updates"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e4.rebootRequiredPackages.length?e4.rebootRequiredPackages.slice(0,5).join(", "):"The operating system has set the reboot-required marker."})]})]}),(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Platform"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e4.platform})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Automatic updates"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:"enabled"===e4.automaticUpdates?"success":"warning",children:e4.automaticUpdates})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"unattended-upgrades"}),(0,t.jsx)("dd",{children:e4.unattendedUpgradesInstalled?"installed":"not installed"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"full apt upgrade policy"}),(0,t.jsx)("dd",{children:e4.fullUpgradePolicyEnabled?"enabled":"not enabled"})]}),e4.timers.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"font-mono text-[11px] text-text-muted",children:e.name}),(0,t.jsx)("dd",{className:"font-mono text-[11px]",children:e.state})]},e.name))]}),e4.supported&&"enabled"!==e4.automaticUpdates&&(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eU,onClick:()=>void eQ(),children:[eU?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(B.f,{className:"h-3.5 w-3.5"}),eU?"Enabling…":"Enable automatic updates"]}),e_&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e_})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Update posture will appear after agent v1.6.0 reports its first heartbeat."})}),(0,t.jsx)(n.N,{title:"Wazuh Agent",description:"Endpoint-security posture from the latest node heartbeat",action:e5?(0,t.jsx)(b.t,{variant:"active"===(e=e5.serviceStatus)?"success":"failed"===e?"danger":"inactive"===e?"warning":"default",children:e5.serviceStatus.replace("_"," ")}):void 0,children:e5?(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Installation"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:e5.installed?"success":"default",children:e5.installed?"installed":"not installed"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Startup"}),(0,t.jsx)("dd",{className:"font-medium",children:e5.enabled})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e5.version??"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Managers"}),(0,t.jsx)("dd",{className:"mt-1 font-mono text-xs break-all",children:e5.managerAddresses.length?e5.managerAddresses.join(", "):"—"})]})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Wazuh posture will appear after this host reports a current Magnus agent heartbeat."})}),(0,t.jsx)(n.N,{title:"Disk Usage",children:y&&ef(y.disks).length?(0,t.jsx)("div",{className:"space-y-3",children:ef(y.disks).map(e=>(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted",children:e.mountPoint}),(0,t.jsxs)("span",{className:"num",children:[(0,A.L)(e.usedBytes)," / ",(0,A.L)(e.totalBytes)]})]}),(0,t.jsx)(l.f,{value:e.usagePercent,thresholds:{warn:80,crit:90},size:"sm",label:`${e.mountPoint} disk usage`,showValue:!0,className:"mt-1"})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No disk data available"})}),(0,t.jsx)(n.N,{title:"Capacity Forecast",description:"Per-volume 30-day growth trend and estimated time to full",children:J.length?(0,t.jsx)("div",{className:"space-y-3",children:J.map(e=>(0,t.jsxs)("div",{className:"rounded border border-border/50 p-3 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-mono text-text",children:e.mountPoint}),(0,t.jsx)(b.t,{variant:null!==e.daysUntilFull&&e.daysUntilFull<=14?"danger":null!==e.daysUntilFull&&e.daysUntilFull<=30?"warning":"default",children:null===e.daysUntilFull?e.growthRatePerDay>0?"trend uncertain":"stable/shrinking":`${e.daysUntilFull}d to full`})]}),(0,t.jsxs)("div",{className:"mt-2 text-text-muted",children:[e.currentUsagePercent.toFixed(1),"% used · ",(0,A.L)(Math.abs(e.growthRatePerDay)),"/day ",e.growthRatePerDay>=0?"growth":"reclaimed"," · confidence ",(100*e.confidence).toFixed(0),"%"]}),(0,t.jsx)("p",{className:"mt-2 text-text-muted",children:e.recommendation})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"At least three retained samples are needed for a capacity forecast."})}),(0,t.jsxs)(n.N,{title:"Software Revisions",description:"Major runtime versions and package update status",action:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>void eJ(),children:(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${em?"animate-spin":""}`})}),children:[(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[["node","npm","python3","redis","docker","tailscale","magnus-agent"].map(e=>(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("dt",{className:"text-text-muted uppercase text-xs tracking-wide",children:e}),(0,t.jsx)("dd",{className:"font-mono text-right text-xs break-all",children:ei[e]??(em?"Loading…":"—")})]},e)),eu&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eu})]}),(0,t.jsxs)("div",{className:"mt-4 border-t border-border pt-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:"APT Updates"}),(0,t.jsx)(b.t,{variant:eh&&eh>0?"warning":"success",children:ek?"Checking…":`${eh??"—"} pending`})]}),(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Refreshed hourly via apt update",eb?` • Last check: ${(0,A.C)(eb)}`:""]}),e$&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e$}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)($.K,{size:"sm",variant:"secondary",disabled:"ONLINE"!==N.status||ek,onClick:()=>void eV(),children:[(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${ek?"animate-spin":""}`}),"Refresh"]}),(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eA,onClick:()=>void eW(),children:[eA?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):null,eA?"Dispatching…":"APT Upgrade"]})]})]})]})]})]}),en.length>0&&(0,t.jsx)(n.N,{title:"Role Applications",children:(0,t.jsx)("div",{className:"space-y-4",children:en.map(e=>(0,t.jsxs)("div",{className:"rounded-lg border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.f,{className:"h-4 w-4 text-primary"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["apply"===e.action?"Apply":"Remove",": ",e.role?.name??"Unknown"]})]}),(0,t.jsx)(b.t,{variant:"completed"===e.status?"success":"failed"===e.status?"danger":"running"===e.status?"info":"default",children:e.status})]}),e.error&&(0,t.jsx)("div",{className:"mb-2 rounded border border-danger/30 bg-danger/10 px-2 py-1 text-xs text-danger font-mono",children:e.error}),(0,t.jsx)("div",{className:"space-y-1",children:e.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"completed"===e.status?"text-success":"failed"===e.status?"text-danger":"running"===e.status?"text-info":"skipped"===e.status?"text-text-muted/50":"text-text-muted",children:["completed"===e.status&&"✓","failed"===e.status&&"✗","running"===e.status&&"⟳","skipped"===e.status&&"—","pending"===e.status&&"○"]}),(0,t.jsx)("span",{className:"skipped"===e.status?"text-text-muted/50 line-through":"",children:e.name}),e.error&&(0,t.jsx)("span",{className:"text-danger ml-2 truncate max-w-xs",title:e.error,children:e.error})]},e.name))}),(0,t.jsxs)("div",{className:"mt-2 text-[10px] text-text-muted",children:[e.startedAt?`Started: ${(0,A.C)(e.startedAt)}`:"",e.completedAt?` — Completed: ${(0,A.C)(e.completedAt)}`:""]})]},e.id))})}),(0,t.jsx)(C.n,{open:ez,onClose:()=>eT(!1),title:"Hermes Skills",description:`${eY.length} enabled on ${N.name}`,icon:(0,t.jsx)(L.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Enabled"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eY.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Total"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eZ.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Sources"}),(0,t.jsx)("p",{className:"mt-1 text-sm font-mono",children:Array.from(new Set(eZ.map(e=>e.source))).filter(Boolean).join(", ")||"unknown"})]})]}),(0,t.jsxs)("div",{className:"max-h-[55vh] overflow-auto rounded border border-border",children:[(0,t.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,t.jsx)("thead",{className:"sticky top-0 bg-surface text-[10px] uppercase tracking-wide text-text-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Skill"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Category"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border",children:eZ.slice().sort((e,t)=>Number(t.enabled)-Number(e.enabled)||e.slug.localeCompare(t.slug)).map(e=>(0,t.jsxs)("tr",{className:"bg-bg/20",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono",children:e.slug}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.category??"uncategorized"}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.source}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b.t,{variant:e.enabled?"success":"default",children:e.enabled?"enabled":"disabled"})})]},`${e.slug}-${e.source}`))})]}),0===eZ.length&&(0,t.jsx)("div",{className:"p-6 text-sm text-text-muted",children:"No synced Hermes skills were reported for this node."})]})]})}),(0,t.jsx)(G.F,{open:Y,node:N,onClose:()=>ee(!1),onSaved:()=>void eq()}),(0,t.jsx)(G.E,{open:et,node:N?{id:N.id,name:N.name,role:N.role}:null,onClose:()=>es(!1),onSaved:e=>{eB.current=e,N&&v({...N,role:e}),eq()}})]})}],5525)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47061,e=>{"use strict";var s=e.i(43476),t=e.i(71645),r=e.i(68759),a=e.i(46670),n=e.i(93999),i=e.i(32568),l=e.i(82983),c=e.i(34479),o=e.i(4050),d=e.i(95187);let x=(0,d.createServerReference)("40999b36d55ee63c584952f1f6624bfb0e927d20c0",d.callServer,void 0,d.findSourceMapURL,"scanCron");var m=e.i(78571),h=e.i(63376),u=e.i(88187),p=e.i(41120),f=e.i(66595),j=e.i(74544),v=e.i(41220),g=e.i(16327),b=e.i(67927),N=e.i(25981),w=e.i(32781),y=e.i(4139),k=e.i(49882),S=e.i(53138),_=e.i(51757),C=e.i(83967);e.s(["default",0,function(){let{activeNode:e}=(0,o.l)(),[d,I]=(0,t.useState)([]),[E,$]=(0,t.useState)(!1),[L,M]=(0,t.useState)(null),[D,z]=(0,t.useState)(!1),[R,T]=(0,t.useState)(""),[O,A]=(0,t.useState)(new Set),[P,F]=(0,t.useState)(null),[U,G]=(0,t.useState)("1.0.0"),[W,K]=(0,t.useState)(""),[H,q]=(0,t.useState)(!1),B=(0,t.useCallback)(async()=>{$(!0),I([]),M(null);let s=Date.now();try{let s=await x(e.id);if(s.success&&Array.isArray(s.data)){let e=s.data.map(e=>({...e,status:"error"===e.status?"error":"done"}));I(e);let t=new Set(e.filter(e=>e.jobs.length>0).map(e=>e.nodeId));A(t.size>0?t:new Set(e.map(e=>e.nodeId)))}else M(s.error?.message??"Scan returned unsuccessful response")}catch(s){let e=s instanceof Error?s.message:"Scan request failed";M(e)}finally{let e=Date.now()-s;e<1500&&await new Promise(s=>setTimeout(s,1500-e)),$(!1),z(!0)}},[e]);(0,t.useEffect)(()=>{e&&B()},[e,B]);let J=d.reduce((e,s)=>e+("done"===s.status?s.jobs.length:0),0),V=d.filter(e=>"done"===e.status).length,Q=d.filter(e=>"error"===e.status).length,Y=e=>{if(!R)return!0;let s=R.toLowerCase();return e.name.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.schedule.toLowerCase().includes(s)||(e.user?.toLowerCase().includes(s)??!1)},Z=async()=>{if(P&&U){q(!0);try{let e=JSON.stringify({name:P.job.name,version:U,schedule:P.job.schedule,command:P.job.command,description:W},null,2);await l.f.library.files.create({name:`${P.job.name} v${U}`,fileName:`${P.job.name}-${U}.json`,mimeType:"application/x-magnus-cronjob",content:e,tags:["cronjob","cron"]}),F(null),G("1.0.0"),K("")}catch{}finally{q(!1)}}};return(0,s.jsxs)(h.U,{className:"space-y-6",children:[(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Cron Jobs"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage scheduled jobs across your fleet"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[D&&!E&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[d.length," node",1!==d.length?"s":""," · ",J," job",1!==J?"s":"",Q>0&&` \xb7 ${Q} error${1!==Q?"s":""}`]}),(0,s.jsxs)(r.K,{variant:"secondary",size:"sm",onClick:()=>void B(),disabled:E,children:[(0,s.jsx)(p.f,{className:(0,m.f)("h-3.5 w-3.5 mr-1.5",E&&"animate-spin")}),E?"Scanning...":"Rescan"]})]})]})}),E&&(0,s.jsx)(h.z,{children:(0,s.jsx)(u.f,{title:"Scanning Nodes for Cron Jobs",description:"Probing all online nodes...",nodes:d.map(e=>({nodeId:e.nodeId,nodeName:e.nodeName,status:e.status,error:e.error})),scanning:!0})}),!E&&D&&J>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(f.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,s.jsx)("input",{type:"text",placeholder:"Search jobs by name, command, or schedule...",value:R,onChange:e=>T(e.target.value),className:(0,m.f)(i.W,"pl-9")})]})}),!E&&D&&L&&(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(S.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,s.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:L}),(0,s.jsxs)(r.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void B(),children:[(0,s.jsx)(p.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!E&&D&&!L&&(0,s.jsxs)(s.Fragment,{children:[0===d.length?(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(v.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):d.map(e=>{let t=O.has(e.nodeId),i=e.jobs.filter(Y);return(0,s.jsx)(h.z,{children:(0,s.jsxs)(n.N,{className:"overflow-hidden",children:[(0,s.jsxs)("button",{onClick:()=>{var s;return s=e.nodeId,void A(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,s.jsx)(v.f,{className:"h-4 w-4 text-primary"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:e.nodeName}),"done"===e.status&&(0,s.jsxs)(a.t,{variant:e.jobs.length>0?"success":"default",children:[e.jobs.length," job",1!==e.jobs.length?"s":""]}),"error"===e.status&&((0,c.f)(e.error)?(0,s.jsx)(a.t,{variant:"default",children:"Disabled"}):(0,s.jsx)(a.t,{variant:"danger",children:"Error"}))]}),"error"===e.status&&e.error&&(0,s.jsx)("p",{className:(0,m.f)("text-[11px] mt-0.5 truncate",(0,c.f)(e.error)?"text-text-muted":"text-danger"),children:(0,c.f)(e.error)??e.error}),"done"===e.status&&0===e.jobs.length&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No cron jobs found on this node"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===e.status?(0,s.jsx)(_.f,{className:"h-4 w-4 text-success"}):(0,s.jsx)(C.f,{className:"h-4 w-4 text-danger"}),t?(0,s.jsx)(g.f,{className:"h-4 w-4 text-text-muted"}):(0,s.jsx)(b.f,{className:"h-4 w-4 text-text-muted"})]})]}),t&&"done"===e.status&&(0,s.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===i.length?(0,s.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:0===e.jobs.length?"No cron jobs found on this node.":"No jobs match your search on this node."})}):(0,s.jsx)("div",{className:"divide-y divide-border/30",children:i.map((t,n)=>(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(j.f,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"text-xs font-bold",children:t.name}),t.user&&(0,s.jsx)(a.t,{variant:"default",children:t.user}),(0,s.jsx)(a.t,{variant:"info",children:t.schedule})]}),(0,s.jsxs)(r.K,{size:"sm",variant:"secondary",onClick:()=>{F({job:t,nodeId:e.nodeId,nodeName:e.nodeName}),G("1.0.0"),K("")},children:[(0,s.jsx)(N.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,s.jsx)(k.f,{className:"h-3 w-3"}),function(e){let s=e.split(/\s+/);if(s.length<5)return e;let[t,r,a,n,i]=s;return"*"===t&&"*"===r&&"*"===a&&"*"===n&&"*"===i?"Every minute":"0"===t&&"*"===r&&"*"===a&&"*"===n&&"*"===i?"Every hour":"0"===t&&"0"===r&&"*"===a&&"*"===n&&"*"===i?"Daily at midnight":t?.startsWith("*/")?`Every ${t.slice(2)} minutes`:r?.startsWith("*/")?`Every ${r.slice(2)} hours`:e}(t.schedule)]}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded border border-border bg-surface p-3",children:[(0,s.jsx)(y.f,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),(0,s.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-all flex-1",children:t.command})]})]},`${t.name}-${n}`))})})]})},e.nodeId)}),d.length>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,s.jsxs)("span",{children:[V," node",1!==V?"s":""," scanned ·"," ",J," job",1!==J?"s":""," discovered"]}),Q>0&&(0,s.jsxs)("span",{className:"text-danger",children:[Q," node",1!==Q?"s":""," unreachable"]})]})})]}),(0,s.jsx)(i.n,{open:!!P,onClose:()=>F(null),title:"Publish to Library",description:P?.job.name??"",icon:(0,s.jsx)(N.f,{className:"h-5 w-5 text-primary"}),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,s.jsx)("span",{className:"text-accent",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:U,onChange:e=>G(e.target.value),placeholder:"1.0.0",className:i.W})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:"Description"}),(0,s.jsx)("input",{type:"text",value:W,onChange:e=>K(e.target.value),placeholder:"What does this cron job do?",className:i.W})]}),P&&(0,s.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",P.nodeName]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Schedule:"})," ",P.job.schedule]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Command:"})," ",(0,s.jsx)("span",{className:"text-primary",children:P.job.command})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,s.jsx)(r.K,{variant:"secondary",size:"sm",onClick:()=>F(null),children:"Cancel"}),(0,s.jsx)(r.K,{size:"sm",onClick:()=>void Z(),disabled:H||!U,children:H?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],47061)},46670,e=>{"use strict";var s=e.i(43476),t=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)]"},a={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:c=!1}){return(0,s.jsxs)("span",{className:(0,t.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,s.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[c&&(0,s.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",a[n])}),(0,s.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",a[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 s=e.i(43476),t=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 a=(0,t.f)(r);var n=e.i(75775),i=e.i(78571),l=e.i(3062),c=e.i(35084);let o={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:t=100,tone:r,thresholds:a=c.q,label:n,size:l="xs",showValue:m=!1,valueLabel:h,glow:u,className:p,testId:f}){let j="number"==typeof e&&Number.isFinite(e),v=j?Math.max(0,Math.min(100,e/(t||1)*100)):0,g=r??(j?(0,c.Z)(v,a):"muted"),b=u||!r&&j&&v>=a.warn,N=h??(j?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,s.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",p),"data-testid":f,children:[(0,s.jsx)("div",{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":j?e:void 0,"aria-valuetext":N,className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,s.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",c.H[g],b&&o[g])})}),m&&(0,s.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",j?c.T[g]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function h({values:e,tone:t="primary",width:r=160,height:a=32,area:n=!0,max:l,percent:o=!1,threshold:d,live:x=!0,emptyLabel:u="not enough data",className:p,testId:f,label:j,stretch:v=!1}){let g=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,s.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",p),"data-testid":f,children:u});let b=c.v[t],N=l??(o?Math.max(100,...e):Math.max(...e,d??0)||1),w=a-4,y=r/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,S=e.map((e,s)=>[s*y,k(e)]),_=S.map(([e,s])=>`${e.toFixed(1)},${s.toFixed(1)}`).join(" "),C=S[S.length-1];return(0,s.jsxs)("svg",{width:v?"100%":r,height:a,viewBox:`0 0 ${r} ${a}`,preserveAspectRatio:v?"none":void 0,className:(0,i.f)("block overflow-visible",p),"data-testid":f,role:j?"img":void 0,"aria-label":j,"aria-hidden":!j||void 0,children:[n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:g,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,s.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,s.jsx)("polygon",{points:`0,${a} ${_} ${r},${a}`,fill:`url(#${g})`})]}),void 0!==d&&(0,s.jsx)("line",{x1:0,x2:r,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,s.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:_}),x&&!v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2,fill:b})]})]})}e.s(["f",0,h],55427),e.s(["N",0,function({title:e,description:t,children:r,className:a,action:n,tone:i,corners:c=!1,...o}){return(0,s.jsx)(l.f,{...o,tone:i,corners:c,title:e,description:t,action:n,className:a,children:r})},"n",0,function({label:e,value:t,icon:r,trend:o,spark:d,meter:m,delta:u,tone:p="primary",className:f,testId:j}){let v=!u||u.value>=0===(u.positiveIsGood??!0);return(0,s.jsxs)(l.f,{tone:p,className:(0,i.f)("overflow-hidden",f),testId:j,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),r&&(0,s.jsx)("span",{className:"text-primary/60",children:r})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,s.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===p?"text-primary neon-text":c.T[p]),children:t}),u&&0!==u.value&&(0,s.jsxs)("span",{className:(0,i.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[u.value>0?(0,s.jsx)(n.f,{className:"h-3 w-3"}):(0,s.jsx)(a,{className:"h-3 w-3"}),Math.abs(u.value).toFixed(+!Number.isInteger(u.value)),u.unit]})]}),o&&(0,s.jsx)("div",{className:(0,i.f)("mt-1 text-[11px]",o.positive?"text-success":"text-danger"),children:o.value}),void 0!==m&&(0,s.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,s.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,s.jsx)(h,{values:d,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var s=e.i(43476),t=e.i(78571),r=e.i(35084);let a={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:c=!0,interactive:o=!0,hero:d=!1,title:x,description:m,icon:h,action:u,as:p="div",padding:f="md",testId:j,className:v,children:g,...b}){return(0,s.jsxs)(p,{...b,"data-testid":j??b["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[f],c&&"panel-corners",c&&a[e],o&&"glow-hover",o&&n[e],o&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||u||h)&&(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,s.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",r.T[e]),children:h}),(0,s.jsxs)("div",{className:"min-w-0",children:[x&&(0,s.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),u]}),g]})}])},63376,e=>{"use strict";var s=e.i(43476);e.s(["z",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:`animate-page-in${t?` ${t}`:""}`,children:e})},"U",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:t,children:e})}])},88187,25981,e=>{"use strict";var s=e.i(43476),t=e.i(32181),r=e.i(32781),a=e.i(51757),n=e.i(83967),i=e.i(15331);e.s(["f",0,function({title:e,description:l,nodes:c,scanning:o}){return(0,s.jsxs)(t.f.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.16,1,.3,1]},className:"rounded border border-primary/30 bg-surface p-6 relative overflow-hidden",children:[o&&(0,s.jsx)(t.f.div,{className:"absolute inset-0 pointer-events-none",initial:{opacity:0},animate:{opacity:1},children:(0,s.jsx)(t.f.div,{className:"absolute left-0 right-0 h-px bg-gradient-to-r from-transparent via-primary/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:2,repeat:1/0,ease:"linear"}})}),(0,s.jsx)("div",{className:"absolute inset-0 rounded pointer-events-none",style:{boxShadow:o?"0 0 20px var(--color-glow), inset 0 0 20px rgba(0,229,255,0.03)":"none",transition:"box-shadow 0.5s ease"}}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[o?(0,s.jsx)(t.f.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:(0,s.jsx)(i.f,{className:"h-5 w-5 text-primary"})}):(0,s.jsx)(a.f,{className:"h-5 w-5 text-success"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-bold uppercase tracking-wider",children:o?e:"Scan Complete"}),l&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:l})]})]}),c.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:c.map((e,i)=>(0,s.jsxs)(t.f.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.05*i,duration:.3},className:"flex items-center gap-3 text-xs",children:["scanning"===e.status&&(0,s.jsx)(r.f,{className:"h-3.5 w-3.5 text-primary animate-spin"}),"done"===e.status&&(0,s.jsx)(a.f,{className:"h-3.5 w-3.5 text-success"}),"error"===e.status&&(0,s.jsx)(n.f,{className:"h-3.5 w-3.5 text-danger"}),(0,s.jsx)("span",{className:"text-text",children:e.nodeName}),"error"===e.status&&e.error&&(0,s.jsx)("span",{className:"text-[10px] text-danger/70 truncate max-w-[200px]",children:e.error})]},e.nodeId))}),0===c.length&&o&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:"Discovering nodes..."})]})]})}],88187);var l=e.i(56420);let c={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};c.node;let o=(0,l.f)(c);e.s(["f",0,o],25981)},75775,e=>{"use strict";var s=e.i(56420);let t={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};t.node;let r=(0,s.f)(t);e.s(["f",0,r],75775)},49882,e=>{"use strict";var s=e.i(56420);let t={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};t.node;let r=(0,s.f)(t);e.s(["f",0,r],49882)},95187,(e,s,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var a in r)Object.defineProperty(t,a,{enumerable:!0,get:r[a]});let n=e.r(32120),i=e.r(92245),l=e.r(35326)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47061,e=>{"use strict";var s=e.i(43476),t=e.i(71645),r=e.i(68759),a=e.i(46670),n=e.i(93999),i=e.i(32568),l=e.i(82983),c=e.i(34479),o=e.i(4050),d=e.i(95187);let x=(0,d.createServerReference)("4058b5564ecf0effb7ce35b324e1f3276263199fb2",d.callServer,void 0,d.findSourceMapURL,"scanCron");var m=e.i(78571),h=e.i(63376),u=e.i(88187),p=e.i(41120),f=e.i(66595),j=e.i(74544),v=e.i(41220),g=e.i(16327),b=e.i(67927),N=e.i(25981),w=e.i(32781),y=e.i(4139),k=e.i(49882),S=e.i(64155),_=e.i(51757),C=e.i(83967);e.s(["default",0,function(){let{activeNode:e}=(0,o.l)(),[d,I]=(0,t.useState)([]),[E,$]=(0,t.useState)(!1),[L,M]=(0,t.useState)(null),[D,z]=(0,t.useState)(!1),[R,T]=(0,t.useState)(""),[O,A]=(0,t.useState)(new Set),[P,F]=(0,t.useState)(null),[U,G]=(0,t.useState)("1.0.0"),[W,K]=(0,t.useState)(""),[H,q]=(0,t.useState)(!1),B=(0,t.useCallback)(async()=>{$(!0),I([]),M(null);let s=Date.now();try{let s=await x(e.id);if(s.success&&Array.isArray(s.data)){let e=s.data.map(e=>({...e,status:"error"===e.status?"error":"done"}));I(e);let t=new Set(e.filter(e=>e.jobs.length>0).map(e=>e.nodeId));A(t.size>0?t:new Set(e.map(e=>e.nodeId)))}else M(s.error?.message??"Scan returned unsuccessful response")}catch(s){let e=s instanceof Error?s.message:"Scan request failed";M(e)}finally{let e=Date.now()-s;e<1500&&await new Promise(s=>setTimeout(s,1500-e)),$(!1),z(!0)}},[e]);(0,t.useEffect)(()=>{e&&B()},[e,B]);let J=d.reduce((e,s)=>e+("done"===s.status?s.jobs.length:0),0),V=d.filter(e=>"done"===e.status).length,Q=d.filter(e=>"error"===e.status).length,Y=e=>{if(!R)return!0;let s=R.toLowerCase();return e.name.toLowerCase().includes(s)||e.command.toLowerCase().includes(s)||e.schedule.toLowerCase().includes(s)||(e.user?.toLowerCase().includes(s)??!1)},Z=async()=>{if(P&&U){q(!0);try{let e=JSON.stringify({name:P.job.name,version:U,schedule:P.job.schedule,command:P.job.command,description:W},null,2);await l.f.library.files.create({name:`${P.job.name} v${U}`,fileName:`${P.job.name}-${U}.json`,mimeType:"application/x-magnus-cronjob",content:e,tags:["cronjob","cron"]}),F(null),G("1.0.0"),K("")}catch{}finally{q(!1)}}};return(0,s.jsxs)(h.U,{className:"space-y-6",children:[(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Cron Jobs"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage scheduled jobs across your fleet"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[D&&!E&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[d.length," node",1!==d.length?"s":""," · ",J," job",1!==J?"s":"",Q>0&&` \xb7 ${Q} error${1!==Q?"s":""}`]}),(0,s.jsxs)(r.K,{variant:"secondary",size:"sm",onClick:()=>void B(),disabled:E,children:[(0,s.jsx)(p.f,{className:(0,m.f)("h-3.5 w-3.5 mr-1.5",E&&"animate-spin")}),E?"Scanning...":"Rescan"]})]})]})}),E&&(0,s.jsx)(h.z,{children:(0,s.jsx)(u.f,{title:"Scanning Nodes for Cron Jobs",description:"Probing all online nodes...",nodes:d.map(e=>({nodeId:e.nodeId,nodeName:e.nodeName,status:e.status,error:e.error})),scanning:!0})}),!E&&D&&J>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(f.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,s.jsx)("input",{type:"text",placeholder:"Search jobs by name, command, or schedule...",value:R,onChange:e=>T(e.target.value),className:(0,m.f)(i.W,"pl-9")})]})}),!E&&D&&L&&(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(S.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,s.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:L}),(0,s.jsxs)(r.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void B(),children:[(0,s.jsx)(p.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!E&&D&&!L&&(0,s.jsxs)(s.Fragment,{children:[0===d.length?(0,s.jsx)(h.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(v.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):d.map(e=>{let t=O.has(e.nodeId),i=e.jobs.filter(Y);return(0,s.jsx)(h.z,{children:(0,s.jsxs)(n.N,{className:"overflow-hidden",children:[(0,s.jsxs)("button",{onClick:()=>{var s;return s=e.nodeId,void A(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,s.jsx)(v.f,{className:"h-4 w-4 text-primary"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:e.nodeName}),"done"===e.status&&(0,s.jsxs)(a.t,{variant:e.jobs.length>0?"success":"default",children:[e.jobs.length," job",1!==e.jobs.length?"s":""]}),"error"===e.status&&((0,c.f)(e.error)?(0,s.jsx)(a.t,{variant:"default",children:"Disabled"}):(0,s.jsx)(a.t,{variant:"danger",children:"Error"}))]}),"error"===e.status&&e.error&&(0,s.jsx)("p",{className:(0,m.f)("text-[11px] mt-0.5 truncate",(0,c.f)(e.error)?"text-text-muted":"text-danger"),children:(0,c.f)(e.error)??e.error}),"done"===e.status&&0===e.jobs.length&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No cron jobs found on this node"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===e.status?(0,s.jsx)(_.f,{className:"h-4 w-4 text-success"}):(0,s.jsx)(C.f,{className:"h-4 w-4 text-danger"}),t?(0,s.jsx)(g.f,{className:"h-4 w-4 text-text-muted"}):(0,s.jsx)(b.f,{className:"h-4 w-4 text-text-muted"})]})]}),t&&"done"===e.status&&(0,s.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===i.length?(0,s.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:0===e.jobs.length?"No cron jobs found on this node.":"No jobs match your search on this node."})}):(0,s.jsx)("div",{className:"divide-y divide-border/30",children:i.map((t,n)=>(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(j.f,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"text-xs font-bold",children:t.name}),t.user&&(0,s.jsx)(a.t,{variant:"default",children:t.user}),(0,s.jsx)(a.t,{variant:"info",children:t.schedule})]}),(0,s.jsxs)(r.K,{size:"sm",variant:"secondary",onClick:()=>{F({job:t,nodeId:e.nodeId,nodeName:e.nodeName}),G("1.0.0"),K("")},children:[(0,s.jsx)(N.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,s.jsx)(k.f,{className:"h-3 w-3"}),function(e){let s=e.split(/\s+/);if(s.length<5)return e;let[t,r,a,n,i]=s;return"*"===t&&"*"===r&&"*"===a&&"*"===n&&"*"===i?"Every minute":"0"===t&&"*"===r&&"*"===a&&"*"===n&&"*"===i?"Every hour":"0"===t&&"0"===r&&"*"===a&&"*"===n&&"*"===i?"Daily at midnight":t?.startsWith("*/")?`Every ${t.slice(2)} minutes`:r?.startsWith("*/")?`Every ${r.slice(2)} hours`:e}(t.schedule)]}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded border border-border bg-surface p-3",children:[(0,s.jsx)(y.f,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),(0,s.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-all flex-1",children:t.command})]})]},`${t.name}-${n}`))})})]})},e.nodeId)}),d.length>0&&(0,s.jsx)(h.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,s.jsxs)("span",{children:[V," node",1!==V?"s":""," scanned ·"," ",J," job",1!==J?"s":""," discovered"]}),Q>0&&(0,s.jsxs)("span",{className:"text-danger",children:[Q," node",1!==Q?"s":""," unreachable"]})]})})]}),(0,s.jsx)(i.n,{open:!!P,onClose:()=>F(null),title:"Publish to Library",description:P?.job.name??"",icon:(0,s.jsx)(N.f,{className:"h-5 w-5 text-primary"}),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,s.jsx)("span",{className:"text-accent",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:U,onChange:e=>G(e.target.value),placeholder:"1.0.0",className:i.W})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:"Description"}),(0,s.jsx)("input",{type:"text",value:W,onChange:e=>K(e.target.value),placeholder:"What does this cron job do?",className:i.W})]}),P&&(0,s.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",P.nodeName]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Schedule:"})," ",P.job.schedule]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Command:"})," ",(0,s.jsx)("span",{className:"text-primary",children:P.job.command})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,s.jsx)(r.K,{variant:"secondary",size:"sm",onClick:()=>F(null),children:"Cancel"}),(0,s.jsx)(r.K,{size:"sm",onClick:()=>void Z(),disabled:H||!U,children:H?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],47061)},46670,e=>{"use strict";var s=e.i(43476),t=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)]"},a={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:c=!1}){return(0,s.jsxs)("span",{className:(0,t.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,s.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[c&&(0,s.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",a[n])}),(0,s.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",a[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 s=e.i(43476),t=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 a=(0,t.f)(r);var n=e.i(75775),i=e.i(78571),l=e.i(3062),c=e.i(35084);let o={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:t=100,tone:r,thresholds:a=c.q,label:n,size:l="xs",showValue:m=!1,valueLabel:h,glow:u,className:p,testId:f}){let j="number"==typeof e&&Number.isFinite(e),v=j?Math.max(0,Math.min(100,e/(t||1)*100)):0,g=r??(j?(0,c.Z)(v,a):"muted"),b=u||!r&&j&&v>=a.warn,N=h??(j?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,s.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",p),"data-testid":f,children:[(0,s.jsx)("div",{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":j?e:void 0,"aria-valuetext":N,className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,s.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",c.H[g],b&&o[g])})}),m&&(0,s.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",j?c.T[g]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function h({values:e,tone:t="primary",width:r=160,height:a=32,area:n=!0,max:l,percent:o=!1,threshold:d,live:x=!0,emptyLabel:u="not enough data",className:p,testId:f,label:j,stretch:v=!1}){let g=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,s.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",p),"data-testid":f,children:u});let b=c.v[t],N=l??(o?Math.max(100,...e):Math.max(...e,d??0)||1),w=a-4,y=r/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,S=e.map((e,s)=>[s*y,k(e)]),_=S.map(([e,s])=>`${e.toFixed(1)},${s.toFixed(1)}`).join(" "),C=S[S.length-1];return(0,s.jsxs)("svg",{width:v?"100%":r,height:a,viewBox:`0 0 ${r} ${a}`,preserveAspectRatio:v?"none":void 0,className:(0,i.f)("block overflow-visible",p),"data-testid":f,role:j?"img":void 0,"aria-label":j,"aria-hidden":!j||void 0,children:[n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:g,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,s.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,s.jsx)("polygon",{points:`0,${a} ${_} ${r},${a}`,fill:`url(#${g})`})]}),void 0!==d&&(0,s.jsx)("line",{x1:0,x2:r,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,s.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:_}),x&&!v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,s.jsx)("circle",{cx:C[0],cy:C[1],r:2,fill:b})]})]})}e.s(["f",0,h],55427),e.s(["N",0,function({title:e,description:t,children:r,className:a,action:n,tone:i,corners:c=!1,...o}){return(0,s.jsx)(l.f,{...o,tone:i,corners:c,title:e,description:t,action:n,className:a,children:r})},"n",0,function({label:e,value:t,icon:r,trend:o,spark:d,meter:m,delta:u,tone:p="primary",className:f,testId:j}){let v=!u||u.value>=0===(u.positiveIsGood??!0);return(0,s.jsxs)(l.f,{tone:p,className:(0,i.f)("overflow-hidden",f),testId:j,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),r&&(0,s.jsx)("span",{className:"text-primary/60",children:r})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,s.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===p?"text-primary neon-text":c.T[p]),children:t}),u&&0!==u.value&&(0,s.jsxs)("span",{className:(0,i.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[u.value>0?(0,s.jsx)(n.f,{className:"h-3 w-3"}):(0,s.jsx)(a,{className:"h-3 w-3"}),Math.abs(u.value).toFixed(+!Number.isInteger(u.value)),u.unit]})]}),o&&(0,s.jsx)("div",{className:(0,i.f)("mt-1 text-[11px]",o.positive?"text-success":"text-danger"),children:o.value}),void 0!==m&&(0,s.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,s.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,s.jsx)(h,{values:d,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var s=e.i(43476),t=e.i(78571),r=e.i(35084);let a={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:c=!0,interactive:o=!0,hero:d=!1,title:x,description:m,icon:h,action:u,as:p="div",padding:f="md",testId:j,className:v,children:g,...b}){return(0,s.jsxs)(p,{...b,"data-testid":j??b["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[f],c&&"panel-corners",c&&a[e],o&&"glow-hover",o&&n[e],o&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||u||h)&&(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,s.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",r.T[e]),children:h}),(0,s.jsxs)("div",{className:"min-w-0",children:[x&&(0,s.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),u]}),g]})}])},63376,e=>{"use strict";var s=e.i(43476);e.s(["z",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:`animate-page-in${t?` ${t}`:""}`,children:e})},"U",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:t,children:e})}])},88187,25981,e=>{"use strict";var s=e.i(43476),t=e.i(32181),r=e.i(32781),a=e.i(51757),n=e.i(83967),i=e.i(15331);e.s(["f",0,function({title:e,description:l,nodes:c,scanning:o}){return(0,s.jsxs)(t.f.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.16,1,.3,1]},className:"rounded border border-primary/30 bg-surface p-6 relative overflow-hidden",children:[o&&(0,s.jsx)(t.f.div,{className:"absolute inset-0 pointer-events-none",initial:{opacity:0},animate:{opacity:1},children:(0,s.jsx)(t.f.div,{className:"absolute left-0 right-0 h-px bg-gradient-to-r from-transparent via-primary/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:2,repeat:1/0,ease:"linear"}})}),(0,s.jsx)("div",{className:"absolute inset-0 rounded pointer-events-none",style:{boxShadow:o?"0 0 20px var(--color-glow), inset 0 0 20px rgba(0,229,255,0.03)":"none",transition:"box-shadow 0.5s ease"}}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[o?(0,s.jsx)(t.f.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:(0,s.jsx)(i.f,{className:"h-5 w-5 text-primary"})}):(0,s.jsx)(a.f,{className:"h-5 w-5 text-success"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-bold uppercase tracking-wider",children:o?e:"Scan Complete"}),l&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:l})]})]}),c.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:c.map((e,i)=>(0,s.jsxs)(t.f.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.05*i,duration:.3},className:"flex items-center gap-3 text-xs",children:["scanning"===e.status&&(0,s.jsx)(r.f,{className:"h-3.5 w-3.5 text-primary animate-spin"}),"done"===e.status&&(0,s.jsx)(a.f,{className:"h-3.5 w-3.5 text-success"}),"error"===e.status&&(0,s.jsx)(n.f,{className:"h-3.5 w-3.5 text-danger"}),(0,s.jsx)("span",{className:"text-text",children:e.nodeName}),"error"===e.status&&e.error&&(0,s.jsx)("span",{className:"text-[10px] text-danger/70 truncate max-w-[200px]",children:e.error})]},e.nodeId))}),0===c.length&&o&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:"Discovering nodes..."})]})]})}],88187);var l=e.i(56420);let c={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};c.node;let o=(0,l.f)(c);e.s(["f",0,o],25981)},75775,e=>{"use strict";var s=e.i(56420);let t={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};t.node;let r=(0,s.f)(t);e.s(["f",0,r],75775)},49882,e=>{"use strict";var s=e.i(56420);let t={name:"calendar",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}]]};t.node;let r=(0,s.f)(t);e.s(["f",0,r],49882)},95187,(e,s,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var a in r)Object.defineProperty(t,a,{enumerable:!0,get:r[a]});let n=e.r(32120),i=e.r(92245),l=e.r(35326)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15219,e=>{"use strict";var t=e.i(43476),r=e.i(22016),s=e.i(71645),a=e.i(63376),i=e.i(93999),n=e.i(82983),l=e.i(53138),o=e.i(68877),c=e.i(41120),d=e.i(16306),x=e.i(63644);e.s(["default",0,function(){let[e,m]=(0,s.useState)(null),[h,p]=(0,s.useState)([]),[u,v]=(0,s.useState)(!0),f=(0,s.useCallback)(async()=>{v(!0);try{let[e,t]=await Promise.all([n.f.anomalies.summary(),n.f.anomalies.list({resolved:"false",pageSize:100})]);m(e.data??null),p(t.data?.anomalies??[])}catch{}finally{v(!1)}},[]);(0,s.useEffect)(()=>{f()},[f]);let g=(0,s.useMemo)(()=>e?.byNode[0]??null,[e]);return(0,t.jsxs)(a.U,{children:[(0,t.jsx)(a.z,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h1",{className:"text-2xl font-bold uppercase tracking-wider text-text",children:"Anomalies"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs uppercase tracking-wider text-text-muted",children:"Fleet-wide anomaly feed with AI correlation drill-down"})]}),(0,t.jsxs)("button",{onClick:()=>void f(),className:"inline-flex items-center gap-2 rounded border border-border px-3 py-2 text-xs font-semibold uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary",children:[(0,t.jsx)(c.f,{className:`h-3.5 w-3.5 ${u?"animate-spin":""}`}),"Refresh"]})]})}),(0,t.jsx)(a.z,{children:(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[(0,t.jsx)(i.N,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(d.f,{className:"h-5 w-5 text-danger"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-lg font-bold text-text",children:e?.totalActive??"—"}),(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Active anomalies"})]})]})}),(0,t.jsx)(i.N,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(l.f,{className:"h-5 w-5 text-warning"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-lg font-bold text-text",children:e?Object.keys(e.bySeverity).length:"—"}),(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Severity bands active"})]})]})}),(0,t.jsx)(i.N,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(x.f,{className:"h-5 w-5 text-primary"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-bold text-text",children:g?.nodeName??"—"}),(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Current hotspot"})]})]})})]})}),(0,t.jsx)(a.z,{children:(0,t.jsxs)(i.N,{className:"overflow-hidden p-0",children:[(0,t.jsx)("div",{className:"border-b border-border/50 px-4 py-3",children:(0,t.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:"Unresolved anomalies"})}),0===h.length?(0,t.jsx)("div",{className:"px-4 py-8 text-center text-sm text-text-muted",children:u?"Loading anomalies…":"No unresolved anomalies at the moment. A rare and beautiful sight."}):(0,t.jsx)("div",{className:"divide-y divide-border/50",children:h.map(e=>{var s;return(0,t.jsxs)(r.default,{href:`/anomalies/${e.id}`,className:"flex items-center justify-between gap-4 px-4 py-3 transition-colors hover:bg-surface-hover",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,t.jsx)("span",{className:`rounded border px-2 py-1 text-[10px] font-bold uppercase tracking-wider ${"critical"===(s=e.severity)?"border-danger/30 bg-danger/5 text-danger":"warning"===s?"border-warning/30 bg-warning/5 text-warning":"border-info/30 bg-info/5 text-info"}`,children:e.severity}),(0,t.jsx)("span",{className:"text-xs font-semibold text-text",children:e.metric}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted",children:e.node?.name??e.nodeId}),e.occurrenceCount>1&&(0,t.jsxs)("span",{className:"rounded bg-accent/10 px-1.5 py-0.5 text-[10px] font-bold text-accent",children:["×",e.occurrenceCount]})]}),(0,t.jsxs)("p",{className:"text-[11px] text-text-muted",children:["Value ",e.value.toFixed(2)," • z-score ",e.zScore.toFixed(2)," ","• first seen ",new Date(e.firstSeenAt).toLocaleString(),e.occurrenceCount>1&&(0,t.jsxs)(t.Fragment,{children:[" • last seen ",new Date(e.lastSeenAt).toLocaleString()]})]})]}),(0,t.jsx)(o.f,{className:"h-4 w-4 flex-shrink-0 text-text-muted"})]},e.id)})})]})})]})}])},93999,51196,55427,e=>{"use strict";var t=e.i(43476),r=e.i(56420);let s={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};s.node;let a=(0,r.f)(s);var i=e.i(75775),n=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:r=100,tone:s,thresholds:a=o.q,label:i,size:l="xs",showValue:m=!1,valueLabel:h,glow:p,className:u,testId:v}){let f="number"==typeof e&&Number.isFinite(e),g=f?Math.max(0,Math.min(100,e/(r||1)*100)):0,j=s??(f?(0,o.Z)(g,a):"muted"),b=p||!s&&f&&g>=a.warn,w=h??(f?`${g.toFixed(+(g<10&&g>0))}%`:"—");return(0,t.jsxs)("div",{className:(0,n.f)("flex min-w-0 items-center gap-2",u),"data-testid":v,children:[(0,t.jsx)("div",{role:"meter","aria-label":i,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":f?e:void 0,"aria-valuetext":w,className:(0,n.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,t.jsx)("div",{style:{"--meter":`${g}%`},className:(0,n.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,t.jsx)("span",{className:(0,n.f)("num w-11 shrink-0 text-right text-[11px]",f?o.T[j]:"text-text-muted"),children:w})]})}e.s(["f",0,x],51196);var m=e.i(71645);function h({values:e,tone:r="primary",width:s=160,height:a=32,area:i=!0,max:l,percent:c=!1,threshold:d,live:x=!0,emptyLabel:p="not enough data",className:u,testId:v,label:f,stretch:g=!1}){let j=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,t.jsx)("div",{className:(0,n.f)("flex h-8 items-center text-xs italic text-text-muted",u),"data-testid":v,children:p});let b=o.v[r],w=l??(c?Math.max(100,...e):Math.max(...e,d??0)||1),N=a-4,y=s/(e.length-1),k=e=>2+N-Math.max(0,e)/w*N,_=e.map((e,t)=>[t*y,k(e)]),$=_.map(([e,t])=>`${e.toFixed(1)},${t.toFixed(1)}`).join(" "),M=_[_.length-1];return(0,t.jsxs)("svg",{width:g?"100%":s,height:a,viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:g?"none":void 0,className:(0,n.f)("block overflow-visible",u),"data-testid":v,role:f?"img":void 0,"aria-label":f,"aria-hidden":!f||void 0,children:[i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:j,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,t.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,t.jsx)("polygon",{points:`0,${a} ${$} ${s},${a}`,fill:`url(#${j})`})]}),void 0!==d&&(0,t.jsx)("line",{x1:0,x2:s,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,t.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:$}),x&&!g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:M[0],cy:M[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,t.jsx)("circle",{cx:M[0],cy:M[1],r:2,fill:b})]})]})}e.s(["f",0,h],55427),e.s(["N",0,function({title:e,description:r,children:s,className:a,action:i,tone:n,corners:o=!1,...c}){return(0,t.jsx)(l.f,{...c,tone:n,corners:o,title:e,description:r,action:i,className:a,children:s})},"n",0,function({label:e,value:r,icon:s,trend:c,spark:d,meter:m,delta:p,tone:u="primary",className:v,testId:f}){let g=!p||p.value>=0===(p.positiveIsGood??!0);return(0,t.jsxs)(l.f,{tone:u,className:(0,n.f)("overflow-hidden",v),testId:f,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),s&&(0,t.jsx)("span",{className:"text-primary/60",children:s})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,t.jsx)("div",{className:(0,n.f)("num text-2xl font-bold","primary"===u?"text-primary neon-text":o.T[u]),children:r}),p&&0!==p.value&&(0,t.jsxs)("span",{className:(0,n.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",g?"text-success":"text-danger"),children:[p.value>0?(0,t.jsx)(i.f,{className:"h-3 w-3"}):(0,t.jsx)(a,{className:"h-3 w-3"}),Math.abs(p.value).toFixed(+!Number.isInteger(p.value)),p.unit]})]}),c&&(0,t.jsx)("div",{className:(0,n.f)("mt-1 text-[11px]",c.positive?"text-success":"text-danger"),children:c.value}),void 0!==m&&(0,t.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,t.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,t.jsx)(h,{values:d,tone:u,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var t=e.i(43476),r=e.i(78571),s=e.i(35084);let a={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)]"},i={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)]"},n={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:h,action:p,as:u="div",padding:v="md",testId:f,className:g,children:j,...b}){return(0,t.jsxs)(u,{...b,"data-testid":f??b["data-testid"],className:(0,r.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[v],o&&"panel-corners",o&&a[e],c&&"glow-hover",c&&i[e],c&&n[e],d&&"grid-bg overflow-hidden bg-surface/80",g),children:[(x||p||h)&&(0,t.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,t.jsx)("span",{className:(0,r.f)("mt-0.5 shrink-0",s.T[e]),children:h}),(0,t.jsxs)("div",{className:"min-w-0",children:[x&&(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),p]}),j]})}])},63376,e=>{"use strict";var t=e.i(43476);e.s(["z",0,function({children:e,className:r}){return(0,t.jsx)("div",{className:`animate-page-in${r?` ${r}`:""}`,children:e})},"U",0,function({children:e,className:r}){return(0,t.jsx)("div",{className:r,children:e})}])},75775,e=>{"use strict";var t=e.i(56420);let r={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],75775)},16306,e=>{"use strict";var t=e.i(56420);let r={name:"shield-alert",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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],16306)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15219,e=>{"use strict";var t=e.i(43476),r=e.i(22016),s=e.i(71645),a=e.i(63376),i=e.i(93999),n=e.i(82983),l=e.i(64155),o=e.i(68877),c=e.i(41120),d=e.i(83902),x=e.i(63644);e.s(["default",0,function(){let[e,m]=(0,s.useState)(null),[h,p]=(0,s.useState)([]),[u,v]=(0,s.useState)(!0),f=(0,s.useCallback)(async()=>{v(!0);try{let[e,t]=await Promise.all([n.f.anomalies.summary(),n.f.anomalies.list({resolved:"false",pageSize:100})]);m(e.data??null),p(t.data?.anomalies??[])}catch{}finally{v(!1)}},[]);(0,s.useEffect)(()=>{f()},[f]);let g=(0,s.useMemo)(()=>e?.byNode[0]??null,[e]);return(0,t.jsxs)(a.U,{children:[(0,t.jsx)(a.z,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h1",{className:"text-2xl font-bold uppercase tracking-wider text-text",children:"Anomalies"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs uppercase tracking-wider text-text-muted",children:"Fleet-wide anomaly feed with AI correlation drill-down"})]}),(0,t.jsxs)("button",{onClick:()=>void f(),className:"inline-flex items-center gap-2 rounded border border-border px-3 py-2 text-xs font-semibold uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary",children:[(0,t.jsx)(c.f,{className:`h-3.5 w-3.5 ${u?"animate-spin":""}`}),"Refresh"]})]})}),(0,t.jsx)(a.z,{children:(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[(0,t.jsx)(i.N,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(d.f,{className:"h-5 w-5 text-danger"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-lg font-bold text-text",children:e?.totalActive??"—"}),(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Active anomalies"})]})]})}),(0,t.jsx)(i.N,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(l.f,{className:"h-5 w-5 text-warning"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-lg font-bold text-text",children:e?Object.keys(e.bySeverity).length:"—"}),(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Severity bands active"})]})]})}),(0,t.jsx)(i.N,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(x.f,{className:"h-5 w-5 text-primary"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-bold text-text",children:g?.nodeName??"—"}),(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:"Current hotspot"})]})]})})]})}),(0,t.jsx)(a.z,{children:(0,t.jsxs)(i.N,{className:"overflow-hidden p-0",children:[(0,t.jsx)("div",{className:"border-b border-border/50 px-4 py-3",children:(0,t.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:"Unresolved anomalies"})}),0===h.length?(0,t.jsx)("div",{className:"px-4 py-8 text-center text-sm text-text-muted",children:u?"Loading anomalies…":"No unresolved anomalies at the moment. A rare and beautiful sight."}):(0,t.jsx)("div",{className:"divide-y divide-border/50",children:h.map(e=>{var s;return(0,t.jsxs)(r.default,{href:`/anomalies/${e.id}`,className:"flex items-center justify-between gap-4 px-4 py-3 transition-colors hover:bg-surface-hover",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,t.jsx)("span",{className:`rounded border px-2 py-1 text-[10px] font-bold uppercase tracking-wider ${"critical"===(s=e.severity)?"border-danger/30 bg-danger/5 text-danger":"warning"===s?"border-warning/30 bg-warning/5 text-warning":"border-info/30 bg-info/5 text-info"}`,children:e.severity}),(0,t.jsx)("span",{className:"text-xs font-semibold text-text",children:e.metric}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted",children:e.node?.name??e.nodeId}),e.occurrenceCount>1&&(0,t.jsxs)("span",{className:"rounded bg-accent/10 px-1.5 py-0.5 text-[10px] font-bold text-accent",children:["×",e.occurrenceCount]})]}),(0,t.jsxs)("p",{className:"text-[11px] text-text-muted",children:["Value ",e.value.toFixed(2)," • z-score ",e.zScore.toFixed(2)," ","• first seen ",new Date(e.firstSeenAt).toLocaleString(),e.occurrenceCount>1&&(0,t.jsxs)(t.Fragment,{children:[" • last seen ",new Date(e.lastSeenAt).toLocaleString()]})]})]}),(0,t.jsx)(o.f,{className:"h-4 w-4 flex-shrink-0 text-text-muted"})]},e.id)})})]})})]})}])},93999,51196,55427,e=>{"use strict";var t=e.i(43476),r=e.i(56420);let s={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};s.node;let a=(0,r.f)(s);var i=e.i(75775),n=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:r=100,tone:s,thresholds:a=o.q,label:i,size:l="xs",showValue:m=!1,valueLabel:h,glow:p,className:u,testId:v}){let f="number"==typeof e&&Number.isFinite(e),g=f?Math.max(0,Math.min(100,e/(r||1)*100)):0,j=s??(f?(0,o.Z)(g,a):"muted"),b=p||!s&&f&&g>=a.warn,w=h??(f?`${g.toFixed(+(g<10&&g>0))}%`:"—");return(0,t.jsxs)("div",{className:(0,n.f)("flex min-w-0 items-center gap-2",u),"data-testid":v,children:[(0,t.jsx)("div",{role:"meter","aria-label":i,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":f?e:void 0,"aria-valuetext":w,className:(0,n.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,t.jsx)("div",{style:{"--meter":`${g}%`},className:(0,n.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,t.jsx)("span",{className:(0,n.f)("num w-11 shrink-0 text-right text-[11px]",f?o.T[j]:"text-text-muted"),children:w})]})}e.s(["f",0,x],51196);var m=e.i(71645);function h({values:e,tone:r="primary",width:s=160,height:a=32,area:i=!0,max:l,percent:c=!1,threshold:d,live:x=!0,emptyLabel:p="not enough data",className:u,testId:v,label:f,stretch:g=!1}){let j=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,t.jsx)("div",{className:(0,n.f)("flex h-8 items-center text-xs italic text-text-muted",u),"data-testid":v,children:p});let b=o.v[r],w=l??(c?Math.max(100,...e):Math.max(...e,d??0)||1),N=a-4,y=s/(e.length-1),k=e=>2+N-Math.max(0,e)/w*N,_=e.map((e,t)=>[t*y,k(e)]),$=_.map(([e,t])=>`${e.toFixed(1)},${t.toFixed(1)}`).join(" "),M=_[_.length-1];return(0,t.jsxs)("svg",{width:g?"100%":s,height:a,viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:g?"none":void 0,className:(0,n.f)("block overflow-visible",u),"data-testid":v,role:f?"img":void 0,"aria-label":f,"aria-hidden":!f||void 0,children:[i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:j,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,t.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,t.jsx)("polygon",{points:`0,${a} ${$} ${s},${a}`,fill:`url(#${j})`})]}),void 0!==d&&(0,t.jsx)("line",{x1:0,x2:s,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,t.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:$}),x&&!g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:M[0],cy:M[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,t.jsx)("circle",{cx:M[0],cy:M[1],r:2,fill:b})]})]})}e.s(["f",0,h],55427),e.s(["N",0,function({title:e,description:r,children:s,className:a,action:i,tone:n,corners:o=!1,...c}){return(0,t.jsx)(l.f,{...c,tone:n,corners:o,title:e,description:r,action:i,className:a,children:s})},"n",0,function({label:e,value:r,icon:s,trend:c,spark:d,meter:m,delta:p,tone:u="primary",className:v,testId:f}){let g=!p||p.value>=0===(p.positiveIsGood??!0);return(0,t.jsxs)(l.f,{tone:u,className:(0,n.f)("overflow-hidden",v),testId:f,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),s&&(0,t.jsx)("span",{className:"text-primary/60",children:s})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,t.jsx)("div",{className:(0,n.f)("num text-2xl font-bold","primary"===u?"text-primary neon-text":o.T[u]),children:r}),p&&0!==p.value&&(0,t.jsxs)("span",{className:(0,n.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",g?"text-success":"text-danger"),children:[p.value>0?(0,t.jsx)(i.f,{className:"h-3 w-3"}):(0,t.jsx)(a,{className:"h-3 w-3"}),Math.abs(p.value).toFixed(+!Number.isInteger(p.value)),p.unit]})]}),c&&(0,t.jsx)("div",{className:(0,n.f)("mt-1 text-[11px]",c.positive?"text-success":"text-danger"),children:c.value}),void 0!==m&&(0,t.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,t.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,t.jsx)(h,{values:d,tone:u,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var t=e.i(43476),r=e.i(78571),s=e.i(35084);let a={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)]"},i={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)]"},n={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:h,action:p,as:u="div",padding:v="md",testId:f,className:g,children:j,...b}){return(0,t.jsxs)(u,{...b,"data-testid":f??b["data-testid"],className:(0,r.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[v],o&&"panel-corners",o&&a[e],c&&"glow-hover",c&&i[e],c&&n[e],d&&"grid-bg overflow-hidden bg-surface/80",g),children:[(x||p||h)&&(0,t.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[h&&(0,t.jsx)("span",{className:(0,r.f)("mt-0.5 shrink-0",s.T[e]),children:h}),(0,t.jsxs)("div",{className:"min-w-0",children:[x&&(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),p]}),j]})}])},63376,e=>{"use strict";var t=e.i(43476);e.s(["z",0,function({children:e,className:r}){return(0,t.jsx)("div",{className:`animate-page-in${r?` ${r}`:""}`,children:e})},"U",0,function({children:e,className:r}){return(0,t.jsx)("div",{className:r,children:e})}])},75775,e=>{"use strict";var t=e.i(56420);let r={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],75775)},83902,e=>{"use strict";var t=e.i(56420);let r={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"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],83902)}]);
|