rigscope 0.1.5 → 0.1.7
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +4 -4
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +6 -6
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/administration/page.js +1 -1
- package/.next/server/app/administration/page.js.nft.json +1 -1
- package/.next/server/app/administration/page_client-reference-manifest.js +1 -1
- package/.next/server/app/administration.html +1 -1
- package/.next/server/app/administration.rsc +6 -6
- package/.next/server/app/administration.segments/_full.segment.rsc +6 -6
- package/.next/server/app/administration.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/administration.segments/administration/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/alerts/page.js +1 -1
- package/.next/server/app/alerts/page.js.nft.json +1 -1
- package/.next/server/app/alerts/page_client-reference-manifest.js +1 -1
- package/.next/server/app/alerts.html +1 -1
- package/.next/server/app/alerts.rsc +6 -6
- package/.next/server/app/alerts.segments/_full.segment.rsc +6 -6
- package/.next/server/app/alerts.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/alerts.segments/alerts/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/connections/page.js +1 -1
- package/.next/server/app/connections/page.js.nft.json +1 -1
- package/.next/server/app/connections/page_client-reference-manifest.js +1 -1
- package/.next/server/app/connections.html +1 -1
- package/.next/server/app/connections.rsc +6 -6
- package/.next/server/app/connections.segments/_full.segment.rsc +6 -6
- package/.next/server/app/connections.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/connections.segments/connections/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/history/page.js +2 -2
- package/.next/server/app/history/page.js.nft.json +1 -1
- package/.next/server/app/history/page_client-reference-manifest.js +1 -1
- package/.next/server/app/history.html +1 -1
- package/.next/server/app/history.rsc +26 -22
- package/.next/server/app/history.segments/_full.segment.rsc +26 -22
- package/.next/server/app/history.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/history.segments/history/__PAGE__.segment.rsc +23 -20
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +6 -6
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/index.segments/_full.segment.rsc +6 -6
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/machines/[machineId]/page.js +1 -1
- package/.next/server/app/machines/[machineId]/page.js.nft.json +1 -1
- package/.next/server/app/machines/[machineId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/processes/page.js +2 -2
- package/.next/server/app/processes/page.js.nft.json +1 -1
- package/.next/server/app/processes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/processes.html +1 -1
- package/.next/server/app/processes.rsc +21 -19
- package/.next/server/app/processes.segments/_full.segment.rsc +21 -19
- package/.next/server/app/processes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/processes.segments/processes/__PAGE__.segment.rsc +21 -19
- package/.next/server/app-paths-manifest.json +4 -4
- package/.next/server/chunks/168.js +1 -1
- package/.next/server/chunks/350.js +1 -0
- package/.next/server/chunks/751.js +1 -1
- package/.next/server/chunks/894.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/103-976549d31902404e.js +1 -0
- package/.next/static/chunks/408-9fdba9e4e956ef08.js +1 -0
- package/.next/static/chunks/944-a7fe1d96f1d20531.js +1 -0
- package/.next/static/chunks/app/administration/page-b62f6610cda5381f.js +1 -0
- package/.next/static/chunks/app/alerts/{page-2548b2ab0c057953.js → page-3445bc100ee03d4e.js} +1 -1
- package/.next/static/chunks/app/connections/{page-07113bf16cb352e7.js → page-75abd16fc495fcbd.js} +1 -1
- package/.next/static/chunks/app/history/page-a25ba8fab7bd7cb9.js +3 -0
- package/.next/static/chunks/app/machines/[machineId]/{page-0b89e4393a137c4d.js → page-89143e71c34b542b.js} +1 -1
- package/.next/static/chunks/app/{page-c68554c93016dd13.js → page-9c9c89166eee4c92.js} +1 -1
- package/.next/static/chunks/app/processes/page-3fdebd2f98b52044.js +3 -0
- package/.next/static/css/f5d3162842dcac31.css +1 -0
- package/CHANGELOG.md +21 -0
- package/dist/collector.cjs +1 -1
- package/dist/hub.cjs +45 -15
- package/dist/ops.cjs +44 -14
- package/docs/installation.md +3 -3
- package/docs/releasing.md +12 -12
- package/package.json +1 -1
- package/.next/server/chunks/721.js +0 -1
- package/.next/static/chunks/103-13ec30dcc059b9d3.js +0 -1
- package/.next/static/chunks/157-0d36ebf66af048ac.js +0 -1
- package/.next/static/chunks/408-29f55984738967db.js +0 -1
- package/.next/static/chunks/app/administration/page-4b16b19bb6a39c36.js +0 -1
- package/.next/static/chunks/app/history/page-69ea64476ee5db85.js +0 -3
- package/.next/static/chunks/app/processes/page-b6d97d119f10e2a1.js +0 -3
- package/.next/static/css/fb3ad9534f4681e6.css +0 -1
- /package/.next/static/{oxwySrJXqXq8O6_7AzZGe → 9SHY6v87ulfunqR2e84n9}/_buildManifest.js +0 -0
- /package/.next/static/{oxwySrJXqXq8O6_7AzZGe → 9SHY6v87ulfunqR2e84n9}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[693],{3092:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("ShieldCheck",[["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:"m9 12 2 2 4-4",key:"dzmm74"}]])},3612:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},4268:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},4891:(e,t,a)=>{Promise.resolve().then(a.bind(a,7044))},5798:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},7044:(e,t,a)=>{"use strict";a.d(t,{AdministrationView:()=>ee});var s=a(5155),n=a(8500),r=a.n(n),l=a(2115),i=a(6914),d=a(7029),c=a(828),o=a(7422),u=a(3092);class m extends Error{status;constructor(e,t){super(t),this.name="AdminApiError",this.status=e}}function h(){return new m(502,"The hub returned an unexpected response.")}var x=a(4173),p=a(3440),f=a(940),g=a(802),b=a(9939);let j="w-full min-w-0 rounded-md border border-border bg-background px-3 py-2 text-base text-foreground placeholder:text-muted-foreground aria-[invalid=true]:border-crit sm:text-sm",y="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50",v="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-card-strong disabled:cursor-not-allowed disabled:opacity-50",w="inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-card-strong hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",N="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md border border-crit px-3 py-1.5 text-xs font-medium text-crit transition-colors hover:bg-crit-soft disabled:cursor-not-allowed disabled:opacity-50";function k({id:e,label:t,error:a,children:n}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,s.jsx)("label",{htmlFor:e,className:"text-xs font-medium text-foreground",children:t}),n,a?(0,s.jsx)("p",{id:`${e}-error`,className:"text-xs text-crit",children:a}):null]})}function C(e,t){if(t)return`${e}-error`}function A({children:e,tone:t="neutral"}){return(0,s.jsx)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${{neutral:"border border-border text-muted-foreground",accent:"bg-selected text-foreground",ok:"bg-ok-soft text-foreground",warn:"bg-warn-soft text-foreground",crit:"bg-crit-soft text-foreground"}[t]}`,children:e})}function S({children:e,tone:t="info",role:a="status"}){return(0,s.jsx)("p",{role:a,className:`rounded-md px-3 py-2 text-xs ${{info:"text-muted-foreground",error:"bg-crit-soft text-foreground",success:"bg-ok-soft text-foreground",warn:"bg-warn-soft text-foreground"}[t]}`,children:e})}function I(e,t){return e instanceof m?e.message:t}function T(e){return e instanceof m&&401===e.status}function $(e){return e instanceof m&&403===e.status}function E(e){return"object"==typeof e&&null!==e&&"AbortError"===e.name}var R=a(8698);let M=(0,R.A)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),D=/^[\x21-\x7e]{1,128}$/,U=/[\u0000-\u001f\u007f]/;function L(e){let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):"Unknown time"}function G(e){let t=e.displayName?.trim();if(t)return t;let a=e.hostname?.trim();return a||e.machineId}function P(e){let{api:t,revision:a,onSessionLost:n}=e,[r,i]=(0,l.useState)([]),[d,o]=(0,l.useState)(!0),[u,m]=(0,l.useState)(null),h=(0,l.useRef)(null),x=(0,l.useCallback)(async()=>{h.current?.abort();let e=new AbortController;h.current=e,o(!0),m(null);try{let a=await t.listAudit(50,e.signal);e.signal.aborted||i(a)}catch(t){if(e.signal.aborted||E(t))return;if(T(t))return void n();m($(t)?"Administrator access is required to read the audit log.":I(t,"Could not load the audit log."))}finally{e.signal.aborted||o(!1)}},[t,n]);return(0,l.useEffect)(()=>(x(),()=>h.current?.abort()),[x,a]),(0,s.jsxs)(p.Z,{title:"Audit log",className:"min-w-0",action:(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>void x(),disabled:d,children:[(0,s.jsx)(c.A,{className:`h-3.5 w-3.5 ${d?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]}),children:[(0,s.jsx)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:(0,s.jsxs)("span",{className:"tnum text-xs text-muted-foreground",children:[r.length," event",1===r.length?"":"s"]})}),u?(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(S,{tone:"error",role:"alert",children:u}),(0,s.jsx)("button",{type:"button",className:w,onClick:()=>void x(),children:"Try again"})]}):null,d&&0===r.length&&!u?(0,s.jsx)("p",{role:"status",className:"py-6 text-sm text-muted-foreground",children:"Loading audit events…"}):null,d||u||0!==r.length?null:(0,s.jsx)(p.p,{icon:M,note:"No administrative changes recorded yet."}),r.length>0?(0,s.jsx)("ol",{className:"mt-2 max-h-96 divide-y divide-border overflow-y-auto border-t border-border",children:r.map((e,t)=>(0,s.jsxs)("li",{className:"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 py-2.5 text-xs",children:[(0,s.jsx)("time",{dateTime:e.at,className:"tnum shrink-0 text-muted-foreground",children:L(e.at)}),(0,s.jsx)("span",{className:"font-medium text-foreground",children:function(e){switch(e){case"user.create":return"Created user";case"user.update":return"Updated access";case"user.update-password":return"Changed password";case"user.delete":return"Deleted user";default:return e.replace(/[-_.]+/g," ")}}(e.action)}),(0,s.jsxs)("span",{className:"min-w-0 break-all text-muted-foreground",children:[e.target," ",(0,s.jsx)("span",{"aria-hidden":!0,children:"\xb7"})," by ",e.actor]})]},`${e.at}-${e.actor}-${e.action}-${e.target}-${t}`))}):null]})}let q=(0,R.A)("ShieldOff",[["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"}]]),F=(0,R.A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);var O=a(4268),Y=a(1735);let Z=(0,R.A)("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),V=[{value:3e5,label:"5 minutes"},{value:6e5,label:"10 minutes"},{value:9e5,label:"15 minutes"}];function B(e){let{api:t,csrfToken:a,sessionKey:n,machines:r,onAuditChange:i,onSessionLost:d}=e,o=(0,l.useId)(),u=e=>`${o}-${e}`,[m,h]=(0,l.useState)([]),[x,f]=(0,l.useState)(!0),[g,b]=(0,l.useState)(null),[C,R]=(0,l.useState)(""),[M,D]=(0,l.useState)(""),[U,P]=(0,l.useState)(9e5),[B,H]=(0,l.useState)(null),[z,_]=(0,l.useState)(null),[K,J]=(0,l.useState)(!1),[W,X]=(0,l.useState)(""),[Q,ee]=(0,l.useState)(null),[et,ea]=(0,l.useState)(!1),[es,en]=(0,l.useState)(null),er=(0,l.useRef)(null),el=(0,l.useRef)(!0),ei=(0,l.useRef)(null),ed=(0,l.useRef)(null);(0,l.useEffect)(()=>(el.current=!0,()=>{el.current=!1,er.current?.abort()}),[]),(0,l.useEffect)(()=>{H(null),X("")},[n]),(0,l.useEffect)(()=>{B&&(ei.current?.focus(),ei.current?.select())},[B]);let ec=(0,l.useCallback)(async()=>{er.current?.abort();let e=new AbortController;er.current=e,f(!0),b(null);try{let a=await t.listCollectors(e.signal);e.signal.aborted||h(a)}catch(t){if(e.signal.aborted||E(t))return;if(T(t))return void d();b($(t)?"Administrator access is required to inspect collector mappings.":I(t,"Could not load the collector registry."))}finally{e.signal.aborted||f(!1)}},[t,d]);(0,l.useEffect)(()=>{ec()},[ec]),(0,l.useEffect)(()=>{""!==M&&(m.some(e=>e.machineId===M&&!e.revoked)||D(""))},[m,M]);let eo=m.filter(e=>!e.revoked),eu=""!==M,em=B?function(e,t="https://your-hub"){let a=new URL(t);if(!["https:","http:"].includes(a.protocol)||a.username||a.password||a.search||a.hash)throw Error("Invalid hub origin");let s=a.origin.replace(/'/g,"%27");return{command:`rigscope connect '${s}'${"replacement"===e?" --replace":""}`,note:"replacement"===e?"Paste the grant at the prompt. The old credential stays active until replacement succeeds.":"Paste the grant at the prompt, then run rigscope start."}}(B.mode,window.location.origin):null,eh=async()=>{if(!K){_(null),J(!0);try{let e=await t.createGrant({ttlMs:U,...eu?{replaceMachineId:M}:{}},a);if(!el.current)return;H({...e,mode:eu?"replacement":"new"}),X(""),R("Grant created. Copy before leaving."),i()}catch(e){if(!el.current)return;if(T(e))return void d();if($(e))return void _(eu?"You do not have access to that machine, so a replacement grant cannot be created.":"A new installation needs a hub administrator with all-machine scope. Choose an existing mapping for a replacement grant, or ask the hub owner to widen your scope.");_(I(e,"Could not create an enrollment grant."))}finally{el.current&&J(!1)}}},ex=async()=>{if(B)try{if(!navigator.clipboard?.writeText)throw Error("clipboard unavailable");await navigator.clipboard.writeText(B.token),X("Grant copied to the clipboard.")}catch{X("Copy failed. Select the grant field and copy it manually.")}},ep=async()=>{if(em)try{if(!navigator.clipboard?.writeText)throw Error("clipboard unavailable");await navigator.clipboard.writeText(em.command),X("Command copied.")}catch{X("Copy failed. Select the command and copy it manually.")}},ef=async()=>{if(Q&&!et){ea(!0),en(null);try{if(await t.revokeCollector(Q.collectorId,a),!el.current)return;let e=`${Q.collectorId} on ${Q.machineId}`;ee(null),R(`Revoked ${e}. Its live stream was disconnected.`),i(),await ec()}catch(e){if(!el.current)return;if(T(e))return void d();en($(e)?"Your account does not have access to that collector's machine.":I(e,"Could not revoke that collector."))}finally{el.current&&ea(!1)}}},eg=e=>{let t=r.find(t=>t.machineId===e);return t?G(t):e};return(0,s.jsxs)(p.Z,{title:"Collectors",className:"min-w-0",action:(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>void ec(),disabled:x,children:[(0,s.jsx)(c.A,{className:`h-3.5 w-3.5 ${x?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]}),children:[(0,s.jsx)("p",{role:"status",className:C?"mb-3 rounded-md bg-ok-soft px-3 py-2 text-xs text-foreground":"sr-only",children:C}),g?(0,s.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(S,{tone:"error",role:"alert",children:g}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>void ec(),children:"Try again"})]}):null,(0,s.jsxs)("div",{className:"grid min-w-0 gap-6 lg:grid-cols-2",children:[(0,s.jsxs)("section",{"aria-labelledby":u("registry-heading"),className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,s.jsx)("h3",{id:u("registry-heading"),className:"text-sm font-medium tracking-tight",children:"Registry"}),(0,s.jsxs)("span",{className:"tnum text-xs text-muted-foreground",children:[eo.length," active / ",m.length," total"]})]}),x&&0===m.length?(0,s.jsx)("p",{role:"status",className:"py-6 text-sm text-muted-foreground",children:"Loading collector mappings…"}):null,x||g||0!==m.length?null:(0,s.jsx)(p.p,{icon:q,note:"No collector mappings are visible."}),m.length>0?(0,s.jsx)("ul",{className:"mt-2 divide-y divide-border border-t border-border",children:m.map(e=>{let t=Q?.collectorId===e.collectorId;return(0,s.jsxs)("li",{className:"min-w-0 py-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"break-words text-sm font-medium",children:eg(e.machineId)}),e.revoked?(0,s.jsx)(A,{tone:"crit",children:"Revoked"}):(0,s.jsx)(A,{tone:"ok",children:"Active"})]}),(0,s.jsxs)("dl",{className:"mt-1 flex flex-col gap-0.5 text-xs text-muted-foreground",children:[(0,s.jsxs)("div",{className:"flex min-w-0 gap-1.5",children:[(0,s.jsx)("dt",{className:"shrink-0",children:"Machine"}),(0,s.jsx)("dd",{className:"tnum break-all",children:e.machineId})]}),(0,s.jsxs)("div",{className:"flex min-w-0 gap-1.5",children:[(0,s.jsx)("dt",{className:"shrink-0",children:"Collector"}),(0,s.jsx)("dd",{className:"tnum break-all",children:e.collectorId})]}),(0,s.jsxs)("div",{className:"flex min-w-0 gap-1.5",children:[(0,s.jsx)("dt",{className:"shrink-0",children:"Updated"}),(0,s.jsx)("dd",{children:L(e.updatedAt)})]})]})]}),e.revoked?null:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>{D(e.machineId),_(null),requestAnimationFrame(()=>ed.current?.focus())},children:[(0,s.jsx)(F,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Replacement grant"]}),(0,s.jsxs)("button",{type:"button",className:w,"aria-expanded":t,onClick:()=>{en(null),ee(t?null:e)},children:[(0,s.jsx)(q,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Revoke"]})]})]}),t?(0,s.jsxs)("div",{role:"alert",className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md bg-crit-soft px-3 py-2",children:[(0,s.jsxs)("p",{className:"min-w-0 flex-1 text-xs text-foreground",children:["Revoke ",(0,s.jsx)("strong",{className:"font-medium",children:e.collectorId})," ","on ",(0,s.jsx)("strong",{className:"font-medium",children:eg(e.machineId)}),"? This disconnects the collector and invalidates its credential."]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,s.jsx)("button",{type:"button",className:N,onClick:()=>void ef(),disabled:et,children:et?"Revoking…":"Revoke collector"}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>ee(null),disabled:et,children:"Cancel"})]})]}):null,t&&es?(0,s.jsx)("p",{role:"alert",className:"mt-2 text-xs text-crit",children:es}):null]},e.collectorId)})}):null]}),(0,s.jsxs)("section",{"aria-labelledby":u("grant-heading"),className:"flex min-w-0 flex-col gap-3 border-t border-border pt-5 lg:border-l lg:border-t-0 lg:pl-6 lg:pt-0",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h3",{id:u("grant-heading"),className:"text-sm font-medium tracking-tight",children:"Add machine"})}),(0,s.jsx)(k,{id:u("target"),label:"Enrollment target",children:(0,s.jsxs)("select",{id:u("target"),value:M,onChange:e=>{D(e.target.value),_(null)},className:j,children:[(0,s.jsx)("option",{value:"",children:"New machine"}),eo.map(e=>(0,s.jsxs)("option",{value:e.machineId,children:["Replacement \xb7 ",eg(e.machineId)," \xb7 ",e.collectorId]},e.collectorId))]})}),(0,s.jsx)(k,{id:u("ttl"),label:"Grant lifetime",children:(0,s.jsx)("select",{id:u("ttl"),value:U,onChange:e=>P(Number(e.target.value)),className:j,children:V.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})}),z?(0,s.jsx)(S,{tone:"error",role:"alert",children:z}):null,(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,s.jsxs)("button",{ref:ed,type:"button",className:y,onClick:()=>void eh(),disabled:K,"aria-busy":K,children:[(0,s.jsx)(F,{className:"h-3.5 w-3.5","aria-hidden":!0}),K?"Creating…":eu?"Create replacement grant":"Create connection grant"]})}),B&&em?(0,s.jsxs)("section",{"aria-labelledby":u("grant-reveal-heading"),className:"flex min-w-0 flex-col gap-3 border-t border-border pt-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsx)("h4",{id:u("grant-reveal-heading"),className:"text-sm font-medium",children:"Copy this grant now"}),(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>{H(null),X(""),_(null),R("Grant dismissed."),requestAnimationFrame(()=>ed.current?.focus())},"aria-label":"Dismiss enrollment grant",children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Dismiss"]})]}),(0,s.jsx)(S,{tone:"warn",role:"alert",children:(0,s.jsxs)("span",{className:"flex items-start gap-2",children:[(0,s.jsx)(Y.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,s.jsxs)("span",{children:["Single-use grant \xb7 expires"," ",(0,s.jsx)("time",{dateTime:B.expiresAt,children:L(B.expiresAt)}),". Copy before leaving."]})]})}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,s.jsx)("label",{htmlFor:u("grant-token"),className:"text-xs font-medium",children:"One-time grant"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:[(0,s.jsx)("input",{ref:ei,id:u("grant-token"),readOnly:!0,autoComplete:"off",spellCheck:!1,value:B.token,onFocus:e=>e.currentTarget.select(),className:`${j} tnum min-w-0 flex-1 break-all`}),(0,s.jsxs)("button",{type:"button",className:v,onClick:()=>void ex(),children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Copy grant"]})]}),(0,s.jsx)("p",{className:"sr-only",role:"status",children:W}),W?(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:W}):null]}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-medium",children:"Run on the new machine"}),(0,s.jsx)("pre",{className:"mt-1.5 overflow-x-auto whitespace-pre-wrap break-all rounded-md bg-card-strong p-3 text-xs text-foreground",children:(0,s.jsx)("code",{children:em.command})}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:(0,s.jsxs)("button",{type:"button",className:v,onClick:()=>void ep(),children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Copy command"]})}),(0,s.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:em.note})]})]}):null]})]})]})}var H=a(8731);let z=(0,R.A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);function _(e){let{api:t,csrfToken:a,machines:n,machinesPending:r,onSessionLost:i}=e,d=(0,l.useId)(),o=e=>`${d}-${e}`,[u,m]=(0,l.useState)(""),[h,x]=(0,l.useState)(""),[f,g]=(0,l.useState)(""),[b,v]=(0,l.useState)(!1),[w,N]=(0,l.useState)({}),[A,E]=(0,l.useState)(null),[R,M]=(0,l.useState)(!1),[D,L]=(0,l.useState)(""),P=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(0===n.length){""!==u&&m("");return}if(n.some(e=>e.machineId===u))return;let e=n[0];m(e.machineId),x(e.displayName??""),g((e.tags??[]).join(", ")),v(!1)},[n,u]),(0,l.useEffect)(()=>{A&&P.current?.focus()},[A]);let q=n.find(e=>e.machineId===u),F=async e=>{let s,n,r;if(e.preventDefault(),!q||R)return;E(null);let l=(s=h.trim(),n={},s.length>128?n.displayName="Display name must be at most 128 characters.":U.test(s)&&(n.displayName="Display name cannot contain control characters."),null!==(r=function(e){let t=e.split(",").map(e=>e.trim()).filter(e=>e.length>0),a=[],s=new Set;for(let e of t){if(e.length>64)return{tags:a,error:"Each tag must be at most 64 characters."};if(U.test(e))return{tags:a,error:"Tags cannot contain control characters."};s.has(e)||(s.add(e),a.push(e))}return a.length>32?{tags:a,error:"Use at most 32 tags."}:{tags:a,error:null}}(f)).error&&(n.tags=r.error),{displayName:0===s.length?null:s,tags:r.tags,errors:n});if(N(l.errors),l.errors.displayName)return void document.getElementById(o("name"))?.focus();if(l.errors.tags)return void document.getElementById(o("tags"))?.focus();M(!0);try{await t.saveMachineMeta(q.machineId,{displayName:l.displayName,tags:l.tags},a),x(l.displayName??""),g(l.tags.join(", ")),v(!1),L(`Saved metadata for ${G(q)}. Fleet and machine views update from the live stream.`)}catch(e){if(T(e))return void i();E($(e)?"You do not have access to this machine, so its metadata cannot be changed.":I(e,"Could not save machine metadata."))}finally{M(!1)}};return(0,s.jsxs)(p.Z,{title:"Machine metadata",className:"min-w-0",children:[(0,s.jsx)("p",{role:"status",className:D?"mb-3 rounded-md bg-ok-soft px-3 py-2 text-xs text-foreground":"sr-only",children:D}),0===n.length?(0,s.jsx)(p.p,{icon:H.A,note:r?"Waiting for the live machine list…":"No machines are visible to your account."}):(0,s.jsxs)("form",{"aria-busy":R,className:"flex min-w-0 flex-col gap-4",onSubmit:e=>void F(e),children:[(0,s.jsx)(k,{id:o("machine"),label:"Machine",children:(0,s.jsx)("select",{id:o("machine"),value:u,onChange:e=>{var t;let a;return t=e.target.value,a=n.find(e=>e.machineId===t),void(m(t),x(a?.displayName??""),g((a?.tags??[]).join(", ")),v(!1),N({}),E(null),L(""))},className:j,children:n.map(e=>(0,s.jsx)("option",{value:e.machineId,children:G(e)},e.machineId))})}),(0,s.jsx)(k,{id:o("name"),label:"Display name",error:w.displayName,children:(0,s.jsx)("input",{id:o("name"),placeholder:q?.hostname||"Hostname",maxLength:128,value:h,onChange:e=>{x(e.target.value),v(!0)},"aria-invalid":!!w.displayName||void 0,"aria-describedby":C(o("name"),w.displayName),className:j})}),(0,s.jsx)(k,{id:o("tags"),label:"Tags (comma-separated)",error:w.tags,children:(0,s.jsx)("input",{id:o("tags"),value:f,onChange:e=>{g(e.target.value),v(!0)},"aria-invalid":!!w.tags||void 0,"aria-describedby":C(o("tags"),w.tags),className:j})}),A?(0,s.jsx)("div",{ref:P,tabIndex:-1,"aria-live":"assertive",children:(0,s.jsx)(S,{tone:"error",role:"alert",children:A})}):null,(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,s.jsx)("button",{type:"submit",className:y,disabled:R||!b,children:R?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}),"Saving…"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Save metadata"]})})})]})]})}var K=a(3612),J=a(5798),W=a(7241);function X(e){let{api:t,username:a,csrfToken:n,machines:r,machinesPending:d,onAuditChange:o,onSessionLost:m}=e,[h,x]=(0,l.useState)([]),[f,g]=(0,l.useState)(!0),[b,j]=(0,l.useState)(null),[k,C]=(0,l.useState)(""),[R,M]=(0,l.useState)(null),[D,U]=(0,l.useState)(null),[L,G]=(0,l.useState)(!1),[P,q]=(0,l.useState)(null),F=(0,l.useRef)(null),O=(0,l.useRef)(!0);(0,l.useEffect)(()=>(O.current=!0,()=>{O.current=!1,F.current?.abort()}),[]);let Y=(0,l.useCallback)(async()=>{F.current?.abort();let e=new AbortController;F.current=e,g(!0),j(null);try{let a=await t.listUsers(e.signal);e.signal.aborted||x(a)}catch(t){if(e.signal.aborted||E(t))return;if(T(t))return void m();j($(t)?"Administrator access is required. If your access just changed, sign in again.":I(t,"Could not load the browser user directory."))}finally{e.signal.aborted||g(!1)}},[t,m]);(0,l.useEffect)(()=>{Y()},[Y]);let Z=async()=>{if(D&&!L){G(!0),q(null);try{if(await t.deleteUser(D.username,n),!O.current)return;let e=D.username;U(null),C(`Deleted user ${e}. Any active sessions were ended.`),o(),await Y()}catch(e){if(!O.current)return;if(T(e))return void m();q($(e)?"Your account no longer has administrative access.":I(e,"Could not delete that user."))}finally{O.current&&G(!1)}}};return(0,s.jsxs)(p.Z,{title:"Browser users",className:"min-w-0",action:(0,s.jsxs)("button",{type:"button",className:y,"aria-expanded":R?.mode==="create",onClick:()=>{U(null),q(null),M(e=>e?.mode==="create"?null:{mode:"create"})},children:[(0,s.jsx)(K.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Add user"]}),children:[(0,s.jsx)("p",{role:"status",className:k?"rounded-md bg-ok-soft px-3 py-2 text-xs text-foreground":"sr-only",children:k}),(0,s.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsxs)("span",{className:"tnum text-xs text-muted-foreground",children:[h.length,"/",50]}),(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>void Y(),disabled:f,children:[(0,s.jsx)(c.A,{className:`h-3.5 w-3.5 ${f?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]})]})}),R?(0,s.jsx)(Q,{api:t,csrfToken:n,existing:"edit"===R.mode?R.user:void 0,currentUsername:a,machines:r,machinesPending:d,onCancel:()=>M(null),onSaved:e=>{M(null),C(e),o(),Y()},onSessionLost:m},"edit"===R.mode?`edit-${R.user.username}`:"create"):null,(0,s.jsxs)("div",{className:"mt-4 flex min-w-0 flex-col gap-3",children:[b?(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(S,{tone:"error",role:"alert",children:b}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>void Y(),children:"Try again"})]}):null,f&&0===h.length?(0,s.jsx)("p",{role:"status",className:"py-6 text-sm text-muted-foreground",children:"Loading browser users…"}):null,f||b||0!==h.length?null:(0,s.jsx)(p.p,{icon:i.A,note:"No browser users are stored yet."}),h.length>0?(0,s.jsx)("ul",{className:"divide-y divide-border border-t border-border",children:h.map(e=>{var t;let n=e.username===a,r=D?.username===e.username;return(0,s.jsxs)("li",{className:"min-w-0 py-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"break-words text-sm font-medium",children:e.username}),n?(0,s.jsx)(A,{tone:"accent",children:"You"}):null,e.admin?(0,s.jsxs)(A,{tone:"ok",children:[(0,s.jsx)(u.A,{className:"h-3 w-3","aria-hidden":!0}),"Administrator"]}):(0,s.jsx)(A,{children:"Viewer"}),e.disabled?(0,s.jsx)(A,{tone:"warn",children:"Disabled"}):null]}),(0,s.jsx)("p",{className:"mt-1 break-words text-xs text-muted-foreground",title:"*"===e.machineIds?"All machines":e.machineIds.join(", "),children:"*"===(t=e.machineIds)?"All machines":0===t.length?"No machines":1===t.length?t[0]:`${t.length} machines`})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",className:w,"aria-expanded":R?.mode==="edit"&&R.user.username===e.username,onClick:()=>{q(null),U(null),M(R?.mode==="edit"&&R.user.username===e.username?null:{mode:"edit",user:e})},children:[(0,s.jsx)(J.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),R?.mode==="edit"&&R.user.username===e.username?"Close editor":"Edit"]}),(0,s.jsxs)("button",{type:"button",className:w,"aria-expanded":r,onClick:()=>{M(null),q(null),U(r?null:e)},children:[(0,s.jsx)(W.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})]}),r?(0,s.jsxs)("div",{role:"alert",className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md bg-crit-soft px-3 py-2",children:[(0,s.jsxs)("p",{className:"min-w-0 flex-1 text-xs text-foreground",children:["Delete ",(0,s.jsx)("strong",{className:"font-medium",children:e.username}),"? Their active sessions end immediately, and this cannot be undone."]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,s.jsx)("button",{type:"button",className:N,onClick:()=>void Z(),disabled:L,children:L?"Deleting…":"Delete user"}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>U(null),disabled:L,children:"Cancel"})]})]}):null,r&&P?(0,s.jsx)("p",{role:"alert",className:"mt-2 text-xs text-crit",children:P}):null]},e.username)})}):null]})]})}function Q(e){let{api:t,csrfToken:a,existing:n,currentUsername:r,machines:i,machinesPending:d,onCancel:c,onSaved:o,onSessionLost:u}=e,m=(0,l.useId)(),h=e=>`${m}-${e}`,x=h("heading"),[p,f]=(0,l.useState)(n?.username??""),[g,b]=(0,l.useState)(""),[N,A]=(0,l.useState)(!!n&&"*"===n.machineIds),[E,R]=(0,l.useState)(n&&"*"!==n.machineIds?[...n.machineIds]:[]),[M,U]=(0,l.useState)(n?.admin??!1),[L,P]=(0,l.useState)(n?.disabled??!1),[q,F]=(0,l.useState)({}),[Z,V]=(0,l.useState)(null),[B,H]=(0,l.useState)(!1),z=(0,l.useRef)(null),_=(0,l.useRef)(!1);(0,l.useEffect)(()=>{_.current||(_.current=!0,document.getElementById(x)?.focus())},[x]),(0,l.useEffect)(()=>{Z&&z.current?.focus()},[Z]);let K=[...i].sort((e,t)=>{let a=G(e).toLocaleLowerCase(),s=G(t).toLocaleLowerCase();return a.localeCompare(s)||e.machineId.localeCompare(t.machineId)}),J=function(e,t){if("*"===e)return[];let a=new Set(t);return e.filter(e=>!a.has(e))}(E,K.map(e=>e.machineId)),W=N?"*":E,X=n?.username===r,Q=async e=>{if(e.preventDefault(),B)return;V(null);let s={username:n?.username??p,password:g,machineIds:W,admin:M,disabled:L},r=function(e,t){let a={};if(D.test(e.username)||(a.username="Use 1–128 printable characters without spaces."),t.existing||0!==e.password.length?e.password.length>1024&&(a.password="Password must be at most 1024 characters."):a.password="Choose a password for the new user.","*"===e.machineIds);else if(Array.isArray(e.machineIds)){let t=new Set,s=2;for(let n of e.machineIds){if(!D.test(n)){a.scope="Every machine ID must be a valid identifier.";break}if((s+=n.length+3)>8192){a.scope="Keep the explicit machine list under 8192 bytes.";break}if(t.has(n)){a.scope="Machine scope contains a duplicate ID.";break}t.add(n)}}else a.scope="Choose all machines or an explicit list of machine IDs.";let s=a.username?"username":a.password?"password":a.scope?"scope":null;return{errors:a,firstInvalid:s}}(s,{existing:void 0!==n});if(F(r.errors),null!==r.firstInvalid){let e="username"===r.firstInvalid?h("username"):"password"===r.firstInvalid?h("password"):h("scope-all");document.getElementById(e)?.focus();return}H(!0);try{await t.saveUser({username:s.username,machineIds:s.machineIds,admin:M,disabled:L,...g.length>0?{password:g}:{}},a),b(""),o(n?`Updated ${n.username}.`:`Created ${s.username}. They can sign in with the password you set.`)}catch(e){if(T(e))return void u();V($(e)?"Your account no longer has administrative access.":I(e,"Could not save that user."))}finally{H(!1)}};return(0,s.jsxs)("form",{"aria-labelledby":x,"aria-busy":B,className:"flex min-w-0 flex-col gap-4 border-t border-border py-4",onSubmit:e=>void Q(e),children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h3",{id:x,tabIndex:-1,className:"text-sm font-medium tracking-tight",children:n?`Edit ${n.username}`:"Add a browser user"})}),(0,s.jsx)("button",{type:"button",className:w,onClick:c,disabled:B,children:"Close"})]}),X?(0,s.jsx)(S,{tone:"warn",role:"status",children:(0,s.jsxs)("span",{className:"flex items-start gap-2",children:[(0,s.jsx)(Y.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,s.jsx)("span",{children:"Account changes may sign you out."})]})}):null,Z?(0,s.jsx)("div",{ref:z,tabIndex:-1,"aria-live":"assertive",children:(0,s.jsx)(S,{tone:"error",role:"alert",children:Z})}):null,(0,s.jsxs)("div",{className:"grid min-w-0 gap-4 sm:grid-cols-2",children:[n?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Username"}),(0,s.jsx)("p",{className:"tnum break-words rounded-md border border-border bg-card-strong px-3 py-2 text-sm",children:n.username})]}):(0,s.jsx)(k,{id:h("username"),label:"Username",error:q.username,children:(0,s.jsx)("input",{id:h("username"),name:"username",autoComplete:"username",value:p,onChange:e=>f(e.target.value),"aria-invalid":!!q.username||void 0,"aria-describedby":C(h("username"),q.username),className:j})}),(0,s.jsx)(k,{id:h("password"),label:n?"New password (optional)":"Password",error:q.password,children:(0,s.jsx)("input",{id:h("password"),name:"new-password",type:"password",autoComplete:"new-password",value:g,onChange:e=>b(e.target.value),"aria-invalid":!!q.password||void 0,"aria-describedby":C(h("password"),q.password),className:j})})]}),(0,s.jsxs)("fieldset",{className:"flex min-w-0 flex-col gap-2","aria-invalid":!!q.scope||void 0,"aria-describedby":q.scope?h("scope-error"):void 0,children:[(0,s.jsx)("legend",{className:"text-xs font-medium text-foreground",children:"Machine access"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-5 gap-y-2",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{id:h("scope-all"),type:"radio",name:h("scope"),checked:N,onChange:()=>A(!0)}),"All machines"]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{id:h("scope-selected"),type:"radio",name:h("scope"),checked:!N,onChange:()=>A(!1)}),"Selected machines"]})]}),N?null:(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 border-t border-border pt-2",children:[0===K.length?(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d?"Waiting for machines…":"No machines available."}):(0,s.jsx)("div",{className:"max-h-56 overflow-y-auto pr-1",children:(0,s.jsx)("ul",{className:"flex flex-col gap-1.5",children:K.map(e=>(0,s.jsxs)("li",{className:"flex items-start gap-2",children:[(0,s.jsx)("input",{id:h(`machine-${e.machineId}`),type:"checkbox",className:"mt-0.5",checked:E.includes(e.machineId),onChange:()=>R(t=>{var a;return a=e.machineId,t.includes(a)?t.filter(e=>e!==a):[...t,a]})}),(0,s.jsxs)("label",{htmlFor:h(`machine-${e.machineId}`),className:"min-w-0 text-xs text-foreground",children:[(0,s.jsx)("span",{className:"block break-words",children:G(e)}),(0,s.jsx)("span",{className:"tnum block break-all text-muted-foreground",children:e.machineId})]})]},e.machineId))})}),J.length>0?(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Other saved machines"}),(0,s.jsx)("ul",{className:"flex flex-wrap gap-1.5",children:J.map(e=>(0,s.jsxs)("li",{className:"flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-xs",children:[(0,s.jsx)("span",{className:"tnum break-all",children:e}),(0,s.jsx)("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-card-strong hover:text-foreground",onClick:()=>R(t=>t.filter(t=>t!==e)),"aria-label":`Remove ${e} from the machine scope`,children:(0,s.jsx)(O.A,{className:"h-3 w-3","aria-hidden":!0})})]},e))})]}):null]}),q.scope?(0,s.jsx)("p",{id:h("scope-error"),className:"text-xs text-crit",children:q.scope}):null]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[(0,s.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:M,onChange:e=>U(e.target.checked)}),(0,s.jsxs)("span",{children:["Administrator",(0,s.jsx)("span",{className:"block text-muted-foreground",children:"Explicit administrative access. A wildcard machine scope alone never grants it."})]})]}),(0,s.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:L,onChange:e=>P(e.target.checked)}),(0,s.jsxs)("span",{children:["Disabled",(0,s.jsx)("span",{className:"block text-muted-foreground",children:"Blocks sign-in and ends active sessions. The account is kept for a later re-enable."})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("button",{type:"submit",className:y,disabled:B,children:B?"Saving…":n?"Save changes":"Create user"}),(0,s.jsx)("button",{type:"button",className:v,onClick:c,disabled:B,children:"Cancel"})]})]})}function ee(){let{session:e,machines:t,phase:a,retryConnection:n}=(0,b.M)(),j=(0,l.useMemo)(()=>(function(e={}){let t=e.fetchImpl??fetch;async function a(e,s={}){let n={Accept:"application/json"};void 0!==s.body&&(n["Content-Type"]="application/json"),void 0!==s.csrfToken&&(n["X-CSRF-Token"]=s.csrfToken);let r=await t(e,{method:s.method??"GET",headers:n,body:void 0===s.body?void 0:JSON.stringify(s.body),signal:s.signal,cache:"no-store",credentials:"same-origin",redirect:"error"}),l=await r.text(),i=null;if(l.length>0)try{i=JSON.parse(l)}catch{i=null}if(!r.ok)throw new m(r.status,function(e,t){if(null!==t&&"object"==typeof t){let e=t.error;if("string"==typeof e&&e.length>0&&e.length<=256)return e}return 400===e?"The request was not valid.":401===e?"Your session ended. Sign in again.":403===e?"Administrative access is required.":404===e?"That record no longer exists.":409===e?"That change conflicts with the current directory.":413===e?"The request was too large.":503===e?"Administration is temporarily unavailable.":"The hub could not complete that request."}(r.status,i));return i}return{async listUsers(e){let t=await a("/api/admin/users",{signal:e});if(!Array.isArray(t?.users))throw h();return t.users},async saveUser(e,t,s){await a("/api/admin/users",{method:"POST",body:e,csrfToken:t,signal:s})},async deleteUser(e,t,s){await a(`/api/admin/users?username=${encodeURIComponent(e)}`,{method:"DELETE",csrfToken:t,signal:s})},async listAudit(e=50,t){let s=Number.isSafeInteger(e)?Math.min(Math.max(e,1),1e3):50,n=await a(`/api/admin/audit?limit=${s}`,{signal:t});if(!Array.isArray(n?.events))throw h();return n.events},async listCollectors(e){let t=await a("/api/admin/collectors",{signal:e});if(!Array.isArray(t?.collectors))throw h();return t.collectors},async revokeCollector(e,t,s){await a("/api/admin/collectors",{method:"POST",body:{action:"revoke",collectorId:e},csrfToken:t,signal:s})},async createGrant(e,t,s){let n=await a("/api/admin/collector-grants",{method:"POST",body:e,csrfToken:t,signal:s});if("string"!=typeof n?.token||"string"!=typeof n.expiresAt)throw h();return{token:n.token,expiresAt:n.expiresAt}},async saveMachineMeta(e,t,s,n){await a(`/api/machines/meta?machineId=${encodeURIComponent(e)}`,{method:"POST",body:t,csrfToken:s,signal:n})}}})(),[]),[w,N]=(0,l.useState)(!1),[k,C]=(0,l.useState)(0),A="signed-in"===e.kind?`${e.user.username}:${e.user.csrfToken}`:e.kind;(0,l.useEffect)(()=>{N(!1)},[A]);let S=(0,l.useCallback)(()=>N(!0),[]),I=(0,l.useCallback)(()=>C(e=>e+1),[]),T=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.$E,{}),(0,s.jsx)(g.B,{})]});if("restoring"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsx)(p.Z,{title:"Checking session",className:"mx-auto my-12 max-w-md",children:(0,s.jsx)(p.p,{icon:i.A,note:"Checking your session…"})})});if("restore-failed"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Hub unreachable",className:"mx-auto my-12 max-w-md",children:[(0,s.jsx)(p.p,{icon:d.A,note:"The hub is unreachable right now."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsxs)("button",{type:"button",className:v,onClick:n,children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Try again"]})})]})});if("signed-out"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"expired"===a?"Session ended":"Sign in required",className:"mx-auto my-12 max-w-md",children:[(0,s.jsx)(p.p,{icon:i.A,note:"expired"===a?"Your session ended.":"Sign in required."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/login",className:y,children:"Sign in"})})]})});if("auth-unavailable"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsx)(p.Z,{title:"Sign-in unavailable",className:"mx-auto my-12 max-w-md",children:(0,s.jsx)(p.p,{icon:o.A,note:"Browser sign-in is not configured on this hub."})})});if("expired"===a)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,s.jsx)(p.p,{icon:o.A,note:"Your session ended."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/login",className:y,children:"Sign in"})})]})});if(!0!==e.user.admin)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Administrator access required",className:"mx-auto my-12 max-w-lg",children:[(0,s.jsx)(p.p,{icon:o.A,note:`You are signed in as ${e.user.username}, but this account is not an administrator.`}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/",className:v,children:"Back to fleet"})})]})});if(w)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Session ended",className:"mx-auto my-12 max-w-lg",children:[(0,s.jsx)(p.p,{icon:o.A,note:"Your administrative session is no longer valid."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/login",className:y,children:"Sign in again"})})]})});let $=t.map(e=>({machineId:e.machineId,hostname:e.hostname,displayName:e.displayName,tags:e.tags})),E="connecting"===a||"idle"===a;return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,s.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-x-6 gap-y-3",children:(0,s.jsxs)("span",{className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-1.5 rounded-full bg-selected px-3 py-1 text-xs font-medium text-foreground",children:[(0,s.jsx)(u.A,{className:"h-3.5 w-3.5 shrink-0 text-accent","aria-hidden":!0}),(0,s.jsxs)("span",{className:"min-w-0 break-all",children:["Administrator \xb7 ",e.user.username]})]})}),(0,s.jsxs)("div",{className:"grid min-w-0 gap-5 xl:grid-cols-12",children:[(0,s.jsx)("div",{className:"min-w-0 xl:col-span-7",children:(0,s.jsx)(X,{api:j,username:e.user.username,csrfToken:e.user.csrfToken,machines:$,machinesPending:E,onAuditChange:I,onSessionLost:S})}),(0,s.jsx)("div",{className:"min-w-0 xl:col-span-5",children:(0,s.jsx)(_,{api:j,csrfToken:e.user.csrfToken,machines:$,machinesPending:E,onSessionLost:S})}),(0,s.jsx)("div",{id:"collectors",className:"min-w-0 scroll-mt-6 xl:col-span-12",children:(0,s.jsx)(B,{api:j,csrfToken:e.user.csrfToken,sessionKey:A,machines:$,onAuditChange:I,onSessionLost:S})}),(0,s.jsx)("div",{className:"min-w-0 xl:col-span-12",children:(0,s.jsx)(P,{api:j,revision:k,onSessionLost:S})})]})]})})}},7241:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}},e=>{e.O(0,[157,939,103,441,794,358],()=>e(e.s=4891)),_N_E=e.O()}]);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[429],{1:(e,t,s)=>{"use strict";s.d(t,{PE:()=>o,UR:()=>d,kg:()=>l,uW:()=>c});let r=/^[\u0009\u000a\u000d ]*[=+\-@]/,n=/^[\u0009\u000a\u000d]/;function i(e){if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?String(e):"";if("boolean"==typeof e)return e?"true":"false";let t=0===e.length?e:r.test(e)||n.test(e)?`'${e}`:e;return/[",\t\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function a(e){return e.map(i).join(",")}function l(e){return`${e.map(a).join("\r\n")}\r
|
|
2
|
-
`}function o(e,t,s){if("u"<typeof document)return;let r=new Blob([t],{type:s}),n=URL.createObjectURL(r),i=document.createElement("a");i.href=n,i.download=e,i.rel="noopener",i.style.display="none",document.body.append(i),i.click(),i.remove(),globalThis.setTimeout(()=>URL.revokeObjectURL(n),0)}let d="text/csv;charset=utf-8",c="application/json;charset=utf-8"},438:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},2910:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]])},2939:(e,t,s)=>{"use strict";s.d(t,{HistoryView:()=>eI});var r=s(5155),n=s(8500),i=s.n(n),a=s(2115),l=s(7422),o=s(3896),d=s(1735),c=s(7029),u=s(828),m=s(4173),h=s(3440),p=s(940),x=s(802),g=s(6582),f=s(9939),b=s(8664),y=s(4567),j=s(592);let v=j.U8,N=/^core:(\d+)$/;function w(e){let t=N.exec(e);if(null===t)return null;let s=Number(t[1]);return!Number.isSafeInteger(s)||s<0||s>=j.U8?null:s}function k(e){return[...new Set(e)].sort((e,t)=>(w(e)??0)-(w(t)??0))}function M(e,t=[]){var s;let r=e?.metrics?.payload.cpu,n=new Set(!Number.isFinite(s=Math.max(e?.inventory?.cpu.logicalCores??0,r?.status==="ok"?r.perCore.length:0))?[]:Array.from({length:Math.min(j.U8,Math.max(0,Math.floor(s)))},(e,t)=>`core:${t}`));for(let e of t)"cpu.core"===e.metric&&null!==w(e.resourceId)&&n.add(e.resourceId);return k([...n])}function $(e,t){let s=new Set(t);if(null===e)return k(t).slice(0,v);let r=[];for(let t of e)if(s.has(t)&&null!==w(t)&&(r.push(t),r.length>=v))break;return k(r)}function A(e){let t=w(e);return null===t?e:`Core ${t}`}var I=s(7726);function C(e){if("string"!=typeof e||0===e.length)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}var S=s(5078),R=s(2910),P=s(9942),U=s(8698);let L=(0,U.A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),_=(0,U.A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var B=s(6114);let T=Object.freeze([]),z=new Set(y.H9.map(e=>e.metric)),E=e=>"boolean"==typeof e?e:null,D=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e)?e.slice(0,1e3):null,F=e=>S.pI.some(t=>t.id===e)?e:null,O=e=>"string"==typeof e&&(""===e||e.split(",").every(e=>z.has(e)))?e:null,H=/^core:\d+$/,Z=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e&&H.test(e))?[...new Set(e)].slice(0,j.U8):null;function G(e,t){return(0,B.u)(`history.hidden.${t}.${e}`,T,D)}function q(e){return(0,B.u)(`history.cores.${e}`,null,Z)}let V=e=>"bytes"===e||"percent"===e?e:null;function W(e,t){return(0,B.u)(`history.units.${t}.${e}`,"bytes",V)}let K="peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:[outline-color:var(--focus)]";function Y({label:e,action:t}){return(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:e}),(0,r.jsx)("span",{"aria-hidden":!0,className:"h-px min-w-0 flex-1 bg-border"}),t]})}let J="inline-flex min-h-8 items-center gap-1.5 rounded-md border border-transparent px-2.5 text-xs transition-colors",Q=`${J} ${K} bg-selected text-foreground`,X=`${J} ${K} bg-card-strong text-muted-foreground hover:text-foreground`;function ee(e){let{machine:t,range:s,selectedMetrics:n,catalog:i,catalogError:a,gpuCards:l,hiddenCards:o,autoRefresh:d,loading:c,manualRefreshing:m,statusText:h,onRangeChange:p,onToggleMetric:x,onSetMetrics:g,onToggleCard:f,onToggleAutoRefresh:b,onRefresh:j}=e,[v,N]=(0,B.u)("history.controlsOpen",!1,E,"session"),w=new Set(n),k=y.H9.filter(({metric:e})=>(0,y.yv)(t,e).available&&(null===i||void 0!==i[e])).map(({metric:e})=>e),I=new Set(k),C=(e,t)=>{let s=new Set(n);for(let r of e)t&&I.has(r)?s.add(r):t||s.delete(r);g([...s])},U=n.some(e=>e.startsWith("gpu.")),T=w.has("cpu.core"),[z,D]=q(t?.machineId??""),F=T?M(t):[],O=$(z,F),H=new Set(O);return(0,r.jsxs)("section",{"aria-labelledby":"history-query-heading","aria-busy":c,className:"mb-5 min-w-0 rounded-xl border border-border bg-card",children:[(0,r.jsx)("h2",{id:"history-query-heading",className:"sr-only",children:"History query"}),(0,r.jsxs)("div",{className:"flex flex-wrap items-end gap-x-5 gap-y-4 p-4 md:p-5",children:[(0,r.jsxs)("fieldset",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,r.jsx)("legend",{className:"mb-1.5 text-xs text-muted-foreground",children:"Time range"}),(0,r.jsx)("div",{className:"inline-flex flex-wrap rounded-lg border border-border bg-background p-0.5",children:S.pI.map(e=>{let t=s===e.id;return(0,r.jsxs)("label",{className:"cursor-pointer",children:[(0,r.jsx)("input",{type:"radio",name:"history-range",value:e.id,checked:t,onChange:()=>p(e.id),className:"peer sr-only"}),(0,r.jsxs)("span",{className:`inline-flex min-h-8 items-center rounded-md px-2.5 text-xs transition-colors ${K} ${t?"bg-selected font-medium text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[e.shortLabel,(0,r.jsxs)("span",{className:"sr-only",children:[" — ",e.label]})]})]},e.id)})})]}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2 sm:ml-auto",children:[(0,r.jsx)("p",{className:"order-first w-full text-xs text-muted-foreground sm:order-none sm:w-auto",children:h}),(0,r.jsxs)("button",{type:"button",onClick:j,disabled:m,className:"inline-flex min-h-8 items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-60",children:[(0,r.jsx)(u.A,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]}),(0,r.jsxs)("button",{type:"button",onClick:b,"aria-pressed":d,className:`inline-flex min-h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs transition-colors ${d?"border-accent/40 bg-selected text-foreground":"border-border bg-background text-muted-foreground hover:bg-card-strong hover:text-foreground"}`,children:[d?(0,r.jsx)(R.A,{className:"h-3.5 w-3.5","aria-hidden":!0}):(0,r.jsx)(P.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),d?"Pause":"Resume"]})]})]}),(0,r.jsxs)("div",{className:"border-t border-border px-4 py-4 md:px-5",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,r.jsxs)("button",{type:"button","aria-expanded":v,"aria-controls":"history-metric-options",onClick:()=>N(!v),className:"inline-flex min-h-8 items-center gap-1.5 rounded-md text-sm font-medium",children:["Metrics ",(0,r.jsxs)("span",{className:"tnum text-xs font-normal text-muted-foreground",children:[w.size," selected"]}),(0,r.jsx)(L,{"aria-hidden":!0,className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${v?"rotate-180":""}`})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>C(k,!0),disabled:k.every(e=>w.has(e)),className:"inline-flex min-h-8 items-center rounded-md border border-border bg-background px-2.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Select all"}),(0,r.jsx)("button",{type:"button",onClick:()=>g([]),disabled:0===w.size,className:"inline-flex min-h-8 items-center rounded-md border border-border bg-background px-2.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Unselect all"})]})]}),(0,r.jsx)("div",{id:"history-metric-options",hidden:!v,children:(0,r.jsxs)("div",{className:"mt-4 min-w-0 md:col-span-2",children:[(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsx)("div",{className:"grid gap-x-6 gap-y-5 md:grid-cols-2 xl:grid-cols-3",children:y.P$.map(e=>(0,r.jsxs)("fieldset",{className:`min-w-0 ${"disk"===e.id?"xl:col-span-2":""}`,children:[(0,r.jsx)("legend",{className:"sr-only",children:e.label}),(0,r.jsx)(Y,{label:e.label,action:(0,r.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,r.jsx)("button",{type:"button","aria-label":`Select all ${e.label} metrics`,onClick:()=>C(e.metrics,!0),disabled:e.metrics.filter(e=>I.has(e)).every(e=>w.has(e)),className:"min-h-6 rounded-sm text-xs text-muted-foreground hover:text-foreground hover:underline disabled:opacity-50",children:"All"}),(0,r.jsx)("button",{type:"button","aria-label":`Unselect all ${e.label} metrics`,onClick:()=>C(e.metrics,!1),disabled:!e.metrics.some(e=>w.has(e)),className:"min-h-6 rounded-sm text-xs text-muted-foreground hover:text-foreground hover:underline disabled:opacity-50",children:"None"})]})}),(0,r.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.metrics.map(e=>{var s;let n=(0,y.oB)(e);if(null===n)return null;let a=(0,y.yv)(t,e),l=null===i||void 0!==i[e],o=a.available&&l,d=w.has(e),c=(0,y.Lf)(n,0);return(0,r.jsxs)("label",{className:o?"cursor-pointer":"cursor-not-allowed",title:a.available?l?n.description:"This hub does not record this metric.":a.reason??void 0,children:[(0,r.jsx)("input",{type:"checkbox",checked:d,onChange:()=>x(e),disabled:!o&&!d,className:"peer sr-only","aria-label":n.label}),(0,r.jsxs)("span",{className:`${!o?d?`${J} ${K} bg-card-strong text-muted-foreground line-through`:`${J} text-muted-foreground opacity-50`:d?Q:X}`,children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border border-current",style:{color:c.color},children:d?(0,r.jsx)(_,{className:"h-3 w-3",strokeWidth:3}):null}),(s=n.label,({"cpu.usage":"Usage","cpu.core":"Per-core","cpu.iowait":"I/O wait","cpu.pressure":"Pressure","cpu.temperature":"Temperature","cpu.power":"Package power","memory.used":"Used bytes","memory.usage":"Usage %","swap.used":"Swap","memory.pressure.some":"Pressure (some)","memory.pressure.full":"Pressure (full)","gpu.utilization":"Utilization","gpu.memory.used":"VRAM","gpu.temperature":"Temperature","gpu.power":"Power","fs.used":"Space used","fs.usage":"Capacity %","fs.inodes.usage":"Inodes %","net.rx":"Received","net.tx":"Sent"})[e]??s)]})]},e)})}),"gpu"===e.id&&U&&l.length>0?(0,r.jsxs)("fieldset",{className:"mt-4 border-t border-border pt-3",children:[(0,r.jsx)("legend",{className:"sr-only",children:"GPU cards"}),(0,r.jsx)(Y,{label:"GPU cards"}),(0,r.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:l.map((e,t)=>{let s=e.id,n=!o.has(s);return(0,r.jsxs)("label",{className:"cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:n,onChange:()=>f(s),className:"peer sr-only"}),(0,r.jsxs)("span",{className:n?Q:X,children:[(0,r.jsx)("span",{className:"tnum text-xs text-muted-foreground",children:t+1}),e.label]})]},e.id)})})]}):null,"cpu"===e.id&&T?(0,r.jsxs)("fieldset",{className:"mt-4 border-t border-border pt-3",children:[(0,r.jsx)("legend",{className:"sr-only",children:"CPU cores"}),(0,r.jsx)(Y,{label:`CPU cores \xb7 ${O.length} / ${F.length}`,action:(0,r.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>D(null),disabled:O.length===F.length,className:"min-h-6 rounded-sm text-xs text-muted-foreground hover:text-foreground disabled:opacity-50",children:"All cores"}),(0,r.jsx)("button",{type:"button",onClick:()=>D([]),disabled:0===O.length,"aria-label":"Unselect all CPU cores",className:"min-h-6 rounded-sm text-xs text-muted-foreground hover:text-foreground disabled:opacity-50",children:"None"})]})}),0===F.length?(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Core count unavailable."}):(0,r.jsxs)("details",{className:"mt-2",children:[(0,r.jsxs)("summary",{className:"inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-md text-xs text-muted-foreground hover:text-foreground",children:["Choose cores ",(0,r.jsx)(L,{className:"h-3.5 w-3.5","aria-hidden":!0})]}),(0,r.jsx)("div",{className:"mt-2 grid max-h-48 grid-cols-3 gap-1.5 overflow-y-auto p-1",children:F.map(e=>{let t=H.has(e);return(0,r.jsxs)("label",{className:"min-w-0 cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:t,onChange:()=>{var s;return s=!t,void D(t=>{let r=$(t,F);return s?r.includes(e)?t:[...r,e]:r.filter(t=>t!==e)})},className:"peer sr-only"}),(0,r.jsxs)("span",{className:`${t?Q:X} w-full px-1.5`,children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-sm border border-current",children:t?(0,r.jsx)(_,{className:"h-3 w-3"}):null}),A(e)]})]},e)})})]})]}):null]},e.id))})}),a?(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:a}):null]})})]})]})}var et=s(9429),es=s(7284),er=s(6304),en=s(4150);let ei="grid grid-cols-[3rem_minmax(0,1fr)_4.5rem] items-center gap-2 sm:grid-cols-[3.5rem_minmax(0,1fr)_4.5rem_3rem]";function ea({title:e,series:t,fromMs:s,toMs:n,stepMs:i,gaps:l,hiddenKeys:o,onToggleSeries:d}){let[c,u]=(0,a.useState)(!1),m=(0,a.useMemo)(()=>t.filter(e=>!o.has(e.key)),[t,o]),h=(0,en.Au)({series:m,fromMs:s,toMs:n,stepMs:i,gaps:l}),p=(0,a.useMemo)(()=>{let e=t.map(e=>{let t=Array(10).fill("");return(function(e,t,s,r=120){let n=Array(r).fill(null),i=Math.max(1,s-t);for(let a of e){if(a.t<t||a.t>s)continue;let e=a.max??a.avg;if(null===e||!Number.isFinite(e))continue;let l=Math.min(r-1,Math.floor((a.t-t)/i*r));n[l]=Math.max(n[l]??0,Math.min(100,Math.max(0,e)))}return n})(e.points,s,n,120).forEach((e,s)=>{if(null===e)return;let r=Math.min(9,Math.floor(e/10));t[r]+=`M${s},1h1v16h-1z`}),{...e,stats:(0,I.T6)(e.points),paths:t}});return c&&e.sort((e,t)=>(t.stats.max??-1)-(e.stats.max??-1)),e},[t,s,n,c]),x=p.filter(e=>!o.has(e.key)).reduce((e,t)=>null!==t.stats.max&&(e?.stats.max===null||null===e||t.stats.max>e.stats.max)?t:e,null),g=null===h.timeMs?null:(0,S.r6)(h.timeMs),f=Math.max(1,n-s),b=(0,I.$z)(l,s,n);return(0,r.jsxs)("figure",{className:"min-w-0 lg:col-span-full",onPointerLeave:h.clear,children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,r.jsx)("h3",{className:"text-xs font-medium text-foreground",children:e}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs",children:[x?(0,r.jsxs)("span",{className:"tnum text-muted-foreground",children:["Peak \xb7 ",x.label," ",(0,r.jsx)("span",{className:"text-foreground",children:(0,S.dd)(x.stats.max,"percent")})]}):null,(0,r.jsx)("button",{type:"button","aria-pressed":c,onClick:()=>u(!c),className:`min-h-8 rounded-md border border-border px-2 ${c?"bg-selected text-foreground":"bg-background text-muted-foreground hover:text-foreground"}`,children:"Busiest first"})]})]}),(0,r.jsxs)("div",{className:`${ei} mb-1 min-h-4 whitespace-nowrap text-xs leading-4 text-muted-foreground`,"aria-hidden":!0,children:[(0,r.jsx)("span",{children:"Core"}),(0,r.jsx)("span",{className:"truncate",children:null!==g?(0,r.jsx)("span",{className:"tnum",children:g}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"sm:hidden",children:"History"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Peak usage over time"})]})}),(0,r.jsx)("span",{className:"hidden text-right sm:block",children:null!==g?"At cursor":"Last"}),(0,r.jsxs)("span",{className:"text-right",children:[(0,r.jsx)("span",{className:"hidden sm:inline",children:"Peak"}),(0,r.jsx)("span",{className:"sm:hidden",children:null!==g?"At cursor":"Peak"})]})]}),(0,r.jsx)("p",{id:`${h.id}-instructions`,className:"sr-only",children:"Focus a core chart and use Left and Right arrows to inspect recorded bucket peaks, Home or End to jump, and Escape to dismiss."}),(0,r.jsx)("div",{role:"region","aria-label":"Per-core history rows",tabIndex:0,className:"max-h-96 overflow-y-auto rounded-md",children:0===p.length?(0,r.jsx)("p",{className:"py-8 text-center text-xs text-muted-foreground",children:"No stored per-core readings."}):p.map(e=>{let t=!o.has(e.key),a=null===h.timeMs?null:(0,er.bO)(e.points,h.timeMs,i,l),c=a?.max??a?.avg??null;return(0,r.jsxs)("div",{className:`${ei} min-h-7 border-b border-border/40 text-xs`,children:[(0,r.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center rounded-sm",children:[(0,r.jsx)("input",{type:"checkbox",checked:t,onChange:()=>d(e.key),className:"peer sr-only"}),(0,r.jsx)("span",{className:`${t?"text-foreground":"text-muted-foreground line-through"} rounded-sm peer-focus-visible:outline-2 peer-focus-visible:outline-accent`,children:e.label})]}),(0,r.jsxs)("svg",{viewBox:"0 0 120 18",preserveAspectRatio:"none",role:"img","aria-label":`${e.label}: ${null!==g?`${(0,S.dd)(c,"percent")} at ${g}`:`latest ${(0,S.dd)(e.stats.latest,"percent")}`}, peak ${(0,S.dd)(e.stats.max,"percent")}${t?"":", hidden"}`,"aria-describedby":`${h.id}-instructions`,tabIndex:t?0:void 0,onPointerMove:t?e=>{let t=e.currentTarget.getBoundingClientRect();h.inspect((0,er.yk)(e.clientX,t.left,t.width,s,n))}:void 0,onFocus:h.onFocus,onBlur:h.clear,onKeyDown:h.onKeyDown,className:`h-5 w-full cursor-crosshair rounded-sm focus-visible:outline-2 focus-visible:outline-accent ${t?"":"opacity-20"}`,children:[(0,r.jsx)("title",{children:`${e.label} \xb7 Last ${(0,S.dd)(e.stats.latest,"percent")} \xb7 Peak ${(0,S.dd)(e.stats.max,"percent")}`}),t?e.paths.map((e,t)=>e?(0,r.jsx)("path",{d:e,fill:t<5?"var(--cpu)":t<8?"var(--warn)":"var(--crit)",opacity:t<5?.15+.17*t:.65+t%5*.07},t):null):null,b.map(e=>(0,r.jsx)("rect",{x:(e.fromMs-s)/f*120,width:(e.toMs-e.fromMs)/f*120,y:0,height:18,fill:"var(--card)"},`${e.fromMs}-${e.toMs}`)),null!==h.timeMs?(0,r.jsx)("line",{"aria-hidden":!0,x1:(h.timeMs-s)/f*120,x2:(h.timeMs-s)/f*120,y1:0,y2:18,stroke:"var(--foreground)",strokeWidth:"1",vectorEffect:"non-scaling-stroke",pointerEvents:"none"}):null]}),(0,r.jsx)("span",{className:"tnum hidden text-right text-muted-foreground sm:block",children:t?(0,S.dd)(null!==h.timeMs?c:e.stats.latest,"percent"):"—"}),(0,r.jsxs)("span",{className:`tnum text-right ${t&&(e.stats.max??0)>=80?"text-crit":"text-muted-foreground"}`,children:[(0,r.jsx)("span",{className:"hidden sm:inline",children:t?(0,S.dd)(e.stats.max,"percent"):"—"}),(0,r.jsx)("span",{className:"sm:hidden",children:t?(0,S.dd)(null!==h.timeMs?c:e.stats.max,"percent"):"—"})]})]},e.key)})}),(0,r.jsxs)("div",{className:`${ei} mt-2 text-xs text-muted-foreground`,"aria-hidden":!0,children:[(0,r.jsx)("span",{}),(0,r.jsx)("div",{className:"flex justify-between gap-2 tnum",children:(0,I.Cf)(s,n,3).map((e,t)=>(0,r.jsx)("span",{className:1===t?"hidden sm:inline":"",children:(0,S.O5)(e,f)},e))}),(0,r.jsx)("span",{className:"hidden sm:block"}),(0,r.jsx)("span",{})]}),(0,r.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[[{label:"0–49%",color:"var(--cpu)"},{label:"50–79%",color:"var(--warn)"},{label:"80–100%",color:"var(--crit)"}].map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"h-2 w-4 rounded-sm",style:{backgroundColor:e.color}}),e.label]},e.label)),(0,r.jsx)("span",{children:"No fill \xb7 no reading"})]})]})}function el(e,t){return`${e}\0${t}`}function eo(e,t,s,r,n){let i=(0,y.oB)(s);return null===i?[]:e.series.filter(e=>e.metric===s&&(void 0===r||e.resourceId===r)).map((e,r)=>{let a=(0,y.Lf)(i,r),l=n?.(e,i,r)??(0,y.bP)(t,s,e.resourceId);return{key:el(e.metric,e.resourceId),label:l,metric:e.metric,resourceId:e.resourceId,color:a.color,dash:a.dash,points:e.points}})}function ed(e){let{machine:t,result:s,selectedMetrics:n,hiddenCards:i,hiddenSeries:a,onToggleSeries:l}=e,[o]=q(t.machineId),d=$(o,M(t,s.series)),c=function(e){let{machine:t,result:s,selectedMetrics:r,hiddenCards:n,coreIds:i}=e,a=new Set(r),l=[];if(["cpu.usage","cpu.core","cpu.temperature","cpu.power","cpu.iowait","cpu.pressure"].filter(e=>a.has(e)).length>0){let e=[],r=["cpu.usage","cpu.iowait","cpu.pressure"].filter(e=>a.has(e));if(r.length>0&&e.push({key:"cpu.usage",title:r.length>1?"Usage & stalls":(0,y.oB)(r[0]).label,unit:"percent",series:r.flatMap(e=>eo(s,t,e,void 0,(t,s)=>"cpu.pressure"===e?"Pressure (some)":s.shortLabel)),emptyMessage:"No stored CPU readings in this range."}),a.has("cpu.core")){let r=(0,y.oB)("cpu.core"),n=M(t,s.series),a=i??$(null,n),l=function(e,t){let s=(0,y.oB)("cpu.core");if(null===s)return[];let r=new Map(e.series.filter(e=>"cpu.core"===e.metric).map(e=>[e.resourceId,e]));return t.flatMap((e,t)=>{let n=r.get(e),i=(0,y.Lf)(s,t);return[{key:el("cpu.core",e),label:A(e),metric:"cpu.core",resourceId:e,color:i.color,dash:i.dash,points:n?.points??[]}]})}(s,a),o=n.length>a.length;e.push({key:"cpu.core",title:o?`Per-core usage \xb7 ${a.length} of ${n.length}`:"Per-core usage",unit:r.unit,series:l,emptyMessage:0===n.length?"No stored per-core readings in this range.":0===a.length?"No CPU cores are selected. Choose cores under Metrics.":"No stored per-core readings for the selected cores in this range."})}if(a.has("cpu.temperature")){let r=(0,y.oB)("cpu.temperature");e.push({key:"cpu.temperature",title:"Temperature",unit:r.unit,series:eo(s,t,"cpu.temperature"),emptyMessage:"No stored CPU temperature readings in this range."})}if(a.has("cpu.power")){let r=(0,y.oB)("cpu.power");e.push({key:"cpu.power",title:"Package power",unit:r.unit,series:eo(s,t,"cpu.power"),emptyMessage:"No stored CPU package power readings in this range."})}l.push({key:"cpu",title:"CPU",charts:e})}if(["memory.used","memory.usage","memory.pressure.some","memory.pressure.full","swap.used"].filter(e=>a.has(e)).length>0){let e=[],r=["memory.used","memory.usage"].filter(e=>a.has(e));if(r.length>0){let n=r.map(e=>({unit:(0,y.oB)(e).unit,series:eo(s,t,e,void 0,()=>"RAM")}));e.push({key:"memory.capacity",title:"RAM",...n[0],unitGroup:"memory",views:n,emptyMessage:"No stored memory readings in this range."})}a.has("swap.used")&&e.push({key:"swap.used",title:"Swap",unit:"bytes",series:eo(s,t,"swap.used"),emptyMessage:"No stored swap readings in this range."});let n=["memory.pressure.some","memory.pressure.full"].filter(e=>a.has(e));if(n.length>0){let r=(0,y.oB)(n[0]),i=n.flatMap(e=>eo(s,t,e,void 0,(t,s)=>"memory.pressure.some"===e?"Some":"memory.pressure.full"===e?"Full":s.shortLabel));e.push({key:"memory.pressure",title:"Memory pressure",unit:r.unit,series:i,emptyMessage:"No stored memory pressure in this range."})}l.push({key:"memory",title:"Memory",charts:e})}let o=["gpu.utilization","gpu.memory.used","gpu.temperature","gpu.power"].filter(e=>a.has(e));if(o.length>0){let e=(0,y.ue)(t,s.series),r=e.filter(e=>!n.has(e.id));for(let n of(0===r.length&&l.push({key:"gpu-empty",title:"GPU",charts:[{key:"gpu-empty",title:"Per-card history",unit:"percent",series:[],emptyMessage:e.length>0?"All GPU cards are hidden. Re-enable a card under Metrics to see its panels.":"No supported GPU cards or stored GPU history in this range."}]}),r)){let e=o.map(e=>{let r=(0,y.oB)(e),i=function(e,t,s,r){return eo(e,t,s,r,(e,t)=>"gpu.utilization"===s?"Utilization":"gpu.memory.used"===s?"VRAM used":t.shortLabel).map(e=>({...e}))}(s,t,e,n.id),a="gpu.memory.used"===e&&null!==n.totalBytes?`of ${(0,S.dd)(n.totalBytes,"bytes")}`:void 0;return{key:`${n.id}-${e}`,title:r.shortLabel,unit:r.unit,series:i,emptyMessage:`No stored ${r.shortLabel.toLowerCase()} readings for this card in this range.`,note:a}});l.push({key:`gpu-${n.id}`,title:`GPU ${n.index+1}${n.label?` \xb7 ${n.label}`:""}`,charts:e})}}if(["fs.used","fs.usage","fs.inodes.usage"].filter(e=>a.has(e)).length>0){let e=[],r=["fs.used","fs.usage"].filter(e=>a.has(e));if(r.length>0){let n=r.map(e=>({unit:(0,y.oB)(e).unit,series:eo(s,t,e)}));e.push({key:"fs.capacity",title:"Capacity used",...n[0],unitGroup:"filesystem",views:n,emptyMessage:"No stored filesystem usage in this range."})}if(a.has("fs.inodes.usage")){let r=(0,y.oB)("fs.inodes.usage");e.push({key:"fs.inodes.usage",title:"Inodes used",unit:r.unit,series:eo(s,t,"fs.inodes.usage"),emptyMessage:"No stored inode usage in this range."})}l.push({key:"filesystems",title:"Filesystems",charts:e})}let d=["disk.read","disk.write"].filter(e=>a.has(e));if(d.length>0){let e=d.flatMap(e=>{let r=(0,y.oB)(e);return eo(s,t,e,void 0,s=>`${(0,y.bP)(t,e,s.resourceId)} ${r.shortLabel.toLowerCase()}`)});l.push({key:"disk",title:"Disk throughput",charts:[{key:"disk",title:"Read and write",unit:"bytes_per_second",series:e,emptyMessage:"No stored disk throughput in this range."}]})}let c=["disk.read.latency","disk.write.latency"].filter(e=>a.has(e)),u=["io.pressure.some","io.pressure.full"].filter(e=>a.has(e));if(c.length>0||u.length>0||a.has("disk.utilization")){let e=[];if(c.length>0){let r=c.flatMap(e=>{let r=(0,y.oB)(e);return eo(s,t,e,void 0,s=>`${(0,y.bP)(t,e,s.resourceId)} ${r.shortLabel.toLowerCase()}`)}),n=(0,y.oB)(c[0]);e.push({key:"disk.latency",title:"Latency",unit:n.unit,series:r,emptyMessage:"No stored disk latency in this range."})}if(a.has("disk.utilization")){let r=(0,y.oB)("disk.utilization");e.push({key:"disk.utilization",title:"Utilization",unit:r.unit,series:eo(s,t,"disk.utilization"),emptyMessage:"No stored disk utilization in this range."})}if(u.length>0){let r=(0,y.oB)(u[0]),n=u.flatMap(e=>eo(s,t,e,void 0,(t,s)=>"io.pressure.some"===e?"Some":"io.pressure.full"===e?"Full":s.shortLabel));e.push({key:"io.pressure",title:"I/O pressure",unit:r.unit,series:n,emptyMessage:"No stored I/O pressure in this range."})}l.push({key:"disk-health",title:"Disk health",charts:e})}let m=["net.rx","net.tx"].filter(e=>a.has(e));if(m.length>0){let e=m.flatMap(e=>{let r=(0,y.oB)(e);return eo(s,t,e,void 0,s=>`${(0,y.bP)(t,e,s.resourceId)} ${r.shortLabel.toLowerCase()}`)});l.push({key:"network",title:"Network throughput",charts:[{key:"network",title:"Received and sent",unit:"bytes_per_second",series:e,emptyMessage:"No stored network throughput in this range."}]})}return l}({machine:t,result:s,selectedMetrics:n,hiddenCards:i,coreIds:d});return(0,r.jsx)(en._C,{children:(0,r.jsx)("div",{className:"grid grid-cols-1 gap-5",children:c.map(n=>{let i=n.charts.find(e=>"cpu.core"===e.key&&e.series.length>4),o=i?[...n.charts.filter(e=>e!==i),i]:n.charts,d=i&&4===o.length?"grid gap-6 lg:grid-cols-2 xl:grid-cols-3":o.length>1&&!(i&&2===o.length)?"grid gap-6 lg:grid-cols-2":"flex flex-col gap-6";return(0,r.jsx)(h.Z,{title:n.title,children:(0,r.jsx)("div",{className:d,children:o.map((n,d)=>{let c=n.unitGroup,u=c?e.capacityUnits[c]:void 0,m=n.views?.find(e=>e.unit===u)??n.views?.[0]??n,h=n===i||!i&&o.length%2==1&&d===o.length-1;return"cpu.core"===n.key&&n.series.length>8?(0,r.jsx)(ea,{title:n.title,series:n.series,fromMs:s.fromMs,toMs:s.toMs,gaps:s.gaps,stepMs:(0,I.jl)(s.stepMs,s.tier,t.expectedIntervalMs),hiddenKeys:a,onToggleSeries:l},n.key):(0,r.jsx)(es.t,{title:n.title,unit:m.unit,series:m.series,fromMs:s.fromMs,toMs:s.toMs,stepMs:(0,I.jl)(s.stepMs,s.tier,t.expectedIntervalMs),gaps:s.gaps,hiddenKeys:a,onToggleSeries:l,emptyMessage:n.emptyMessage,note:n.note,action:c&&n.views&&n.views.length>1?(0,r.jsx)("div",{role:"group","aria-label":`${n.title} units`,className:"inline-flex rounded-md border border-border bg-background p-0.5",children:n.views.map(t=>(0,r.jsx)("button",{type:"button","aria-pressed":t.unit===m.unit,onClick:()=>e.onCapacityUnitChange(c,t.unit),className:`min-h-7 rounded px-2 text-xs transition-colors ${t.unit===m.unit?"bg-selected text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"bytes"===t.unit?"Bytes":"%"},t.unit))}):void 0,maxDrawPoints:"cpu.core"===n.key?150:void 0,className:h?"lg:col-span-full":void 0},n.key)})})},n.key)})})},`${t.machineId}|${s.toMs-s.fromMs}`)}var ec=s(1),eu=s(7499);let em={raw:"raw samples","1m":"1-minute rollups","1h":"1-hour rollups"};function eh(e){return e.displayName?.trim()||e.hostname.trim()||e.machineId}function ep(e,t){return`${e}\0${t}`}function ex(e){let t=new Set(e.selectedMetrics),s=new Set((0,y.ue)(e.machine,e.result.series).filter(t=>!e.hiddenCards.has(t.id)).map(e=>e.id));return e.result.series.filter(r=>!(!t.has(r.metric)||e.hiddenSeries.has(ep(r.metric,r.resourceId))||"cpu.core"===r.metric&&void 0!==e.coreIds&&!e.coreIds.includes(r.resourceId)||r.metric.startsWith("gpu.")&&""!==r.resourceId&&!s.has(r.resourceId)))}function eg(e){return new Date(e).toISOString()}function ef(e){return(0,y.oB)(e)?.label??e}function eb(e){return ex(e).map(t=>({metric:t.metric,label:ef(t.metric),resourceId:t.resourceId,resourceLabel:(0,y.bP)(e.machine,t.metric,t.resourceId),unit:t.unit,unitLabel:(0,y.RL)(t.unit),stats:(0,I.T6)(t.points),points:t.points.map(t=>{let s=Math.min(e.result.toMs,t.t+e.result.stepMs),r=null!==t.min||null!==t.max||null!==t.avg;return{t:t.t,tIso:eg(t.t),bucketStartMs:t.t,bucketStartIso:eg(t.t),bucketEndMs:s,bucketEndIso:eg(s),min:t.min,max:t.max,avg:t.avg,state:r?"recorded":"unavailable"}})}))}function ey(e){return(0,I.$z)(e.result.gaps,e.result.fromMs,e.result.toMs).map(e=>({...e,fromIso:eg(e.fromMs),toIso:eg(e.toMs)}))}function ej(e){let t=new Set(e.result.series.map(e=>e.metric));return e.selectedMetrics.filter(e=>!t.has(e))}function ev(e){let t=new Set(e.selectedMetrics),s=new Set(ex(e).map(e=>ep(e.metric,e.resourceId)));return e.result.series.filter(e=>t.has(e.metric)&&!s.has(ep(e.metric,e.resourceId))).length}function eN(e,t){let s=e.result,r=["Only the visible series from the loaded History result are included; this export does not query more data."];"raw"!==s.tier&&r.push(`Values are ${em[s.tier]}, not individual raw samples.`),s.truncated&&r.push("The loaded result is partial: the hub limited or shortened this history query.");let n=ey(e);n.length>0&&r.push(`${n.length} recorded data gap${1===n.length?"":"s"} included.`),t.length>0&&r.push(`Selected metrics without stored data: ${t.join(", ")}.`);let i=ev(e);return i>0&&r.push(`${i} selected series hidden in this view were not exported.`),r}let ew=["record_type","metric","metric_label","resource_id","resource_label","unit","bucket_start_ms","bucket_start_iso","bucket_end_ms","bucket_end_iso","min","max","avg","value_state","gap_kind","gap_reason","gap_dropped_records"],ek="inline-flex min-h-7 items-center rounded-md border border-border bg-background px-2 text-xs text-foreground transition-colors hover:bg-card-strong disabled:cursor-not-allowed disabled:opacity-50";function eM(e){let[t,s]=(0,a.useState)(null),n=ex(e).length,i=t=>{let r=Date.now(),n={...e,exportedAt:r};try{let e,i,a,l,o,d,c,u,m=function(e,t,s=Date.now()){return(0,eu.Y8)("history",eh(e.machine),s,t)}(n,t,r),h="csv"===t?function(e){let t,s,r,n,i,a,l=e.exportedAt??Date.now(),o=(t=(0,S.ly)(e.range),s=e.result,r=ex(e),n=ej(e),i=ey(e),a=e.selectedMetrics.map(ef).join("; "),[["Rigscope History export"],["Scope","Visible series from the loaded History result"],["Machine",eh(e.machine)],["Machine ID",e.machine.machineId],["Query",a],["Range",`${t.label} (${eg(s.fromMs)} – ${eg(s.toMs)})`],["Resolution",`${em[s.tier]} \xb7 ${s.stepMs} ms buckets`],["Loaded at",eg(e.loadedAt)],["Exported at",eg(l)],["Partial",s.truncated?"true":"false"],["Gaps",String(i.length)],["Visible series",String(r.length)],["Selected without stored data",n.length>0?n.join(", "):"none"],["Note",eN(e,n).join(" ")],[]]);for(let t of(o.push([...ew]),eb(e)))for(let e of t.points)o.push(["bucket",t.metric,t.label,t.resourceId,t.resourceLabel,t.unit,e.bucketStartMs,e.bucketStartIso,e.bucketEndMs,e.bucketEndIso,e.min,e.max,e.avg,e.state,"","",""]);for(let t of ey(e))o.push(["gap","","","","","",t.fromMs,t.fromIso,t.toMs,t.toIso,"","","","gap",t.kind,t.reason??"",t.droppedRecords??""]);return(0,ec.kg)(o)}(n):(e=n.exportedAt??Date.now(),i=(0,S.ly)(n.range),a=n.result,l=eb(n),o=ej(n),d=ey(n),c=ev(n),u={app:"Rigscope",kind:"history",exportedAt:eg(e),scope:{description:"Visible series from the loaded History result",machine:{id:n.machine.machineId,name:eh(n.machine),hostname:n.machine.hostname,connected:n.machine.connected,lastReceivedAt:n.machine.lastReceivedAt},query:{range:{id:i.id,label:i.label,fromMs:a.fromMs,fromIso:eg(a.fromMs),toMs:a.toMs,toIso:eg(a.toMs)},selectedMetrics:[...n.selectedMetrics],visibleSeries:l.length,hiddenSeriesCount:c}},resolution:{tier:a.tier,label:em[a.tier],stepMs:a.stepMs,expectedIntervalMs:n.machine.expectedIntervalMs??null},loadedAt:eg(n.loadedAt),partial:a.truncated,gaps:d,series:l.map(e=>({metric:e.metric,label:e.label,resourceId:e.resourceId,resourceLabel:e.resourceLabel,unit:e.unit,unitLabel:e.unitLabel,summary:{points:e.stats.count,min:e.stats.min,max:e.stats.max,averageOfBucketAverages:e.stats.avg,latest:e.stats.latest,latestAt:null===e.stats.latestT?null:eg(e.stats.latestT),firstAt:null===e.stats.firstT?null:eg(e.stats.firstT),lastAt:null===e.stats.lastT?null:eg(e.stats.lastT)},points:e.points})),missingData:o.map(e=>({metric:e,label:ef(e),reason:"No stored series in the loaded result."})),notes:eN(n,o)},`${JSON.stringify(u,null,2)}
|
|
3
|
-
`);(0,ec.PE)(m,h,"csv"===t?ec.UR:ec.uW),s(null)}catch{s("The history export could not be created.")}};return(0,r.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Export visible",(0,r.jsx)("span",{className:"sr-only",children:` (${n} series from the loaded result)`})]}),(0,r.jsx)("button",{type:"button",onClick:()=>i("csv"),"aria-label":"Download visible history as CSV",title:"Download the visible series from this loaded result as CSV",className:ek,children:"CSV"}),(0,r.jsx)("button",{type:"button",onClick:()=>i("json"),"aria-label":"Download visible history as JSON",title:"Download the visible series from this loaded result as JSON",className:ek,children:"JSON"}),null!==t?(0,r.jsxs)("span",{role:"status",className:"inline-flex items-center gap-1 text-xs text-warn",children:[(0,r.jsx)(d.A,{className:"h-3 w-3","aria-hidden":!0}),t]}):null]})}function e$(e){return e.displayName?.trim()||e.hostname.trim()||e.machineId}function eA(){return(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-5 xl:grid-cols-2","aria-busy":"true",children:[(0,r.jsx)(h.Z,{title:"Loading stored history",children:(0,r.jsx)("div",{className:"h-40 animate-pulse rounded-lg bg-card-strong","aria-hidden":!0})}),(0,r.jsx)(h.Z,{title:"Preparing charts",children:(0,r.jsx)("div",{className:"h-40 animate-pulse rounded-lg bg-card-strong","aria-hidden":!0})})]})}function eI(){let e,t,s,n,{session:j,phase:v,machines:N,retryConnection:w}=(0,f.M)(),k=(0,g.x)(),{machine:A,machineId:R,requestedMachineId:P}=(0,b.JG)("history"),[U,L]=W(R,"memory"),[_,T]=W(R,"filesystem"),z={memory:U,filesystem:_},[D,H]=(0,B.u)("history.range","10m",F),[Z,V]=(0,B.u)(`history.metrics.${R}`,null,O),[K]=q(R),Y=M(A),J=$(K,Y),[Q,X]=G(R,"cards"),[es,er]=G(R,"series"),en=(0,a.useMemo)(()=>new Set(Q),[Q]),ei=(0,a.useMemo)(()=>new Set(es),[es]),[ea,el]=(0,B.u)("history.autoRefresh",!0,E,"session"),[eo,ec]=(0,a.useState)(null),[eu,em]=(0,a.useState)(null),[eh,ep]=(0,a.useState)(0),ex=(0,a.useRef)(null),[eg,ef]=(0,a.useState)(null),[eb,ey]=(0,a.useState)(Date.now);(0,a.useEffect)(()=>{if(void 0===A){ex.current=null,ef(null);return}let e=ex.current,t={connected:A.connected,lastReceivedAt:A.lastReceivedAt},s=e?.machineId===A.machineId?e.point:null;ef(e=>{let r=function(e,t,s,r){let n=e.findIndex(e=>null===e.toMs);if(!s.connected){if(n>=0)return e;let i=[...e,{fromMs:C(s.lastReceivedAt)??C(t?.lastReceivedAt??null)??r,toMs:null}];return i.length>64?i.slice(i.length-64):i}if(n<0||null===t||t.connected)return e;let i=e[n],a=C(s.lastReceivedAt),l=null!==a&&a>i.fromMs?a:Math.max(i.fromMs,r);return e.map((e,t)=>t===n?{fromMs:e.fromMs,toMs:l}:e)}(e?.machineId===A.machineId?e.outages:[],s,t,Date.now());return e?.machineId===A.machineId&&e.outages===r?e:{machineId:A.machineId,outages:r}}),t.connected&&s?.connected!==!1||ey(Date.now()),ex.current={machineId:A.machineId,point:t}},[A?.machineId,A?.connected,A?.lastReceivedAt]),(0,a.useEffect)(()=>{if(A?.connected!==!1||!ea)return;let e=window.setInterval(()=>{"visible"===document.visibilityState&&ey(Date.now())},1e3);return()=>window.clearInterval(e)},[A?.machineId,A?.connected,ea]);let ej=(0,a.useMemo)(()=>void 0===A?"":(0,y.er)(A).join(","),[A?.machineId,A?.inventory,A?.metrics?.payload.gpus]),ev=Z??ej,eN=""===ev?[]:ev.split(","),ew="signed-in"===j.kind&&void 0!==A&&""!==R&&""!==ev;(0,a.useEffect)(()=>{if(""===R){ec(null),em(null);return}let e=new AbortController;return ec(null),em(null),fetch(`/api/history/metrics?machineId=${encodeURIComponent(R)}`,{signal:e.signal,cache:"no-store",headers:{Accept:"application/json"}}).then(async t=>{if(!t.ok){if(401===t.status||403===t.status||404===t.status)return;throw Error(`catalog ${t.status}`)}let s=await t.json();if(null===s||"object"!=typeof s||!("metrics"in s))throw Error("catalog shape");let r=s.metrics;if(null===r||"object"!=typeof r)throw Error("catalog shape");let n=Object.create(null);for(let[e,t]of Object.entries(r))null!==t&&"object"==typeof t&&"string"==typeof t.unit&&(n[e]={unit:t.unit});e.signal.aborted||ec(n)}).catch(()=>{e.signal.aborted||em("The hub's metric catalog could not be loaded; standard metric names are shown.")}),()=>e.abort()},[R]);let{data:ek,error:eI,loading:eC,manualRefreshing:eS}=(0,et.n)({machineId:R,metricsKey:ev,coreIdsKey:eN.includes("cpu.core")&&J.length!==Y.length?J.join(","):void 0,range:D,enabled:ew,autoRefresh:ea,refreshNonce:eh});(0,a.useEffect)(()=>{eI?.kind==="rate-limited"&&el(!1)},[eI?.kind,el]);let eR=(0,a.useMemo)(()=>{if(!ek||eg?.machineId!==R||0===eg.outages.length)return ek;let e=ek.result,t=Math.max(e.toMs,...eg.outages.map(e=>e.toMs??eb)),s=e.fromMs+t-e.toMs;return{...ek,result:{...e,fromMs:s,toMs:t,gaps:(0,I.$z)([...e.gaps,...function(e,t,s){if(!Number.isFinite(t)||!Number.isFinite(s)||s<=t)return[];let r=[];for(let n of e){let e=Math.max(t,n.fromMs),i=Math.min(s,n.toMs??s);Number.isFinite(e)&&Number.isFinite(i)&&!(i<=e)&&r.push({fromMs:e,toMs:i,kind:"missing",reason:null===n.toMs?"collector disconnected":"collector outage"})}var n=r;let i=n.filter(e=>Number.isFinite(e.fromMs)&&Number.isFinite(e.toMs)&&e.toMs>e.fromMs).map(e=>({...e})).sort((e,t)=>e.fromMs-t.fromMs||e.toMs-t.toMs),a=[];for(let e of i){let t=a.at(-1);if(void 0!==t&&e.fromMs<=t.toMs){t.toMs=Math.max(t.toMs,e.toMs),"dropped"===e.kind&&(t.kind="dropped"),void 0===t.reason&&void 0!==e.reason&&(t.reason=e.reason),void 0===t.droppedRecords&&void 0!==e.droppedRecords&&(t.droppedRecords=e.droppedRecords);continue}a.push(e)}return a}(eg.outages,s,t)],s,t)}}},[ek,R,eg,eb]),eP=eR?.result??null,eU=void 0===A?[]:(0,y.ue)(A,eP?.series??[]),eL=(0,S.ly)(D),e_=null!==eI?null!==eR?`${"rate-limited"===eI.kind?"Refresh paused":"Refresh failed"} \xb7 ${(0,S.ei)(eR.loadedAt)}`:"History unavailable":null!==eR?`Updated ${(0,S.ei)(eR.loadedAt)}`:eC?"Loading…":"",eB=ew&&null===eR&&null===eI,eT=N.length,ez="disconnected"===v;return(0,r.jsx)(m.G,{title:"History",machineId:R,machineView:"history",headerRight:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.$E,{}),(0,r.jsx)(x.B,{})]}),children:k||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{role:"status","aria-live":"polite",className:"sr-only",children:eI?.message??""}),(0,r.jsx)(ee,{machine:A,range:D,selectedMetrics:eN,catalog:eo,catalogError:eu,gpuCards:eU,hiddenCards:en,autoRefresh:ea,loading:eC,manualRefreshing:eS,statusText:e_,onRangeChange:H,onToggleMetric:e=>{let t=new Set(eN);t.has(e)?t.delete(e):t.add(e),V([...t].sort().join(","))},onSetMetrics:e=>V([...new Set(e)].sort().join(",")),onToggleCard:e=>{X(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),[...s]})},onToggleAutoRefresh:()=>el(e=>!e),onRefresh:()=>ep(e=>e+1)}),"reconnecting"===v||"disconnected"===v?(0,r.jsxs)("div",{role:"status",className:"mb-4 flex items-start gap-2 rounded-lg border border-border bg-card px-4 py-2.5 text-xs text-muted-foreground",children:[(0,r.jsx)(d.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,r.jsxs)("span",{children:["Live feed ","disconnected"===v?"disconnected":"reconnecting"," \xb7 stored history available"]}),"disconnected"===v?(0,r.jsxs)("button",{type:"button",onClick:w,className:"ml-auto inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,r.jsx)(u.A,{className:"h-3 w-3","aria-hidden":!0}),"Retry now"]}):null]}):null,void 0===A?ez?(0,r.jsxs)(h.Z,{title:"Hub disconnected",className:"mx-auto mt-3 max-w-xl",children:[(0,r.jsx)(h.p,{icon:c.A,note:"The hub is unreachable, so the authorized machine list is unavailable."}),(0,r.jsx)("div",{className:"mt-2 flex justify-center",children:(0,r.jsxs)("button",{type:"button",onClick:w,className:"inline-flex min-h-8 items-center gap-1.5 rounded-md border border-border px-3 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,r.jsx)(u.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Check again"]})})]}):0!==eT||ez||"idle"!==v&&"connecting"!==v&&"reconnecting"!==v?0===eT?(0,r.jsx)(h.Z,{title:"No machines",className:"mx-auto mt-3 max-w-xl",children:(0,r.jsx)(h.p,{icon:o.A,note:"No machines are available in your authorized fleet."})}):(0,r.jsxs)(h.Z,{title:"Machine not found",className:"mx-auto mt-3 max-w-xl",children:[(0,r.jsx)(h.p,{icon:o.A,note:"This machine is unavailable or outside your access."}),P?(0,r.jsxs)("p",{className:"tnum mt-2 text-center text-xs text-muted-foreground",children:["Requested identifier: ",P]}):null,(0,r.jsx)("div",{className:"mt-2 flex justify-center",children:(0,r.jsx)(i(),{href:"/",className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:"Back to fleet"})})]}):(0,r.jsx)(h.Z,{title:"Waiting for machines",className:"mx-auto mt-3 max-w-xl",children:(0,r.jsx)(h.p,{icon:o.A,note:"Waiting for the hub to report your authorized machines…"})}):0===eN.length?(0,r.jsx)(h.Z,{title:"No metrics selected",className:"mx-auto mt-3 max-w-xl",children:(0,r.jsx)(h.p,{icon:o.A,note:""===ej?"No metric families are shared with this hub.":"Choose at least one metric above to draw history."})}):null!==eI&&null===eR?(t=(e=function(e){switch(e.kind){case"unauthorized":return{title:"Session ended",note:"Your session is no longer accepted, so stored history is hidden.",icon:l.A};case"denied":return{title:"History access denied",note:e.message,icon:l.A};case"missing":return{title:"Machine unavailable",note:e.message,icon:o.A};case"rate-limited":return{title:"History requests limited",note:e.message,icon:d.A};case"unavailable":return{title:"History unavailable",note:e.message,icon:c.A};case"network":return{title:"Hub unreachable",note:"The hub could not be reached for stored history.",icon:c.A};case"invalid":return{title:"Unexpected history response",note:e.message,icon:d.A}}}(eI)).icon,(0,r.jsxs)(h.Z,{title:e.title,className:"mx-auto mt-3 max-w-xl",children:[(0,r.jsx)(h.p,{icon:t,note:e.note}),(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap justify-center gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>ep(e=>e+1),className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,r.jsx)(u.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Try again"]}),"unauthorized"===eI.kind?(0,r.jsx)(i(),{href:"/login",className:"inline-flex items-center rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90",children:"Sign in"}):null]})]})):(eC||eB)&&null===eR?(0,r.jsx)(eA,{}):null===eR?(0,r.jsx)(h.Z,{title:"History",className:"mx-auto mt-3 max-w-xl",children:(0,r.jsx)(h.p,{icon:o.A,note:"No stored history has arrived yet."})}):(n="raw"===(s=eR.result).tier?"raw samples":"1m"===s.tier?"1-minute rollups":"1-hour rollups",(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-baseline gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-foreground",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:`inline-block h-2 w-2 shrink-0 rounded-full ${A.connected?"bg-ok":"bg-crit"}`}),e$(A)]}),(0,r.jsxs)("span",{children:[(0,S.r6)(s.fromMs)," – ",(0,S.r6)(s.toMs)]}),(0,r.jsxs)("span",{className:"tnum",title:n,children:[(0,S.I_)(s.stepMs)," buckets"]}),(0,r.jsx)("div",{className:"ml-auto self-center",children:(0,r.jsx)(eM,{machine:A,result:s,range:D,selectedMetrics:(0,y.Cv)(eN,z),hiddenCards:en,hiddenSeries:ei,coreIds:J,loadedAt:eR.loadedAt})})]}),s.truncated?(0,r.jsxs)("div",{role:"status",className:"mb-4 flex items-start gap-2 rounded-lg bg-warn-soft px-4 py-2.5 text-xs text-foreground",children:[(0,r.jsx)(d.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,r.jsx)("span",{children:"Partial history \xb7 narrow the range for more detail."})]}):null,s.gaps.length>0?(0,r.jsxs)("details",{className:"mb-4 max-w-3xl text-xs text-muted-foreground",children:[(0,r.jsxs)("summary",{className:"inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-md text-warn",children:[(0,r.jsx)(d.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,r.jsxs)("span",{children:[(0,r.jsx)("strong",{className:"font-medium",children:"Data gaps:"})," ",(0,S.fH)(s.gaps,s.fromMs,s.toMs)]})]}),(0,r.jsxs)("ul",{className:"mt-1.5 flex flex-col gap-1",children:[s.gaps.slice(0,20).map(e=>(0,r.jsxs)("li",{className:"tnum text-xs",children:[(0,S.r6)(e.fromMs)," – ",(0,S.r6)(e.toMs)," (",(0,S.I_)(e.toMs-e.fromMs),"):"," ","dropped"===e.kind?"dropped":"missed",e.reason?` \xb7 ${e.reason}`:"",void 0!==e.droppedRecords?` \xb7 ${e.droppedRecords} record${1===e.droppedRecords?"":"s"}`:""]},`${e.fromMs}-${e.toMs}-${e.kind}`)),s.gaps.length>20?(0,r.jsxs)("li",{className:"text-xs text-muted-foreground",children:["…and ",s.gaps.length-20," more."]}):null]})]}):null,0===s.series.length?(0,r.jsx)(h.Z,{title:"No stored points",className:"mx-auto max-w-xl",children:(0,r.jsx)(h.p,{icon:o.A,note:`No stored readings for ${void 0===A?"this machine":e$(A)} in ${eL.label.toLowerCase()}.`})}):(0,r.jsx)(ed,{machine:A,result:s,selectedMetrics:eN,hiddenCards:en,hiddenSeries:ei,onToggleSeries:e=>{er(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),[...s]})},capacityUnits:z,onCapacityUnitChange:(e,t)=>("memory"===e?L:T)(t)})]}))]})})}},6582:(e,t,s)=>{"use strict";s.d(t,{E:()=>f,x:()=>g});var r=s(5155),n=s(8500),i=s.n(n),a=s(828),l=s(6914),o=s(7029),d=s(438),c=s(7422),u=s(1735),m=s(3440),h=s(9939);function p(e){return(0,r.jsxs)("button",{type:"button",onClick:e.onClick,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,r.jsx)(a.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),e.children]})}function x(e){return(0,r.jsx)(i(),{href:e.href,className:e.primary?"inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90":"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:e.children})}function g(){let{session:e,phase:t,retryConnection:s}=(0,h.M)();switch(e.kind){case"restoring":return(0,r.jsx)(m.Z,{title:"Checking session",className:"mx-auto my-12 max-w-md",children:(0,r.jsx)(m.p,{icon:l.A,note:"Checking your session…"})});case"restore-failed":return(0,r.jsxs)(m.Z,{title:"Hub unreachable",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(m.p,{icon:o.A,note:"The hub is unreachable right now."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(p,{onClick:s,children:"Check again"})})]});case"signed-out":if("expired"===t)return(0,r.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(m.p,{icon:d.A,note:"Your session ended."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(x,{href:"/login",primary:!0,children:"Sign in"})})]});return(0,r.jsxs)(m.Z,{title:"Sign in required",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(m.p,{icon:l.A,note:"Sign in required."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(x,{href:"/login",primary:!0,children:"Sign in"})})]});case"auth-unavailable":return(0,r.jsx)(m.Z,{title:"Sign-in unavailable",className:"mx-auto my-12 max-w-md",children:(0,r.jsx)(m.p,{icon:c.A,note:"Browser sign-in is not configured on this hub."})})}return"expired"===t?(0,r.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(m.p,{icon:d.A,note:"Your session ended."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(x,{href:"/login",primary:!0,children:"Sign in"})})]}):"no-permission"===t?(0,r.jsxs)(m.Z,{title:"No permission",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(m.p,{icon:c.A,note:`You are signed in as ${e.user.username}, but this hub grants no machine view to this account.`}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(p,{onClick:s,children:"Check again"})})]}):null}function f(){let{phase:e,retryConnection:t}=(0,h.M)();return"reconnecting"!==e&&"disconnected"!==e&&"connecting"!==e?null:"connecting"===e?(0,r.jsxs)("div",{role:"status",className:"mb-5 flex items-center gap-2 rounded-lg border border-border bg-card px-4 py-2.5 text-xs text-muted-foreground",children:[(0,r.jsx)(a.A,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),"Connecting to the live feed — waiting for the first snapshot."]}):(0,r.jsxs)("div",{role:"status",className:"mb-5 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-border bg-card px-4 py-2.5 text-xs text-muted-foreground",children:[(0,r.jsx)(u.A,{className:"h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,r.jsxs)("span",{children:["Connection lost — values below are ",(0,r.jsx)("strong",{className:"font-medium text-foreground",children:"last known"}),", not live measurements","reconnecting"===e?" — retrying with backoff…":" — retries stopped."]}),"disconnected"===e?(0,r.jsx)(p,{onClick:t,children:"Retry now"}):null]})}},7148:(e,t,s)=>{Promise.resolve().then(s.bind(s,2939)),Promise.resolve().then(s.bind(s,1721)),Promise.resolve().then(s.bind(s,2701)),Promise.resolve().then(s.bind(s,2394))},7499:(e,t,s)=>{"use strict";function r(e,t,s,r){return`rigscope-${e}-${function(e,t="machine"){let s=e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"");return s.length>0?s:t}(t)}-${!Number.isFinite(s)?"unknown-time":new Date(s).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"Z")}.${r}`}s.d(t,{Y8:()=>r})},9942:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])}},e=>{e.O(0,[157,939,103,408,441,794,358],()=>e(e.s=7148)),_N_E=e.O()}]);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[952],{1:(e,t,s)=>{"use strict";s.d(t,{PE:()=>o,UR:()=>c,kg:()=>l,uW:()=>d});let r=/^[\u0009\u000a\u000d ]*[=+\-@]/,n=/^[\u0009\u000a\u000d]/;function a(e){if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?String(e):"";if("boolean"==typeof e)return e?"true":"false";let t=0===e.length?e:r.test(e)||n.test(e)?`'${e}`:e;return/[",\t\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function i(e){return e.map(a).join(",")}function l(e){return`${e.map(i).join("\r\n")}\r
|
|
2
|
-
`}function o(e,t,s){if("u"<typeof document)return;let r=new Blob([t],{type:s}),n=URL.createObjectURL(r),a=document.createElement("a");a.href=n,a.download=e,a.rel="noopener",a.style.display="none",document.body.append(a),a.click(),a.remove(),globalThis.setTimeout(()=>URL.revokeObjectURL(n),0)}let c="text/csv;charset=utf-8",d="application/json;charset=utf-8"},438:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},2910:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]])},3381:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]])},4268:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6582:(e,t,s)=>{"use strict";s.d(t,{E:()=>x,x:()=>g});var r=s(5155),n=s(8500),a=s.n(n),i=s(828),l=s(6914),o=s(7029),c=s(438),d=s(7422),u=s(1735),p=s(3440),h=s(9939);function m(e){return(0,r.jsxs)("button",{type:"button",onClick:e.onClick,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),e.children]})}function f(e){return(0,r.jsx)(a(),{href:e.href,className:e.primary?"inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90":"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:e.children})}function g(){let{session:e,phase:t,retryConnection:s}=(0,h.M)();switch(e.kind){case"restoring":return(0,r.jsx)(p.Z,{title:"Checking session",className:"mx-auto my-12 max-w-md",children:(0,r.jsx)(p.p,{icon:l.A,note:"Checking your session…"})});case"restore-failed":return(0,r.jsxs)(p.Z,{title:"Hub unreachable",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(p.p,{icon:o.A,note:"The hub is unreachable right now."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(m,{onClick:s,children:"Check again"})})]});case"signed-out":if("expired"===t)return(0,r.jsxs)(p.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(p.p,{icon:c.A,note:"Your session ended."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(f,{href:"/login",primary:!0,children:"Sign in"})})]});return(0,r.jsxs)(p.Z,{title:"Sign in required",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(p.p,{icon:l.A,note:"Sign in required."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(f,{href:"/login",primary:!0,children:"Sign in"})})]});case"auth-unavailable":return(0,r.jsx)(p.Z,{title:"Sign-in unavailable",className:"mx-auto my-12 max-w-md",children:(0,r.jsx)(p.p,{icon:d.A,note:"Browser sign-in is not configured on this hub."})})}return"expired"===t?(0,r.jsxs)(p.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(p.p,{icon:c.A,note:"Your session ended."}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(f,{href:"/login",primary:!0,children:"Sign in"})})]}):"no-permission"===t?(0,r.jsxs)(p.Z,{title:"No permission",className:"mx-auto my-12 max-w-md",children:[(0,r.jsx)(p.p,{icon:d.A,note:`You are signed in as ${e.user.username}, but this hub grants no machine view to this account.`}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(m,{onClick:s,children:"Check again"})})]}):null}function x(){let{phase:e,retryConnection:t}=(0,h.M)();return"reconnecting"!==e&&"disconnected"!==e&&"connecting"!==e?null:"connecting"===e?(0,r.jsxs)("div",{role:"status",className:"mb-5 flex items-center gap-2 rounded-lg border border-border bg-card px-4 py-2.5 text-xs text-muted-foreground",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),"Connecting to the live feed — waiting for the first snapshot."]}):(0,r.jsxs)("div",{role:"status",className:"mb-5 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-border bg-card px-4 py-2.5 text-xs text-muted-foreground",children:[(0,r.jsx)(u.A,{className:"h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,r.jsxs)("span",{children:["Connection lost — values below are ",(0,r.jsx)("strong",{className:"font-medium text-foreground",children:"last known"}),", not live measurements","reconnecting"===e?" — retrying with backoff…":" — retries stopped."]}),"disconnected"===e?(0,r.jsx)(m,{onClick:t,children:"Retry now"}):null]})}},7339:(e,t,s)=>{"use strict";s.d(t,{ProcessesView:()=>eX});var r=s(5155),n=s(8500),a=s.n(n),i=s(9926),l=s(3381),o=s(8731),c=s(4173),d=s(3440),u=s(940),p=s(802),h=s(6582),m=s(9939),f=s(8664),g=s(2115),x=s(828),b=s(7422),y=s(7029),w=s(2910),v=s(1735),j=s(9764),k=s(9664),M=s(4268),N=s(9942);let A=new Set(["bash","zsh","fish","sh","dash","ksh","mksh","tcsh","csh","ash","busybox"]),P=new Set(["sshd","sshd-session","dropbear","tmux","screen","systemd"]),S=["cpuPercent","memoryRssBytes","gpuMemoryBytes","ioReadBytesPerSec","ioWriteBytesPerSec"];function $(e,t,s){return e.slice().sort((e,r)=>D(W(e,t),W(r,t),s))}function R(e){return null!==e&&!!("init.scope"===e||/^session-.+\.scope$/.test(e)||/^user@.+\.service$/.test(e))}function C(e){return null===e||!e.endsWith(".scope")&&!e.endsWith(".service")||R(e)?null:e}function B(e){let t=e.replace(/\.(scope|service)$/,"");return t.startsWith("app-gnome-")?t=t.slice(10):t.startsWith("app-")&&(t=t.slice(4)),(t=t.replace(/-\d+$/,"")).length>0?t:e}function T(e){return{key:`tree:${e.pid}:${e.startTicks}`,label:e.name,kind:"tree",leader:e}}function U(e,t){switch(t){case"cpu":return e.cpuPercent;case"memory":return e.memoryRssBytes;case"gpuMemory":return e.gpuMemoryBytes;case"ioRead":return e.ioReadBytesPerSec;case"ioWrite":return e.ioWriteBytesPerSec;case"name":return e.label;case"count":return e.count;case"pid":var s=e.members;let r=null;for(let e of s)(null===r||e.pid<r)&&(r=e.pid);return r;case"user":return e.users.length>0?e.users[0]:null}}function W(e,t){switch(t){case"cpu":return e.cpuPercent;case"memory":return e.memoryRssBytes;case"gpuMemory":return e.gpuMemoryBytes;case"ioRead":return e.ioReadBytesPerSec;case"ioWrite":return e.ioWriteBytesPerSec;case"name":return e.name;case"count":return 1;case"pid":return e.pid;case"user":return e.user}}function D(e,t,s){let r,n=null==e,a=null==t;if(n&&a)return 0;if(n)return 1;if(a)return -1;if("number"==typeof e&&"number"==typeof t)r=e-t;else{let s=String(e).toLowerCase(),n=String(t).toLowerCase();r=s<n?-1:+(s>n)}return"asc"===s?r:-r}var I=s(592),L=s(7586);let q={key:"cpu",dir:"desc"};function K(e,t,s){return null!==e&&t-e>=(!Number.isFinite(s)||s<=0?1e4:Math.max(1e4,3*s))}let _=[{value:"applications",label:"Applications"},{value:"processes",label:"Processes"},{value:"tree",label:"Tree"}];function F(e){return`${e.pid}:${e.startTicks}`}function E(e){if(void 0===e.command)return e;let{command:t,...s}=e;return s}function z(e){return null!=e&&Number.isFinite(e)?Math.round(e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):"—"}function O(e){switch(e){case"idle":return{label:"Not connected",tone:"muted",description:"Select a machine to request process detail.",retryable:!1};case"acquiring":return{label:"Connecting",tone:"warn",description:"Requesting process detail…",retryable:!1};case"loading":return{label:"Waiting",tone:"warn",description:"Waiting for the collector's first process snapshot…",retryable:!1};case"ready":return{label:"Live",tone:"ok",description:"Process detail is live.",retryable:!1};case"paused":return{label:"Paused",tone:"muted",description:"Process updates are paused.",retryable:!1};case"stale":return{label:"Not refreshing",tone:"warn",description:"The last snapshot is retained, but new snapshots are not arriving.",retryable:!0};case"disconnected":return{label:"Disconnected",tone:"crit",description:"The collector is disconnected; the last snapshot is not live.",retryable:!0};case"withheld":return{label:"Withheld",tone:"warn",description:"Process detail is withheld for this hub.",retryable:!0};case"unsupported":return{label:"Unsupported",tone:"warn",description:"This collector cannot provide process detail.",retryable:!0};case"busy":return{label:"Busy",tone:"warn",description:"Too many process views are open for this hub.",retryable:!0};case"expired":return{label:"Expired",tone:"warn",description:"Process detail expired before a fresh snapshot arrived.",retryable:!0};case"failed":return{label:"Scan failed",tone:"crit",description:"The process scan failed repeatedly.",retryable:!0};case"cancelled":return{label:"Stopped",tone:"muted",description:"The process detail view was stopped.",retryable:!0};case"error":return{label:"Unavailable",tone:"crit",description:"Process detail is unavailable right now.",retryable:!0}}}function V(e){return"number"==typeof e&&Number.isFinite(e)&&e>0}var Z=s(7348);class G{maxAgeMs;limit;session=null;entries=new Map;constructor(e=3e5,t=32){this.maxAgeMs=e,this.limit=t}scope(e){(this.session!==e||null===e)&&this.entries.clear(),this.session=e}get(e,t,s=Date.now()){this.scope(t);let r=this.entries.get(e);return r&&s-r.lastReceivedMs>=this.maxAgeMs?void this.entries.delete(e):r}set(e,t,s){this.scope(t),this.entries.delete(e),this.entries.set(e,s),this.entries.size>this.limit&&this.entries.delete(this.entries.keys().next().value)}delete(e,t){this.scope(t),this.entries.delete(e)}}let Y=new G;function X(e,t){let s=Y.get(e??"",t);return void 0!==s?{phase:"stale",message:"Resuming process updates…",...s}:{phase:null===e?"idle":"acquiring",detail:null,message:null,intervalMs:1e3,leaseMs:15e3,lastReceivedMs:null}}async function J(e){try{let t=await e.json();if(t&&"object"==typeof t&&"error"in t){let e=t.error;if("string"==typeof e&&e.length>0)return e}}catch{}return e.statusText||null}var H=s(8698);let Q=(0,H.A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),ee=(0,H.A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),et=(0,H.A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var es=s(8528),er=s(6114);let en=[{id:"name",label:"Application",sortKey:"name",align:"left",width:300},{id:"count",label:"Procs",sortKey:"count",align:"right",width:76},{id:"cpu",label:"CPU / core",sortKey:"cpu",align:"right",width:104},{id:"memory",label:"RSS",sortKey:"memory",align:"right",width:96},{id:"gpuMemory",label:"VRAM",sortKey:"gpuMemory",align:"right",width:96},{id:"ioRead",label:"Read",sortKey:"ioRead",align:"right",width:104},{id:"ioWrite",label:"Write",sortKey:"ioWrite",align:"right",width:104},{id:"users",label:"Users",sortKey:"user",align:"left",width:160}],ea=[{id:"name",label:"Process",sortKey:"name",align:"left",width:300},{id:"pid",label:"PID",sortKey:"pid",align:"right",width:84},{id:"user",label:"User",sortKey:"user",align:"left",width:120},{id:"cpu",label:"CPU / core",sortKey:"cpu",align:"right",width:104},{id:"memory",label:"RSS",sortKey:"memory",align:"right",width:96},{id:"gpuMemory",label:"VRAM",sortKey:"gpuMemory",align:"right",width:96},{id:"ioRead",label:"Read",sortKey:"ioRead",align:"right",width:104},{id:"ioWrite",label:"Write",sortKey:"ioWrite",align:"right",width:104},{id:"threads",label:"Threads",align:"right",width:84}],ei=Object.freeze({}),el=Object.freeze([]),eo=new Set(["cpu","memory","gpuMemory","ioRead","ioWrite","name","count","pid","user"]);function ec(e){return Math.round(Math.min(1200,Math.max(56,e)))}function ed(e){return"applications"===e||"processes"===e||"tree"===e?e:null}function eu(e){if(null===e||"object"!=typeof e)return null;let{key:t,dir:s}=e;return"string"==typeof t&&eo.has(t)&&("asc"===s||"desc"===s)?{key:t,dir:s}:null}function ep(e){if(null===e||"object"!=typeof e||Array.isArray(e))return null;let t={};for(let[s,r]of Object.entries(e))"number"==typeof r&&Number.isFinite(r)&&(t[s]=ec(r));return t}function eh(e){return"string"==typeof e?e.slice(0,200):null}function em(e){return"boolean"==typeof e?e:null}function ef(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)?e.slice(0,500):null}let eg="overflow-hidden text-ellipsis whitespace-nowrap border-b border-border px-2 py-2 align-middle",ex=`${eg} tnum text-right text-xs`,eb="relative overflow-hidden whitespace-nowrap border-b border-border px-2 py-2 text-left text-xs font-normal text-muted-foreground";function ey(e,t){return t[e.id]??e.width}function ew({label:e,width:t,onChange:s,onReset:n}){let a=(0,g.useRef)(null);return(0,r.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e} column`,"aria-valuenow":t,"aria-valuemin":56,"aria-valuemax":1200,tabIndex:0,title:"Drag to resize \xb7 double-click to reset",onPointerDown:e=>{0===e.button&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),a.current={x:e.clientX,width:t})},onPointerMove:e=>{null!==a.current&&s(ec(a.current.width+e.clientX-a.current.x))},onPointerUp:e=>{null!==a.current&&s(ec(a.current.width+e.clientX-a.current.x)),a.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerCancel:()=>{a.current=null},onLostPointerCapture:()=>{a.current=null},onClick:e=>e.stopPropagation(),onDoubleClick:e=>{e.stopPropagation(),n()},onKeyDown:e=>{"ArrowLeft"===e.key?(e.preventDefault(),s(ec(t-16))):"ArrowRight"===e.key&&(e.preventDefault(),s(ec(t+16)))},className:"group/handle absolute inset-y-0 right-0 z-10 flex w-2.5 cursor-col-resize touch-none select-none justify-end",children:(0,r.jsx)("span",{"aria-hidden":!0,className:"my-2 w-px bg-border transition-colors group-hover/handle:bg-accent group-focus-visible/handle:bg-accent"})})}function ev({column:e,sort:t,onSort:s,width:n,onResize:a,onReset:i}){let l="right"===e.align,o=e.sortKey,c=void 0!==o?t.key!==o?"none":"asc"===t.dir?"ascending":"descending":"none",d="none"!==c,u=d?"asc"===t.dir?ee:et:Q;return(0,r.jsxs)("th",{scope:"col","aria-sort":void 0!==o?c:void 0,className:l?`${eb} text-right`:eb,children:[void 0!==o?(0,r.jsxs)("button",{type:"button",onClick:()=>s(o),className:["inline-flex min-h-6 max-w-full items-center gap-1 rounded-sm transition-colors hover:text-foreground",l?"w-full justify-end pr-1":"",d?"text-foreground":""].filter(Boolean).join(" "),children:[(0,r.jsx)("span",{className:"truncate",children:e.label}),(0,r.jsx)(u,{className:d?"h-3 w-3 shrink-0":"h-3 w-3 shrink-0 opacity-40","aria-hidden":!0})]}):(0,r.jsx)("span",{className:l?"block truncate pr-1":"block truncate",children:e.label}),(0,r.jsx)(ew,{label:e.label,width:n,onChange:a,onReset:i})]})}function ej({table:e,columns:t,label:s,caption:n,sort:a,onSort:i,children:l}){let[o,c]=(0,er.u)(`processes.widths.${e}`,ei,ep),d=(0,g.useRef)(null),[u,p]=(0,g.useState)(0);(0,g.useEffect)(()=>{let e=d.current;if(!e)return;let t=new ResizeObserver(([e])=>p(e.contentRect.width));return t.observe(e),()=>t.disconnect()},[]);let h=e=>"name"===e.id?160:56,m=t.reduce((e,t)=>e+h(t),0),f=t.reduce((e,t)=>e+ey(t,o),0),x={},b=Math.max(u||f,m),y=[...t];for(;y.length>0;){let e=y.reduce((e,t)=>e+ey(t,o),0),t=y.filter(t=>b*ey(t,o)/e<h(t));if(0===t.length){for(let t of y)x[t.id]=b*ey(t,o)/e;break}for(let e of t)x[e.id]=h(e),b-=h(e);y=y.filter(e=>!t.includes(e))}return(0,r.jsx)("div",{ref:d,className:"relative min-h-0 w-full min-w-0 flex-1 overflow-auto overscroll-contain",tabIndex:0,role:"region","aria-label":s,children:(0,r.jsxs)("table",{className:"table-fixed border-separate border-spacing-0 text-left",style:{width:"100%",minWidth:m},children:[(0,r.jsx)("caption",{className:"sr-only",children:n}),(0,r.jsx)("colgroup",{children:t.map(e=>(0,r.jsx)("col",{style:{width:x[e.id]}},e.id))}),(0,r.jsx)("thead",{className:"sticky top-0 z-20 bg-card",children:(0,r.jsx)("tr",{children:t.map(e=>(0,r.jsx)(ev,{column:e,sort:a,onSort:i,width:x[e.id],onResize:s=>{let r,n,a;return r=t.indexOf(e),n=t[r+1]??t[r-1],a=Math.max(h(e)-x[e.id],Math.min(s-x[e.id],x[n.id]-h(n))),void c({...x,[e.id]:x[e.id]+a,[n.id]:x[n.id]-a})},onReset:()=>c(t=>{let{[e.id]:s,...r}=t;return r})},e.id))})}),(0,r.jsx)("tbody",{children:l})]})})}function ek({value:e,kind:t,partial:s=!1}){let n=function(e,t,s=!1){let r;if(null===e||!Number.isFinite(e)||e<0)return{text:"—",atLeast:!1,title:null};switch(t){case"percent":r=(0,L.l9)(e);break;case"bytes":r=(0,L.z3)(e);break;case"rate":r=`${(0,L.z3)(e)}/s`;break;case"count":r=z(e)}return{text:r,atLeast:s,title:s?`At least ${r}: some processes in this group did not report this metric.`:null}}(e,t,s);return(0,r.jsxs)("td",{className:"—"===n.text?`${ex} text-muted-foreground`:ex,title:n.title??void 0,children:[n.atLeast?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{"aria-hidden":!0,children:"≥ "}),(0,r.jsx)("span",{className:"sr-only",children:"at least "})]}):null,n.text]})}function eM(e){let t=e.name.length>0?e.name:"Unnamed process";return null!==e.unit?`${t} \xb7 ${e.unit}`:t}function eN({row:e,depth:t=0}){return(0,r.jsx)("th",{scope:"row",className:`${eg} text-left text-sm font-medium`,title:eM(e),children:(0,r.jsxs)("span",{style:t>0?{paddingLeft:`${14*t}px`}:void 0,children:[t>0?(0,r.jsx)("span",{className:"sr-only",children:`Nested level ${t+1}. `}):null,e.name.length>0?e.name:(0,r.jsx)("span",{className:"text-muted-foreground",children:"Unnamed process"})]})})}function eA({entries:e,sort:t,onSort:s,mode:n}){return(0,r.jsx)(ej,{table:"processes",columns:ea,label:"tree"===n?"Process tree":"Process list",caption:"tree"===n?"Process tree with nesting depth, PID, user, CPU per core, resident memory, GPU memory, read and write rates, and threads":"Processes with PID, user, CPU per core, resident memory, GPU memory, read and write rates, and threads",sort:t,onSort:s,children:e.map(({row:e,depth:t})=>(0,r.jsxs)("tr",{className:"transition-colors hover:bg-card-strong/60",children:[(0,r.jsx)(eN,{row:e,depth:t}),(0,r.jsx)("td",{className:ex,children:e.pid}),(0,r.jsx)("td",{className:`${eg} text-xs text-muted-foreground`,title:e.user??void 0,children:e.user??"—"}),(0,r.jsx)(ek,{value:e.cpuPercent,kind:"percent"}),(0,r.jsx)(ek,{value:e.memoryRssBytes,kind:"bytes"}),(0,r.jsx)(ek,{value:e.gpuMemoryBytes,kind:"bytes"}),(0,r.jsx)(ek,{value:e.ioReadBytesPerSec,kind:"rate"}),(0,r.jsx)(ek,{value:e.ioWriteBytesPerSec,kind:"rate"}),(0,r.jsx)("td",{className:ex,children:z(e.threads)})]},F(e)))})}function eP({group:e}){return(0,r.jsx)(r.Fragment,{children:e.members.map(e=>(0,r.jsxs)("tr",{className:"bg-card-strong/40 transition-colors hover:bg-card-strong/70",children:[(0,r.jsx)("th",{scope:"row",className:`${eg} text-left text-xs font-normal`,title:`${eM(e)} \xb7 PID ${e.pid}`,children:(0,r.jsxs)("span",{className:"pl-5",children:[e.name.length>0?e.name:"Unnamed process",(0,r.jsx)("span",{className:"tnum ml-2 text-muted-foreground",children:e.pid})]})}),(0,r.jsx)("td",{className:ex}),(0,r.jsx)(ek,{value:e.cpuPercent,kind:"percent"}),(0,r.jsx)(ek,{value:e.memoryRssBytes,kind:"bytes"}),(0,r.jsx)(ek,{value:e.gpuMemoryBytes,kind:"bytes"}),(0,r.jsx)(ek,{value:e.ioReadBytesPerSec,kind:"rate"}),(0,r.jsx)(ek,{value:e.ioWriteBytesPerSec,kind:"rate"}),(0,r.jsx)("td",{className:`${eg} text-xs text-muted-foreground`,title:e.user??void 0,children:e.user??"—"})]},F(e)))})}function eS({groups:e,sort:t,onSort:s,expanded:n,onToggleGroup:a}){return(0,r.jsx)(ej,{table:"applications",columns:en,label:"Applications",caption:"Applications grouped by systemd unit, process tree, or kernel, with process count, aggregate CPU per core, resident memory, GPU memory, read and write rates, and users",sort:t,onSort:s,children:e.map(e=>{var t;let s=n.has(e.key),i=e.label.length>0?e.label:"Unnamed application",l=e.users.length>0?e.users.join(", "):"—";return(0,r.jsxs)(g.Fragment,{children:[(0,r.jsxs)("tr",{className:"transition-colors hover:bg-card-strong/60",children:[(0,r.jsx)("th",{scope:"row",className:`${eg} text-left font-normal`,title:`${i} \xb7 ${"unit"===(t=e.kind)?"systemd unit":"kernel"===t?"kernel":"process tree"}`,children:(0,r.jsxs)("button",{type:"button","aria-expanded":s,onClick:()=>a(e.key),className:"inline-flex min-h-6 max-w-full items-center gap-1.5 rounded-sm text-left",children:[(0,r.jsx)(es.A,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${s?"rotate-90":""}`,"aria-hidden":!0}),(0,r.jsx)("span",{className:"truncate text-sm font-medium",children:i})]})}),(0,r.jsx)("td",{className:ex,children:z(e.count)}),(0,r.jsx)(ek,{value:e.cpuPercent,kind:"percent",partial:e.partial.cpuPercent}),(0,r.jsx)(ek,{value:e.memoryRssBytes,kind:"bytes",partial:e.partial.memoryRssBytes}),(0,r.jsx)(ek,{value:e.gpuMemoryBytes,kind:"bytes",partial:e.partial.gpuMemoryBytes}),(0,r.jsx)(ek,{value:e.ioReadBytesPerSec,kind:"rate",partial:e.partial.ioReadBytesPerSec}),(0,r.jsx)(ek,{value:e.ioWriteBytesPerSec,kind:"rate",partial:e.partial.ioWriteBytesPerSec}),(0,r.jsx)("td",{className:`${eg} text-xs text-muted-foreground`,title:l,children:l})]}),s?(0,r.jsx)(eP,{group:e}):null]},e.key)})})}function e$({mode:e,groups:t,rows:s,tree:n,sort:a,onSort:i,expanded:l,onToggleGroup:o}){if("applications"===e)return(0,r.jsx)(eS,{groups:t,sort:a,onSort:i,expanded:l,onToggleGroup:o});let c="tree"===e?n.map(e=>({row:e.row,depth:e.depth})):s.map(e=>({row:e,depth:0}));return(0,r.jsx)(eA,{entries:c,mode:e,sort:a,onSort:i})}var eR=s(1),eC=s(7499);let eB=[{key:"cpuPercent",label:"cpu"},{key:"memoryRssBytes",label:"memory"},{key:"gpuMemoryBytes",label:"vram"},{key:"ioReadBytesPerSec",label:"read"},{key:"ioWriteBytesPerSec",label:"write"},{key:"threads",label:"threads"}];function eT(e){return new Date(e).toISOString()}function eU(e){return e.displayName?.trim()||e.hostname.trim()||e.machineId}function eW(e){return"applications"===e.mode?e.groups.flatMap(t=>$([...t.members],e.sort.key,e.sort.dir).map(e=>({row:e,application:t.label,applicationKind:t.kind,depth:0}))):"tree"===e.mode?e.tree.map(e=>({row:e.row,application:null,applicationKind:null,depth:e.depth})):e.sortedRows.map(e=>({row:e,application:null,applicationKind:null,depth:0}))}function eD(e){let t=e.now??Date.now(),s=null===e.receivedAtMs?null:Math.max(0,t-e.receivedAtMs),r=null===s?"receipt time unknown":`${Math.round(s/1e3)}s old`;return null===e.receivedAtMs?{label:"unknown",ageMs:null,stale:!0,note:"No browser receipt time is available for this snapshot."}:"paused"===e.phase?{label:"paused",ageMs:s,stale:!1,note:`Paused \xb7 ${r}. Not live.`}:"disconnected"===e.phase?{label:"disconnected",ageMs:s,stale:!0,note:`Collector disconnected \xb7 last snapshot ${r}. Not live.`}:"withheld"===e.phase||"unsupported"===e.phase?{label:"not live",ageMs:s,stale:!0,note:`Process detail is ${e.phase} \xb7 last snapshot ${r}.`}:"failed"===e.phase||"expired"===e.phase||"busy"===e.phase||"cancelled"===e.phase||"error"===e.phase?{label:"not live",ageMs:s,stale:!0,note:`Refresh problem \xb7 last snapshot ${r}. Not live.`}:"acquiring"===e.phase||"loading"===e.phase||"idle"===e.phase?{label:"waiting",ageMs:s,stale:!0,note:`Waiting for a fresh snapshot \xb7 ${r}.`}:K(e.receivedAtMs,t,e.intervalMs)?{label:"stale",ageMs:s,stale:!0,note:`No new snapshot has arrived \xb7 ${r}. Not live.`}:{label:"live",ageMs:s,stale:!1,note:`Live \xb7 updated ${r}.`}}function eI(e){return eB.filter(({key:t})=>null===e[t]).map(({label:e})=>e).join(" ")}function eL(e,t){let s=eD({phase:e.phase,receivedAtMs:e.receivedAtMs,intervalMs:e.intervalMs,now:t}),r=null===e.receivedAtMs?"unknown":eT(e.receivedAtMs),n=e.query.trim();return[`Filtered process snapshot from the loaded view \xb7 ${s.note}`,`Search: ${n.length>0?n:"(none)"} \xb7 view: ${e.mode} \xb7 sort: ${e.sort.key} ${e.sort.dir}`,`Snapshot ${e.snapshot.processes.length} shown of ${e.snapshot.totalProcesses} processes \xb7 ${e.snapshot.inaccessible} unreadable${e.snapshot.truncated?" \xb7 collector kept the highest-CPU rows":""}`,`Captured ${e.capturedAt} \xb7 received ${r}`]}let eq=["name","pid","user","application","application_kind","tree_depth","cpu_percent","memory_rss_bytes","gpu_memory_bytes","io_read_bytes_per_sec","io_write_bytes_per_sec","threads","unavailable_metrics"],eK="inline-flex min-h-7 items-center rounded-md border border-border bg-background px-2 text-xs text-foreground transition-colors hover:bg-card-strong disabled:cursor-not-allowed disabled:opacity-50";function e_(e){let[t,s]=(0,g.useState)(null),n=null!==e.snapshot&&null!==e.capturedAt,a=n?"applications"===e.mode?e.filteredRows.length:"tree"===e.mode?e.tree.length:e.sortedRows.length:0,i=!n||0===a,l=t=>{if(null===e.snapshot||null===e.capturedAt)return;let r=Date.now(),n={...e,snapshot:e.snapshot,capturedAt:e.capturedAt,exportedAt:r};try{let e,i,l,o=function(e,t,s=Date.now()){let r=Date.parse(e.capturedAt);return(0,eC.Y8)("processes",eU(e.machine),Number.isFinite(r)?r:s,t)}(n,t,r),c="csv"===t?function(e){let t,s,r=e.exportedAt??Date.now(),n=(t=eW(e),s=eD({phase:e.phase,receivedAtMs:e.receivedAtMs,intervalMs:e.intervalMs,now:r}),[["Rigscope process snapshot"],["Scope",eL(e,r)[0]],["Machine",eU(e.machine)],["Machine ID",e.machine.machineId],["Snapshot captured",e.capturedAt],["Snapshot received",null===e.receivedAtMs?"unknown":eT(e.receivedAtMs)],["Freshness",`${s.label}${null===s.ageMs?"":` \xb7 ${Math.round(s.ageMs/1e3)}s old`}`],["Search",e.query.trim()||"(none)"],["View",e.mode],["Sort",`${e.sort.key} ${e.sort.dir}`],["Snapshot rows",`${e.snapshot.processes.length} shown of ${e.snapshot.totalProcesses}`],["Unreadable",String(e.snapshot.inaccessible)],["Collector truncated",e.snapshot.truncated?"true":"false"],["Exported rows",String(t.length)],["Note",eL(e,r).slice(1).join(" ")],[]]);for(let t of(n.push([...eq]),eW(e)))n.push(function(e){let{row:t}=e;return[t.name,t.pid,t.user,e.application,e.applicationKind,e.depth,t.cpuPercent,t.memoryRssBytes,t.gpuMemoryBytes,t.ioReadBytesPerSec,t.ioWriteBytesPerSec,t.threads,eI(t)]}(t));return(0,eR.kg)(n)}(n):(e=n.exportedAt??Date.now(),i=eD({phase:n.phase,receivedAtMs:n.receivedAtMs,intervalMs:n.intervalMs,now:e}),l={app:"Rigscope",kind:"processes",exportedAt:eT(e),scope:{description:"Filtered process snapshot from the loaded view",machine:{id:n.machine.machineId,name:eU(n.machine),hostname:n.machine.hostname,connected:n.machine.connected},query:n.query.trim(),view:n.mode,sort:n.sort},snapshot:{capturedAt:n.capturedAt,receivedAt:null===n.receivedAtMs?null:eT(n.receivedAtMs),ageMs:i.ageMs,freshness:i.label,live:!i.stale&&"live"===i.label,note:i.note,totalProcesses:n.snapshot.totalProcesses,shownProcesses:n.snapshot.processes.length,inaccessible:n.snapshot.inaccessible,truncated:n.snapshot.truncated},exportedRows:eW(n).length,notes:eL(n,e),processes:eW(n).map(e=>({name:e.row.name,pid:e.row.pid,user:e.row.user,application:e.application,applicationKind:e.applicationKind,treeDepth:e.depth,cpuPercent:e.row.cpuPercent,memoryRssBytes:e.row.memoryRssBytes,gpuMemoryBytes:e.row.gpuMemoryBytes,ioReadBytesPerSec:e.row.ioReadBytesPerSec,ioWriteBytesPerSec:e.row.ioWriteBytesPerSec,threads:e.row.threads,unavailableMetrics:eI(e.row).split(" ").filter(Boolean)}))},`${JSON.stringify(l,null,2)}
|
|
3
|
-
`);(0,eR.PE)(o,c,"csv"===t?eR.UR:eR.uW),s(`${t.toUpperCase()} downloaded \xb7 ${a} ${1===a?"process":"processes"}`)}catch{s("The process export could not be created.")}},o=n?0===a?"No processes match the current search":void 0:"A process snapshot is not available yet";return(0,r.jsxs)("div",{className:"flex min-w-0 shrink-0 items-center gap-1.5",children:[(0,r.jsx)("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:"Export"}),(0,r.jsx)("button",{type:"button",onClick:()=>l("csv"),disabled:i,"aria-label":"Download current process snapshot as CSV",title:o??"Download the filtered process snapshot as CSV",className:eK,children:"CSV"}),(0,r.jsx)("button",{type:"button",onClick:()=>l("json"),disabled:i,"aria-label":"Download current process snapshot as JSON",title:o??"Download the filtered process snapshot as JSON",className:eK,children:"JSON"}),(0,r.jsxs)("span",{role:"status",className:t?.includes("could not")?"inline-flex items-center gap-1 text-xs text-warn":"sr-only",children:[t?.includes("could not")?(0,r.jsx)(v.A,{className:"h-3 w-3","aria-hidden":!0}):null,t??""]})]})}let eF={ok:"bg-ok-soft text-ok",warn:"bg-warn-soft text-warn",crit:"bg-crit-soft text-crit",muted:"border border-border text-muted-foreground"};function eE({phase:e,message:t}){return(0,r.jsxs)("span",{title:t??e.description,className:`inline-flex h-6 w-32 shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs ${eF[e.tone]}`,children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-current","aria-hidden":!0}),e.label]})}function ez({onClick:e,label:t="Check again"}){return(0,r.jsxs)("button",{type:"button",onClick:e,className:"inline-flex min-h-5 items-center gap-1.5 rounded-md border border-border bg-card px-2 py-1 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,r.jsx)(x.A,{className:"h-3 w-3","aria-hidden":!0}),t]})}function eO({phase:e,info:t,message:s,onRetry:n}){let a="withheld"===e||"unsupported"===e?b.A:"disconnected"===e||"error"===e?y.A:"paused"===e?w.A:"acquiring"===e||"loading"===e?i.A:"busy"===e||"expired"===e||"failed"===e||"stale"===e?v.A:j.A;return(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 break-words",children:[(0,r.jsx)(d.p,{icon:a,note:s??t.description,className:"min-h-64 w-full"}),"paused"!==e&&t.retryable?(0,r.jsx)(ez,{onClick:n,label:"Retry process detail"}):null]})}function eV({summary:e,lastReceivedMs:t,intervalMs:s,message:n,phase:a,hasSnapshot:i}){let l=(0,Z.c)(1e3),o="ready"===a&&K(t,l,s),c=o?"stale":a,d="paused"===c,u=O(c),p=null===t?null:(0,L.nV)(Math.max(0,l-t)),h=null===p?null:"ready"===c?`Updated ${p}`:`Last snapshot ${p}`,m=d?i?"Paused. This snapshot is not live.":"Paused. Use Resume to request a fresh snapshot.":`${u.label}${o?". No new snapshot has arrived.":""}${n?`. ${n}`:""}`;return d&&!i?(0,r.jsx)("p",{role:"status",className:"sr-only",children:m}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{role:"status",className:"sr-only",children:m}),(0,r.jsxs)("div",{className:"flex min-h-6 flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[d?(0,r.jsx)("span",{children:"Paused — not live"}):(0,r.jsx)(eE,{phase:u,message:n}),i&&null!==h?(0,r.jsx)("span",{className:"tnum",children:h}):null,i&&e.truncated?(0,r.jsxs)("span",{className:"tnum",title:"The collector kept the highest-CPU rows",children:["top ",z(e.shown)," of ",z(e.total)]}):null,i&&e.inaccessible>0?(0,r.jsxs)("span",{className:"tnum text-warn",children:[z(e.inaccessible)," unreadable"]}):null]})]})}function eZ({machine:e,csrfToken:t,paused:s,onPausedChange:n}){var a;let[i,l]=(0,er.u)("processes.query","",eh,"session"),o=(0,g.useDeferredValue)(i),[c,u]=(0,er.u)("processes.mode","applications",ed),[p,h]=(a="applications"===c?"applications":"processes",(0,er.u)(`processes.sort.${a}`,q,eu)),[m,f]=(0,er.u)("processes.expanded",el,ef,"session"),x=(0,g.useMemo)(()=>new Set(m),[m]),{state:b,refresh:y}=function(e){let{machineId:t,csrfToken:s,paused:r}=e,[n,a]=(0,g.useState)(()=>"u">typeof document&&document.hidden),[i,l]=(0,g.useState)(0),[o,c]=(0,g.useState)(()=>X(t,s)),d=(0,g.useRef)(o),u=(0,g.useRef)({machineId:t,csrfToken:s}),p=(0,g.useRef)(0),h=(0,g.useCallback)(()=>{p.current+=1,l(p.current)},[]);return(0,g.useEffect)(()=>{if("u"<typeof document)return;let e=()=>a(document.hidden);return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,g.useEffect)(()=>{let e;if(u.current.machineId!==t||u.current.csrfToken!==s){u.current={machineId:t,csrfToken:s};let e=X(t,s);d.current=e,c(e)}if(!(null!==t&&null!==s&&!r&&!n)){if(t&&s){let e={...d.current,phase:"paused",message:n?"This tab is hidden — process updates are stopped until it is visible again.":"Paused — process updates are stopped until you resume."};d.current=e,c(e)}else{let e=X(t,s);d.current=e,c(e)}return}let a=!1,i=new AbortController,l=(e=globalThis.crypto)&&"function"==typeof e.randomUUID?e.randomUUID():`viewer-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,o=`/api/processes?machineId=${encodeURIComponent(t)}&viewerId=${encodeURIComponent(l)}`,p=d.current.intervalMs||1e3,h=d.current.leaseMs||15e3,m=null!==d.current.detail,f=!1,g=!1,x=!1,b=null,y=null,w=null,v=e=>{if(a)return;let r=d.current,n="function"==typeof e?e(r):e,i={...r,...n};d.current=i,null!==i.detail&&null!==i.lastReceivedMs&&Y.set(t,s,{detail:i.detail,intervalMs:i.intervalMs,leaseMs:i.leaseMs,lastReceivedMs:i.lastReceivedMs}),c(i)},j=()=>{null!==b&&(clearTimeout(b),b=null),null!==y&&(clearTimeout(y),y=null),w?.abort(),w=null},k=()=>{try{fetch(o,{method:"DELETE",cache:"no-store",keepalive:!0,headers:{"X-CSRF-Token":s,Accept:"application/json"}}).catch(()=>void 0)}catch{}},M=()=>{g=!1,null!==b&&(clearTimeout(b),b=null)},N=(e,r)=>{x=!0,j(),m=!1,Y.delete(t,s),v({phase:e,detail:null,message:r,lastReceivedMs:null}),k()},A=e=>{let t="u">typeof navigator&&!1===navigator.onLine;v({phase:m?t?"disconnected":"stale":"error",message:e})},P=async()=>{try{let e=await fetch(o,{method:"POST",cache:"no-store",signal:i.signal,headers:{"X-CSRF-Token":s,Accept:"application/json"}});if(a||i.signal.aborted)return!1;if(!e.ok){M();let t=await J(e);return 401===e.status?N("error","Your session ended. Sign in again to inspect processes."):403===e.status?N("withheld",t??"Processes are not available to this hub."):409===e.status?N("unsupported",t??"This collector requires an upgrade before Processes is available."):(429===e.status||503===e.status)&&/budget/i.test(t??"")?v({phase:"busy",message:t??"Too many process views are open for this hub."}):A(t??`Could not request process detail (HTTP ${e.status}).`),!1}g=!0;let t=null;try{t=await e.json()}catch{t=null}let r=function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return null;let t=e.leaseMs,s=e.intervalMs;return V(t)&&V(s)?{leaseMs:Math.round(t),intervalMs:Math.round(s)}:null}(t);if(null===r)return M(),k(),A("The hub returned an unexpected response."),!1;if(a||i.signal.aborted)return!1;return p=r.intervalMs,h=r.leaseMs,v(e=>({intervalMs:r.intervalMs,leaseMs:r.leaseMs,phase:null===e.detail?"loading":e.phase,message:null})),!0}catch(e){if(a||i.signal.aborted)return!1;return M(),A(m?"Could not refresh process detail. Showing the last snapshot, which is not live.":"Could not reach the hub for process detail."),!1}},S=()=>{a||x||null!==y||(y=setTimeout(()=>{y=null,$()},Math.max(1e3,Math.min(5e3,Math.floor(h/3)))))},$=async()=>{a||x||(await P(),a||x||(g&&!f&&null===b&&R(),S()))},R=async()=>{if(a||x||f)return;f=!0;let e=new AbortController;w=e;let t=()=>e.abort();i.signal.addEventListener("abort",t,{once:!0});try{let t=await fetch(o,{cache:"no-store",signal:e.signal,headers:{Accept:"application/json"}});if(a||e.signal.aborted)return;if(410===t.status){v({phase:m?"stale":"loading",message:"Process detail expired. Renewing…"}),await P();return}if(!t.ok){let e=await J(t);401===t.status?N("error","Your session ended. Sign in again to inspect processes."):403===t.status?N("withheld",e??"Processes are not available to this machine."):A(e??`Could not refresh processes (HTTP ${t.status}).`);return}let s=null;try{s=await t.json()}catch{s=null}let r=function(e){if(null===e||"object"!=typeof e||Array.isArray(e))return null;let t=e.state;if("string"!=typeof t||0===t.length)return null;let s=e.result;if(null==s)return{state:t,result:null};try{let e=(0,I.Q_)(s);if("detail.result"!==e.type)return null;return{state:t,result:e}}catch{return null}}(s);if(a||e.signal.aborted)return;if(null===r)return void A(m?"Unable to read the process update. Showing the last snapshot.":"Unable to read the process update from the hub.");((e,t)=>{if(null!==t){m=!0;let e=d.current;if(null!==e.detail&&e.detail.subscriptionId===t.subscriptionId&&e.detail.capturedAt===t.capturedAt&&"ready"===e.phase&&null===e.message)return;v(e=>{let s=null!==e.detail&&e.detail.subscriptionId===t.subscriptionId&&e.detail.capturedAt===t.capturedAt;return{phase:"ready",detail:s?e.detail:t,message:null,lastReceivedMs:s?e.lastReceivedMs:Date.now()}});return}let s=function(e){switch(e){case"ready":return"ready";case"loading":return"loading";case"paused":return"paused";case"disconnected":return"disconnected";case"withheld":return"withheld";case"unsupported":return"unsupported";case"busy":return"busy";case"expired":return"expired";case"failed":return"failed";case"cancelled":return"cancelled";default:return"error"}}(e);switch(s){case"ready":case"loading":return v({phase:m?"stale":"loading",message:m?"Waiting for a fresh snapshot. The values shown are from the last received snapshot.":"Waiting for the collector to report processes…"});case"disconnected":return v({phase:"disconnected",message:m?"The collector is disconnected. Showing the last received snapshot; it is not live.":"The collector is disconnected."});case"withheld":case"unsupported":case"cancelled":return N(s,O(s).description);case"busy":case"expired":case"failed":return v({phase:s,message:m?`${O(s).description} Showing the last received snapshot.`:O(s).description});case"paused":return v({phase:"paused",message:"Process updates are paused."});default:v({phase:m?"stale":"error",message:"Unable to read the process status from the hub."})}})(r.state,r.result)}catch{if(a||e.signal.aborted)return;A(m?"Process refresh failed. Showing the last snapshot, which is not live.":"Could not reach the hub for process detail.")}finally{i.signal.removeEventListener("abort",t),w===e&&(w=null),f=!1,a||x||a||x||!g||null!==b||(b=setTimeout(()=>{b=null,R()},p))}};return v(e=>null===e.detail?{phase:"acquiring",message:null}:"ready"===e.phase&&null===e.message?{}:{phase:"stale",message:"Resuming process updates…"}),(async()=>{let e=await P();a||x||(S(),e&&R())})(),()=>{a=!0,x=!0,j(),k()}},[t,s,r,n,i]),{state:u.current.machineId===t&&u.current.csrfToken===s?o:X(t,s),hidden:n,refresh:h}}({machineId:e.machineId,csrfToken:t,paused:s}),v=(0,g.useMemo)(()=>b.detail?.snapshot.processes??[],[b.detail]),j=(0,g.useMemo)(()=>(function(e){if(null===e)return{total:0,shown:0,inaccessible:0,truncated:!1};let t=e.processes.length;return{total:e.totalProcesses,shown:t,inaccessible:e.inaccessible,truncated:e.truncated}})(b.detail?.snapshot??null),[b.detail]),W=(0,g.useMemo)(()=>{var e,t,s;let r;return e=v,t=o,s=e.map(E),0===(r=t.trim().toLowerCase()).length?s.slice():s.filter(e=>!!(e.name.toLowerCase().includes(r)||null!==e.user&&e.user.toLowerCase().includes(r)||String(e.pid).includes(r)||null!==e.unit&&e.unit.toLowerCase().includes(r)||void 0!==e.command&&e.command.toLowerCase().includes(r)))},[v,o]),L=(0,g.useMemo)(()=>$(W,p.key,p.dir),[W,p]),K=(0,g.useMemo)(()=>{var e,t,s;return"applications"===c?(e=function(e){let t=new Map;for(let s of e)t.has(s.pid)||t.set(s.pid,s);let s=new Map;for(let r of e){let e=function(e,t){if(function(e,t){if(2===e.pid||2===e.ppid)return!0;let s=e,r=new Set;for(;s&&!r.has(s.pid);){if(2===s.pid)return!0;r.add(s.pid),s=t.get(s.ppid)}return!1}(e,t))return{key:"kernel",label:"kernel",kind:"kernel",leader:e};let s=C(e.unit);if(null!==s)return{key:`unit:${s}`,label:B(s),kind:"unit",leader:e};let r=e,n=new Set;for(;;){if(n.has(r.pid)){let e=r;for(let s of n){let r=t.get(s);r&&(r.pid<e.pid||r.pid===e.pid&&r.startTicks<e.startTicks)&&(e=r)}return T(e)}n.add(r.pid);let e=t.get(r.ppid);if(!e||function(e,t){if(1===e.pid)return!0;let s=e.name.toLowerCase();if(A.has(s)||P.has(s)||s.startsWith("tmux:"))return!0;if(R(e.unit)){let s=t.get(e.ppid);return void 0===s||s.unit!==e.unit}return!1}(e,t))return T(r);let s=C(e.unit);if(null!==s)return{key:`unit:${s}`,label:B(s),kind:"unit",leader:e};r=e}}(r,t),n=s.get(e.key);n?n.members.push(r):s.set(e.key,{descriptor:e,members:[r]})}return[...s.values()].map(({descriptor:e,members:t})=>(function(e,t){let s={cpuPercent:{sum:0,known:0},memoryRssBytes:{sum:0,known:0},gpuMemoryBytes:{sum:0,known:0},ioReadBytesPerSec:{sum:0,known:0},ioWriteBytesPerSec:{sum:0,known:0}},r=new Set;for(let e of t)for(let t of(null!==e.user&&r.add(e.user),S)){let r=e[t];null!==r&&Number.isFinite(r)&&(s[t].sum+=r,s[t].known++)}let n=e=>0===s[e].known?null:s[e].sum,a={};for(let e of S)a[e]=s[e].known>0&&s[e].known<t.length;return{key:e.key,label:e.label,kind:e.kind,members:e.leader!==t[0]?[e.leader,...t.filter(t=>t!==e.leader)]:t,cpuPercent:n("cpuPercent"),memoryRssBytes:n("memoryRssBytes"),gpuMemoryBytes:n("gpuMemoryBytes"),ioReadBytesPerSec:n("ioReadBytesPerSec"),ioWriteBytesPerSec:n("ioWriteBytesPerSec"),count:t.length,users:[...r].sort(),partial:a}})(e,t))}(W),t=p.key,s=p.dir,e.slice().sort((e,r)=>D(U(e,t),U(r,t),s))):[]},[W,c,p]),F=(0,g.useMemo)(()=>"tree"===c?function(e){let t=e.length,s=new Map;for(let r=0;r<t;r++)s.has(e[r].pid)||s.set(e[r].pid,r);let r=e.map(e=>{let t=s.get(e.ppid);return void 0===t?null:t}),n=new Uint8Array(t);for(let e=0;e<t;e++){if(0!==n[e])continue;let t=[],s=e;for(;null!==s&&0===n[s];)n[s]=1,t.push(s),s=r[s];for(let e of(null!==s&&1===n[s]&&(r[t[t.length-1]]=null),t))n[e]=2}let a=Array.from({length:t},()=>[]),i=[];for(let e=0;e<t;e++){let t=r[e];null===t?i.push(e):a[t].push(e)}let l=[],o=[];for(let e=i.length-1;e>=0;e--)o.push({index:i[e],depth:0});for(;o.length>0;){let{index:t,depth:s}=o.pop();l.push({row:e[t],depth:s,children:a[t].length});let r=a[t];for(let e=r.length-1;e>=0;e--)o.push({index:r[e],depth:s+1})}return l}(L):[],[c,L]),z=O(b.phase),Z=null!==b.detail,G=!Z&&("acquiring"===b.phase||"loading"===b.phase),H=o.trim().slice(0,80),Q=(0,g.useMemo)(()=>{let e=W.length,t=o.trim().length>0,s=1!==e||t?"processes":"process";return"applications"===c?`${K.length} app${1===K.length?"":"s"} \xb7 ${e}${t?` of ${j.shown}`:""} ${s}`:`${e}${t?` of ${j.shown}`:""} ${s}`},[o,W.length,K.length,c,j.shown]);return(0,r.jsx)(d.Z,{title:"Process detail",action:Z?(0,r.jsx)("span",{className:"tnum hidden max-w-[18rem] truncate text-muted-foreground sm:block",children:Q}):void 0,className:"min-h-0 flex-1",children:(0,r.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative min-w-0 flex-1 basis-52",children:[(0,r.jsx)("label",{htmlFor:"process-search",className:"sr-only",children:"Search processes"}),(0,r.jsx)(k.A,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground","aria-hidden":!0}),(0,r.jsx)("input",{id:"process-search",type:"search",value:i,onChange:e=>l(e.target.value),placeholder:"Search name, user, PID, or unit",autoComplete:"off",spellCheck:!1,className:"h-9 w-full rounded-md border border-border bg-card-strong py-1.5 pl-8 pr-8 text-sm text-foreground placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:[-webkit-appearance:none]"}),i.length>0?(0,r.jsx)("button",{type:"button",onClick:()=>l(""),"aria-label":"Clear search",className:"absolute right-0.5 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-card hover:text-foreground",children:(0,r.jsx)(M.A,{className:"h-3.5 w-3.5","aria-hidden":!0})}):null]}),(0,r.jsx)("div",{role:"group","aria-label":"Process view",className:"inline-flex shrink-0 rounded-md border border-border p-0.5",children:_.map(e=>{let t=c===e.value;return(0,r.jsx)("button",{type:"button","aria-pressed":t,onClick:()=>u(e.value),className:["rounded px-2.5 py-1 text-xs transition-colors",t?"bg-selected font-medium text-foreground":"text-muted-foreground hover:bg-card-strong hover:text-foreground"].join(" "),children:e.label},e.value)})}),(0,r.jsxs)("button",{type:"button",onClick:()=>n(!s),title:s?"Resume process updates":"Pause process updates",className:"inline-flex min-h-9 shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:[s?(0,r.jsx)(N.A,{className:"h-3.5 w-3.5","aria-hidden":!0}):(0,r.jsx)(w.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),s?"Resume":"Pause"]}),(0,r.jsx)(e_,{machine:e,snapshot:b.detail?.snapshot??null,capturedAt:b.detail?.capturedAt??null,receivedAtMs:b.lastReceivedMs,intervalMs:b.intervalMs,phase:b.phase,query:o,mode:c,sort:p,filteredRows:W,sortedRows:L,groups:K,tree:F})]}),(0,r.jsx)(eV,{summary:j,lastReceivedMs:b.lastReceivedMs,intervalMs:b.intervalMs,message:b.message,phase:b.phase,hasSnapshot:Z}),(0,r.jsx)("div",{"aria-busy":G||"acquiring"===b.phase,className:"flex min-h-0 flex-1 flex-col overflow-auto",children:Z?0===W.length?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 break-words",children:[(0,r.jsx)(d.p,{icon:k.A,note:0===j.shown?"The collector reported no processes in this snapshot.":o.trim().length>0?`No processes match “${H}”.`:"No processes to show.",className:"min-h-64 w-full"}),o.trim().length>0?(0,r.jsxs)("button",{type:"button",onClick:()=>l(""),className:"inline-flex min-h-6 items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,r.jsx)(M.A,{className:"h-3 w-3","aria-hidden":!0}),"Clear search"]}):null]}):(0,r.jsx)(e$,{mode:c,groups:K,rows:L,tree:F,sort:p,onSort:e=>h(t=>(function(e,t){return e.key===t?{key:t,dir:"asc"===e.dir?"desc":"asc"}:{key:t,dir:"name"===t||"user"===t||"pid"===t?"asc":"desc"}})(t,e)),expanded:x,onToggleGroup:e=>{f(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}):(0,r.jsx)(eO,{phase:b.phase,info:z,message:b.message,onRetry:y})})]})})}function eG({waiting:e}){return(0,r.jsx)(d.Z,{title:e?"Waiting for machines":"No machines",className:"mt-2",children:(0,r.jsx)(d.p,{icon:e?i.A:l.A,note:e?"Waiting for the fleet snapshot…":"No machines are available in your authorized fleet."})})}function eY({requested:e}){return(0,r.jsxs)(d.Z,{title:"Machine not found",className:"mt-2",children:[(0,r.jsx)(d.p,{icon:o.A,note:"This machine is unavailable or outside your access."}),(0,r.jsxs)("p",{className:"tnum mt-2 break-all text-center text-xs text-muted-foreground",children:["Requested identifier: ",e]}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(a(),{href:"/",className:"mt-2 inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:"Back to fleet"})})]})}function eX(){let{session:e,phase:t,machines:s}=(0,m.M)(),n=(0,h.x)(),[a,i]=(0,er.u)("processes.paused",!1,em,"session"),{machine:l,navMachineId:o,requestedMachineId:d}=(0,f.JG)("processes"),g="signed-in"===e.kind?e.user.csrfToken:null,x=0===s.length&&("connecting"===t||"idle"===t);return(0,r.jsx)(c.G,{title:"Processes",machineId:o,machineView:"processes",workspace:!0,headerRight:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.$E,{}),(0,r.jsx)(p.B,{})]}),children:n||(0,r.jsx)(r.Fragment,{children:0===s.length?(0,r.jsx)(eG,{waiting:x}):l?(0,r.jsx)(eZ,{machine:l,csrfToken:g,paused:a,onPausedChange:i},`${l.machineId}:${g}`):(0,r.jsx)(eY,{requested:d??""})})})}},7499:(e,t,s)=>{"use strict";function r(e,t,s,r){return`rigscope-${e}-${function(e,t="machine"){let s=e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"");return s.length>0?s:t}(t)}-${!Number.isFinite(s)?"unknown-time":new Date(s).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"Z")}.${r}`}s.d(t,{Y8:()=>r})},8528:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},9031:(e,t,s)=>{Promise.resolve().then(s.bind(s,1721)),Promise.resolve().then(s.bind(s,7339)),Promise.resolve().then(s.bind(s,2701)),Promise.resolve().then(s.bind(s,2394))},9664:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},9926:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]])},9942:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(8698).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])}},e=>{e.O(0,[157,939,103,441,794,358],()=>e(e.s=9031)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-outline-style:solid}}}@layer theme{:host,:root{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground)}}@layer base{*,::backdrop,:after,:before{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden}.absolute,.sr-only{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.right-0{right:0}.right-0\.5{right:calc(var(--spacing) * .5)}.right-2{right:calc(var(--spacing) * 2)}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.order-first{order:-9999}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-1{margin:var(--spacing)}.m-2{margin:calc(var(--spacing) * 2)}.m-3{margin:calc(var(--spacing) * 3)}.m-74{margin:calc(var(--spacing) * 74)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-12{margin-block:calc(var(--spacing) * 12)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:var(--spacing)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-14{height:calc(var(--spacing) * 14)}.h-40{height:calc(var(--spacing) * 40)}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[min\(30dvh\,20rem\)\]{max-height:min(30dvh,20rem)}.min-h-0{min-height:0}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-7{min-height:calc(var(--spacing) * 7)}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-14{min-height:calc(var(--spacing) * 14)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-48{min-height:calc(var(--spacing) * 48)}.min-h-64{min-height:calc(var(--spacing) * 64)}.min-h-dvh{min-height:100dvh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-32{width:calc(var(--spacing) * 32)}.w-40{width:calc(var(--spacing) * 40)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-32{max-width:calc(var(--spacing) * 32)}.max-w-48{max-width:calc(var(--spacing) * 48)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-\[12rem\]{max-width:12rem}.max-w-\[16rem\]{max-width:16rem}.max-w-\[18rem\]{max-width:18rem}.max-w-\[1500px\]{max-width:1500px}.max-w-\[calc\(100\%-1rem\)\]{max-width:calc(100% - 1rem)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-52{flex-basis:calc(var(--spacing) * 52)}.table-fixed{table-layout:fixed}.border-separate{border-collapse:separate}.border-spacing-0{--tw-border-spacing-x:0px;--tw-border-spacing-y:0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-crosshair{cursor:crosshair}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.scroll-mt-6{scroll-margin-top:calc(var(--spacing) * 6)}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[3rem_minmax\(0\,1fr\)_4\.5rem\]{grid-template-columns:3rem minmax(0,1fr) 4.5rem}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[repeat\(auto-fit\,minmax\(3\.5rem\,1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(3.5rem,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}.gap-y-5{row-gap:calc(var(--spacing) * 5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border>:not(:last-child)){border-color:var(--border)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e+38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-\[5px\]{border-style:var(--tw-border-style);border-width:5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/40{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/40{border-color:color-mix(in oklab,var(--accent) 40%,transparent)}}.border-accent\/60{border-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.border-accent\/60{border-color:color-mix(in oklab,var(--accent) 60%,transparent)}}.border-border,.border-border\/40{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/40{border-color:color-mix(in oklab,var(--border) 40%,transparent)}}.border-crit{border-color:var(--crit)}.border-current{border-color:currentColor}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-card-strong,.bg-card-strong\/25{background-color:var(--card-strong)}@supports (color:color-mix(in lab,red,red)){.bg-card-strong\/25{background-color:color-mix(in oklab,var(--card-strong) 25%,transparent)}}.bg-card-strong\/30{background-color:var(--card-strong)}@supports (color:color-mix(in lab,red,red)){.bg-card-strong\/30{background-color:color-mix(in oklab,var(--card-strong) 30%,transparent)}}.bg-card-strong\/40{background-color:var(--card-strong)}@supports (color:color-mix(in lab,red,red)){.bg-card-strong\/40{background-color:color-mix(in oklab,var(--card-strong) 40%,transparent)}}.bg-cpu{background-color:var(--cpu)}.bg-crit{background-color:var(--crit)}.bg-crit-soft{background-color:var(--crit-soft)}.bg-current{background-color:currentColor}.bg-mem{background-color:var(--mem)}.bg-muted-foreground,.bg-muted-foreground\/50{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/50{background-color:color-mix(in oklab,var(--muted-foreground) 50%,transparent)}}.bg-ok{background-color:var(--ok)}.bg-ok-soft{background-color:var(--ok-soft)}.bg-selected{background-color:var(--selected)}.bg-warn{background-color:var(--warn)}.bg-warn-soft{background-color:var(--warn-soft)}.fill-foreground{fill:var(--foreground)}.fill-muted-foreground{fill:var(--muted-foreground)}.fill-warn{fill:var(--warn)}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-1{padding-right:var(--spacing)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--accent)}.text-accent-foreground{color:var(--accent-foreground)}.text-crit{color:var(--crit)}.text-foreground,.text-foreground\/80{color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.text-foreground\/80{color:color-mix(in oklab,var(--foreground) 80%,transparent)}}.text-muted-foreground{color:var(--muted-foreground)}.text-ok{color:var(--ok)}.text-warn{color:var(--warn)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.accent-foreground{accent-color:var(--foreground)}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline-offset-\[-2px\]{outline-offset:-2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\/handle\:bg-accent:is(:where(.group\/handle):hover *){background-color:var(--accent)}}.group-focus-visible\/handle\:bg-accent:is(:where(.group\/handle):focus-visible *){background-color:var(--accent)}.peer-focus-visible\:outline:is(:where(.peer):focus-visible~*){outline-style:var(--tw-outline-style);outline-width:1px}.peer-focus-visible\:outline-2:is(:where(.peer):focus-visible~*){outline-style:var(--tw-outline-style);outline-width:2px}.peer-focus-visible\:outline-offset-2:is(:where(.peer):focus-visible~*){outline-offset:2px}.peer-focus-visible\:\[outline-color\:var\(--focus\)\]:is(:where(.peer):focus-visible~*){outline-color:var(--focus)}.peer-focus-visible\:outline-accent:is(:where(.peer):focus-visible~*){outline-color:var(--accent)}.placeholder\:text-muted-foreground::placeholder,.placeholder\:text-muted-foreground\/70::placeholder{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-muted-foreground\/70::placeholder{color:color-mix(in oklab,var(--muted-foreground) 70%,transparent)}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:border-muted-foreground\/40:hover{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.hover\:border-muted-foreground\/40:hover{border-color:color-mix(in oklab,var(--muted-foreground) 40%,transparent)}}.hover\:bg-accent\/90:hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/90:hover{background-color:color-mix(in oklab,var(--accent) 90%,transparent)}}.hover\:bg-card:hover{background-color:var(--card)}.hover\:bg-card-strong:hover,.hover\:bg-card-strong\/60:hover{background-color:var(--card-strong)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card-strong\/60:hover{background-color:color-mix(in oklab,var(--card-strong) 60%,transparent)}}.hover\:bg-card-strong\/70:hover{background-color:var(--card-strong)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card-strong\/70:hover{background-color:color-mix(in oklab,var(--card-strong) 70%,transparent)}}.hover\:bg-crit-soft:hover{background-color:var(--crit-soft)}.hover\:bg-selected:hover{background-color:var(--selected)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:start-2:focus{inset-inline-start:calc(var(--spacing) * 2)}.focus\:top-2:focus{top:calc(var(--spacing) * 2)}.focus\:outline-2:focus{outline-style:var(--tw-outline-style);outline-width:2px}.focus\:outline-accent:focus{outline-color:var(--accent)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-accent:focus-visible{outline-color:var(--accent)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.aria-\[invalid\=true\]\:border-crit[aria-invalid=true]{border-color:var(--crit)}@media not all and (min-width:48rem){.max-md\:absolute{position:absolute}.max-md\:-right-1{right:calc(var(--spacing) * -1)}.max-md\:-bottom-0\.5{bottom:calc(var(--spacing) * -.5)}.max-md\:justify-center{justify-content:center}.max-md\:px-0{padding-inline:0}}@media (min-width:40rem){.sm\:order-none{order:0}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:ml-auto{margin-left:auto}.sm\:block{display:block}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[3\.5rem_minmax\(0\,1fr\)_4\.5rem_3rem\]{grid-template-columns:3.5rem minmax(0,1fr) 4.5rem 3rem}.sm\:flex-row{flex-direction:row}.sm\:items-end{align-items:flex-end}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:block{display:block}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-4{width:calc(var(--spacing) * 4)}.md\:w-56{width:calc(var(--spacing) * 56)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:p-3{padding:calc(var(--spacing) * 3)}.md\:p-5{padding:calc(var(--spacing) * 5)}.md\:p-6{padding:calc(var(--spacing) * 6)}.md\:px-3{padding-inline:calc(var(--spacing) * 3)}.md\:px-5{padding-inline:calc(var(--spacing) * 5)}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}}@media (min-width:64rem){.lg\:col-span-full{grid-column:1/-1}.lg\:inline{display:inline}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,13rem\)_minmax\(0\,1fr\)\]{grid-template-columns:minmax(0,13rem) minmax(0,1fr)}.lg\:items-start{align-items:flex-start}.lg\:border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.lg\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.lg\:pt-0{padding-top:0}.lg\:pl-6{padding-left:calc(var(--spacing) * 6)}}@media (min-width:80rem){.xl\:col-span-2{grid-column:span 2/span 2}.xl\:col-span-3{grid-column:span 3/span 3}.xl\:col-span-5{grid-column:span 5/span 5}.xl\:col-span-7{grid-column:span 7/span 7}.xl\:col-span-12{grid-column:span 12/span 12}.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1fr\)_24rem\]{grid-template-columns:minmax(0,1fr) 24rem}.xl\:grid-cols-\[repeat\(auto-fit\,minmax\(30rem\,1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(30rem,1fr))}}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.\[\&\:\:-webkit-search-cancel-button\]\:hidden::-webkit-search-cancel-button{display:none}.\[\&\:\:-webkit-search-cancel-button\]\:\[-webkit-appearance\:none\]::-webkit-search-cancel-button{-webkit-appearance:none}}:root{color-scheme:light;--background:#f4f5f7;--card:#fff;--card-strong:#f9fafb;--border:#e2e4e9;--foreground:#1a1b1e;--muted-foreground:#5d5f64;--accent:#1c71d8;--accent-foreground:#fff;--selected:#e8f0fb;--component-selected:#1c71d8;--ok:#2a9134;--ok-soft:#2a913421;--warn:#c67b00;--warn-soft:#c67b0024;--crit:#c33c3c;--crit-soft:#c33c3c24;--cpu:#3584e4;--mem:#33a06f;--swap:#d8a23a;--scrollbar:#c7cad0;--focus:oklab(55.8192% -.0413209 -.171246/.6)}.dark{color-scheme:dark;--background:#181a1e;--card:#22252a;--card-strong:#2d3036;--border:#3a3e45;--foreground:#f1f2f4;--muted-foreground:#afb4bd;--accent:#3584e4;--accent-foreground:#fff;--selected:#1e3a5c;--component-selected:#3584e4;--ok:#58cc8b;--ok-soft:#58cc8b26;--warn:#e5b45e;--warn-soft:#e5b45e26;--crit:#e05e5e;--crit-soft:#e05e5e26;--cpu:#4c9bf5;--mem:#58cc8b;--swap:#e5b45e;--scrollbar:#3a3e45;--focus:#4c9bf5}body,html{overscroll-behavior:none}body{background-color:var(--color-background);color:var(--color-foreground);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;font-family:ui-sans-serif,system-ui,Noto Sans,Inter,sans-serif}.tnum{font-variant-numeric:tabular-nums}::selection{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){::selection{background-color:color-mix(in oklab,var(--accent) 28%,transparent)}}::selection{color:var(--foreground)}:focus-visible{outline:2px solid var(--focus);outline-offset:2px}*{scrollbar-width:thin;scrollbar-color:var(--scrollbar) transparent}@media (prefers-reduced-motion:reduce){*,:after,:before{transition-duration:.01ms!important;animation-duration:.01ms!important}}@property --tw-border-spacing-x{syntax:"<length>";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"<length>";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(1turn)}}@keyframes pulse{50%{opacity:.5}}
|
|
File without changes
|
|
File without changes
|