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,2 +1,2 @@
|
|
|
1
|
-
"use strict";exports.id=894,exports.ids=[894],exports.modules={4155:(a,b,c)=>{c.d(b,{E:()=>r,x:()=>q});var d=c(48249),e=c(2116),f=c.n(e),g=c(31742),h=c(50132),i=c(49187),j=c(90606),k=c(93484),l=c(12421),m=c(22338),n=c(58910);function o(a){return(0,d.jsxs)("button",{type:"button",onClick:a.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,d.jsx)(g.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),a.children]})}function p(a){return(0,d.jsx)(f(),{href:a.href,className:a.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:a.children})}function q(){let{session:a,phase:b,retryConnection:c}=(0,n.M)();switch(a.kind){case"restoring":return(0,d.jsx)(m.Z,{title:"Checking session",className:"mx-auto my-12 max-w-md",children:(0,d.jsx)(m.p,{icon:h.A,note:"Checking your session…"})});case"restore-failed":return(0,d.jsxs)(m.Z,{title:"Hub unreachable",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:i.A,note:"The hub is unreachable right now."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(o,{onClick:c,children:"Check again"})})]});case"signed-out":if("expired"===b)return(0,d.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:j.A,note:"Your session ended."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]});return(0,d.jsxs)(m.Z,{title:"Sign in required",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:h.A,note:"Sign in required."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]});case"auth-unavailable":return(0,d.jsx)(m.Z,{title:"Sign-in unavailable",className:"mx-auto my-12 max-w-md",children:(0,d.jsx)(m.p,{icon:k.A,note:"Browser sign-in is not configured on this hub."})})}return"expired"===b?(0,d.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:j.A,note:"Your session ended."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]}):"no-permission"===b?(0,d.jsxs)(m.Z,{title:"No permission",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:k.A,note:`You are signed in as ${a.user.username}, but this hub grants no machine view to this account.`}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(o,{onClick:c,children:"Check again"})})]}):null}function r(){let{phase:a,retryConnection:b}=(0,n.M)();return"reconnecting"!==a&&"disconnected"!==a&&"connecting"!==a?null:"connecting"===a?(0,d.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,d.jsx)(g.A,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),"Connecting to the live feed — waiting for the first snapshot."]}):(0,d.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,d.jsx)(l.A,{className:"h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,d.jsxs)("span",{children:["Connection lost — values below are ",(0,d.jsx)("strong",{className:"font-medium text-foreground",children:"last known"}),", not live measurements","reconnecting"===a?" — retrying with backoff…":" — retries stopped."]}),"disconnected"===a?(0,d.jsx)(o,{onClick:b,children:"Retry now"}):null]})}},28565:(a,b,c)=>{c.d(b,{MachineBreadcrumb:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call MachineBreadcrumb() from the server but MachineBreadcrumb is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/live/machine-navigation.tsx","MachineBreadcrumb")},35448:(a,b,c)=>{c.d(b,{Z:()=>e});var d=c(5735);function e({title:a,action:b,className:c,children:f}){return(0,d.jsxs)("section",{className:["flex min-w-0 flex-col rounded-xl border border-border bg-card p-5",c].filter(Boolean).join(" "),children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[(0,d.jsx)("h2",{className:"text-sm font-medium tracking-tight",children:a}),b?(0,d.jsx)("div",{className:"text-xs tabular-nums",children:b}):null]}),(0,d.jsx)("div",{className:"mt-4 flex min-h-0 flex-1 flex-col",children:f})]})}},46568:(a,b,c)=>{c.d(b,{ThemeToggle:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ThemeToggle() from the server but ThemeToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/theme-toggle.tsx","ThemeToggle")},50369:(a,b,c)=>{c.d(b,{Sidebar:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/shell/sidebar.tsx","Sidebar")},56013:(a,b,c)=>{c.d(b,{Y8:()=>d});function d(a,b,c,d){return`rigscope-${a}-${function(a,b="machine"){let c=a.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"");return c.length>0?c:b}(b)}-${!Number.isFinite(c)?"unknown-time":new Date(c).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"Z")}.${d}`}},64500:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},71335:(a,b,c)=>{c.d(b,{PE:()=>i,UR:()=>j,kg:()=>h,uW:()=>k});let d=/^[\u0009\u000a\u000d ]*[=+\-@]/,e=/^[\u0009\u000a\u000d]/;function f(a){if(null==a)return"";if("number"==typeof a)return Number.isFinite(a)?String(a):"";if("boolean"==typeof a)return a?"true":"false";let b=0===a.length?a:d.test(a)||e.test(a)?`'${a}`:a;return/[",\t\r\n]/.test(b)?`"${b.replace(/"/g,'""')}"`:b}function g(a){return a.map(f).join(",")}function h(a){return`${a.map(g).join("\r\n")}\r
|
|
2
|
-
`}function i(a,b,c){if("u"<typeof document)return;let d=new Blob([b],{type:c}),e=URL.createObjectURL(d),f=document.createElement("a");f.href=e,f.download=a,f.rel="noopener",f.style.display="none",document.body.append(f),f.click(),f.remove(),globalThis.setTimeout(()=>URL.revokeObjectURL(e),0)}let j="text/csv;charset=utf-8",k="application/json;charset=utf-8"},73742:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).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"}]])},88713:(a,b,c)=>{c.d(b,{G:()=>
|
|
1
|
+
"use strict";exports.id=894,exports.ids=[894],exports.modules={4155:(a,b,c)=>{c.d(b,{E:()=>r,x:()=>q});var d=c(48249),e=c(2116),f=c.n(e),g=c(31742),h=c(50132),i=c(49187),j=c(90606),k=c(93484),l=c(12421),m=c(22338),n=c(58910);function o(a){return(0,d.jsxs)("button",{type:"button",onClick:a.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,d.jsx)(g.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),a.children]})}function p(a){return(0,d.jsx)(f(),{href:a.href,className:a.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:a.children})}function q(){let{session:a,phase:b,retryConnection:c}=(0,n.M)();switch(a.kind){case"restoring":return(0,d.jsx)(m.Z,{title:"Checking session",className:"mx-auto my-12 max-w-md",children:(0,d.jsx)(m.p,{icon:h.A,note:"Checking your session…"})});case"restore-failed":return(0,d.jsxs)(m.Z,{title:"Hub unreachable",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:i.A,note:"The hub is unreachable right now."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(o,{onClick:c,children:"Check again"})})]});case"signed-out":if("expired"===b)return(0,d.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:j.A,note:"Your session ended."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]});return(0,d.jsxs)(m.Z,{title:"Sign in required",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:h.A,note:"Sign in required."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]});case"auth-unavailable":return(0,d.jsx)(m.Z,{title:"Sign-in unavailable",className:"mx-auto my-12 max-w-md",children:(0,d.jsx)(m.p,{icon:k.A,note:"Browser sign-in is not configured on this hub."})})}return"expired"===b?(0,d.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:j.A,note:"Your session ended."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]}):"no-permission"===b?(0,d.jsxs)(m.Z,{title:"No permission",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:k.A,note:`You are signed in as ${a.user.username}, but this hub grants no machine view to this account.`}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(o,{onClick:c,children:"Check again"})})]}):null}function r(){let{phase:a,retryConnection:b}=(0,n.M)();return"reconnecting"!==a&&"disconnected"!==a&&"connecting"!==a?null:"connecting"===a?(0,d.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,d.jsx)(g.A,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),"Connecting to the live feed — waiting for the first snapshot."]}):(0,d.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,d.jsx)(l.A,{className:"h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,d.jsxs)("span",{children:["Connection lost — values below are ",(0,d.jsx)("strong",{className:"font-medium text-foreground",children:"last known"}),", not live measurements","reconnecting"===a?" — retrying with backoff…":" — retries stopped."]}),"disconnected"===a?(0,d.jsx)(o,{onClick:b,children:"Retry now"}):null]})}},28565:(a,b,c)=>{c.d(b,{MachineBreadcrumb:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call MachineBreadcrumb() from the server but MachineBreadcrumb is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/live/machine-navigation.tsx","MachineBreadcrumb")},35448:(a,b,c)=>{c.d(b,{Z:()=>e});var d=c(5735);function e({title:a,action:b,className:c,children:f}){return(0,d.jsxs)("section",{className:["flex min-w-0 flex-col rounded-xl border border-border bg-card p-5",c].filter(Boolean).join(" "),children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[(0,d.jsx)("h2",{className:"text-sm font-medium tracking-tight",children:a}),b?(0,d.jsx)("div",{className:"text-xs tabular-nums",children:b}):null]}),(0,d.jsx)("div",{className:"mt-4 flex min-h-0 flex-1 flex-col",children:f})]})}},46568:(a,b,c)=>{c.d(b,{ThemeToggle:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ThemeToggle() from the server but ThemeToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/theme-toggle.tsx","ThemeToggle")},50369:(a,b,c)=>{c.d(b,{Sidebar:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/shell/sidebar.tsx","Sidebar")},56013:(a,b,c)=>{c.d(b,{Y8:()=>d});function d(a,b,c,d){return`rigscope-${a}-${function(a,b="machine"){let c=a.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"");return c.length>0?c:b}(b)}-${!Number.isFinite(c)?"unknown-time":new Date(c).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"Z")}.${d}`}},64500:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},64792:(a,b,c)=>{c.d(b,{MobileNavigation:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call MobileNavigation() from the server but MobileNavigation is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/shell/mobile-navigation.tsx","MobileNavigation")},71335:(a,b,c)=>{c.d(b,{PE:()=>i,UR:()=>j,kg:()=>h,uW:()=>k});let d=/^[\u0009\u000a\u000d ]*[=+\-@]/,e=/^[\u0009\u000a\u000d]/;function f(a){if(null==a)return"";if("number"==typeof a)return Number.isFinite(a)?String(a):"";if("boolean"==typeof a)return a?"true":"false";let b=0===a.length?a:d.test(a)||e.test(a)?`'${a}`:a;return/[",\t\r\n]/.test(b)?`"${b.replace(/"/g,'""')}"`:b}function g(a){return a.map(f).join(",")}function h(a){return`${a.map(g).join("\r\n")}\r
|
|
2
|
+
`}function i(a,b,c){if("u"<typeof document)return;let d=new Blob([b],{type:c}),e=URL.createObjectURL(d),f=document.createElement("a");f.href=e,f.download=a,f.rel="noopener",f.style.display="none",document.body.append(f),f.click(),f.remove(),globalThis.setTimeout(()=>URL.revokeObjectURL(e),0)}let j="text/csv;charset=utf-8",k="application/json;charset=utf-8"},73742:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).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"}]])},88713:(a,b,c)=>{c.d(b,{G:()=>i});var d=c(5735),e=c(28565),f=c(64792),g=c(50369),h=c(46568);function i({title:a,headerRight:b,children:c,workspace:j=!1,machineId:k,machineView:l}){return(0,d.jsxs)("div",{className:"relative flex h-dvh overflow-hidden bg-background text-foreground",children:[(0,d.jsx)("a",{href:"#main-content",className:"sr-only z-50 rounded-md bg-card px-4 py-2 text-foreground focus:not-sr-only focus:absolute focus:start-2 focus:top-2 focus:outline-2 focus:outline-accent",children:"Skip to content"}),(0,d.jsx)("div",{className:"hidden md:flex",children:(0,d.jsx)(g.Sidebar,{machineId:k,machineView:l})}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,d.jsxs)("header",{className:"flex min-h-14 shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-2 md:px-6",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,d.jsx)(f.MobileNavigation,{machineId:k,machineView:l}),k&&l?(0,d.jsx)(e.MachineBreadcrumb,{machineId:k,title:a,view:l}):(0,d.jsx)("h1",{className:"truncate text-lg font-semibold tracking-tight",children:a})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[b?(0,d.jsx)("div",{className:"flex min-w-0 items-center gap-3",children:b}):null,(0,d.jsx)(h.ThemeToggle,{})]})]}),(0,d.jsx)("main",{id:"main-content",tabIndex:-1,className:`relative min-h-0 min-w-0 flex-1 overflow-x-hidden overscroll-contain p-4 outline-offset-[-2px] md:p-6 ${j?"flex flex-col overflow-y-hidden":"overflow-y-auto"}`,children:(0,d.jsx)("div",{className:j?"mx-auto flex h-full w-full min-h-0 min-w-0 max-w-[1500px] flex-1 flex-col":"mx-auto flex w-full min-w-0 max-w-[1500px] flex-col",children:c})})]})]})}},90606:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/
|
|
1
|
+
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/9SHY6v87ulfunqR2e84n9/_buildManifest.js","static/9SHY6v87ulfunqR2e84n9/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-9ca43f4ce1bb8938.js","static/chunks/4bd1b696-c7408084347438ae.js","static/chunks/794-ceeb732a1a81bc27.js","static/chunks/main-app-f92328c8950d2e53.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/f5d3162842dcac31.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js"/><script src="/_next/static/chunks/4bd1b696-c7408084347438ae.js" async=""></script><script src="/_next/static/chunks/794-ceeb732a1a81bc27.js" async=""></script><script src="/_next/static/chunks/main-app-f92328c8950d2e53.js" async=""></script><script src="/_next/static/chunks/939-514e554087419c71.js" async=""></script><script src="/_next/static/chunks/app/layout-4feff677c4071745.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Rigscope</title><meta name="description" content="Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub."/><link rel="icon" href="/icon.svg?3b3fa3229e2d0d7a" type="image/svg+xml" sizes="any"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","dark",null,["light","dark"],null,true,true)</script><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:\"static/chunks/939-514e554087419c71.js\"\n3:\"static/chunks/app/layout-4feff677c4071745.js\"\n4:I[2737,[\"939\",\"$2\",\"177\",\"$3\"],\"ThemeProvider\"]\n5:I[9939,[\"939\",\"$2\",\"177\",\"$3\"],\"LiveProvider\"]\n6:I[7121,[],\"\"]\n7:I[4581,[],\"\"]\nb:I[484,[],\"OutletBoundary\"]\nc:\"$Sreact.suspense\"\ne:\"ViewportBoundary\"\nf:I[484,[],\"$e\"]\n11:\"MetadataBoundary\"\n12:I[484,[],\"$11\"]\n14:I[7123,[],\"default\",1]\n:HL[\"/_next/static/css/f5d3162842dcac31.css\",\"style\"]\n9:X\na:[[\"children\",{\"s\":\"__PAGE__\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$c\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@d\"}]}]]}],\"p\":false,\"v\":null}}]]\n8:[[\"children\",{\"s\":\"_not-found\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$9\"},\"c\":\"$Qa\"}]]\n0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/f5d3162842dcac31.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L4\",null,{\"attribute\":\"class\",\"defaultTheme\":\"dark\",\"enableSystem\":true,\"children\":[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]}]]}],\"p\":false,\"v\":null},\"c\":\"$Q8\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Lf\",null,{\"children\":\"$L10\"}],[\"$\",\"$L12\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L13\"}]}],null]}],null]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$14\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"9SHY6v87ulfunqR2e84n9\"}\n"])</script><script>self.__next_f.push([1,"9:C\n10:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"15:I[6869,[],\"IconMark\"]\nd:null\n13:[[\"$\",\"title\",\"0\",{\"children\":\"Rigscope\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?3b3fa3229e2d0d7a\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$L15\",\"3\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js"/><script src="/_next/static/chunks/4bd1b696-c7408084347438ae.js" async=""></script><script src="/_next/static/chunks/794-ceeb732a1a81bc27.js" async=""></script><script src="/_next/static/chunks/main-app-f92328c8950d2e53.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n7:I[484,[],\"OutletBoundary\"]\n8:\"$Sreact.suspense\"\na:\"ViewportBoundary\"\nb:I[484,[],\"$a\"]\nd:\"MetadataBoundary\"\ne:I[484,[],\"$d\"]\n10:I[7123,[],\"default\",1]\n4:X\n"])</script><script>self.__next_f.push([1,"6:[[\"children\",{\"s\":\"__PAGE__\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L7\",null,{\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@9\"}]}]]}],\"p\":false,\"v\":null}}]]\n"])</script><script>self.__next_f.push([1,"5:[[\"children\",{\"s\":\"_global-error\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$4\"},\"c\":\"$Q6\"}]]\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$4\"},\"c\":\"$Q5\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"$Le\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}],null]}],null]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js"/><script src="/_next/static/chunks/4bd1b696-c7408084347438ae.js" async=""></script><script src="/_next/static/chunks/794-ceeb732a1a81bc27.js" async=""></script><script src="/_next/static/chunks/main-app-f92328c8950d2e53.js" async=""></script><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n7:I[484,[],\"OutletBoundary\"]\n8:\"$Sreact.suspense\"\na:\"ViewportBoundary\"\nb:I[484,[],\"$a\"]\nd:\"MetadataBoundary\"\ne:I[484,[],\"$d\"]\n10:I[7123,[],\"default\",1]\n4:X\n"])</script><script>self.__next_f.push([1,"6:[[\"children\",{\"s\":\"__PAGE__\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L7\",null,{\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@9\"}]}]]}],\"p\":false,\"v\":null}}]]\n"])</script><script>self.__next_f.push([1,"5:[[\"children\",{\"s\":\"_global-error\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$4\"},\"c\":\"$Q6\"}]]\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$4\"},\"c\":\"$Q5\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"$Le\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}],null]}],null]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"9SHY6v87ulfunqR2e84n9\"}\n"])</script><script>self.__next_f.push([1,"4:C\nc:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"9:null\nf:[]\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[103],{802:(e,n,r)=>{r.d(n,{B:()=>l});var t=r(5155),a=r(8500),i=r.n(a),s=r(9939);function l(){let{session:e,phase:n,signOut:r}=(0,s.M)();return"signed-in"===e.kind?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"hidden max-w-[12rem] truncate text-xs text-muted-foreground sm:inline",children:e.user.username}),(0,t.jsx)("button",{type:"button",onClick:()=>void r(),className:"rounded-md px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-card-strong hover:text-foreground",children:"Sign out"})]}):"restoring"===e.kind||"auth-unavailable"===e.kind?null:(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsx)(i(),{href:"/login",className:"rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:"Sign in"})})}},940:(e,n,r)=>{r.d(n,{$E:()=>o,TK:()=>d});var t=r(5155),a=r(9939);let i={ok:"bg-ok",warn:"bg-warn",crit:"bg-crit",muted:"bg-muted-foreground/50"};function s(e,n){switch(e.kind){case"restoring":return{label:"Checking session…",tone:"muted"};case"restore-failed":return{label:"Hub unreachable",tone:"crit"};case"signed-out":return{label:"Signed out",tone:"muted"};case"auth-unavailable":return{label:"Sign-in unavailable",tone:"warn"}}switch(n){case"idle":return{label:"Not connected",tone:"muted"};case"connecting":return{label:"Connecting…",tone:"warn"};case"live":return{label:"Live",tone:"ok"};case"reconnecting":return{label:"Reconnecting…",tone:"warn"};case"disconnected":return{label:"Disconnected",tone:"crit"};case"expired":return{label:"Session ended",tone:"crit"};case"no-permission":return{label:"No permission",tone:"warn"}}}function l({tone:e}){return(0,t.jsx)("span",{className:`inline-block h-2 w-2 shrink-0 rounded-full ${i[e]}`,"aria-hidden":!0})}function o(){let{session:e,phase:n,lastEventKind:r,notice:i,dismissNotice:o}=(0,a.M)(),d=s(e,n),c="reset"===r&&"live"===n?"Stream resynchronized with a fresh snapshot.":null;return(0,t.jsxs)("div",{role:"status","aria-label":`Live feed status: ${d.label}`,className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(l,{tone:d.tone}),(0,t.jsx)("span",{className:"tnum truncate text-xs text-muted-foreground",children:d.label}),c?(0,t.jsxs)("span",{className:"tnum hidden truncate text-xs text-muted-foreground lg:inline",title:c,children:["\xb7 ",c]}):null,i?(0,t.jsxs)("button",{type:"button",onClick:o,className:"max-w-[16rem] truncate rounded-md border border-border px-2 py-0.5 text-xs text-foreground transition-colors hover:bg-card-strong",title:`${i} Click to dismiss.`,children:[i,(0,t.jsx)("span",{"aria-hidden":!0,children:" ✕"})]}):null]})}function d(){let{session:e,phase:n}=(0,a.M)(),r=s(e,n);return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 text-xs",children:[(0,t.jsx)(l,{tone:r.tone}),(0,t.jsx)("span",{className:"truncate",role:"status","aria-label":`Live feed status: ${r.label}`,children:r.label})]})}},1721:(e,n,r)=>{r.d(n,{MachineBreadcrumb:()=>o});var t=r(5155),a=r(8500),i=r.n(a),s=r(9939),l=r(8664);function o({machineId:e,title:n,view:r}){let{machines:a}=(0,s.M)(),d=(0,l.FM)(),c=a.find(n=>n.machineId===e),u=c?.displayName||c?.hostname||"Machine";return(0,t.jsxs)("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,t.jsx)(i(),{href:"/",className:"hidden text-muted-foreground hover:text-foreground sm:inline",children:"Fleet"}),(0,t.jsx)("span",{"aria-hidden":!0,className:"hidden text-muted-foreground sm:inline",children:"/"}),(0,t.jsx)(i(),{href:(0,l.Y2)(e,"overview"),className:"hidden max-w-48 truncate text-muted-foreground hover:text-foreground md:inline",children:u}),(0,t.jsx)("select",{"aria-label":"Machine",value:e,onChange:e=>d(e.target.value,r),className:"h-8 min-w-0 max-w-32 rounded-md border border-border bg-card px-1.5 text-sm md:hidden",children:a.map(e=>(0,t.jsx)("option",{value:e.machineId,children:e.displayName||e.hostname||e.machineId},e.machineId))}),(0,t.jsx)("span",{"aria-hidden":!0,className:"text-muted-foreground",children:"/"}),(0,t.jsx)("h1",{className:"truncate text-lg font-semibold tracking-tight",children:n})]})}},2394:(e,n,r)=>{r.d(n,{ThemeToggle:()=>l});var t=r(5155),a=r(1134),i=r(9145),s=r(460);function l(){let{resolvedTheme:e,setTheme:n}=(0,s.D)();return(0,t.jsxs)("button",{type:"button",onClick:()=>n("dark"===e?"light":"dark"),"aria-label":"Toggle theme",className:"flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-selected hover:text-foreground",children:[(0,t.jsx)(a.A,{className:"h-4.5 w-4.5 dark:hidden"}),(0,t.jsx)(i.A,{className:"hidden h-4.5 w-4.5 dark:block"})]})}},2701:(e,n,r)=>{r.d(n,{Sidebar:()=>k});var t=r(5155),a=r(8500),i=r.n(a),s=r(3321),l=r(257),o=r(7233),d=r(2955),c=r(3896),u=r(9764),m=r(4201),h=r(8731),x=r(8664),f=r(8773),b=r(940),g=r(9939),p=r(7586),v=r(7348);let w=[{href:"/alerts",label:"Alerts",icon:l.A},{href:"/connections",label:"Connections",icon:o.A}],j=[{view:"overview",label:"Overview",icon:d.A},{view:"history",label:"History",icon:c.A},{view:"processes",label:"Processes",icon:u.A}],N=e=>["flex min-h-11 min-w-0 md:min-h-9 items-center gap-3 rounded-md border px-2 text-sm transition-colors md:px-3",e?"border-accent/60 bg-selected font-medium text-foreground":"border-transparent text-muted-foreground hover:bg-card-strong hover:text-foreground"].join(" ");function k({machineId:e,machineView:n,expanded:r=!1}){let a=(0,s.usePathname)(),{session:l,machines:o,phase:d}=(0,g.M)(),c=(0,v.c)(),{machine:u,view:y,selectMachine:I}=(0,x.PY)(e,n),M="signed-in"===l.kind&&!0===l.user.admin?[...w,{href:"/administration",label:"Administration",icon:m.A}]:w;return(0,t.jsxs)("aside",{className:`flex shrink-0 flex-col border-r border-border bg-background ${r?"w-full":"w-56"}`,children:[(0,t.jsxs)(i(),{href:"/","aria-label":"Rigscope",className:"flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-3 md:px-5",children:[(0,t.jsx)(f.R,{className:"h-5 w-5 shrink-0 text-accent","aria-hidden":!0}),(0,t.jsx)("span",{className:"hidden text-sm font-semibold tracking-tight text-foreground md:inline",children:"Rigscope"})]}),(0,t.jsxs)("nav",{"aria-label":"Primary",className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-2 md:p-3",children:[(0,t.jsxs)(i(),{href:"/","aria-current":"/"===a?"page":void 0,title:"Fleet","aria-label":"Fleet",className:N("/"===a),children:[(0,t.jsx)(h.A,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"inline",children:"Fleet"})]}),o.length>0?(0,t.jsx)("div",{role:"group","aria-label":"Select a machine",className:"my-3 flex max-h-[min(30dvh,20rem)] shrink-0 flex-col gap-1 overflow-y-auto",children:o.map(e=>{let n=e.displayName||e.hostname||e.machineId,r=e.tags?.join(", "),a=u?.machineId===e.machineId,i=(0,p.vj)(e,c),s=e.connected?"live"!==d?"Feed unavailable":"stale"===i?"Stale":"unknown"===i?"No sample yet":"Live":"Disconnected",l="Live"===s?"bg-ok":"Disconnected"===s?"bg-crit":"No sample yet"===s?"bg-muted-foreground":"bg-warn",o=e.inventory?.cpu.model||r;return(0,t.jsxs)("button",{type:"button","aria-pressed":a,"aria-label":`${n}: ${s}${o?`, ${o}`:""}`,title:[n,s,o,r].filter(Boolean).join(" \xb7 "),onClick:()=>I(e.machineId),className:`${N(a)} w-full shrink-0 py-2 text-left focus-visible:outline-offset-[-2px] `,children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"relative flex h-5 w-4 shrink-0 items-center justify-center",children:[(0,t.jsx)("span",{className:"hidden",children:n.slice(0,2).toUpperCase()}),(0,t.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full ${l}`})]}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 block",children:[(0,t.jsx)("span",{className:"block break-words font-medium leading-5",children:n}),o?(0,t.jsx)("span",{className:`mt-0.5 block break-words text-xs leading-4 ${a?"text-foreground/80":"text-muted-foreground"}`,children:o}):null]})]},e.machineId)})}):null,u?(0,t.jsx)("div",{role:"group","aria-label":"Selected machine views",className:"mb-3 flex shrink-0 flex-col gap-1 border-t border-border pt-3",children:j.map(({view:e,label:n,icon:r})=>(0,t.jsxs)(i(),{href:(0,x.Y2)(u.machineId,e),"aria-current":y===e?"page":void 0,"aria-label":`${u.displayName||u.hostname||u.machineId}: ${n}`,title:`${u.displayName||u.hostname||u.machineId}: ${n}`,className:N(y===e),children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"inline",children:n})]},e))}):null,(0,t.jsx)("div",{className:"flex shrink-0 flex-col gap-1 border-t border-border pt-3",children:M.map(({href:e,label:n,icon:r})=>(0,t.jsxs)(i(),{href:e,"aria-current":a===e?"page":void 0,title:n,"aria-label":n,className:N(a===e),children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"inline",children:n})]},e))})]}),(0,t.jsx)("footer",{className:"shrink-0 border-t border-border p-3",children:(0,t.jsx)(b.TK,{})})]})}},3440:(e,n,r)=>{r.d(n,{Z:()=>a,p:()=>i});var t=r(5155);function a({title:e,action:n,className:r,children:i}){return(0,t.jsxs)("section",{className:["flex min-w-0 flex-col rounded-xl border border-border bg-card p-5",r].filter(Boolean).join(" "),children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[(0,t.jsx)("h2",{className:"text-sm font-medium tracking-tight",children:e}),n?(0,t.jsx)("div",{className:"text-xs tabular-nums",children:n}):null]}),(0,t.jsx)("div",{className:"mt-4 flex min-h-0 flex-1 flex-col",children:i})]})}function i({icon:e,note:n,className:r}){return(0,t.jsxs)("div",{className:["flex flex-1 flex-col items-center justify-center gap-2.5 rounded-lg border border-dashed border-border px-6 py-10 text-center",r].filter(Boolean).join(" "),children:[(0,t.jsx)(e,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n})]})}},4173:(e,n,r)=>{r.d(n,{G:()=>o});var t=r(5155),a=r(1721),i=r(9904),s=r(2701),l=r(2394);function o({title:e,headerRight:n,children:r,workspace:d=!1,machineId:c,machineView:u}){return(0,t.jsxs)("div",{className:"relative flex h-dvh overflow-hidden bg-background text-foreground",children:[(0,t.jsx)("a",{href:"#main-content",className:"sr-only z-50 rounded-md bg-card px-4 py-2 text-foreground focus:not-sr-only focus:absolute focus:start-2 focus:top-2 focus:outline-2 focus:outline-accent",children:"Skip to content"}),(0,t.jsx)("div",{className:"hidden md:flex",children:(0,t.jsx)(s.Sidebar,{machineId:c,machineView:u})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsxs)("header",{className:"flex min-h-14 shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-2 md:px-6",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(i.MobileNavigation,{machineId:c,machineView:u}),c&&u?(0,t.jsx)(a.MachineBreadcrumb,{machineId:c,title:e,view:u}):(0,t.jsx)("h1",{className:"truncate text-lg font-semibold tracking-tight",children:e})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[n?(0,t.jsx)("div",{className:"flex min-w-0 items-center gap-3",children:n}):null,(0,t.jsx)(l.ThemeToggle,{})]})]}),(0,t.jsx)("main",{id:"main-content",tabIndex:-1,className:`relative min-h-0 min-w-0 flex-1 overflow-x-hidden overscroll-contain p-4 outline-offset-[-2px] md:p-6 ${d?"flex flex-col overflow-y-hidden":"overflow-y-auto"}`,children:(0,t.jsx)("div",{className:d?"mx-auto flex h-full w-full min-h-0 min-w-0 max-w-[1500px] flex-1 flex-col":"mx-auto flex w-full min-w-0 max-w-[1500px] flex-col",children:r})})]})]})}},6114:(e,n,r)=>{r.d(n,{u:()=>m});var t=r(2115);let a="rigscope:",i=new Map,s=new Map,l=new Map,o=!1;function d(e){try{return"local"===e?window.localStorage:window.sessionStorage}catch{return null}}function c(e,n){return`${e}:${n}`}function u(e,n,r,t){let s=c(e,n);if(i.has(s))return i.get(s);let l=r,o=d(e);if(null!==o)try{let e=o.getItem(a+n);if(null!==e){let n=t(JSON.parse(e));null!==n&&(l=n)}}catch{}return i.set(s,l),l}function m(e,n,r,h="local"){let x=c(h,e);return[(0,t.useSyncExternalStore)((0,t.useCallback)(e=>{let n;return void 0===(n=s.get(x))&&(n=new Set,s.set(x,n)),n.add(e),()=>{n.delete(e)}},[x]),()=>u(h,e,n,r),()=>n),(0,t.useCallback)(t=>{let m=u(h,e,n,r),f="function"==typeof t?t(m):t;if(!Object.is(f,m)){i.set(x,f);let n=c(h,e),r=l.get(n);void 0!==r&&clearTimeout(r.timer);let t=()=>{let r=l.get(n);r&&clearTimeout(r.timer),l.delete(n);let t=d(h);if(null!==t)try{t.setItem(a+e,JSON.stringify(i.get(n)))}catch{}};if(l.set(n,{timer:setTimeout(t,250),flush:t}),!o){o=!0;let e=()=>l.forEach(e=>e.flush());window.addEventListener("pagehide",e),document.addEventListener("visibilitychange",()=>{document.hidden&&e()})}s.get(x)?.forEach(e=>e())}},[n,x,e,h,r])]}},7348:(e,n,r)=>{r.d(n,{c:()=>a});var t=r(2115);function a(e=1e3){let[n,r]=(0,t.useState)(()=>Date.now());return(0,t.useEffect)(()=>{r(Date.now());let n=setInterval(()=>r(Date.now()),e);return()=>clearInterval(n)},[e]),n}},8664:(e,n,r)=>{r.d(n,{FM:()=>f,JG:()=>x,PY:()=>b,Y2:()=>l});var t=r(2115),a=r(3321),i=r(6114),s=r(9939);function l(e,n){let r=encodeURIComponent(e);return"overview"===n?`/machines/${r}`:`/${n}?machineId=${r}`}function o(e){let n=e.inventory?.capabilities?.processes;return void 0===n||"supported"===n.status}let d={overview:e=>e[0],history:e=>e[0],processes:e=>e.find(o)??e[0]};function c({view:e,requestedMachineId:n,rememberedMachineId:r,machines:t}){if(0===t.length)return{kind:"fleet-empty"};if(n){let e=t.find(e=>e.machineId===n);return e?{kind:"resolved",machine:e,via:"requested"}:{kind:"missing",requestedMachineId:n}}if(r){let e=t.find(e=>e.machineId===r);if(e)return{kind:"resolved",machine:e,via:"remembered"}}let a=d[e](t);return a?{kind:"resolved",machine:a,via:"fallback"}:{kind:"fleet-empty"}}let u=e=>"string"==typeof e?e:null;function m(){return(0,i.u)("machine.selected","",u,"session")}let h=new Set(["history"]);function x(e,n){let{session:r,machines:i}=(0,s.M)(),l=(0,a.useRouter)(),o=(0,a.usePathname)()||`/${e}`,d=(0,a.useSearchParams)(),[u,x]=m(),f="overview"===e?n??"":d.get("machineId")||null,b=(0,t.useMemo)(()=>c({view:e,requestedMachineId:f,rememberedMachineId:u,machines:i}),[e,f,u,i]),g="resolved"===b.kind?b.machine:void 0,p=g?.machineId??"",v="overview"===e?f??"":"processes"===e?g?.machineId??f??"":p;(0,t.useEffect)(()=>{p&&x(p)},[p,x]);let w=h.has(e);return(0,t.useEffect)(()=>{if(!w||"signed-in"!==r.kind||0===i.length||null!==f||""===p)return;let e=function(e,n,r){if(n.get("machineId"))return null;let t=new URLSearchParams(n.toString());return t.set("machineId",r),`${e}?${t.toString()}`}(o,d,p);e&&l.replace(e,{scroll:!1})},[w,r.kind,i,f,p,d,l,o]),{resolution:b,machine:g,machineId:p,navMachineId:v,requestedMachineId:f}}function f(){let e=(0,a.useRouter)(),[,n]=m();return(0,t.useCallback)((r,t)=>{n(r),e.push(l(r,t))},[n,e])}function b(e,n){let r=(0,a.usePathname)()||"/",{machines:t}=(0,s.M)(),[i]=m(),l=f(),o=n??(r.startsWith("/machines/")?"overview":"/history"===r?"history":"/processes"===r?"processes":null),d=c({view:o??"overview",requestedMachineId:t.some(n=>n.machineId===e)?e:null,rememberedMachineId:i,machines:t});return{view:o,machine:"resolved"===d.kind?d.machine:void 0,selectMachine:e=>l(e,o??"overview")}}},8773:(e,n,r)=>{r.d(n,{R:()=>a});var t=r(5155);function a(e){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...e,children:[(0,t.jsx)("path",{d:"M8 3H4v18h4M16 3h4v18h-4"}),(0,t.jsx)("path",{d:"m8 15 4-6 4 3M8 8h.01M16 17h.01"})]})}},9904:(e,n,r)=>{r.d(n,{MobileNavigation:()=>o});var t=r(5155),a=r(2115),i=r(2915),s=r(4268),l=r(2701);function o(e){let n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=window.matchMedia("(min-width: 768px)"),r=()=>{e.matches&&n.current?.close()};return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button","aria-label":"Open navigation","aria-haspopup":"dialog",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-card-strong md:hidden",onClick:()=>n.current?.showModal(),children:(0,t.jsx)(i.A,{className:"h-5 w-5","aria-hidden":!0})}),(0,t.jsx)("dialog",{ref:n,"aria-label":"Navigation",className:"fixed inset-y-0 left-0 m-0 h-dvh max-h-none w-[min(20rem,90vw)] max-w-none border-r border-border bg-background p-0 text-foreground backdrop:bg-black/50",onClick:e=>{e.target===e.currentTarget&&n.current?.close()},children:(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsx)("button",{type:"button","aria-label":"Close navigation",autoFocus:!0,className:"absolute right-2 top-1.5 z-10 flex h-11 w-11 items-center justify-center rounded-md hover:bg-card-strong",onClick:()=>n.current?.close(),children:(0,t.jsx)(s.A,{className:"h-5 w-5","aria-hidden":!0})}),(0,t.jsx)("div",{className:"flex min-h-0 flex-1",onClick:e=>{e.target.closest("a, nav button")&&n.current?.close()},children:(0,t.jsx)(l.Sidebar,{...e,expanded:!0})})]})})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[408],{4150:(e,t,r)=>{r.d(t,{Au:()=>u,_C:()=>a,eg:()=>c});var n=r(5155),s=r(2115),i=r(6304),l=r(5078);let o=(0,s.createContext)(null);function a({children:e}){let[t,r]=(0,s.useState)(null),i=(0,s.useCallback)(e=>r(t=>t?.timeMs===e?.timeMs&&t?.source===e?.source?t:e),[]),l=(0,s.useMemo)(()=>({cursor:t,setCursor:i}),[t,i]);return(0,n.jsx)(o.Provider,{value:l,children:e})}function u({series:e,fromMs:t,toMs:r,stepMs:n,gaps:l}){let a=(0,s.useId)(),[c,d]=(0,s.useState)(null),m=(0,s.useContext)(o),f=m?m.cursor:c,p=m?m.setCursor:d,h=(0,s.useRef)(null),g=(0,s.useRef)(null),y=(0,s.useCallback)(()=>{null!==h.current&&cancelAnimationFrame(h.current),h.current=null,g.current=null},[]);(0,s.useEffect)(()=>y,[y]);let b=(0,s.useMemo)(()=>(0,i.X)(e).filter(e=>e.t<=r&&e.t+n/2>=t),[e,t,r,n]),x=f&&f.timeMs>=t-n/2&&f.timeMs<=r?f.timeMs:null,v=null!==x&&f?.source===a;(0,s.useEffect)(()=>{if(!v)return;let e=e=>{"Escape"===e.key&&(y(),p(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v,p,y]);let M=()=>{y(),f?.source===a&&p(null)};return{id:a,timeMs:x,active:v,inspect:e=>{let s=Math.max(t,Math.min(r,e)),o=(0,i.bO)(b,s,n,l);g.current={timeMs:o?.t??s,source:a},null===h.current&&(h.current=requestAnimationFrame(()=>{h.current=null,p(g.current),g.current=null}))},clear:M,onKeyDown:e=>{if(y(),"Escape"===e.key)e.preventDefault(),M();else if(["ArrowLeft","ArrowRight","Home","End"].includes(e.key)){e.preventDefault();let t=(0,i.o7)(b,x,e.key);null!==t&&p({timeMs:t,source:a})}},onFocus:()=>{y(),p({timeMs:b.at(-1)?.t??r,source:a})}}}function c({id:e,timeMs:t,fraction:r,unit:i,readings:o}){let[a]=(0,s.useState)(()=>r>.5?"left":"right");return(0,n.jsxs)("div",{id:e,role:"tooltip",className:`pointer-events-none absolute bottom-full mb-2 md:pointer-events-auto md:bottom-auto md:top-2 md:mb-0 z-10 max-h-56 w-56 max-w-[calc(100%-1rem)] overflow-y-auto rounded-md border border-border bg-card p-3 text-xs text-foreground ${"left"===a?"left-2":"right-2"}`,children:[(0,n.jsx)("p",{className:"tnum font-medium",children:(0,l.r6)(t)}),(0,n.jsx)("p",{className:"mb-2 text-muted-foreground",children:"Recorded bucket average"}),(0,n.jsx)("dl",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-4 gap-y-1.5",children:o.map(({key:e,label:r,color:s,point:o})=>(0,n.jsxs)("div",{className:"contents",children:[(0,n.jsxs)("dt",{className:"flex min-w-0 items-center gap-1.5",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:s}}),(0,n.jsx)("span",{className:"break-words",children:r})]}),(0,n.jsxs)("dd",{className:"tnum text-right",children:[o?.avg==null?"No reading":(0,l.dd)(o.avg,i),o&&o.t!==t?(0,n.jsx)("span",{className:"block text-muted-foreground",children:(0,l.ei)(o.t)}):null]})]},e))})]})}},4567:(e,t,r)=>{r.d(t,{Cv:()=>s,H9:()=>n,Lf:()=>u,P$:()=>i,RL:()=>g,bP:()=>h,er:()=>m,oB:()=>a,ue:()=>p,yv:()=>d});let n=[{metric:"cpu.usage",label:"CPU usage",shortLabel:"CPU",unit:"percent",family:"cpu",colorSlot:0,description:"Total processor utilization"},{metric:"cpu.core",label:"Per-core CPU",shortLabel:"Per-core",unit:"percent",family:"cpu",colorSlot:0,description:"Logical-core utilization; heatmap for large selections"},{metric:"cpu.temperature",label:"CPU temperature",shortLabel:"Temperature",unit:"celsius",family:"cpu",colorSlot:3,description:"Identifiable CPU hwmon sensor temperature"},{metric:"cpu.power",label:"CPU package power",shortLabel:"Power",unit:"watts",family:"cpu",colorSlot:4,description:"Top-level RAPL package power draw"},{metric:"cpu.iowait",label:"CPU I/O wait",shortLabel:"I/O wait",unit:"percent",family:"cpu",colorSlot:2,description:"Processor time waiting on I/O"},{metric:"cpu.pressure",label:"CPU pressure",shortLabel:"Pressure",unit:"percent",family:"cpu",colorSlot:4,description:"Linux PSI CPU stall pressure (avg10)"},{metric:"memory.used",label:"Memory used",shortLabel:"Memory",unit:"bytes",family:"memory",colorSlot:1,description:"Physical memory in use"},{metric:"memory.usage",label:"Memory usage",shortLabel:"Memory %",unit:"percent",family:"memory",colorSlot:1,description:"Physical memory used as a share of total"},{metric:"memory.pressure.some",label:"Memory pressure (some)",shortLabel:"Pressure some",unit:"percent",family:"memory",colorSlot:2,description:"Linux PSI memory stall pressure, some tasks (avg10)"},{metric:"memory.pressure.full",label:"Memory pressure (full)",shortLabel:"Pressure full",unit:"percent",family:"memory",colorSlot:4,description:"Linux PSI memory stall pressure, all tasks (avg10)"},{metric:"swap.used",label:"Swap used",shortLabel:"Swap",unit:"bytes",family:"swap",colorSlot:2,description:"Swap space in use"},{metric:"gpu.utilization",label:"GPU utilization",shortLabel:"Utilization",unit:"percent",family:"gpus",colorSlot:0,description:"Per-card graphics processor utilization"},{metric:"gpu.memory.used",label:"GPU memory used",shortLabel:"VRAM",unit:"bytes",family:"gpus",colorSlot:1,description:"Per-card video memory in use"},{metric:"gpu.temperature",label:"GPU temperature",shortLabel:"Temperature",unit:"celsius",family:"gpus",colorSlot:3,description:"Per-card temperature"},{metric:"gpu.power",label:"GPU power",shortLabel:"Power",unit:"watts",family:"gpus",colorSlot:4,description:"Per-card power draw"},{metric:"fs.used",label:"Filesystem used",shortLabel:"Filesystem",unit:"bytes",family:"disks",colorSlot:1,description:"Used space per mounted filesystem"},{metric:"fs.usage",label:"Filesystem usage",shortLabel:"Filesystem %",unit:"percent",family:"disks",colorSlot:1,description:"Used capacity per mounted filesystem, derived from a positive total"},{metric:"fs.inodes.usage",label:"Inode usage",shortLabel:"Inodes %",unit:"percent",family:"disks",colorSlot:2,description:"Used inodes per filesystem where the collector can read them"},{metric:"disk.read",label:"Disk read",shortLabel:"Read",unit:"bytes_per_second",family:"disks",colorSlot:0,description:"Device read throughput"},{metric:"disk.write",label:"Disk write",shortLabel:"Write",unit:"bytes_per_second",family:"disks",colorSlot:2,description:"Device write throughput"},{metric:"disk.read.latency",label:"Disk read latency",shortLabel:"Read latency",unit:"milliseconds",family:"disks",colorSlot:0,description:"Average device read latency"},{metric:"disk.write.latency",label:"Disk write latency",shortLabel:"Write latency",unit:"milliseconds",family:"disks",colorSlot:2,description:"Average device write latency"},{metric:"disk.utilization",label:"Disk utilization",shortLabel:"Utilization",unit:"percent",family:"disks",colorSlot:3,description:"Share of time the device had I/O in flight"},{metric:"io.pressure.some",label:"I/O pressure (some)",shortLabel:"I/O some",unit:"percent",family:"disks",colorSlot:3,description:"Linux PSI I/O stall pressure, some tasks (avg10)"},{metric:"io.pressure.full",label:"I/O pressure (full)",shortLabel:"I/O full",unit:"percent",family:"disks",colorSlot:4,description:"Linux PSI I/O stall pressure, all tasks (avg10)"},{metric:"net.rx",label:"Network received",shortLabel:"Received",unit:"bytes_per_second",family:"network",colorSlot:0,description:"Interface receive rate"},{metric:"net.tx",label:"Network sent",shortLabel:"Sent",unit:"bytes_per_second",family:"network",colorSlot:2,description:"Interface transmit rate"}];function s(e,t){return e.filter(r=>{for(let[n,s,i]of[["memory","memory.used","memory.usage"],["filesystem","fs.used","fs.usage"]])if(e.includes(s)&&e.includes(i)&&(r===s||r===i))return r===("percent"===t[n]?i:s);return!0})}let i=[{id:"cpu",label:"CPU",metrics:["cpu.usage","cpu.core","cpu.iowait","cpu.pressure","cpu.temperature","cpu.power"]},{id:"memory",label:"Memory",metrics:["memory.used","memory.usage","swap.used","memory.pressure.some","memory.pressure.full"]},{id:"gpu",label:"GPU",metrics:["gpu.utilization","gpu.memory.used","gpu.temperature","gpu.power"]},{id:"disk",label:"Storage",metrics:["fs.used","fs.usage","fs.inodes.usage","disk.read","disk.write","disk.read.latency","disk.write.latency","disk.utilization","io.pressure.some","io.pressure.full"]},{id:"network",label:"Network",metrics:["net.rx","net.tx"]}],l=["var(--cpu)","var(--mem)","color-mix(in oklab, var(--swap) 75%, var(--foreground))","var(--warn)","var(--crit)","var(--accent)"],o=[void 0,"7 4","2 3","10 3 2 3","4 4","1 3"];function a(e){return n.find(t=>t.metric===e)??null}function u(e,t){let r=Math.max(0,t),n=e.colorSlot+r,s=(r+Math.floor(n/l.length))%o.length;return{color:l[n%l.length],dash:o[s]}}let c={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPU metrics",disks:"Disk metrics",network:"Network metrics"};function d(e,t){let r=a(t);if(null===r||void 0===e)return{available:!0,reason:null};let n=e.inventory?.capabilities?.[r.family];if(!n||"supported"===n.status)return{available:!0,reason:null};let s=n.reason?.trim();return{available:!1,reason:s?`${c[r.family]}: ${n.status} — ${s}`:`${c[r.family]} are ${n.status} on this machine.`}}function m(e){if(void 0===e)return[];let t=[],r=r=>{!(t.length>=16)&&d(e,r).available&&t.push(r)};r("cpu.usage"),r("memory.used");let n=function(e){let t=e.inventory?.memory.swapTotalBytes;if("number"==typeof t)return t;let r=e.metrics?.payload.swap;return r?.status==="ok"?r.totalBytes:null}(e);return null!==n&&n>0&&r("swap.used"),p(e,[]).length>0&&(r("gpu.utilization"),r("gpu.memory.used")),t}function f(e){let t=e.includes(":")?e.slice(e.indexOf(":")+1):e;return t.length<=18?t:`${t.slice(0,10)}…${t.slice(-4)}`}function p(e,t){let r=new Set(t.filter(e=>e.metric.startsWith("gpu.")&&""!==e.resourceId&&e.points.some(e=>null!==e.avg||null!==e.min||null!==e.max)).map(e=>e.resourceId)),n=[],s=new Set;(e?.inventory?.gpus??[]).forEach(e=>{let t="supported"===e.telemetry;(t||r.has(e.id))&&(s.add(e.id),n.push({id:e.id,label:e.name.trim()||f(e.id),index:n.length,totalBytes:e.memoryTotalBytes,supported:t,hasHistory:r.has(e.id)}))});let i=e?.metrics?.payload.gpus;if(i?.status==="ok")for(let e of i.devices)s.has(e.id)||"ok"!==e.status||(s.add(e.id),n.push({id:e.id,label:f(e.id),index:n.length,totalBytes:e.memoryTotalBytes,supported:!0,hasHistory:r.has(e.id)}));for(let e of[...r].sort())s.has(e)||n.push({id:e,label:e.startsWith("pci:")?`Previously detected GPU (${f(e)})`:f(e),index:n.length,totalBytes:null,supported:!0,hasHistory:!0});return n}function h(e,t,r){if(""===r)return a(t)?.shortLabel??"Total";let n=a(t);if(null===n)return f(r);switch(n.family){case"gpus":{let t=e?.inventory?.gpus.find(e=>e.id===r);return t?.name.trim()||f(r)}case"disks":{if(t.startsWith("fs.")){let t=e?.inventory?.filesystems.find(e=>e.id===r);return t?.mountPoint||f(r)}let n=e?.inventory?.disks.find(e=>e.id===r);return n?.name||f(r)}case"network":{let t=e?.inventory?.network.find(e=>e.id===r);return t?.name||f(r)}case"cpu":{let e=/^core:(\d+)$/.exec(r);return e?`Core ${e[1]}`:f(r)}default:return f(r)}}function g(e){switch(e){case"percent":return"%";case"bytes":return"bytes";case"bytes_per_second":return"bytes/s";case"celsius":return"\xb0C";case"watts":return"W";case"milliseconds":return"ms";default:return e}}},5078:(e,t,r)=>{r.d(t,{Ah:()=>d,I_:()=>h,O5:()=>p,Vw:()=>M,bf:()=>v,dd:()=>c,ei:()=>m,fH:()=>g,ly:()=>s,pI:()=>n,r6:()=>f,zp:()=>i});let n=[{id:"10m",shortLabel:"10m",label:"Last 10 minutes",ms:6e5,refreshMs:1e3},{id:"1h",shortLabel:"1h",label:"Last hour",ms:36e5,refreshMs:1e3},{id:"6h",shortLabel:"6h",label:"Last 6 hours",ms:216e5,refreshMs:1e3},{id:"24h",shortLabel:"24h",label:"Last 24 hours",ms:864e5,refreshMs:1e3},{id:"7d",shortLabel:"7d",label:"Last 7 days",ms:6048e5,refreshMs:1e3}];function s(e){return n.find(t=>t.id===e)??n[0]}function i(e){return s(e).refreshMs}let l=["B","KiB","MiB","GiB","TiB","PiB"];function o(e){let t=Math.abs(e),r=0;for(;t>=1024&&r<l.length-1;)t/=1024,r+=1;return{value:e<0?-t:t,unit:l[r]}}function a(e,t){return String(Number(e.toFixed(t)))}function u(e,t=""){let{value:r,unit:n}=o(e),s=Math.abs(r)>=100?0:1;return`${a(r,s)} ${n}${t}`}function c(e,t){if(null==e||!Number.isFinite(e))return"—";switch(t){case"percent":return`${a(e,1)}%`;case"bytes":return u(e);case"bytes_per_second":return u(e,"/s");case"celsius":return`${a(e,1)}\xb0C`;case"watts":return`${a(e,1)} W`;case"milliseconds":return`${a(e,10>Math.abs(e)?2:1)} ms`;default:return a(e,2)}}function d(e,t){if(!Number.isFinite(e))return"—";switch(t){case"percent":return`${a(e,0)}%`;case"bytes":case"bytes_per_second":{let{value:r,unit:n}=o(e),s=Math.abs(r)>=10||0===r?0:1;return`${a(r,s)} ${n}${"bytes_per_second"===t?"/s":""}`}case"celsius":return`${a(e,0)}\xb0C`;case"watts":return`${a(e,0)} W`;case"milliseconds":return`${a(e,+(10>Math.abs(e)))} ms`;default:return a(e,1)}}function m(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function f(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"medium"})}function p(e,t){let r=new Date(e);return t>=1728e5?r.toLocaleDateString(void 0,{month:"short",day:"numeric"}):t>=864e5?r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function h(e){let t=Math.max(0,e);return t>=36e5?`${a(t/36e5,1)} h`:t>=6e4?`${a(t/6e4,1)} min`:`${a(t/1e3,1)} s`}function g(e,t,r){let n=e.filter(e=>e.toMs>=t&&e.fromMs<=r);if(0===n.length)return"No recorded gaps in this range.";let s=n.filter(e=>"dropped"===e.kind).length,i=n.length-s,l=[];i>0&&l.push(`${i} missed interval${1===i?"":"s"}`),s>0&&l.push(`${s} dropped report${1===s?"":"s"}`);let o=[...new Set(n.map(e=>e.reason).filter(e=>"string"==typeof e&&e.length>0))],a=o.length>0?` (${o.slice(0,3).join("; ")})`:"";return`${l.join(" and ")}${a}.`}function y(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function b(e){return"number"==typeof e&&Number.isFinite(e)}function x(e){return null===e||b(e)}function v(e){if(!y(e)||"string"!=typeof e.machineId||0===e.machineId.length||!b(e.fromMs)||!b(e.toMs)||e.toMs<=e.fromMs||!b(e.stepMs)||e.stepMs<=0||"raw"!==e.tier&&"1m"!==e.tier&&"1h"!==e.tier||"boolean"!=typeof e.truncated||!b(e.elapsedMs)||!Array.isArray(e.series)||!Array.isArray(e.gaps))return null;let t=[];for(let r of e.series){if(!y(r)||"string"!=typeof r.metric||"string"!=typeof r.resourceId||"string"!=typeof r.unit||!Array.isArray(r.points))return null;let e=[];for(let t of r.points){if(!y(t)||!b(t.t)||!x(t.min)||!x(t.max)||!x(t.avg))return null;e.push({t:t.t,min:t.min,max:t.max,avg:t.avg})}t.push({metric:r.metric,resourceId:r.resourceId,unit:r.unit,points:e})}let r=[];for(let t of e.gaps){if(!y(t)||!b(t.fromMs)||!b(t.toMs)||"missing"!==t.kind&&"dropped"!==t.kind)return null;let e={fromMs:t.fromMs,toMs:t.toMs,kind:t.kind};"string"==typeof t.reason&&(e.reason=t.reason),b(t.droppedRecords)&&(e.droppedRecords=t.droppedRecords),r.push(e)}return{machineId:e.machineId,fromMs:e.fromMs,toMs:e.toMs,stepMs:e.stepMs,tier:e.tier,series:t,gaps:r,truncated:e.truncated,elapsedMs:e.elapsedMs}}function M(e,t,r,n,i=600,l){let{fromMs:o,toMs:a}={fromMs:n-s(r).ms,toMs:n},u=new URLSearchParams({machineId:e,metrics:t.join(","),from:String(Math.floor(o)),to:String(Math.floor(a)),maxPoints:String(i)});return void 0!==l&&u.set("coreIds",l.join(",")),`/api/history?${u.toString()}`}},6304:(e,t,r)=>{function n(e,t,r,n){if(n.some(e=>t>e.fromMs&&t<e.toMs))return null;let s=0,i=e.length;for(;s<i;){let r=s+i>>>1;e[r].t<t?s=r+1:i=r}let l=e[s-1],o=e[s],a=l&&(!o||t-l.t<=o.t-t)?l:o;return!a||Math.abs(a.t-t)>r/2||n.some(e=>e.toMs>Math.min(t,a.t)&&e.fromMs<Math.max(t,a.t))?null:a}function s(e){return[...new Set(e.flatMap(e=>e.points.map(e=>e.t)))].sort((e,t)=>e-t).map(e=>({t:e,min:null,max:null,avg:null}))}function i(e,t,r,n,s,l=0){return Math.round(n+Math.max(0,Math.min(1,((r>0?(e-t)/r:0)-l)/(1-2*l)))*(s-n))}function l(e,t,r){return 0===e.length?null:"Home"===r?e[0].t:"End"===r||null===t?e.at(-1).t:"ArrowLeft"===r?[...e].reverse().find(e=>e.t<t)?.t??e[0].t:"ArrowRight"===r?e.find(e=>e.t>t)?.t??e.at(-1).t:t}r.d(t,{X:()=>s,bO:()=>n,o7:()=>l,yk:()=>i})},7284:(e,t,r)=>{r.d(t,{t:()=>c});var n=r(5155),s=r(2115),i=r(7726),l=r(5078),o=r(4567),a=r(6304),u=r(4150);function c(e){let{title:t,unit:r,series:c,fromMs:d,toMs:m,stepMs:f,gaps:p,hiddenKeys:h,onToggleSeries:g,emptyMessage:y,note:b}=e,x=(0,s.useMemo)(()=>c.filter(e=>!h.has(e.key)),[c,h]),v=(0,u.Au)({series:x,fromMs:d,toMs:m,stepMs:f,gaps:p}),M=(0,s.useRef)(null),k=(0,s.useMemo)(()=>x.flatMap(e=>e.points),[x]),w=k.some(e=>null!==e.avg||null!==e.min||null!==e.max),$=Math.max(1,m-d),j=(0,s.useMemo)(()=>(0,i.$z)(p,d,m,k),[p,d,m,k]),S=(0,s.useMemo)(()=>(0,i.kk)(r,k.flatMap(e=>[e.min,e.max,e.avg]).filter(e=>null!==e)),[r,k]),L=Math.max(1e-9,S.max-S.min),N=(0,s.useCallback)(e=>6+(Math.min(m,Math.max(d,e))-d)/$*788,[d,m,$]),P=(0,s.useCallback)(e=>6+(1-(e-S.min)/L)*148,[S.min,L]),I=(0,s.useMemo)(()=>x.map(t=>{let r=(0,i.o)(t.points,{stepMs:f,gaps:j,fromMs:d,toMs:m}).map(t=>(0,i.SG)(t,e.maxDrawPoints??601,f));return{...t,segments:r,envelope:r.filter(e=>e.length>1).map(e=>{let t=e.map(e=>`${N(e.t).toFixed(2)},${P(e.max??e.avg).toFixed(2)}`),r=[...e].reverse().map(e=>`${N(e.t).toFixed(2)},${P(e.min??e.avg).toFixed(2)}`);return`M${t.join("L")}L${r.join("L")}Z`}).join(" "),path:r.filter(e=>e.length>1).map(e=>e.map((e,t)=>`${0===t?"M":"L"}${N(e.t).toFixed(2)},${P(e.avg).toFixed(2)}`).join(" ")).join(" ")}}),[x,e.maxDrawPoints,f,j,d,m,N,P]),C=(0,s.useMemo)(()=>(function(e,t,r,n,s,o){if(0===r.length)return`${e} chart: no series selected.`;let a=r.map(e=>{let r=(0,i.T6)(e.points);return`${e.label}: ${function(e,t){let r=[];if(null!==e.latest){let n=null!==e.latestT?(0,l.ei)(e.latestT):null;r.push(`latest ${(0,l.dd)(e.latest,t)}${n?` at ${n}`:""}`)}return r.push(`average ${(0,l.dd)(e.avg,t)}`),null!==e.min&&null!==e.max&&r.push(`recorded range ${(0,l.dd)(e.min,t)} to ${(0,l.dd)(e.max,t)}`),r.join(", ")}(r,t)}`}),u=o>0?`${o} shaded interval${1===o?"":"s"} without stored data.`:"";return`${e} time-series chart. ${a.join(". ")}. ${u} Time range ${(0,l.ei)(n)} to ${(0,l.ei)(s)}.`})(t,r,x,d,m,j.length),[t,r,x,d,m,j.length]),A=(0,s.useMemo)(()=>new Map(c.map(e=>[e.key,(0,i.T6)(e.points)])),[c]),D=null===v.timeMs?[]:x.map(e=>({...e,point:(0,a.bO)(e.points,v.timeMs,f,p)})),F=null===v.timeMs?null:N(v.timeMs),R=`${v.id}-tooltip`,T=`${v.id}-instructions`,U=(0,s.useMemo)(()=>(0,n.jsxs)(n.Fragment,{children:[S.ticks.map(e=>(0,n.jsx)("line",{x1:6,x2:794,y1:P(e),y2:P(e),stroke:"var(--border)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${e}`)),j.map(e=>(0,n.jsx)("rect",{x:N(e.fromMs),y:6,width:Math.max(1,N(e.toMs)-N(e.fromMs)),height:148,fill:"var(--muted-foreground)",opacity:"0.09"},`gap-${e.fromMs}-${e.toMs}-${e.kind}`)),I.map(e=>{let t=e.envelope;return""===t?null:(0,n.jsx)("path",{d:t,fill:e.color,opacity:"0.14",stroke:"none"},`band-${e.key}`)}),I.map(e=>{let t=e.path;return""===t?null:(0,n.jsx)("path",{d:t,fill:"none",stroke:e.color,strokeWidth:"2",strokeDasharray:e.dash,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},`line-${e.key}`)}),I.flatMap(e=>e.segments.filter(e=>1===e.length).map(t=>{let r=t[0],s=N(r.t),i=P(r.avg);return(0,n.jsx)("line",{x1:s-2.5,x2:s+2.5,y1:i,y2:i,stroke:e.color,strokeWidth:"2.5",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"},`dot-${e.key}-${r.t}`)}))]}),[S,N,P,j,I]);return(0,n.jsxs)("figure",{className:`flex min-w-0 flex-col gap-2 ${e.className??""}`,children:[(0,n.jsxs)("div",{className:"flex min-h-8 flex-wrap items-center justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-xs font-medium tracking-tight text-foreground",children:t}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("span",{className:"tnum shrink-0 text-xs text-muted-foreground",children:b??(0,o.RL)(r)}),e.action]})]}),w?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,n.jsx)("div",{"aria-hidden":!0,className:"flex h-40 w-14 shrink-0 flex-col justify-between py-0.5 text-right text-xs leading-none tnum text-muted-foreground",children:[...S.ticks].reverse().map(e=>(0,n.jsx)("span",{children:(0,l.Ah)(e,r)},e))}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"relative touch-pan-y select-none",onPointerLeave:e=>{"mouse"===e.pointerType&&v.clear()},onPointerDown:e=>{if("mouse"===e.pointerType)return;e.currentTarget.setPointerCapture(e.pointerId);let t=M.current?.getBoundingClientRect();t&&v.inspect((0,a.yk)(e.clientX,t.left,t.width,d,m,.0075))},onPointerCancel:v.clear,onContextMenu:e=>e.preventDefault(),onPointerMove:e=>{let t=M.current?.getBoundingClientRect();t&&v.inspect((0,a.yk)(e.clientX,t.left,t.width,d,m,.0075))},children:[(0,n.jsx)("p",{id:T,className:"sr-only",children:"Touch and drag horizontally to inspect readings. Use Left and Right arrows to inspect recorded readings, Home or End to jump, and Escape to dismiss."}),(0,n.jsxs)("svg",{ref:M,viewBox:"0 0 800 160",preserveAspectRatio:"none",role:"img","aria-label":C,tabIndex:0,"aria-describedby":`${T}${v.active?` ${R}`:""}`,onFocus:v.onFocus,onBlur:v.clear,onKeyDown:v.onKeyDown,className:"block h-40 w-full cursor-crosshair rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:[(0,n.jsx)("title",{children:t}),U,null!==F?(0,n.jsxs)("g",{"aria-hidden":!0,pointerEvents:"none",children:[(0,n.jsx)("line",{x1:F,x2:F,y1:6,y2:154,stroke:"var(--muted-foreground)",strokeWidth:"1",strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke"}),D.map(({key:e,color:t,point:r})=>r?.avg==null?null:(0,n.jsx)("circle",{cx:N(r.t),cy:P(r.avg),r:"3.5",fill:t,stroke:"var(--card)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"},e))]}):null]}),v.active&&null!==v.timeMs&&null!==F?(0,n.jsx)(u.eg,{id:R,timeMs:v.timeMs,fraction:F/800,unit:r,readings:D}):null]}),(0,n.jsx)("div",{"aria-hidden":!0,className:"mt-1 flex justify-between gap-2 text-xs leading-tight tnum text-muted-foreground",children:(0,i.Cf)(d,m).map((e,t,r)=>(0,n.jsx)("span",{className:`${0===t?"text-left":t===r.length-1?"text-right":"hidden text-center sm:inline"}`,children:(0,l.O5)(e,$)},e))})]})]}),(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:c.map(e=>{let t=!h.has(e.key),s=A.get(e.key);return(0,n.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",title:t?`Hide ${e.label}`:`Show ${e.label}`,children:[(0,n.jsx)("input",{type:"checkbox",checked:t,onChange:()=>g(e.key),className:"peer sr-only"}),(0,n.jsx)("span",{"aria-hidden":!0,className:"flex h-4 w-5 shrink-0 items-center justify-center rounded-sm peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:[outline-color:var(--focus)]",children:(0,n.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,n.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:e.color,strokeWidth:"2.5",strokeDasharray:e.dash,strokeLinecap:"round"})})}),(0,n.jsx)("span",{className:t?"text-foreground":"text-muted-foreground line-through",children:e.label}),(0,n.jsx)("span",{className:"tnum text-muted-foreground",children:(0,l.dd)(s.latest,r)})]},`legend-${e.key}`)})})]}):(0,n.jsx)("div",{className:"flex min-h-32 items-center justify-center rounded-lg border border-dashed border-border px-4 py-6 text-center text-xs text-muted-foreground",children:0===c.length?y:0===x.length?"All series are hidden. Re-enable one in the legend below.":y}),!w&&c.length>0?(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:c.map(e=>{let t=!h.has(e.key);return(0,n.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",children:[(0,n.jsx)("input",{type:"checkbox",checked:t,onChange:()=>g(e.key),className:"peer sr-only"}),(0,n.jsx)("span",{"aria-hidden":!0,className:"flex h-4 w-5 shrink-0 items-center justify-center peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:[outline-color:var(--focus)]",children:(0,n.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,n.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:e.color,strokeWidth:"2.5",strokeDasharray:e.dash,strokeLinecap:"round"})})}),(0,n.jsx)("span",{className:t?"text-foreground":"text-muted-foreground line-through",children:e.label})]},`legend-empty-${e.key}`)})}):null]})}},7726:(e,t,r)=>{function n(e){return null!==e.avg&&Number.isFinite(e.avg)}function s(e){return null!==e&&Number.isFinite(e)?e:null}function i(e){let t=[];for(let r of e){let e=t.at(-1);if(void 0!==e&&r.fromMs<=e.toMs){e.toMs=Math.max(e.toMs,r.toMs),"missing"===e.kind&&"dropped"===r.kind&&(e.kind="dropped"),void 0===e.reason&&void 0!==r.reason&&(e.reason=r.reason),void 0===e.droppedRecords&&void 0!==r.droppedRecords&&(e.droppedRecords=r.droppedRecords);continue}t.push({...r})}return t}function l(e,t,r,s){let l=i(e.map(e=>({...e,fromMs:Math.max(t,e.fromMs),toMs:Math.min(r,e.toMs)})).filter(e=>e.toMs>e.fromMs).sort((e,t)=>e.fromMs-t.fromMs||e.toMs-t.toMs));return void 0===s?l:function(e,t,r,s){if(0===e.length)return[];let l=[...new Set(t.filter(n).map(e=>e.t).filter(e=>Number.isFinite(e)))].sort((e,t)=>e-t),o=[];for(let t of e){let e=Math.max(r,Math.min(s,t.fromMs)),n=Math.max(r,Math.min(s,t.toMs));if(n<=e)continue;let i=Math.max(r,function(e,t){let r=0,n=e.length;for(;r<n;){let s=r+n>>>1;e[s]<=t?r=s+1:n=s}return r>0?e[r-1]:null}(l,e)??e),a=Math.min(s,function(e,t){let r=0,n=e.length;for(;r<n;){let s=r+n>>>1;e[s]<t?r=s+1:n=s}return r<e.length?e[r]:null}(l,n)??n);a<=i||o.push({...t,fromMs:i,toMs:a})}return o.sort((e,t)=>e.fromMs-t.fromMs||e.toMs-t.toMs),i(o)}(l,s,t,r)}function o(e,t,r){return Math.max(e,"1h"===t?36e5:"1m"===t?6e4:100,r??0)}function a(e,t){let r=[...e].sort((e,t)=>e.t-t.t),s=l(t.gaps,t.fromMs,t.toMs),i=Math.max(1,t.stepMs),o=[],a=[],u=()=>{a.length>0&&o.push(a),a=[]};for(let e of r){if(!n(e)){u();continue}let t=a.at(-1);if(void 0!==t){let r=!e.merged&&!t.merged&&(e.t<t.t||e.t-t.t>1.5*i),n=!0===e.gapBefore||function(e,t,r){return r.some(r=>r.toMs>e&&r.fromMs<t)}(t.t,e.t,s);(r||n)&&u()}a.push(e)}return u(),o}function u(e,t,r){if(t<=0)return[];let i=[...e].sort((e,t)=>e.t-t.t);if(i.length<=t)return i.map(e=>({...e}));let l=Math.max(2,Math.ceil(i.length/t)),o=Math.max(1,r),a=[],u=[],c=!1,d=null,m=()=>{if(0===u.length)return;let e=null,t=null,r=0,n=0;for(let i of u){let l=s(i.min),o=s(i.max);null!==l&&(null===e||l<e)&&(e=l),null!==o&&(null===t||o>t)&&(t=o);let a=s(i.avg);null!==a&&(r+=a,n+=1)}a.push({t:u[0].t,min:e,max:t,avg:n>0?r/n:null,...u.length>1?{merged:!0}:{},...c?{gapBefore:!0}:{}}),u=[],c=!1};for(let e of i){if(!n(e)){m(),a.push({...e}),d=null;continue}let t=null!==d&&e.t>=d.t&&e.t-d.t<=1.5*o;u.length>0&&(!t||u.length>=l)&&m(),0===u.length&&(c=null!==d&&!t),u.push(e),d=e}return m(),a}function c(e){let t=null,r=null,n=0,i=0,l=null,o=null,a=null,u=null;for(let c of e){if(null===c.avg)continue;(null===a||c.t<a)&&(a=c.t),(null===u||c.t>u)&&(u=c.t);let e=s(c.min),d=s(c.max);null!==e&&(null===t||e<t)&&(t=e),null!==d&&(null===r||d>r)&&(r=d),null!==c.avg&&Number.isFinite(c.avg)&&(n+=c.avg,i+=1,l=c.avg,o=c.t)}return{count:i,min:t,max:r,avg:i>0?n/i:null,latest:l,latestT:o,firstT:a,lastT:u}}function d(e){if(!Number.isFinite(e)||e<=0)return 1;let t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function m(e,t){if("percent"===e)return{min:0,max:100,ticks:[0,25,50,75,100]};let r=t.filter(e=>null!==e&&Number.isFinite(e));if(0===r.length)return{min:0,max:1,ticks:[0,1]};let n=Math.min(...r),s=Math.max(...r);if("celsius"===e){let e=Math.max(1,(s-n)*.1);n=5*Math.floor((n-e)/5),s=5*Math.ceil((s+e)/5)}else n=0,s=s>0?s:1;s<=n&&(s=n+1);let i=d((s-n)/4),l=Math.floor(n/i)*i,o=Math.ceil(s/i)*i,a=function(e,t,r=4){if(!Number.isFinite(e)||!Number.isFinite(t))return[0,1];if(t<=e)return[e];let n=d((t-e)/Math.max(1,r)),s=Math.ceil(e/n)*n,i=[];for(let e=s;e<=t+.001*n&&i.length<20;e+=n)i.push(Number(e.toPrecision(12)));return i.length>0?i:[e,t]}(l,o,4);return{min:l,max:o,ticks:a}}function f(e,t,r=4){let n=Math.max(2,Math.floor(r)),s=Math.max(0,t-e);return Array.from({length:n},(t,r)=>e+s*r/(n-1))}r.d(t,{$z:()=>l,Cf:()=>f,SG:()=>u,T6:()=>c,jl:()=>o,kk:()=>m,o:()=>a})},9429:(e,t,r)=>{r.d(t,{n:()=>l});var n=r(2115),s=r(5078);async function i(e){let t=null;try{let r=await e.json();if(null!==r&&"object"==typeof r&&"error"in r){let e=r.error;"string"==typeof e&&(t=e)}}catch{}switch(e.status){case 401:return{kind:"unauthorized",message:"Your session is no longer accepted."};case 403:return{kind:"denied",message:t??"You do not have access to this machine's history."};case 404:return{kind:"missing",message:t??"This machine is not available to the hub."};case 429:return{kind:"rate-limited",message:t??"The hub is limiting history requests."};case 503:return{kind:"unavailable",message:t??"History is temporarily unavailable."};default:return{kind:"invalid",message:t??`The hub could not answer this history query (${e.status}).`}}}function l({machineId:e,metricsKey:t,coreIdsKey:r,range:o,enabled:a=!0,autoRefresh:u=!0,refreshNonce:c=0}){let[d,m]=(0,n.useState)({machineId:e,metricsKey:t,coreIdsKey:r,range:o}),f=d.machineId===e&&d.range===o;(0,n.useEffect)(()=>{if(!f)return void m({machineId:e,metricsKey:t,coreIdsKey:r,range:o});let n=window.setTimeout(()=>m({machineId:e,metricsKey:t,coreIdsKey:r,range:o}),300);return()=>window.clearTimeout(n)},[e,t,r,o,f]);let p=f?d:{machineId:e,metricsKey:t,coreIdsKey:r,range:o},h=p.metricsKey,g=p.coreIdsKey,y=`${e}|${h}|${o}|${g??"all"}`,[b,x]=(0,n.useState)(null),[v,M]=(0,n.useState)(null),[k,w]=(0,n.useState)(null),$=(0,n.useRef)(c);return(0,n.useEffect)(()=>{let t=$.current!==c;if($.current=c,!a||!e||!h)return;let r=!0,n=!1,l=!1,d=-1/0,m=new AbortController,f=(0,s.zp)(o),p=async(t=!1)=>{if(r&&!n&&!l){n=!0,d=Date.now(),w({key:y,manual:t});try{let t=await fetch((0,s.Vw)(e,h.split(","),o,Date.now(),600,void 0===g?void 0:g.split(",").filter(Boolean)),{signal:"function"!=typeof AbortSignal.any||"function"!=typeof AbortSignal.timeout?m.signal:AbortSignal.any([m.signal,AbortSignal.timeout(2e4)]),cache:"no-store",headers:{Accept:"application/json"}});if(!t.ok)throw await i(t);let n=(0,s.bf)(await t.json());if(null===n||n.machineId!==e)throw{kind:"invalid",message:"Unexpected history response."};if(!r)return;x({key:y,range:o,result:n,loadedAt:Date.now()}),M(null)}catch(t){if(!r||m.signal.aborted)return;let e=null!==t&&"object"==typeof t&&"kind"in t&&"message"in t&&"string"==typeof t.message?t:{kind:"network",message:"Could not reach the hub. Try again."};l="rate-limited"===e.kind,["unauthorized","denied","missing"].includes(e.kind)&&x(null),M({key:y,error:e})}finally{n=!1,r&&w(null)}}},b=()=>{"visible"!==document.visibilityState||Date.now()-d<f||p()};p(t);let v=u?window.setInterval(b,f):null;return u&&document.addEventListener("visibilitychange",b),()=>{r=!1,m.abort(),null!==v&&window.clearInterval(v),document.removeEventListener("visibilitychange",b)}},[a,e,h,g,o,y,u,c]),{data:a&&b?.result.machineId===e&&b.range===o?b:null,error:a&&v?.key===y?v.error:null,loading:a&&k?.key===y,manualRefreshing:a&&k?.key===y&&k.manual}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[944],{91:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return s},urlObjectKeys:function(){return i}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6388)._(r(1393)),l=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",u=e.hash||"",i=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),i&&"object"==typeof i&&(i=String(o.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==s?(s="//"+(s||""),a&&"/"!==a[0]&&(a="/"+a)):s||(s=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${a}${c}${u}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return u(e)}},257:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]])},460:(e,t,r)=>{r.d(t,{D:()=>s,N:()=>c});var n=r(2115),a=(e,t,r,n,a,o,l,u)=>{let i=document.documentElement,s=["light","dark"];function c(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&o?a.map(e=>o[e]||e):a;r?(i.classList.remove(...n),i.classList.add(o&&o[t]?o[t]:t)):i.setAttribute(e,t)}),r=t,u&&s.includes(r)&&(i.style.colorScheme=r)}if(n)c(n);else try{let e=localStorage.getItem(t)||r,n=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(n)}catch(e){}},o=["light","dark"],l="(prefers-color-scheme: dark)",u=n.createContext(void 0),i={setTheme:e=>{},themes:[]},s=()=>{var e;return null!=(e=n.useContext(u))?e:i},c=e=>n.useContext(u)?n.createElement(n.Fragment,null,e.children):n.createElement(h,{...e}),d=["light","dark"],h=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:a=!0,storageKey:i="theme",themes:s=d,defaultTheme:c=r?"system":"light",attribute:h="data-theme",value:k,children:g,nonce:v,scriptProps:b})=>{let[A,M]=n.useState(()=>p(i,c)),[w,x]=n.useState(()=>"system"===A?m():A),S=k?Object.values(k):s,C=n.useCallback(e=>{let n=e;if(!n)return;"system"===e&&r&&(n=m());let l=k?k[n]:n,u=t?y(v):null,i=document.documentElement,s=e=>{"class"===e?(i.classList.remove(...S),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(h)?h.forEach(s):s(h),a){let e=o.includes(c)?c:null,t=o.includes(n)?n:e;i.style.colorScheme=t}null==u||u()},[v]),E=n.useCallback(e=>{let t="function"==typeof e?e(A):e;M(t);try{localStorage.setItem(i,t)}catch(e){}},[A]),P=n.useCallback(t=>{x(m(t)),"system"===A&&r&&!e&&C("system")},[A,e]);n.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(P),P(e),()=>e.removeListener(P)},[P]),n.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?M(e.newValue):E(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),n.useEffect(()=>{C(null!=e?e:A)},[e,A]);let j=n.useMemo(()=>({theme:A,setTheme:E,forcedTheme:e,resolvedTheme:"system"===A?w:A,themes:r?[...s,"system"]:s,systemTheme:r?w:void 0}),[A,E,e,w,r,s]);return n.createElement(u.Provider,{value:j},n.createElement(f,{forcedTheme:e,storageKey:i,attribute:h,enableSystem:r,enableColorScheme:a,defaultTheme:c,value:k,themes:s,nonce:v,scriptProps:b}),g)},f=n.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:o,enableColorScheme:l,defaultTheme:u,value:i,themes:s,nonce:c,scriptProps:d})=>{let h=JSON.stringify([r,t,u,e,s,i,o,l]).slice(1,-1);return n.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:`(${a.toString()})(${h})`}})}),p=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},m=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},857:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={DecodeError:function(){return m},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return v},NormalizeError:function(){return k},PageNotFoundError:function(){return g},SP:function(){return p},ST:function(){return y},WEB_VITALS:function(){return a},execOnce:function(){return o},getDisplayName:function(){return c},getLocationOrigin:function(){return i},getURL:function(){return s},isAbsoluteUrl:function(){return u},isResSent:function(){return d},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return A}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=["CLS","FCP","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function i(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function s(){let{href:e}=window.location,t=i();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let p="u">typeof performance,y=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class k extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function A(e){return JSON.stringify({message:e.message,stack:e.stack})}},1134:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},1172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=r(2115);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1735:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},2915:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},2955:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},3321:(e,t,r)=>{var n=r(4645);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},3896:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},4201:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},4268:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},6914:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},7029:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},7233:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]])},7422:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},8500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return k},useLinkStatus:function(){return v}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6388),l=r(5155),u=o._(r(2115)),i=r(91),s=r(2909),c=r(1172),d=r(857),h=r(127),f=r(4616),p=r(4972),y=r(9470),m=r(7565);function k(e){var t;let n,a,o,[k,v]=(0,u.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,u.useRef)(null),{href:A,as:M,children:w,prefetch:x=null,passHref:S,replace:C,shallow:E,scroll:P,onClick:j,onMouseEnter:L,onTouchStart:T,legacyBehavior:_=!1,onNavigate:N,transitionTypes:O,ref:z,unstable_dynamicOnHover:R,...$}=e;n=w,_&&("string"==typeof n||"number"==typeof n)&&(n=(0,l.jsx)("a",{children:n}));let I=u.default.useContext(s.AppRouterContext),U=!1!==x,B=!1===x?"none":!0===x?"full":"auto",F="none"!==B?"auto"===B?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,V="string"==typeof(t=M||A)?t:(0,i.formatUrl)(t);if(_){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");a=u.default.Children.only(n)}let q=_?a&&"object"==typeof a&&a.ref:z,D,K=u.default.useCallback(e=>(null!==I&&(b.current=(0,p.mountLinkInstance)(e,V,I,F,U,v,D)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,V,I,F,v,D]),W={ref:(0,c.useMergedRef)(K,q),onClick(e){_||"function"!=typeof j||j(e),_&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(e),!I||e.defaultPrevented||function(e,t,n,a,o,l,u,i="none"){{let s,{nodeName:c}=e.currentTarget;if("A"===c.toUpperCase()&&((s=e.currentTarget.getAttribute("target"))&&"_self"!==s||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))return;if(!(0,y.isLocalURL)(t)){a&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=r(5287);d(t,a?"replace":"push",!1===o?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,u,i)}}(e,V,b,C,P,N,O,B)},onMouseEnter(e){_||"function"!=typeof L||L(e),_&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)},onTouchStart:function(e){_||"function"!=typeof T||T(e),_&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)}};return(0,d.isAbsoluteUrl)(V)?W.href=V:_&&!S&&("a"!==a.type||"href"in a.props)||(W.href=(0,h.addBasePath)(V)),o=_?u.default.cloneElement(a,W):(0,l.jsx)("a",{...$,...W,children:n}),(0,l.jsx)(g.Provider,{value:k,children:o})}let g=(0,u.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,u.useContext)(g);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8698:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(2115);let a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,n.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:u="",children:i,iconNode:s,...c},d)=>(0,n.createElement)("svg",{ref:d,...o,width:t,height:t,stroke:e,strokeWidth:l?24*Number(r)/Number(t):r,className:a("lucide",u),...c},[...s.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(i)?i:[i]])),u=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...o},u)=>(0,n.createElement)(l,{ref:u,iconNode:t,className:a(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o}));return r.displayName=`${e}`,r}},8731:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},9145:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},9470:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=r(857),a=r(8512);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},9764:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
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"}]])},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,[944,939,103,441,794,358],()=>e(e.s=4891)),_N_E=e.O()}]);
|