rigscope 0.1.1 → 0.1.3
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 +2 -2
- package/.next/build-manifest.json +2 -2
- 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 +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- 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 +3 -3
- package/.next/server/app/administration.segments/_full.segment.rsc +3 -3
- package/.next/server/app/administration.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/administration.segments/administration/__PAGE__.segment.rsc +3 -3
- 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 +3 -3
- package/.next/server/app/alerts.segments/_full.segment.rsc +3 -3
- package/.next/server/app/alerts.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/alerts.segments/alerts/__PAGE__.segment.rsc +3 -3
- 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 +3 -3
- package/.next/server/app/connections.segments/_full.segment.rsc +3 -3
- package/.next/server/app/connections.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/connections.segments/connections/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/history/page.js +2 -2
- 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 +6 -6
- package/.next/server/app/history.segments/_full.segment.rsc +6 -6
- package/.next/server/app/history.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/history.segments/history/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/machines/[machineId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/processes/page.js +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 +4 -4
- package/.next/server/app/processes.segments/_full.segment.rsc +4 -4
- package/.next/server/app/processes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/processes.segments/processes/__PAGE__.segment.rsc +4 -4
- package/.next/server/app-paths-manifest.json +2 -2
- package/.next/server/chunks/161.js +1 -1
- package/.next/server/chunks/168.js +1 -1
- 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/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.html +1 -0
- package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.meta +1 -0
- package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.rsc +26 -0
- package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.segments/_full.segment.rsc +26 -0
- package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.segments/_tree.segment.rsc +4 -0
- package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.segments/login/__PAGE__.segment.rsc +32 -0
- package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.html +1 -0
- package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.meta +1 -0
- package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.rsc +24 -0
- package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.segments/_full.segment.rsc +24 -0
- package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.segments/_not-found/__PAGE__.segment.rsc +30 -0
- package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.segments/_tree.segment.rsc +4 -0
- package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.html +1 -0
- package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.meta +1 -0
- package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.rsc +26 -0
- package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.segments/__PAGE__.segment.rsc +31 -0
- package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.segments/_full.segment.rsc +26 -0
- package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.segments/_tree.segment.rsc +3 -0
- package/.next/static/chunks/408-4fe7147e38981ee1.js +1 -0
- package/.next/static/chunks/939-514e554087419c71.js +1 -0
- package/.next/static/chunks/app/history/page-69ea64476ee5db85.js +3 -0
- package/.next/static/chunks/app/processes/{page-e471ed23a1d5632f.js → page-0e98a4a64e829c5f.js} +1 -1
- package/.next/static/css/3fbf75e4c471c6a8.css +1 -0
- package/ARCHITECTURE.md +30 -4
- package/CHANGELOG.md +47 -2
- package/dist/cli.cjs +1627 -1042
- package/dist/collector.cjs +138 -226
- package/dist/hub.cjs +7 -20
- package/dist/ops.cjs +160 -33
- package/dist/system.cjs +869 -450
- package/docs/bottlenecks.md +4 -6
- package/docs/configuration.md +2 -0
- package/docs/installation.md +42 -7
- package/docs/operations.md +32 -16
- package/docs/releasing.md +21 -17
- package/docs/system-installation.md +11 -2
- package/package.json +1 -2
- package/.next/static/chunks/408-dc6158e0bb450ef6.js +0 -1
- package/.next/static/chunks/939-2600d7c8e583d5ef.js +0 -1
- package/.next/static/chunks/app/history/page-1475454737279ee0.js +0 -3
- package/.next/static/css/e45c0c7ef5ba0336.css +0 -1
- /package/.next/static/{NE6PGEiJxUnKRceuzUWPc → xjSDCOO8Gpm5iPO9tyRG5}/_buildManifest.js +0 -0
- /package/.next/static/{NE6PGEiJxUnKRceuzUWPc → xjSDCOO8Gpm5iPO9tyRG5}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:"static/chunks/939-
|
|
2
|
+
2:"static/chunks/939-514e554087419c71.js"
|
|
3
3
|
3:"static/chunks/app/layout-4feff677c4071745.js"
|
|
4
4
|
4:I[2737,["939","$2","177","$3"],"ThemeProvider"]
|
|
5
5
|
5:I[9939,["939","$2","177","$3"],"LiveProvider"]
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
b:"$Sreact.suspense"
|
|
9
9
|
c:"static/chunks/157-0d36ebf66af048ac.js"
|
|
10
10
|
d:"static/chunks/103-c47318242b24e9ac.js"
|
|
11
|
-
e:"static/chunks/app/processes/page-
|
|
11
|
+
e:"static/chunks/app/processes/page-0e98a4a64e829c5f.js"
|
|
12
12
|
f:I[2701,["157","$c","939","$2","103","$d","952","$e"],"Sidebar"]
|
|
13
13
|
10:I[2394,["157","$c","939","$2","103","$d","952","$e"],"ThemeToggle"]
|
|
14
14
|
11:I[7339,["157","$c","939","$2","103","$d","952","$e"],"ProcessesView"]
|
|
@@ -18,11 +18,11 @@ f:I[2701,["157","$c","939","$2","103","$d","952","$e"],"Sidebar"]
|
|
|
18
18
|
17:"MetadataBoundary"
|
|
19
19
|
18:I[484,[],"$17"]
|
|
20
20
|
1a:I[7123,[],"default",1]
|
|
21
|
-
:HL["/_next/static/css/
|
|
21
|
+
:HL["/_next/static/css/3fbf75e4c471c6a8.css","style"]
|
|
22
22
|
9:X
|
|
23
23
|
a:[["children",{"s":"__PAGE__","h":512,"d":{"r":["$","$1","c",{"children":[["$","$b",null,{"fallback":["$","div",null,{"className":"relative flex h-dvh overflow-hidden bg-background text-foreground","children":[["$","a",null,{"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"}],["$","$Lf",null,{"machineId":"$undefined","machineView":"$undefined"}],["$","div",null,{"className":"flex min-w-0 flex-1 flex-col","children":[["$","header",null,{"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":[["$","h1",null,{"className":"truncate text-lg font-semibold tracking-tight","children":"Processes"}],["$","div",null,{"className":"flex items-center gap-3","children":[null,["$","$L10",null,{}]]}]]}],["$","main",null,{"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 overflow-y-auto","children":["$","div",null,{"className":"mx-auto flex w-full min-w-0 max-w-[1500px] flex-col","children":["$","section",null,{"className":"flex min-w-0 flex-col rounded-xl border border-border bg-card p-5 mt-2","children":[["$","div",null,{"className":"flex shrink-0 items-center justify-between gap-4","children":[["$","h2",null,{"className":"text-sm font-medium tracking-tight","children":"Process detail"}],null]}],["$","div",null,{"className":"mt-4 flex min-h-0 flex-1 flex-col","children":["$","p",null,{"role":"status","className":"py-10 text-center text-sm text-muted-foreground","children":"Loading the process view…"}]}]]}]}]}]]}]]}],"children":["$","$L11",null,{}]}],null,["$","$L12",null,{"children":["$","$b",null,{"name":"Next.MetadataOutlet","children":"$@13"}]}]]}],"p":false,"v":null}}]]
|
|
24
24
|
8:[["children",{"s":"processes","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"}]]
|
|
25
|
-
0:{"P":null,"c":["","processes"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/
|
|
25
|
+
0:{"P":null,"c":["","processes"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/3fbf75e4c471c6a8.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":[[["$","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."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L15",null,{"children":"$L16"}],["$","$L18",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$b",null,{"name":"Next.Metadata","children":"$L19"}]}],null]}],null]}],"p":false,"v":null}},"m":"$undefined","G":["$1a",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"xjSDCOO8Gpm5iPO9tyRG5"}
|
|
26
26
|
9:C
|
|
27
27
|
16:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
28
28
|
1b:I[6869,[],"IconMark"]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:"static/chunks/939-
|
|
2
|
+
2:"static/chunks/939-514e554087419c71.js"
|
|
3
3
|
3:"static/chunks/app/layout-4feff677c4071745.js"
|
|
4
4
|
4:I[2737,["939","$2","177","$3"],"ThemeProvider"]
|
|
5
5
|
5:I[9939,["939","$2","177","$3"],"LiveProvider"]
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
b:"$Sreact.suspense"
|
|
9
9
|
c:"static/chunks/157-0d36ebf66af048ac.js"
|
|
10
10
|
d:"static/chunks/103-c47318242b24e9ac.js"
|
|
11
|
-
e:"static/chunks/app/processes/page-
|
|
11
|
+
e:"static/chunks/app/processes/page-0e98a4a64e829c5f.js"
|
|
12
12
|
f:I[2701,["157","$c","939","$2","103","$d","952","$e"],"Sidebar"]
|
|
13
13
|
10:I[2394,["157","$c","939","$2","103","$d","952","$e"],"ThemeToggle"]
|
|
14
14
|
11:I[7339,["157","$c","939","$2","103","$d","952","$e"],"ProcessesView"]
|
|
@@ -18,11 +18,11 @@ f:I[2701,["157","$c","939","$2","103","$d","952","$e"],"Sidebar"]
|
|
|
18
18
|
17:"MetadataBoundary"
|
|
19
19
|
18:I[484,[],"$17"]
|
|
20
20
|
1a:I[7123,[],"default",1]
|
|
21
|
-
:HL["/_next/static/css/
|
|
21
|
+
:HL["/_next/static/css/3fbf75e4c471c6a8.css","style"]
|
|
22
22
|
9:X
|
|
23
23
|
a:[["children",{"s":"__PAGE__","h":512,"d":{"r":["$","$1","c",{"children":[["$","$b",null,{"fallback":["$","div",null,{"className":"relative flex h-dvh overflow-hidden bg-background text-foreground","children":[["$","a",null,{"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"}],["$","$Lf",null,{"machineId":"$undefined","machineView":"$undefined"}],["$","div",null,{"className":"flex min-w-0 flex-1 flex-col","children":[["$","header",null,{"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":[["$","h1",null,{"className":"truncate text-lg font-semibold tracking-tight","children":"Processes"}],["$","div",null,{"className":"flex items-center gap-3","children":[null,["$","$L10",null,{}]]}]]}],["$","main",null,{"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 overflow-y-auto","children":["$","div",null,{"className":"mx-auto flex w-full min-w-0 max-w-[1500px] flex-col","children":["$","section",null,{"className":"flex min-w-0 flex-col rounded-xl border border-border bg-card p-5 mt-2","children":[["$","div",null,{"className":"flex shrink-0 items-center justify-between gap-4","children":[["$","h2",null,{"className":"text-sm font-medium tracking-tight","children":"Process detail"}],null]}],["$","div",null,{"className":"mt-4 flex min-h-0 flex-1 flex-col","children":["$","p",null,{"role":"status","className":"py-10 text-center text-sm text-muted-foreground","children":"Loading the process view…"}]}]]}]}]}]]}]]}],"children":["$","$L11",null,{}]}],null,["$","$L12",null,{"children":["$","$b",null,{"name":"Next.MetadataOutlet","children":"$@13"}]}]]}],"p":false,"v":null}}]]
|
|
24
24
|
8:[["children",{"s":"processes","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"}]]
|
|
25
|
-
0:{"P":null,"c":["","processes"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/
|
|
25
|
+
0:{"P":null,"c":["","processes"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/3fbf75e4c471c6a8.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":[[["$","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."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L15",null,{"children":"$L16"}],["$","$L18",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$b",null,{"name":"Next.Metadata","children":"$L19"}]}],null]}],null]}],"p":false,"v":null}},"m":"$undefined","G":["$1a",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"xjSDCOO8Gpm5iPO9tyRG5"}
|
|
26
26
|
9:C
|
|
27
27
|
16:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
28
28
|
1b:I[6869,[],"IconMark"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
:HL["/_next/static/css/
|
|
1
|
+
:HL["/_next/static/css/3fbf75e4c471c6a8.css","style"]
|
|
2
2
|
2:[["children",{"s":"__PAGE__","h":160}]]
|
|
3
3
|
1:[["children",{"s":"processes","h":96,"c":"$Q2"}]]
|
|
4
|
-
0:{"b":"
|
|
4
|
+
0:{"b":"xjSDCOO8Gpm5iPO9tyRG5","t":{"t":{"s":"","h":80,"c":"$Q1"}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:"static/chunks/939-
|
|
2
|
+
2:"static/chunks/939-514e554087419c71.js"
|
|
3
3
|
3:"static/chunks/app/layout-4feff677c4071745.js"
|
|
4
4
|
4:I[2737,["939","$2","177","$3"],"ThemeProvider"]
|
|
5
5
|
5:I[9939,["939","$2","177","$3"],"LiveProvider"]
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
e:"$Sreact.suspense"
|
|
9
9
|
f:"static/chunks/157-0d36ebf66af048ac.js"
|
|
10
10
|
10:"static/chunks/103-c47318242b24e9ac.js"
|
|
11
|
-
11:"static/chunks/app/processes/page-
|
|
11
|
+
11:"static/chunks/app/processes/page-0e98a4a64e829c5f.js"
|
|
12
12
|
12:I[2701,["157","$f","939","$2","103","$10","952","$11"],"Sidebar"]
|
|
13
13
|
13:I[2394,["157","$f","939","$2","103","$10","952","$11"],"ThemeToggle"]
|
|
14
14
|
14:I[7339,["157","$f","939","$2","103","$10","952","$11"],"ProcessesView"]
|
|
@@ -18,13 +18,13 @@ f:"static/chunks/157-0d36ebf66af048ac.js"
|
|
|
18
18
|
1a:"MetadataBoundary"
|
|
19
19
|
1b:I[484,[],"$1a"]
|
|
20
20
|
1c:I[6869,[],"IconMark"]
|
|
21
|
-
:HL["/_next/static/css/
|
|
21
|
+
:HL["/_next/static/css/3fbf75e4c471c6a8.css","style"]
|
|
22
22
|
9:X
|
|
23
23
|
c:X
|
|
24
24
|
c:C
|
|
25
25
|
d:[["children",{"s":"__PAGE__","h":160,"d":{"r":["$","$1","c",{"children":[["$","$e",null,{"fallback":["$","div",null,{"className":"relative flex h-dvh overflow-hidden bg-background text-foreground","children":[["$","a",null,{"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"}],["$","$L12",null,{}],["$","div",null,{"className":"flex min-w-0 flex-1 flex-col","children":[["$","header",null,{"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":[["$","h1",null,{"className":"truncate text-lg font-semibold tracking-tight","children":"Processes"}],["$","div",null,{"className":"flex items-center gap-3","children":[null,["$","$L13",null,{}]]}]]}],["$","main",null,{"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 overflow-y-auto","children":["$","div",null,{"className":"mx-auto flex w-full min-w-0 max-w-[1500px] flex-col","children":["$","section",null,{"className":"flex min-w-0 flex-col rounded-xl border border-border bg-card p-5 mt-2","children":[["$","div",null,{"className":"flex shrink-0 items-center justify-between gap-4","children":[["$","h2",null,{"className":"text-sm font-medium tracking-tight","children":"Process detail"}],null]}],["$","div",null,{"className":"mt-4 flex min-h-0 flex-1 flex-col","children":["$","p",null,{"role":"status","className":"py-10 text-center text-sm text-muted-foreground","children":"Loading the process view…"}]}]]}]}]}]]}]]}],"children":["$","$L14",null,{}]}],null,["$","$L15",null,{"children":["$","$e",null,{"name":"Next.MetadataOutlet","children":"$@16"}]}]]}],"p":"$@17","v":null,"s":"$9"}}]]
|
|
26
26
|
a:[["children",{"s":"processes","h":96,"d":{"r":["$","$1","c",{"children":[null,["$","$L6",null,{"parallelRouterKey":"children","template":["$","$L7",null,{}]}]]}],"p":"$@b","v":"$c","s":"$9"},"c":"$Qd"}]]
|
|
27
|
-
0:{"t":{"t":{"s":"","h":80,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/
|
|
27
|
+
0:{"t":{"t":{"s":"","h":80,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/3fbf75e4c471c6a8.css","precedence":"next"}]],["$","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","template":["$","$L7",null,{}],"notFound":[[["$","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."}]}]]}]}]],[]]}]}]}]}]}]]}],"p":"$@8","v":null,"s":"$9"},"c":"$Qa"},"h":{"r":["$","$1","h",{"children":[null,["$","$L19",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","$L1b",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$e",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"Processes — 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"}],["$","$L1c","3",{}]]}]}],null]}],null]}],"p":"$@1d","v":null,"s":"$9"}},"a":"$@1e","u":"$@1f","b":"xjSDCOO8Gpm5iPO9tyRG5"}
|
|
28
28
|
16:null
|
|
29
29
|
9:300
|
|
30
30
|
1f:true
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"/_not-found/page": "app/_not-found/page.js",
|
|
3
3
|
"/_global-error/page": "app/_global-error/page.js",
|
|
4
4
|
"/icon.svg/route": "app/icon.svg/route.js",
|
|
5
|
+
"/administration/page": "app/administration/page.js",
|
|
5
6
|
"/alerts/page": "app/alerts/page.js",
|
|
6
7
|
"/connections/page": "app/connections/page.js",
|
|
7
|
-
"/administration/page": "app/administration/page.js",
|
|
8
|
-
"/history/page": "app/history/page.js",
|
|
9
8
|
"/login/page": "app/login/page.js",
|
|
9
|
+
"/history/page": "app/history/page.js",
|
|
10
10
|
"/page": "app/page.js",
|
|
11
11
|
"/processes/page": "app/processes/page.js",
|
|
12
12
|
"/machines/[machineId]/page": "app/machines/[machineId]/page.js"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=161,exports.ids=[161],exports.modules={4833:(a,b,c)=>{"use strict";c.d(b,{ThemeProvider:()=>f});var d=c(48249),e=c(8696);function f({children:a,...b}){return(0,d.jsx)(e.N,{...b,children:a})}},7909:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23))},21061:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23))},21585:(a,b,c)=>{Promise.resolve().then(c.bind(c,65223)),Promise.resolve().then(c.bind(c,89604))},22127:(a,b,c)=>{"use strict";c.d(b,{mq:()=>e,vz:()=>d,yY:()=>f});let d=15e3,e=9e4,f=180},25982:(a,b,c)=>{"use strict";c.d(b,{U8:()=>d,Q_:()=>j,FZ:()=>F});let d=1024,e=Date.parse("2000-01-01T00:00:00Z"),f=Date.parse("2200-01-01T00:00:00Z"),g=["metrics","inventory","processes"],h=["cpu","memory","swap","gpus","disks","network"],i=["outbox-age","outbox-bytes","disk-budget","write-failure","rejected"];function j(a){let b=t(a,"collector message");switch(b.type){case"hello":{u(b,["type","collectorId","runId","bootId","hostname","capabilities","expectedIntervalMs","collectorVersion"],"hello");let a=w(b.capabilities,"hello.capabilities",1,g.length).map(a=>x(a,g,"hello.capabilities"));if(new Set(a).size!==a.length||!a.includes("metrics"))throw Error("invalid hello: capabilities must be unique and include metrics");return{type:"hello",collectorId:z(b.collectorId,"collectorId"),runId:z(b.runId,"runId"),bootId:y(b.bootId,"bootId",0,128),hostname:y(b.hostname,"hostname",0,255),capabilities:a,expectedIntervalMs:B(b.expectedIntervalMs,"expectedIntervalMs",100,72e5),collectorVersion:y(b.collectorVersion,"collectorVersion",1,64)}}case"samples":{u(b,["type","mode","records"],"samples");let a=x(b.mode,["live","replay"],"samples.mode"),c=w(b.records,"samples.records",1,32).map((a,b)=>k(a,`records[${b}]`)),d=new Set;for(let a of c){let b=`${a.runId}\0${a.sequence}`;if(d.has(b))throw Error("invalid samples: duplicate record in batch");d.add(b)}return{type:"samples",mode:a,records:c}}case"inventory":return u(b,["type","capturedAt","inventory"],"inventory"),{type:"inventory",capturedAt:D(b.capturedAt,"capturedAt"),inventory:l(b.inventory)};case"status":return u(b,["type","capturedAt","delivery","failures"],"status"),{type:"status",capturedAt:D(b.capturedAt,"capturedAt"),delivery:function(a){let b=t(a,"delivery");if(u(b,["pendingRecords","pendingBytes","oldestPendingCapturedAt","inFlightRecords","droppedRecords","replaying","lastAckAt"],"delivery"),"boolean"!=typeof b.replaying)throw Error("invalid delivery: replaying");let c=(a,b)=>B(a,b,0,Number.MAX_SAFE_INTEGER);return{pendingRecords:c(b.pendingRecords,"pendingRecords"),pendingBytes:c(b.pendingBytes,"pendingBytes"),oldestPendingCapturedAt:r(b.oldestPendingCapturedAt,a=>D(a,"oldestPendingCapturedAt")),inFlightRecords:c(b.inFlightRecords,"inFlightRecords"),droppedRecords:c(b.droppedRecords,"droppedRecords"),replaying:b.replaying,lastAckAt:r(b.lastAckAt,a=>D(a,"lastAckAt"))}}(b.delivery),failures:w(b.failures,"failures",0,32).map(a=>{let b=t(a,"failure");return u(b,["metric","resourceId","reason"],"failure"),{metric:y(b.metric,"metric",1,64),resourceId:null===b.resourceId?null:A(b.resourceId),reason:y(b.reason,"reason",0,256)}})};case"detail.result":return u(b,["type","subscriptionId","capturedAt","snapshot"],"detail.result"),{type:"detail.result",subscriptionId:z(b.subscriptionId,"subscriptionId"),capturedAt:D(b.capturedAt,"capturedAt"),snapshot:function(a){let b=t(a,"process snapshot");if(u(b,["totalProcesses","truncated","inaccessible","processes"],"process snapshot"),"boolean"!=typeof b.truncated)throw Error("invalid process snapshot: truncated");let c=(a,b,c)=>r(a,a=>C(a,b,0,c));return{totalProcesses:B(b.totalProcesses,"totalProcesses",0,1e7),truncated:b.truncated,inaccessible:B(b.inaccessible,"inaccessible",0,1e7),processes:w(b.processes,"processes",0,6e3).map(a=>{let b=t(a,"process");u(b,["pid","ppid","startTicks","name","user","state","cpuPercent","memoryRssBytes","gpuMemoryBytes","ioReadBytesPerSec","ioWriteBytesPerSec","threads","unit"],"process",["command"]);let e={pid:B(b.pid,"pid",0,0x80000000),ppid:B(b.ppid,"ppid",0,0x80000000),startTicks:B(b.startTicks,"startTicks",0,Number.MAX_SAFE_INTEGER),name:y(b.name,"name",0,256),user:r(b.user,a=>y(a,"user",0,64)),state:y(b.state,"state",0,16),cpuPercent:c(b.cpuPercent,"cpuPercent",100*d),memoryRssBytes:r(b.memoryRssBytes,a=>B(a,"memoryRssBytes",0,Number.MAX_SAFE_INTEGER)),gpuMemoryBytes:r(b.gpuMemoryBytes,a=>B(a,"gpuMemoryBytes",0,Number.MAX_SAFE_INTEGER)),ioReadBytesPerSec:c(b.ioReadBytesPerSec,"ioReadBytesPerSec",1e13),ioWriteBytesPerSec:c(b.ioWriteBytesPerSec,"ioWriteBytesPerSec",1e13),threads:r(b.threads,a=>B(a,"threads",0,1e7)),unit:r(b.unit,a=>y(a,"unit",1,256))};return v(b,"command")&&(e.command=y(b.command,"command",0,4096)),e})}}(b.snapshot)};case"detail.ended":return u(b,["type","subscriptionId","reason"],"detail.ended"),{type:"detail.ended",subscriptionId:z(b.subscriptionId,"subscriptionId"),reason:x(b.reason,["expired","cancelled","withheld","unsupported","busy","failed"],"detail.ended.reason")};default:throw Error(`invalid collector message: unsupported type ${E(b.type)}`)}}function k(a,b="record"){let c=t(a,b);u(c,["collectorId","runId","bootId","sequence","capturedAt","kind","payload"],b);let e={collectorId:z(c.collectorId,"collectorId"),runId:z(c.runId,"runId"),bootId:y(c.bootId,"bootId",0,128),sequence:B(c.sequence,"sequence",0,Number.MAX_SAFE_INTEGER),capturedAt:D(c.capturedAt,"capturedAt")};if("metrics"===c.kind){let a;return{...e,kind:"metrics",payload:(u(a=t(c.payload,"metrics payload"),[...h],"metrics payload"),{cpu:o(a.cpu,"cpu",a=>{u(a,["status","usagePercent","perCore"],"cpu",["temperatureC","powerWatts","iowaitPercent","pressureSomePercent"]);let b={status:"ok",usagePercent:C(a.usagePercent,"usagePercent",0,100),perCore:w(a.perCore,"perCore",0,d).map(a=>null===a?null:C(a,"perCore",0,100))},c=s(a,"temperatureC",a=>C(a,"temperatureC",-50,200));void 0!==c&&(b.temperatureC=c);let e=s(a,"powerWatts",a=>C(a,"powerWatts",0,1e4));void 0!==e&&(b.powerWatts=e);let f=s(a,"iowaitPercent",a=>C(a,"iowaitPercent",0,100));void 0!==f&&(b.iowaitPercent=f);let g=s(a,"pressureSomePercent",a=>C(a,"pressureSomePercent",0,100));return void 0!==g&&(b.pressureSomePercent=g),b}),memory:o(a.memory,"memory",n),swap:o(a.swap,"swap",m),gpus:o(a.gpus,"gpus",a=>(u(a,["status","devices"],"gpus"),{status:"ok",devices:q(w(a.devices,"gpus.devices",0,16).map(a=>p(a,"gpu",(a,b)=>{u(a,["id","status","utilizationPercent","memoryUsedBytes","memoryTotalBytes","temperatureC","powerWatts"],"gpu");let c=r(a.memoryUsedBytes,a=>B(a,"memoryUsedBytes",0,Number.MAX_SAFE_INTEGER)),d=r(a.memoryTotalBytes,a=>B(a,"memoryTotalBytes",0,Number.MAX_SAFE_INTEGER));if(null!==c&&null!==d&&c>d)throw Error("invalid gpu: memoryUsedBytes exceeds total");return{id:b,status:"ok",utilizationPercent:r(a.utilizationPercent,a=>C(a,"utilizationPercent",0,100)),memoryUsedBytes:c,memoryTotalBytes:d,temperatureC:r(a.temperatureC,a=>C(a,"temperatureC",-50,200)),powerWatts:r(a.powerWatts,a=>C(a,"powerWatts",0,1e4))}})))})),disks:o(a.disks,"disks",a=>{u(a,["status","filesystems","devices"],"disks",["pressureSomePercent","pressureFullPercent"]);let b={status:"ok",filesystems:q(w(a.filesystems,"filesystems",0,64).map(a=>p(a,"filesystem",(a,b)=>{u(a,["id","status","usedBytes","totalBytes"],"filesystem",["inodesUsed","inodesTotal"]);let c=m({status:"ok",usedBytes:a.usedBytes,totalBytes:a.totalBytes}),d={id:b,status:"ok",usedBytes:c.usedBytes,totalBytes:c.totalBytes},e=s(a,"inodesUsed",a=>B(a,"inodesUsed",0,Number.MAX_SAFE_INTEGER));void 0!==e&&(d.inodesUsed=e);let f=s(a,"inodesTotal",a=>B(a,"inodesTotal",0,Number.MAX_SAFE_INTEGER));if(void 0!==f&&(d.inodesTotal=f),null!=e&&null!=f&&e>f)throw Error("invalid filesystem: inodesUsed exceeds inodesTotal");return d}))),devices:q(w(a.devices,"disk devices",0,64).map(a=>p(a,"disk",(a,b)=>{u(a,["id","status","readBytesPerSec","writeBytesPerSec"],"disk",["readLatencyMs","writeLatencyMs","ioUtilizationPercent"]);let c={id:b,status:"ok",readBytesPerSec:C(a.readBytesPerSec,"readBytesPerSec",0,1e13),writeBytesPerSec:C(a.writeBytesPerSec,"writeBytesPerSec",0,1e13)},d=s(a,"readLatencyMs",a=>C(a,"readLatencyMs",0,864e5));void 0!==d&&(c.readLatencyMs=d);let e=s(a,"writeLatencyMs",a=>C(a,"writeLatencyMs",0,864e5));void 0!==e&&(c.writeLatencyMs=e);let f=s(a,"ioUtilizationPercent",a=>C(a,"ioUtilizationPercent",0,100));return void 0!==f&&(c.ioUtilizationPercent=f),c})))},c=s(a,"pressureSomePercent",a=>C(a,"pressureSomePercent",0,100));void 0!==c&&(b.pressureSomePercent=c);let d=s(a,"pressureFullPercent",a=>C(a,"pressureFullPercent",0,100));return void 0!==d&&(b.pressureFullPercent=d),b}),network:o(a.network,"network",a=>(u(a,["status","interfaces"],"network"),{status:"ok",interfaces:q(w(a.interfaces,"interfaces",0,64).map(a=>p(a,"interface",(a,b)=>(u(a,["id","status","rxBytesPerSec","txBytesPerSec"],"interface"),{id:b,status:"ok",rxBytesPerSec:C(a.rxBytesPerSec,"rxBytesPerSec",0,1e13),txBytesPerSec:C(a.txBytesPerSec,"txBytesPerSec",0,1e13)}))))}))})}}if("gap"===c.kind){let a=t(c.payload,`${b}.payload`);u(a,["fromCapturedAt","toCapturedAt","droppedRecords","reason"],"gap payload");let d=D(a.fromCapturedAt,"fromCapturedAt"),f=D(a.toCapturedAt,"toCapturedAt");if(Date.parse(d)>Date.parse(f))throw Error("invalid gap: fromCapturedAt after toCapturedAt");return{...e,kind:"gap",payload:{fromCapturedAt:d,toCapturedAt:f,droppedRecords:B(a.droppedRecords,"droppedRecords",1,Number.MAX_SAFE_INTEGER),reason:x(a.reason,i,"gap.reason")}}}throw Error(`invalid ${b}: unsupported kind ${E(c.kind)}`)}function l(a){let b=t(a,"inventory");u(b,["os","cpu","memory","gpus","filesystems","disks","network","capabilities"],"inventory");let c=t(b.os,"inventory.os");u(c,["platform","release","distro","arch"],"inventory.os");let e=t(b.cpu,"inventory.cpu");u(e,["model","logicalCores"],"inventory.cpu");let f=t(b.memory,"inventory.memory");u(f,["totalBytes","swapTotalBytes"],"inventory.memory");let g=t(b.capabilities,"inventory.capabilities"),i=[...h,"processes"];u(g,[...i],"inventory.capabilities");let j={};for(let a of i){let b=t(g[a],`capability ${a}`);u(b,["status"],`capability ${a}`,["reason"]);let c={status:x(b.status,["supported","unsupported","withheld"],`capability ${a}`)};v(b,"reason")&&(c.reason=y(b.reason,"reason",0,256)),j[a]=c}let k=(a,b)=>r(a,a=>B(a,b,0,Number.MAX_SAFE_INTEGER));return{os:{platform:y(c.platform,"platform",0,64),release:y(c.release,"release",0,256),distro:r(c.distro,a=>y(a,"distro",0,256)),arch:y(c.arch,"arch",0,64)},cpu:{model:r(e.model,a=>y(a,"model",0,256)),logicalCores:B(e.logicalCores,"logicalCores",0,d)},memory:{totalBytes:k(f.totalBytes,"totalBytes"),swapTotalBytes:k(f.swapTotalBytes,"swapTotalBytes")},gpus:q(w(b.gpus,"inventory.gpus",0,16).map(a=>{let b=t(a,"gpu inventory");u(b,["id","name","vendor","pciBusId","telemetry","memoryTotalBytes"],"gpu inventory",["reason"]);let c={id:A(b.id),name:y(b.name,"name",0,256),vendor:x(b.vendor,["nvidia","amd","intel","aspeed","other"],"vendor"),pciBusId:r(b.pciBusId,a=>y(a,"pciBusId",1,64)),telemetry:x(b.telemetry,["supported","unsupported"],"telemetry"),memoryTotalBytes:k(b.memoryTotalBytes,"memoryTotalBytes")};return v(b,"reason")&&(c.reason=y(b.reason,"reason",0,256)),c})),filesystems:q(w(b.filesystems,"inventory.filesystems",0,64).map(a=>{let b=t(a,"filesystem inventory");return u(b,["id","mountPoint","device","fsType","totalBytes"],"filesystem inventory"),{id:A(b.id),mountPoint:y(b.mountPoint,"mountPoint",1,256),device:y(b.device,"device",0,256),fsType:y(b.fsType,"fsType",0,64),totalBytes:k(b.totalBytes,"totalBytes")}})),disks:q(w(b.disks,"inventory.disks",0,64).map(a=>{let b=t(a,"disk inventory");if(u(b,["id","name","model","rotational","sizeBytes"],"disk inventory"),null!==b.rotational&&"boolean"!=typeof b.rotational)throw Error("invalid disk inventory: rotational");return{id:A(b.id),name:y(b.name,"name",1,64),model:r(b.model,a=>y(a,"model",0,256)),rotational:b.rotational,sizeBytes:k(b.sizeBytes,"sizeBytes")}})),network:q(w(b.network,"inventory.network",0,64).map(a=>{let b=t(a,"interface inventory");if(u(b,["id","name","mac","addresses","virtual","state","speedMbps"],"interface inventory"),"boolean"!=typeof b.virtual)throw Error("invalid interface inventory: virtual");return{id:A(b.id),name:y(b.name,"name",1,64),mac:r(b.mac,a=>y(a,"mac",1,64)),addresses:w(b.addresses,"addresses",0,32).map(a=>{let b=t(a,"address");u(b,["family","address","prefix"],"address");let c=x(b.family,["ipv4","ipv6"],"family");return{family:c,address:y(b.address,"address",2,64),prefix:B(b.prefix,"prefix",0,"ipv4"===c?32:128)}}),virtual:b.virtual,state:x(b.state,["up","down","unknown"],"state"),speedMbps:r(b.speedMbps,a=>B(a,"speedMbps",0,1e7))}})),capabilities:j}}function m(a){u(a,["status","usedBytes","totalBytes"],"usage");let b=B(a.totalBytes,"totalBytes",0,Number.MAX_SAFE_INTEGER),c=B(a.usedBytes,"usedBytes",0,Number.MAX_SAFE_INTEGER);if(c>b)throw Error("invalid usage: usedBytes exceeds totalBytes");return{status:"ok",usedBytes:c,totalBytes:b}}function n(a){u(a,["status","usedBytes","totalBytes"],"memory",["pressureSomePercent","pressureFullPercent"]);let b=B(a.totalBytes,"totalBytes",0,Number.MAX_SAFE_INTEGER),c=B(a.usedBytes,"usedBytes",0,Number.MAX_SAFE_INTEGER);if(c>b)throw Error("invalid memory: usedBytes exceeds totalBytes");let d={status:"ok",usedBytes:c,totalBytes:b},e=s(a,"pressureSomePercent",a=>C(a,"pressureSomePercent",0,100));void 0!==e&&(d.pressureSomePercent=e);let f=s(a,"pressureFullPercent",a=>C(a,"pressureFullPercent",0,100));return void 0!==f&&(d.pressureFullPercent=f),d}function o(a,b,c){let d=t(a,b);if("ok"===d.status)return c(d);if("unavailable"===d.status)return u(d,["status","reason"],b),{status:"unavailable",reason:y(d.reason,"reason",0,256)};throw Error(`invalid ${b}: unsupported status ${E(d.status)}`)}function p(a,b,c){let d=t(a,b),e=A(d.id);if("ok"===d.status)return c(d,e);if("unavailable"===d.status)return u(d,["id","status","reason"],b),{id:e,status:"unavailable",reason:y(d.reason,"reason",0,256)};throw Error(`invalid ${b}: unsupported status ${E(d.status)}`)}function q(a){let b=new Set;for(let c of a){if(b.has(c.id))throw Error(`invalid resource list: duplicate id ${E(c.id)}`);b.add(c.id)}return a}function r(a,b){return null===a?null:b(a)}function s(a,b,c){if(v(a,b))return r(a[b],c)}function t(a,b){if(null===a||"object"!=typeof a||Array.isArray(a))throw Error(`invalid ${b}: expected object, got ${E(a)}`);return a}function u(a,b,c,d=[]){let e=new Set([...b,...d]);for(let b of Object.keys(a))if(!e.has(b))throw Error(`invalid ${c}: unexpected field "${b}"`);for(let d of b)if(void 0===a[d])throw Error(`invalid ${c}: missing field "${d}"`);for(let b of d)if(v(a,b)&&void 0===a[b])throw Error(`invalid ${c}: ${b} must not be undefined`)}function v(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function w(a,b,c,d){if(!Array.isArray(a))throw Error(`invalid ${b}: expected array`);if(a.length<c||a.length>d)throw Error(`invalid ${b}: length ${a.length} outside ${c}..${d}`);return a}function x(a,b,c){if("string"!=typeof a||!b.includes(a))throw Error(`invalid ${c}: unexpected value ${E(a)}`);return a}function y(a,b,c,d){if("string"!=typeof a)throw Error(`invalid ${b}: expected string, got ${E(a)}`);if(a.length<c||a.length>d)throw Error(`invalid ${b}: length ${a.length} outside ${c}..${d}`);return a}function z(a,b){return y(a,b,1,128)}function A(a){return y(a,"resource id",1,256)}function B(a,b,c,d){if("number"!=typeof a||!Number.isSafeInteger(a))throw Error(`invalid ${b}: expected safe integer, got ${E(a)}`);if(a<c||a>d)throw Error(`invalid ${b}: ${a} outside ${c}..${d}`);return a}function C(a,b,c,d){if("number"!=typeof a||!Number.isFinite(a))throw Error(`invalid ${b}: expected finite number, got ${E(a)}`);if(a<c||a>d)throw Error(`invalid ${b}: ${a} outside ${c}..${d}`);return a}function D(a,b){let c=y(a,b,1,64),d=Date.parse(c);if(!Number.isFinite(d)||d<e||d>f)throw Error(`invalid ${b}: not a parseable timestamp`);return c}function E(a){try{let b=JSON.stringify(a);if("string"==typeof b)return b.length<=80?b:`${b.slice(0,77)}...`}catch{}return String(a)}function F(a){let b=J(a,"hub snapshot");K(b,["hubRunId","machines"],"hub snapshot");let c=M(b.hubRunId,"hubRunId","hub snapshot");if(!Array.isArray(b.machines))throw Error("invalid snapshot machines");let d=new Set;return{hubRunId:c,machines:b.machines.map(a=>{let b=J(a,"machine");K(b,["machineId","collectorId","hostname","connected","lastReceivedAt"],"machine",["expectedIntervalMs","metrics","inventory","delivery","displayName","tags"]);let c=M(b.machineId,"machineId","machine");if(d.has(c))throw Error("duplicate snapshot machine");d.add(c);let e=M(b.collectorId,"collectorId","machine"),f=N(b.hostname,"hostname","machine",0,G);if("boolean"!=typeof b.connected)throw Error("invalid machine connection state");let g=null===b.lastReceivedAt?null:O(b.lastReceivedAt,"lastReceivedAt","machine"),h={},i=L(b,"expectedIntervalMs")?function(a,b,c){if(null===a)return null;if(void 0===a)throw Error(`invalid ${c}: ${b} must not be undefined`);var d=a,e=b,f=c;if("number"!=typeof d||!Number.isSafeInteger(d))throw Error(`invalid ${f}: ${e} must be a safe integer, got ${P(d)}`);if(d<100||d>72e5)throw Error(`invalid ${f}: ${e} ${d} outside ${100}..${72e5}`);return d}(b.expectedIntervalMs,"expectedIntervalMs","machine"):void 0;if(L(b,"metrics")){let{receivedAt:a,...c}=J(b.metrics,"received metrics"),d=k(c);if("metrics"!==d.kind||d.collectorId!==e)throw Error("conflicting machine metrics");if(h.metrics={...d,receivedAt:O(a,"receivedAt","metrics")},h.metrics.receivedAt!==g)throw Error("conflicting metrics receipt time")}if(L(b,"inventory")&&(h.inventory=l(b.inventory)),L(b,"delivery")){let a=j(b.delivery);if("status"!==a.type)throw Error("invalid delivery status");h.delivery=a}if(L(b,"displayName")&&(h.displayName=null===b.displayName?null:N(b.displayName,"displayName","machine",0,128)),L(b,"tags")){if(!Array.isArray(b.tags)||b.tags.length>32)throw Error("invalid machine tags");h.tags=b.tags.map(a=>N(a,"tag","machine",1,64))}return{machineId:c,collectorId:e,hostname:f,connected:b.connected,lastReceivedAt:g,...void 0===i?{}:{expectedIntervalMs:i},...h}})}}let G=255,H=Date.parse("2000-01-01T00:00:00Z"),I=Date.parse("2200-01-01T00:00:00Z");function J(a,b){if(null===a||"object"!=typeof a||Array.isArray(a))throw Error(`invalid ${b}: expected object, got ${P(a)}`);return a}function K(a,b,c,d=[]){let e=new Set([...b,...d]);for(let b of Object.keys(a))if(!e.has(b))throw Error(`invalid ${c}: unexpected field "${b}"`);for(let d of b)if(void 0===a[d])throw Error(`invalid ${c}: missing field "${d}"`);for(let b of d)if(L(a,b)&&void 0===a[b])throw Error(`invalid ${c}: ${b} must not be undefined`)}function L(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function M(a,b,c){return N(a,b,c,1,128)}function N(a,b,c,d,e){if("string"!=typeof a)throw Error(`invalid ${c}: ${b} must be a string, got ${P(a)}`);if(a.length<d||a.length>e)throw Error(`invalid ${c}: ${b} length ${a.length} outside ${d}..${e}`);return a}function O(a,b,c){let d=N(a,b,c,1,64),e=Date.parse(d);if(!Number.isFinite(e)||e<H||e>I)throw Error(`invalid ${c}: ${b} is not a parseable timestamp`);return d}function P(a){try{let b=JSON.stringify(a);if("string"==typeof b)return b.length<=80?b:`${b.slice(0,77)}...`}catch{}return String(a)}},41756:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23)),Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},55324:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23)),Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},58910:(a,b,c)=>{"use strict";c.d(b,{LiveProvider:()=>s,M:()=>r});var d=c(48249),e=c(67484);async function f(a){try{let b=await a.json();if(b&&"object"==typeof b&&"error"in b){let a=b.error;if("string"==typeof a)return a}}catch{}return a.statusText||null}function g(a){if(!a||"object"!=typeof a)return null;let b=a.username,c=a.csrfToken;if("string"!=typeof b||0===b.length||"string"!=typeof c||0===c.length)return null;let d=a.admin;return void 0!==d&&"boolean"!=typeof d?null:{username:b,csrfToken:c,...!0===d?{admin:!0}:{}}}async function h(){try{let a=await fetch("/api/auth/session",{cache:"no-store",signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(a.ok){try{let b=g(await a.json());if(b)return{kind:"signed-in",user:b}}catch{}return{kind:"error",detail:"unexpected session response"}}if(401===a.status)return{kind:"signed-out"};if(503===a.status)return{kind:"auth-unavailable",detail:await f(a)};return{kind:"error",detail:`unexpected status ${a.status}`}}catch{return{kind:"unreachable"}}}async function i(a,b){try{let c=await fetch("/api/auth/login",{method:"POST",cache:"no-store",signal:AbortSignal.timeout(5e3),headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({username:a,password:b})});if(c.ok){try{let a=g(await c.json());if(a)return{kind:"signed-in",user:a}}catch{}return{kind:"error",detail:"unexpected sign-in response"}}if(401===c.status)return{kind:"invalid-credentials",detail:await f(c)};if(429===c.status)return{kind:"error",detail:"too many attempts — wait a moment and try again"};if(503===c.status)return{kind:"auth-unavailable",detail:await f(c)};return{kind:"error",detail:`unexpected status ${c.status}`}}catch{return{kind:"unreachable"}}}async function j(a){try{let b=await fetch("/api/auth/logout",{method:"POST",cache:"no-store",signal:AbortSignal.timeout(5e3),headers:{"X-CSRF-Token":a,Accept:"application/json"}});if(b.ok||401===b.status)return"ok";return b.status,{kind:"error",detail:`unexpected status ${b.status}`}}catch{return"unreachable"}}async function k(a=5e3){let b=new AbortController,c=setTimeout(()=>b.abort(),a);try{let a=await fetch("/api/live",{cache:"no-store",signal:b.signal,headers:{Accept:"text/event-stream"}});if(200===a.status)return{kind:"ok"};if(401===a.status)return{kind:"unauthorized"};if(403===a.status)return{kind:"forbidden"};return{kind:"error",detail:`unexpected status ${a.status}`}}catch{return{kind:"unreachable"}}finally{clearTimeout(c);try{b.abort()}catch{}}}var l=c(25982);let m=["snapshot","update","reset"];class n{source=null;lastId=null;get lastEventId(){return this.lastId}get isOpen(){return null!==this.source&&2!==this.source.readyState}start(a,b){this.close();let c=new EventSource(a);this.source=c;let d=a=>d=>{if(this.source!==c||null===this.source)return;let e=d.lastEventId;"string"==typeof e&&e.length>0&&(this.lastId=e);try{b.onSnapshot((0,l.FZ)(JSON.parse(d.data)),a,e??"")}catch{this.close(),b.onError()}};for(let a of m)c.addEventListener(a,d(a));c.onerror=()=>{this.source===c&&(this.close(),b.onError())}}close(){this.source?.close(),this.source=null}}var o=c(65666);let p=[1e3,2e3,4e3,8e3,15e3],q=(0,e.createContext)(null);function r(){let a=(0,e.useContext)(q);if(!a)throw Error("useLive must be used inside <LiveProvider>");return a}function s({children:a}){let[b,c]=(0,e.useState)({kind:"restoring"}),[f,g]=(0,e.useState)("idle"),[l,m]=(0,e.useState)(null),[r,t]=(0,e.useState)([]),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(new Map),E=(0,e.useRef)(!0),F=(0,e.useRef)(0),G=(0,e.useRef)(null),H=(0,e.useRef)(null),I=(0,e.useRef)(0),J=(0,e.useRef)(b),K=(0,e.useRef)(0),L=(0,e.useRef)(!1),M=(0,e.useRef)(!1),N=a=>{J.current=a,c(a)},O=()=>{null!==H.current&&(clearTimeout(H.current),H.current=null)},P=()=>{K.current+=1,F.current+=1,G.current?.close(),G.current=null,O()},Q=()=>{L.current=!1,t([]),D(new Map),m(null),x(null),z(null),v(null)},R=a=>{let b=J.current;("signed-in"!==b.kind||b.user.csrfToken!==a.csrfToken)&&Q(),N({kind:"signed-in",user:a})},S=()=>{if("signed-in"!==J.current.kind)return;P(),g(L.current?"reconnecting":"connecting");let a=new n;G.current=a,a.start("/api/live",{onSnapshot:(b,c,d)=>{E.current&&G.current===a&&(I.current=0,L.current=!0,m(b.hubRunId),t(b.machines),v(Date.now()),x(d||null),z(c),D(a=>(0,o.g)(a,b)),g("live"))},onError:()=>{E.current&&G.current===a&&T()}})},T=async()=>{P();let a=K.current;g("reconnecting");let b=await h();if(!E.current||a!==K.current)return;if("signed-in"===b.kind)R(b.user);else if("signed-out"===b.kind){N({kind:"signed-out"}),Q(),g("expired");return}else if("auth-unavailable"===b.kind){N({kind:"auth-unavailable",detail:b.detail}),Q(),g("idle");return}let c=Math.min(I.current+1,p.length+1);if(I.current=c,c>p.length){g("disconnected"),V();return}g("reconnecting"),H.current=setTimeout(()=>{U()},p[c-1])},U=async()=>{if(!E.current||M.current)return;P();let a=K.current,b=await k();if(E.current&&a===K.current){if("forbidden"===b.kind){Q(),g("no-permission");return}if("unauthorized"===b.kind){let b=await h();if(!E.current||a!==K.current)return;if("signed-in"===b.kind){R(b.user),S();return}if("signed-out"===b.kind){N({kind:"signed-out"}),Q(),g("expired");return}if("auth-unavailable"===b.kind){N({kind:"auth-unavailable",detail:b.detail}),Q(),g("idle");return}}S()}},V=()=>{O(),H.current=setTimeout(()=>{W()},3e4)},W=async()=>{if(!E.current||M.current)return;P();let a=K.current,b=await h();if(E.current&&a===K.current){if("signed-in"===b.kind){R(b.user),S();return}if("signed-out"===b.kind){N({kind:"signed-out"}),Q(),g("expired");return}if("auth-unavailable"===b.kind){N({kind:"auth-unavailable",detail:b.detail}),Q(),g("idle");return}V()}},X=async a=>{let b=K.current,c=await h();if(E.current&&F.current===a&&b===K.current){if("signed-in"===c.kind){R(c.user),I.current=0,S();return}if("signed-out"===c.kind){N({kind:"signed-out"}),g("idle");return}if("auth-unavailable"===c.kind){N({kind:"auth-unavailable",detail:c.detail}),g("idle");return}N({kind:"restore-failed",detail:"error"===c.kind?c.detail:null}),g("idle")}},Y=async(a,b)=>{P();let c=K.current,d=await i(a,b);return E.current&&c===K.current?("signed-in"===d.kind&&E.current&&(R(d.user),B(null),I.current=0,S()),d):{kind:"error",detail:"Session request superseded. Try again."}},Z=async()=>{let a=J.current;if("signed-in"!==a.kind||M.current)return;M.current=!0,P();let b=K.current;Q(),g("idle");let c=await j(a.user.csrfToken);if(M.current=!1,!E.current||b!==K.current)return;if("ok"===c){N({kind:"signed-out"}),Q(),g("idle"),B("Signed out.");return}let d=await h();if(E.current&&b===K.current){if("signed-in"===d.kind){R(d.user),B("Sign out failed — try again."),S();return}if("signed-out"===d.kind){N({kind:"signed-out"}),Q(),g("idle"),B(null);return}if("auth-unavailable"===d.kind){N({kind:"auth-unavailable",detail:d.detail}),g("idle");return}N({kind:"restore-failed",detail:"error"===d.kind?d.detail:null}),g("idle")}};return(0,d.jsx)(q.Provider,{value:{session:b,phase:f,hubRunId:l,machines:r,lastReceivedLocalMs:u,lastEventId:w,lastEventKind:y,notice:A,history:C,login:Y,signOut:Z,retryConnection:()=>{if(E.current&&!M.current){if("signed-in"===J.current.kind){I.current=0,U();return}F.current+=1,X(F.current)}},dismissNotice:()=>B(null)},children:a})}},59645:(a,b,c)=>{"use strict";function d(){return[{type:"image/svg+xml",sizes:"any",url:"/icon.svg?3b3fa3229e2d0d7a"}]}c.r(b),c.d(b,{default:()=>d})},61135:()=>{},65223:(a,b,c)=>{"use strict";c.d(b,{ThemeProvider:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ThemeProvider() from the server but ThemeProvider 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-provider.tsx","ThemeProvider")},65666:(a,b,c)=>{"use strict";c.d(b,{K:()=>h,g:()=>f});var d=c(22127),e=c(93224);function f(a,b){let c=new Map;for(let f of b.machines){let g=f.metrics;if(!g)continue;let h=`${b.hubRunId}\0${g.collectorId}\0${g.runId}\0${g.sequence}`,i=a.get(f.machineId)??[],j=i.at(-1);if(j?.sampleId===h){c.set(f.machineId,i);continue}let k=h.slice(0,h.lastIndexOf("\0")+1),l=j?.sampleId.startsWith(k)?i:[],m=g.payload.memory;c.set(f.machineId,[...l,{sampleId:h,receivedAtLocal:Date.parse(g.receivedAt),cpuPercent:"ok"===g.payload.cpu.status?g.payload.cpu.usagePercent:null,memoryPercent:"ok"===m.status&&m.totalBytes>0?100*m.usedBytes/m.totalBytes:null,gapThresholdMs:(0,e.Cj)(f.expectedIntervalMs)}].slice(-d.yY))}return c}function g(a){return"number"==typeof a.gapThresholdMs&&Number.isFinite(a.gapThresholdMs)&&a.gapThresholdMs>0?a.gapThresholdMs:d.vz}function h(a,b=600,c=140){let e;if(a.length<2)return null;let f=a[0].receivedAtLocal,i=Math.max(1e3,a.at(-1).receivedAtLocal-f),j="";for(let h of a){if(null===h.cpuPercent){e=void 0;continue}let a=4+(h.receivedAtLocal-f)/i*(b-8),k=c-4-h.cpuPercent/100*(c-8),l=e?Math.min(g(e),g(h)):d.vz,m=e&&h.receivedAtLocal>=e.receivedAtLocal&&h.receivedAtLocal-e.receivedAtLocal<l;j+=`${m?"L":"M"}${a.toFixed(2)},${k.toFixed(2)} `,e=h}return j.trim()||null}},76537:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,metadata:()=>g});var d=c(5735),e=c(65223),f=c(89604);c(61135);let g={title:{template:"%s — Rigscope",default:"Rigscope"},description:"Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub."};function h({children:a}){return(0,d.jsx)("html",{lang:"en",suppressHydrationWarning:!0,children:(0,d.jsx)("body",{children:(0,d.jsx)(e.ThemeProvider,{attribute:"class",defaultTheme:"dark",enableSystem:!0,children:(0,d.jsx)(f.LiveProvider,{children:a})})})})}},78335:()=>{},86737:(a,b,c)=>{Promise.resolve().then(c.bind(c,4833)),Promise.resolve().then(c.bind(c,58910))},89604:(a,b,c)=>{"use strict";c.d(b,{LiveProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call useLive() from the server but useLive 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/live/live-provider.tsx","useLive");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call LiveProvider() from the server but LiveProvider 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/live/live-provider.tsx","LiveProvider")},93224:(a,b,c)=>{"use strict";c.d(b,{$:()=>f,A4:()=>k,Cj:()=>e,F2:()=>n,L_:()=>m,fv:()=>l,l9:()=>i,nV:()=>j,vj:()=>g,z3:()=>h});var d=c(22127);function e(a){return null==a||"number"!=typeof a||!Number.isFinite(a)||a<=0?d.vz:Math.max(d.vz,3*a)}function f(a){if(null==a||!Number.isFinite(a)||a<0)return"—";if(a<6e4){let b=a/1e3;return Number.isInteger(b)?`${b} s`:`${b.toFixed(1)} s`}if(a<36e5){let b=a/6e4;return Number.isInteger(b)?`${b} min`:`${b.toFixed(1)} min`}let b=a/36e5;return Number.isInteger(b)?`${b} h`:`${b.toFixed(1)} h`}function g(a,b,c=e(a.expectedIntervalMs)){return function(a,b,c=d.vz){if(null===a)return"unknown";let e=Date.parse(a);return Number.isFinite(e)?b-e>=c?"stale":"live":"unknown"}(a.lastReceivedAt,b,c)}function h(a){if(null==a||!Number.isFinite(a)||a<0)return"—";let b=["B","KiB","MiB","GiB","TiB"],c=a,d=0;for(;c>=1024&&d<b.length-1;)c/=1024,d+=1;return 0===d?`${Math.round(c)} B`:`${c.toFixed(1)} ${b[d]}`}function i(a){return null!=a&&Number.isFinite(a)?`${a.toFixed(1)}%`:"—"}function j(a){if(null===a||!Number.isFinite(a))return"—";let b=Math.round(Math.max(0,a)/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60){let a=b%60;return 0===a?`${c}m ago`:`${c}m ${a}s ago`}let d=Math.floor(c/60);if(d<24){let a=c%60;return 0===a?`${d}h ago`:`${d}h ${a}m ago`}let e=Math.floor(d/24),f=d%24;return 0===f?`${e}d ago`:`${e}d ${f}h ago`}function k(a,b){if(null===a)return null;let c=Date.parse(a);return Number.isFinite(c)?b-c:null}function l(a){switch(a){case"ok":return"Live";case"degraded":return"Degraded";case"stale":return"Stale";case"disconnected":return"Disconnected";case"unseen":return"No sample yet"}}function m(a,b=d.mq){let c=a.metrics;if(!c)return{kind:"unknown"};let e=Date.parse(c.capturedAt),f=Date.parse(c.receivedAt);if(!Number.isFinite(e)||!Number.isFinite(f))return{kind:"unknown"};let g=e-f;return g>b?{kind:"ahead",skewMs:g}:g<-b?{kind:"behind",skewMs:-g}:{kind:"none"}}function n(a,b,c=e(a.expectedIntervalMs)){return{freshness:g(a,b,c),attention:function(a,b,c=e(a.expectedIntervalMs)){var d;let f=g(a,b,c);return a.metrics&&"unknown"!==f?"stale"===f?"stale":(d=a.metrics)&&("unavailable"===d.payload.cpu.status||"unavailable"===d.payload.memory.status)?"degraded":a.connected?"ok":"disconnected":"unseen"}(a,b,c),connection:a.connected?"connected":"disconnected",skew:m(a),thresholdMs:c}}},96487:()=>{}};
|
|
1
|
+
exports.id=161,exports.ids=[161],exports.modules={4833:(a,b,c)=>{"use strict";c.d(b,{ThemeProvider:()=>f});var d=c(48249),e=c(8696);function f({children:a,...b}){return(0,d.jsx)(e.N,{...b,children:a})}},7909:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23))},21061:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23))},21585:(a,b,c)=>{Promise.resolve().then(c.bind(c,65223)),Promise.resolve().then(c.bind(c,89604))},22127:(a,b,c)=>{"use strict";c.d(b,{mq:()=>e,vz:()=>d,yY:()=>f});let d=15e3,e=9e4,f=180},25982:(a,b,c)=>{"use strict";c.d(b,{U8:()=>d,Q_:()=>j,FZ:()=>F});let d=1024,e=Date.parse("2000-01-01T00:00:00Z"),f=Date.parse("2200-01-01T00:00:00Z"),g=["metrics","inventory","processes"],h=["cpu","memory","swap","gpus","disks","network"],i=["outbox-age","outbox-bytes","disk-budget","write-failure","rejected"];function j(a){let b=t(a,"collector message");switch(b.type){case"hello":{u(b,["type","collectorId","runId","bootId","hostname","capabilities","expectedIntervalMs"],"hello");let a=w(b.capabilities,"hello.capabilities",1,g.length).map(a=>x(a,g,"hello.capabilities"));if(new Set(a).size!==a.length||!a.includes("metrics"))throw Error("invalid hello: capabilities must be unique and include metrics");return{type:"hello",collectorId:z(b.collectorId,"collectorId"),runId:z(b.runId,"runId"),bootId:y(b.bootId,"bootId",0,128),hostname:y(b.hostname,"hostname",0,255),capabilities:a,expectedIntervalMs:B(b.expectedIntervalMs,"expectedIntervalMs",100,72e5)}}case"samples":{u(b,["type","mode","records"],"samples");let a=x(b.mode,["live","replay"],"samples.mode"),c=w(b.records,"samples.records",1,32).map((a,b)=>k(a,`records[${b}]`)),d=new Set;for(let a of c){let b=`${a.runId}\0${a.sequence}`;if(d.has(b))throw Error("invalid samples: duplicate record in batch");d.add(b)}return{type:"samples",mode:a,records:c}}case"inventory":return u(b,["type","capturedAt","inventory"],"inventory"),{type:"inventory",capturedAt:D(b.capturedAt,"capturedAt"),inventory:l(b.inventory)};case"status":return u(b,["type","capturedAt","delivery","failures"],"status"),{type:"status",capturedAt:D(b.capturedAt,"capturedAt"),delivery:function(a){let b=t(a,"delivery");if(u(b,["pendingRecords","pendingBytes","oldestPendingCapturedAt","inFlightRecords","droppedRecords","replaying","lastAckAt"],"delivery"),"boolean"!=typeof b.replaying)throw Error("invalid delivery: replaying");let c=(a,b)=>B(a,b,0,Number.MAX_SAFE_INTEGER);return{pendingRecords:c(b.pendingRecords,"pendingRecords"),pendingBytes:c(b.pendingBytes,"pendingBytes"),oldestPendingCapturedAt:r(b.oldestPendingCapturedAt,a=>D(a,"oldestPendingCapturedAt")),inFlightRecords:c(b.inFlightRecords,"inFlightRecords"),droppedRecords:c(b.droppedRecords,"droppedRecords"),replaying:b.replaying,lastAckAt:r(b.lastAckAt,a=>D(a,"lastAckAt"))}}(b.delivery),failures:w(b.failures,"failures",0,32).map(a=>{let b=t(a,"failure");return u(b,["metric","resourceId","reason"],"failure"),{metric:y(b.metric,"metric",1,64),resourceId:null===b.resourceId?null:A(b.resourceId),reason:y(b.reason,"reason",0,256)}})};case"detail.result":return u(b,["type","subscriptionId","capturedAt","snapshot"],"detail.result"),{type:"detail.result",subscriptionId:z(b.subscriptionId,"subscriptionId"),capturedAt:D(b.capturedAt,"capturedAt"),snapshot:function(a){let b=t(a,"process snapshot");if(u(b,["totalProcesses","truncated","inaccessible","processes"],"process snapshot"),"boolean"!=typeof b.truncated)throw Error("invalid process snapshot: truncated");let c=(a,b,c)=>r(a,a=>C(a,b,0,c));return{totalProcesses:B(b.totalProcesses,"totalProcesses",0,1e7),truncated:b.truncated,inaccessible:B(b.inaccessible,"inaccessible",0,1e7),processes:w(b.processes,"processes",0,6e3).map(a=>{let b=t(a,"process");u(b,["pid","ppid","startTicks","name","user","state","cpuPercent","memoryRssBytes","gpuMemoryBytes","ioReadBytesPerSec","ioWriteBytesPerSec","threads","unit"],"process",["command"]);let e={pid:B(b.pid,"pid",0,0x80000000),ppid:B(b.ppid,"ppid",0,0x80000000),startTicks:B(b.startTicks,"startTicks",0,Number.MAX_SAFE_INTEGER),name:y(b.name,"name",0,256),user:r(b.user,a=>y(a,"user",0,64)),state:y(b.state,"state",0,16),cpuPercent:c(b.cpuPercent,"cpuPercent",100*d),memoryRssBytes:r(b.memoryRssBytes,a=>B(a,"memoryRssBytes",0,Number.MAX_SAFE_INTEGER)),gpuMemoryBytes:r(b.gpuMemoryBytes,a=>B(a,"gpuMemoryBytes",0,Number.MAX_SAFE_INTEGER)),ioReadBytesPerSec:c(b.ioReadBytesPerSec,"ioReadBytesPerSec",1e13),ioWriteBytesPerSec:c(b.ioWriteBytesPerSec,"ioWriteBytesPerSec",1e13),threads:r(b.threads,a=>B(a,"threads",0,1e7)),unit:r(b.unit,a=>y(a,"unit",1,256))};return v(b,"command")&&(e.command=y(b.command,"command",0,4096)),e})}}(b.snapshot)};case"detail.ended":return u(b,["type","subscriptionId","reason"],"detail.ended"),{type:"detail.ended",subscriptionId:z(b.subscriptionId,"subscriptionId"),reason:x(b.reason,["expired","cancelled","withheld","unsupported","busy","failed"],"detail.ended.reason")};default:throw Error(`invalid collector message: unsupported type ${E(b.type)}`)}}function k(a,b="record"){let c=t(a,b);u(c,["collectorId","runId","bootId","sequence","capturedAt","kind","payload"],b);let e={collectorId:z(c.collectorId,"collectorId"),runId:z(c.runId,"runId"),bootId:y(c.bootId,"bootId",0,128),sequence:B(c.sequence,"sequence",0,Number.MAX_SAFE_INTEGER),capturedAt:D(c.capturedAt,"capturedAt")};if("metrics"===c.kind){let a;return{...e,kind:"metrics",payload:(u(a=t(c.payload,"metrics payload"),[...h],"metrics payload"),{cpu:o(a.cpu,"cpu",a=>{u(a,["status","usagePercent","perCore"],"cpu",["temperatureC","powerWatts","iowaitPercent","pressureSomePercent"]);let b={status:"ok",usagePercent:C(a.usagePercent,"usagePercent",0,100),perCore:w(a.perCore,"perCore",0,d).map(a=>null===a?null:C(a,"perCore",0,100))},c=s(a,"temperatureC",a=>C(a,"temperatureC",-50,200));void 0!==c&&(b.temperatureC=c);let e=s(a,"powerWatts",a=>C(a,"powerWatts",0,1e4));void 0!==e&&(b.powerWatts=e);let f=s(a,"iowaitPercent",a=>C(a,"iowaitPercent",0,100));void 0!==f&&(b.iowaitPercent=f);let g=s(a,"pressureSomePercent",a=>C(a,"pressureSomePercent",0,100));return void 0!==g&&(b.pressureSomePercent=g),b}),memory:o(a.memory,"memory",n),swap:o(a.swap,"swap",m),gpus:o(a.gpus,"gpus",a=>(u(a,["status","devices"],"gpus"),{status:"ok",devices:q(w(a.devices,"gpus.devices",0,16).map(a=>p(a,"gpu",(a,b)=>{u(a,["id","status","utilizationPercent","memoryUsedBytes","memoryTotalBytes","temperatureC","powerWatts"],"gpu");let c=r(a.memoryUsedBytes,a=>B(a,"memoryUsedBytes",0,Number.MAX_SAFE_INTEGER)),d=r(a.memoryTotalBytes,a=>B(a,"memoryTotalBytes",0,Number.MAX_SAFE_INTEGER));if(null!==c&&null!==d&&c>d)throw Error("invalid gpu: memoryUsedBytes exceeds total");return{id:b,status:"ok",utilizationPercent:r(a.utilizationPercent,a=>C(a,"utilizationPercent",0,100)),memoryUsedBytes:c,memoryTotalBytes:d,temperatureC:r(a.temperatureC,a=>C(a,"temperatureC",-50,200)),powerWatts:r(a.powerWatts,a=>C(a,"powerWatts",0,1e4))}})))})),disks:o(a.disks,"disks",a=>{u(a,["status","filesystems","devices"],"disks",["pressureSomePercent","pressureFullPercent"]);let b={status:"ok",filesystems:q(w(a.filesystems,"filesystems",0,64).map(a=>p(a,"filesystem",(a,b)=>{u(a,["id","status","usedBytes","totalBytes"],"filesystem",["inodesUsed","inodesTotal"]);let c=m({status:"ok",usedBytes:a.usedBytes,totalBytes:a.totalBytes}),d={id:b,status:"ok",usedBytes:c.usedBytes,totalBytes:c.totalBytes},e=s(a,"inodesUsed",a=>B(a,"inodesUsed",0,Number.MAX_SAFE_INTEGER));void 0!==e&&(d.inodesUsed=e);let f=s(a,"inodesTotal",a=>B(a,"inodesTotal",0,Number.MAX_SAFE_INTEGER));if(void 0!==f&&(d.inodesTotal=f),null!=e&&null!=f&&e>f)throw Error("invalid filesystem: inodesUsed exceeds inodesTotal");return d}))),devices:q(w(a.devices,"disk devices",0,64).map(a=>p(a,"disk",(a,b)=>{u(a,["id","status","readBytesPerSec","writeBytesPerSec"],"disk",["readLatencyMs","writeLatencyMs","ioUtilizationPercent"]);let c={id:b,status:"ok",readBytesPerSec:C(a.readBytesPerSec,"readBytesPerSec",0,1e13),writeBytesPerSec:C(a.writeBytesPerSec,"writeBytesPerSec",0,1e13)},d=s(a,"readLatencyMs",a=>C(a,"readLatencyMs",0,864e5));void 0!==d&&(c.readLatencyMs=d);let e=s(a,"writeLatencyMs",a=>C(a,"writeLatencyMs",0,864e5));void 0!==e&&(c.writeLatencyMs=e);let f=s(a,"ioUtilizationPercent",a=>C(a,"ioUtilizationPercent",0,100));return void 0!==f&&(c.ioUtilizationPercent=f),c})))},c=s(a,"pressureSomePercent",a=>C(a,"pressureSomePercent",0,100));void 0!==c&&(b.pressureSomePercent=c);let d=s(a,"pressureFullPercent",a=>C(a,"pressureFullPercent",0,100));return void 0!==d&&(b.pressureFullPercent=d),b}),network:o(a.network,"network",a=>(u(a,["status","interfaces"],"network"),{status:"ok",interfaces:q(w(a.interfaces,"interfaces",0,64).map(a=>p(a,"interface",(a,b)=>(u(a,["id","status","rxBytesPerSec","txBytesPerSec"],"interface"),{id:b,status:"ok",rxBytesPerSec:C(a.rxBytesPerSec,"rxBytesPerSec",0,1e13),txBytesPerSec:C(a.txBytesPerSec,"txBytesPerSec",0,1e13)}))))}))})}}if("gap"===c.kind){let a=t(c.payload,`${b}.payload`);u(a,["fromCapturedAt","toCapturedAt","droppedRecords","reason"],"gap payload");let d=D(a.fromCapturedAt,"fromCapturedAt"),f=D(a.toCapturedAt,"toCapturedAt");if(Date.parse(d)>Date.parse(f))throw Error("invalid gap: fromCapturedAt after toCapturedAt");return{...e,kind:"gap",payload:{fromCapturedAt:d,toCapturedAt:f,droppedRecords:B(a.droppedRecords,"droppedRecords",1,Number.MAX_SAFE_INTEGER),reason:x(a.reason,i,"gap.reason")}}}throw Error(`invalid ${b}: unsupported kind ${E(c.kind)}`)}function l(a){let b=t(a,"inventory");u(b,["os","cpu","memory","gpus","filesystems","disks","network","capabilities"],"inventory");let c=t(b.os,"inventory.os");u(c,["platform","release","distro","arch"],"inventory.os");let e=t(b.cpu,"inventory.cpu");u(e,["model","logicalCores"],"inventory.cpu");let f=t(b.memory,"inventory.memory");u(f,["totalBytes","swapTotalBytes"],"inventory.memory");let g=t(b.capabilities,"inventory.capabilities"),i=[...h,"processes"];u(g,[...i],"inventory.capabilities");let j={};for(let a of i){let b=t(g[a],`capability ${a}`);u(b,["status"],`capability ${a}`,["reason"]);let c={status:x(b.status,["supported","unsupported","withheld"],`capability ${a}`)};v(b,"reason")&&(c.reason=y(b.reason,"reason",0,256)),j[a]=c}let k=(a,b)=>r(a,a=>B(a,b,0,Number.MAX_SAFE_INTEGER));return{os:{platform:y(c.platform,"platform",0,64),release:y(c.release,"release",0,256),distro:r(c.distro,a=>y(a,"distro",0,256)),arch:y(c.arch,"arch",0,64)},cpu:{model:r(e.model,a=>y(a,"model",0,256)),logicalCores:B(e.logicalCores,"logicalCores",0,d)},memory:{totalBytes:k(f.totalBytes,"totalBytes"),swapTotalBytes:k(f.swapTotalBytes,"swapTotalBytes")},gpus:q(w(b.gpus,"inventory.gpus",0,16).map(a=>{let b=t(a,"gpu inventory");u(b,["id","name","vendor","pciBusId","telemetry","memoryTotalBytes"],"gpu inventory",["reason"]);let c={id:A(b.id),name:y(b.name,"name",0,256),vendor:x(b.vendor,["nvidia","amd","intel","aspeed","other"],"vendor"),pciBusId:r(b.pciBusId,a=>y(a,"pciBusId",1,64)),telemetry:x(b.telemetry,["supported","unsupported"],"telemetry"),memoryTotalBytes:k(b.memoryTotalBytes,"memoryTotalBytes")};return v(b,"reason")&&(c.reason=y(b.reason,"reason",0,256)),c})),filesystems:q(w(b.filesystems,"inventory.filesystems",0,64).map(a=>{let b=t(a,"filesystem inventory");return u(b,["id","mountPoint","device","fsType","totalBytes"],"filesystem inventory"),{id:A(b.id),mountPoint:y(b.mountPoint,"mountPoint",1,256),device:y(b.device,"device",0,256),fsType:y(b.fsType,"fsType",0,64),totalBytes:k(b.totalBytes,"totalBytes")}})),disks:q(w(b.disks,"inventory.disks",0,64).map(a=>{let b=t(a,"disk inventory");if(u(b,["id","name","model","rotational","sizeBytes"],"disk inventory"),null!==b.rotational&&"boolean"!=typeof b.rotational)throw Error("invalid disk inventory: rotational");return{id:A(b.id),name:y(b.name,"name",1,64),model:r(b.model,a=>y(a,"model",0,256)),rotational:b.rotational,sizeBytes:k(b.sizeBytes,"sizeBytes")}})),network:q(w(b.network,"inventory.network",0,64).map(a=>{let b=t(a,"interface inventory");if(u(b,["id","name","mac","addresses","virtual","state","speedMbps"],"interface inventory"),"boolean"!=typeof b.virtual)throw Error("invalid interface inventory: virtual");return{id:A(b.id),name:y(b.name,"name",1,64),mac:r(b.mac,a=>y(a,"mac",1,64)),addresses:w(b.addresses,"addresses",0,32).map(a=>{let b=t(a,"address");u(b,["family","address","prefix"],"address");let c=x(b.family,["ipv4","ipv6"],"family");return{family:c,address:y(b.address,"address",2,64),prefix:B(b.prefix,"prefix",0,"ipv4"===c?32:128)}}),virtual:b.virtual,state:x(b.state,["up","down","unknown"],"state"),speedMbps:r(b.speedMbps,a=>B(a,"speedMbps",0,1e7))}})),capabilities:j}}function m(a){u(a,["status","usedBytes","totalBytes"],"usage");let b=B(a.totalBytes,"totalBytes",0,Number.MAX_SAFE_INTEGER),c=B(a.usedBytes,"usedBytes",0,Number.MAX_SAFE_INTEGER);if(c>b)throw Error("invalid usage: usedBytes exceeds totalBytes");return{status:"ok",usedBytes:c,totalBytes:b}}function n(a){u(a,["status","usedBytes","totalBytes"],"memory",["pressureSomePercent","pressureFullPercent"]);let b=B(a.totalBytes,"totalBytes",0,Number.MAX_SAFE_INTEGER),c=B(a.usedBytes,"usedBytes",0,Number.MAX_SAFE_INTEGER);if(c>b)throw Error("invalid memory: usedBytes exceeds totalBytes");let d={status:"ok",usedBytes:c,totalBytes:b},e=s(a,"pressureSomePercent",a=>C(a,"pressureSomePercent",0,100));void 0!==e&&(d.pressureSomePercent=e);let f=s(a,"pressureFullPercent",a=>C(a,"pressureFullPercent",0,100));return void 0!==f&&(d.pressureFullPercent=f),d}function o(a,b,c){let d=t(a,b);if("ok"===d.status)return c(d);if("unavailable"===d.status)return u(d,["status","reason"],b),{status:"unavailable",reason:y(d.reason,"reason",0,256)};throw Error(`invalid ${b}: unsupported status ${E(d.status)}`)}function p(a,b,c){let d=t(a,b),e=A(d.id);if("ok"===d.status)return c(d,e);if("unavailable"===d.status)return u(d,["id","status","reason"],b),{id:e,status:"unavailable",reason:y(d.reason,"reason",0,256)};throw Error(`invalid ${b}: unsupported status ${E(d.status)}`)}function q(a){let b=new Set;for(let c of a){if(b.has(c.id))throw Error(`invalid resource list: duplicate id ${E(c.id)}`);b.add(c.id)}return a}function r(a,b){return null===a?null:b(a)}function s(a,b,c){if(v(a,b))return r(a[b],c)}function t(a,b){if(null===a||"object"!=typeof a||Array.isArray(a))throw Error(`invalid ${b}: expected object, got ${E(a)}`);return a}function u(a,b,c,d=[]){let e=new Set([...b,...d]);for(let b of Object.keys(a))if(!e.has(b))throw Error(`invalid ${c}: unexpected field "${b}"`);for(let d of b)if(void 0===a[d])throw Error(`invalid ${c}: missing field "${d}"`);for(let b of d)if(v(a,b)&&void 0===a[b])throw Error(`invalid ${c}: ${b} must not be undefined`)}function v(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function w(a,b,c,d){if(!Array.isArray(a))throw Error(`invalid ${b}: expected array`);if(a.length<c||a.length>d)throw Error(`invalid ${b}: length ${a.length} outside ${c}..${d}`);return a}function x(a,b,c){if("string"!=typeof a||!b.includes(a))throw Error(`invalid ${c}: unexpected value ${E(a)}`);return a}function y(a,b,c,d){if("string"!=typeof a)throw Error(`invalid ${b}: expected string, got ${E(a)}`);if(a.length<c||a.length>d)throw Error(`invalid ${b}: length ${a.length} outside ${c}..${d}`);return a}function z(a,b){return y(a,b,1,128)}function A(a){return y(a,"resource id",1,256)}function B(a,b,c,d){if("number"!=typeof a||!Number.isSafeInteger(a))throw Error(`invalid ${b}: expected safe integer, got ${E(a)}`);if(a<c||a>d)throw Error(`invalid ${b}: ${a} outside ${c}..${d}`);return a}function C(a,b,c,d){if("number"!=typeof a||!Number.isFinite(a))throw Error(`invalid ${b}: expected finite number, got ${E(a)}`);if(a<c||a>d)throw Error(`invalid ${b}: ${a} outside ${c}..${d}`);return a}function D(a,b){let c=y(a,b,1,64),d=Date.parse(c);if(!Number.isFinite(d)||d<e||d>f)throw Error(`invalid ${b}: not a parseable timestamp`);return c}function E(a){try{let b=JSON.stringify(a);if("string"==typeof b)return b.length<=80?b:`${b.slice(0,77)}...`}catch{}return String(a)}function F(a){let b=J(a,"hub snapshot");K(b,["hubRunId","machines"],"hub snapshot");let c=M(b.hubRunId,"hubRunId","hub snapshot");if(!Array.isArray(b.machines))throw Error("invalid snapshot machines");let d=new Set;return{hubRunId:c,machines:b.machines.map(a=>{let b=J(a,"machine");K(b,["machineId","collectorId","hostname","connected","lastReceivedAt"],"machine",["expectedIntervalMs","metrics","inventory","delivery","displayName","tags"]);let c=M(b.machineId,"machineId","machine");if(d.has(c))throw Error("duplicate snapshot machine");d.add(c);let e=M(b.collectorId,"collectorId","machine"),f=N(b.hostname,"hostname","machine",0,G);if("boolean"!=typeof b.connected)throw Error("invalid machine connection state");let g=null===b.lastReceivedAt?null:O(b.lastReceivedAt,"lastReceivedAt","machine"),h={},i=L(b,"expectedIntervalMs")?function(a,b,c){if(null===a)return null;if(void 0===a)throw Error(`invalid ${c}: ${b} must not be undefined`);var d=a,e=b,f=c;if("number"!=typeof d||!Number.isSafeInteger(d))throw Error(`invalid ${f}: ${e} must be a safe integer, got ${P(d)}`);if(d<100||d>72e5)throw Error(`invalid ${f}: ${e} ${d} outside ${100}..${72e5}`);return d}(b.expectedIntervalMs,"expectedIntervalMs","machine"):void 0;if(L(b,"metrics")){let{receivedAt:a,...c}=J(b.metrics,"received metrics"),d=k(c);if("metrics"!==d.kind||d.collectorId!==e)throw Error("conflicting machine metrics");if(h.metrics={...d,receivedAt:O(a,"receivedAt","metrics")},h.metrics.receivedAt!==g)throw Error("conflicting metrics receipt time")}if(L(b,"inventory")&&(h.inventory=l(b.inventory)),L(b,"delivery")){let a=j(b.delivery);if("status"!==a.type)throw Error("invalid delivery status");h.delivery=a}if(L(b,"displayName")&&(h.displayName=null===b.displayName?null:N(b.displayName,"displayName","machine",0,128)),L(b,"tags")){if(!Array.isArray(b.tags)||b.tags.length>32)throw Error("invalid machine tags");h.tags=b.tags.map(a=>N(a,"tag","machine",1,64))}return{machineId:c,collectorId:e,hostname:f,connected:b.connected,lastReceivedAt:g,...void 0===i?{}:{expectedIntervalMs:i},...h}})}}let G=255,H=Date.parse("2000-01-01T00:00:00Z"),I=Date.parse("2200-01-01T00:00:00Z");function J(a,b){if(null===a||"object"!=typeof a||Array.isArray(a))throw Error(`invalid ${b}: expected object, got ${P(a)}`);return a}function K(a,b,c,d=[]){let e=new Set([...b,...d]);for(let b of Object.keys(a))if(!e.has(b))throw Error(`invalid ${c}: unexpected field "${b}"`);for(let d of b)if(void 0===a[d])throw Error(`invalid ${c}: missing field "${d}"`);for(let b of d)if(L(a,b)&&void 0===a[b])throw Error(`invalid ${c}: ${b} must not be undefined`)}function L(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function M(a,b,c){return N(a,b,c,1,128)}function N(a,b,c,d,e){if("string"!=typeof a)throw Error(`invalid ${c}: ${b} must be a string, got ${P(a)}`);if(a.length<d||a.length>e)throw Error(`invalid ${c}: ${b} length ${a.length} outside ${d}..${e}`);return a}function O(a,b,c){let d=N(a,b,c,1,64),e=Date.parse(d);if(!Number.isFinite(e)||e<H||e>I)throw Error(`invalid ${c}: ${b} is not a parseable timestamp`);return d}function P(a){try{let b=JSON.stringify(a);if("string"==typeof b)return b.length<=80?b:`${b.slice(0,77)}...`}catch{}return String(a)}},41756:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81921,23)),Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},55324:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,95547,23)),Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},58910:(a,b,c)=>{"use strict";c.d(b,{LiveProvider:()=>s,M:()=>r});var d=c(48249),e=c(67484);async function f(a){try{let b=await a.json();if(b&&"object"==typeof b&&"error"in b){let a=b.error;if("string"==typeof a)return a}}catch{}return a.statusText||null}function g(a){if(!a||"object"!=typeof a)return null;let b=a.username,c=a.csrfToken;if("string"!=typeof b||0===b.length||"string"!=typeof c||0===c.length)return null;let d=a.admin;return void 0!==d&&"boolean"!=typeof d?null:{username:b,csrfToken:c,...!0===d?{admin:!0}:{}}}async function h(){try{let a=await fetch("/api/auth/session",{cache:"no-store",signal:AbortSignal.timeout(5e3),headers:{Accept:"application/json"}});if(a.ok){try{let b=g(await a.json());if(b)return{kind:"signed-in",user:b}}catch{}return{kind:"error",detail:"unexpected session response"}}if(401===a.status)return{kind:"signed-out"};if(503===a.status)return{kind:"auth-unavailable",detail:await f(a)};return{kind:"error",detail:`unexpected status ${a.status}`}}catch{return{kind:"unreachable"}}}async function i(a,b){try{let c=await fetch("/api/auth/login",{method:"POST",cache:"no-store",signal:AbortSignal.timeout(5e3),headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({username:a,password:b})});if(c.ok){try{let a=g(await c.json());if(a)return{kind:"signed-in",user:a}}catch{}return{kind:"error",detail:"unexpected sign-in response"}}if(401===c.status)return{kind:"invalid-credentials",detail:await f(c)};if(429===c.status)return{kind:"error",detail:"too many attempts — wait a moment and try again"};if(503===c.status)return{kind:"auth-unavailable",detail:await f(c)};return{kind:"error",detail:`unexpected status ${c.status}`}}catch{return{kind:"unreachable"}}}async function j(a){try{let b=await fetch("/api/auth/logout",{method:"POST",cache:"no-store",signal:AbortSignal.timeout(5e3),headers:{"X-CSRF-Token":a,Accept:"application/json"}});if(b.ok||401===b.status)return"ok";return b.status,{kind:"error",detail:`unexpected status ${b.status}`}}catch{return"unreachable"}}async function k(a=5e3){let b=new AbortController,c=setTimeout(()=>b.abort(),a);try{let a=await fetch("/api/live",{cache:"no-store",signal:b.signal,headers:{Accept:"text/event-stream"}});if(200===a.status)return{kind:"ok"};if(401===a.status)return{kind:"unauthorized"};if(403===a.status)return{kind:"forbidden"};return{kind:"error",detail:`unexpected status ${a.status}`}}catch{return{kind:"unreachable"}}finally{clearTimeout(c);try{b.abort()}catch{}}}var l=c(25982);let m=["snapshot","update","reset"];class n{source=null;lastId=null;get lastEventId(){return this.lastId}get isOpen(){return null!==this.source&&2!==this.source.readyState}start(a,b){this.close();let c=new EventSource(a);this.source=c;let d=a=>d=>{if(this.source!==c||null===this.source)return;let e=d.lastEventId;"string"==typeof e&&e.length>0&&(this.lastId=e);try{b.onSnapshot((0,l.FZ)(JSON.parse(d.data)),a,e??"")}catch{this.close(),b.onError()}};for(let a of m)c.addEventListener(a,d(a));c.onerror=()=>{this.source===c&&(this.close(),b.onError())}}close(){this.source?.close(),this.source=null}}var o=c(65666);let p=[1e3,2e3,4e3,8e3,15e3],q=(0,e.createContext)(null);function r(){let a=(0,e.useContext)(q);if(!a)throw Error("useLive must be used inside <LiveProvider>");return a}function s({children:a}){let[b,c]=(0,e.useState)({kind:"restoring"}),[f,g]=(0,e.useState)("idle"),[l,m]=(0,e.useState)(null),[r,t]=(0,e.useState)([]),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(new Map),E=(0,e.useRef)(!0),F=(0,e.useRef)(0),G=(0,e.useRef)(null),H=(0,e.useRef)(null),I=(0,e.useRef)(0),J=(0,e.useRef)(b),K=(0,e.useRef)(0),L=(0,e.useRef)(!1),M=(0,e.useRef)(!1),N=a=>{J.current=a,c(a)},O=()=>{null!==H.current&&(clearTimeout(H.current),H.current=null)},P=()=>{K.current+=1,F.current+=1,G.current?.close(),G.current=null,O()},Q=()=>{L.current=!1,t([]),D(new Map),m(null),x(null),z(null),v(null)},R=a=>{let b=J.current;("signed-in"!==b.kind||b.user.csrfToken!==a.csrfToken)&&Q(),N({kind:"signed-in",user:a})},S=()=>{if("signed-in"!==J.current.kind)return;P(),g(L.current?"reconnecting":"connecting");let a=new n;G.current=a,a.start("/api/live",{onSnapshot:(b,c,d)=>{E.current&&G.current===a&&(I.current=0,L.current=!0,m(b.hubRunId),t(b.machines),v(Date.now()),x(d||null),z(c),D(a=>(0,o.g)(a,b)),g("live"))},onError:()=>{E.current&&G.current===a&&T()}})},T=async()=>{P();let a=K.current;g("reconnecting");let b=await h();if(!E.current||a!==K.current)return;if("signed-in"===b.kind)R(b.user);else if("signed-out"===b.kind){N({kind:"signed-out"}),Q(),g("expired");return}else if("auth-unavailable"===b.kind){N({kind:"auth-unavailable",detail:b.detail}),Q(),g("idle");return}let c=Math.min(I.current+1,p.length+1);if(I.current=c,c>p.length){g("disconnected"),V();return}g("reconnecting"),H.current=setTimeout(()=>{U()},p[c-1])},U=async()=>{if(!E.current||M.current)return;P();let a=K.current,b=await k();if(E.current&&a===K.current){if("forbidden"===b.kind){Q(),g("no-permission");return}if("unauthorized"===b.kind){let b=await h();if(!E.current||a!==K.current)return;if("signed-in"===b.kind){R(b.user),S();return}if("signed-out"===b.kind){N({kind:"signed-out"}),Q(),g("expired");return}if("auth-unavailable"===b.kind){N({kind:"auth-unavailable",detail:b.detail}),Q(),g("idle");return}}S()}},V=()=>{O(),H.current=setTimeout(()=>{W()},3e4)},W=async()=>{if(!E.current||M.current)return;P();let a=K.current,b=await h();if(E.current&&a===K.current){if("signed-in"===b.kind){R(b.user),S();return}if("signed-out"===b.kind){N({kind:"signed-out"}),Q(),g("expired");return}if("auth-unavailable"===b.kind){N({kind:"auth-unavailable",detail:b.detail}),Q(),g("idle");return}V()}},X=async a=>{let b=K.current,c=await h();if(E.current&&F.current===a&&b===K.current){if("signed-in"===c.kind){R(c.user),I.current=0,S();return}if("signed-out"===c.kind){N({kind:"signed-out"}),g("idle");return}if("auth-unavailable"===c.kind){N({kind:"auth-unavailable",detail:c.detail}),g("idle");return}N({kind:"restore-failed",detail:"error"===c.kind?c.detail:null}),g("idle")}},Y=async(a,b)=>{P();let c=K.current,d=await i(a,b);return E.current&&c===K.current?("signed-in"===d.kind&&E.current&&(R(d.user),B(null),I.current=0,S()),d):{kind:"error",detail:"Session request superseded. Try again."}},Z=async()=>{let a=J.current;if("signed-in"!==a.kind||M.current)return;M.current=!0,P();let b=K.current;Q(),g("idle");let c=await j(a.user.csrfToken);if(M.current=!1,!E.current||b!==K.current)return;if("ok"===c){N({kind:"signed-out"}),Q(),g("idle"),B("Signed out.");return}let d=await h();if(E.current&&b===K.current){if("signed-in"===d.kind){R(d.user),B("Sign out failed — try again."),S();return}if("signed-out"===d.kind){N({kind:"signed-out"}),Q(),g("idle"),B(null);return}if("auth-unavailable"===d.kind){N({kind:"auth-unavailable",detail:d.detail}),g("idle");return}N({kind:"restore-failed",detail:"error"===d.kind?d.detail:null}),g("idle")}};return(0,d.jsx)(q.Provider,{value:{session:b,phase:f,hubRunId:l,machines:r,lastReceivedLocalMs:u,lastEventId:w,lastEventKind:y,notice:A,history:C,login:Y,signOut:Z,retryConnection:()=>{if(E.current&&!M.current){if("signed-in"===J.current.kind){I.current=0,U();return}F.current+=1,X(F.current)}},dismissNotice:()=>B(null)},children:a})}},59645:(a,b,c)=>{"use strict";function d(){return[{type:"image/svg+xml",sizes:"any",url:"/icon.svg?3b3fa3229e2d0d7a"}]}c.r(b),c.d(b,{default:()=>d})},61135:()=>{},65223:(a,b,c)=>{"use strict";c.d(b,{ThemeProvider:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ThemeProvider() from the server but ThemeProvider 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-provider.tsx","ThemeProvider")},65666:(a,b,c)=>{"use strict";c.d(b,{K:()=>h,g:()=>f});var d=c(22127),e=c(93224);function f(a,b){let c=new Map;for(let f of b.machines){let g=f.metrics;if(!g)continue;let h=`${b.hubRunId}\0${g.collectorId}\0${g.runId}\0${g.sequence}`,i=a.get(f.machineId)??[],j=i.at(-1);if(j?.sampleId===h){c.set(f.machineId,i);continue}let k=h.slice(0,h.lastIndexOf("\0")+1),l=j?.sampleId.startsWith(k)?i:[],m=g.payload.memory;c.set(f.machineId,[...l,{sampleId:h,receivedAtLocal:Date.parse(g.receivedAt),cpuPercent:"ok"===g.payload.cpu.status?g.payload.cpu.usagePercent:null,memoryPercent:"ok"===m.status&&m.totalBytes>0?100*m.usedBytes/m.totalBytes:null,gapThresholdMs:(0,e.Cj)(f.expectedIntervalMs)}].slice(-d.yY))}return c}function g(a){return"number"==typeof a.gapThresholdMs&&Number.isFinite(a.gapThresholdMs)&&a.gapThresholdMs>0?a.gapThresholdMs:d.vz}function h(a,b=600,c=140){let e;if(a.length<2)return null;let f=a[0].receivedAtLocal,i=Math.max(1e3,a.at(-1).receivedAtLocal-f),j="";for(let h of a){if(null===h.cpuPercent){e=void 0;continue}let a=4+(h.receivedAtLocal-f)/i*(b-8),k=c-4-h.cpuPercent/100*(c-8),l=e?Math.min(g(e),g(h)):d.vz,m=e&&h.receivedAtLocal>=e.receivedAtLocal&&h.receivedAtLocal-e.receivedAtLocal<l;j+=`${m?"L":"M"}${a.toFixed(2)},${k.toFixed(2)} `,e=h}return j.trim()||null}},76537:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,metadata:()=>g});var d=c(5735),e=c(65223),f=c(89604);c(61135);let g={title:{template:"%s — Rigscope",default:"Rigscope"},description:"Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub."};function h({children:a}){return(0,d.jsx)("html",{lang:"en",suppressHydrationWarning:!0,children:(0,d.jsx)("body",{children:(0,d.jsx)(e.ThemeProvider,{attribute:"class",defaultTheme:"dark",enableSystem:!0,children:(0,d.jsx)(f.LiveProvider,{children:a})})})})}},78335:()=>{},86737:(a,b,c)=>{Promise.resolve().then(c.bind(c,4833)),Promise.resolve().then(c.bind(c,58910))},89604:(a,b,c)=>{"use strict";c.d(b,{LiveProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call useLive() from the server but useLive 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/live/live-provider.tsx","useLive");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call LiveProvider() from the server but LiveProvider 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/live/live-provider.tsx","LiveProvider")},93224:(a,b,c)=>{"use strict";c.d(b,{$:()=>f,A4:()=>k,Cj:()=>e,F2:()=>n,L_:()=>m,fv:()=>l,l9:()=>i,nV:()=>j,vj:()=>g,z3:()=>h});var d=c(22127);function e(a){return null==a||"number"!=typeof a||!Number.isFinite(a)||a<=0?d.vz:Math.max(d.vz,3*a)}function f(a){if(null==a||!Number.isFinite(a)||a<0)return"—";if(a<6e4){let b=a/1e3;return Number.isInteger(b)?`${b} s`:`${b.toFixed(1)} s`}if(a<36e5){let b=a/6e4;return Number.isInteger(b)?`${b} min`:`${b.toFixed(1)} min`}let b=a/36e5;return Number.isInteger(b)?`${b} h`:`${b.toFixed(1)} h`}function g(a,b,c=e(a.expectedIntervalMs)){return function(a,b,c=d.vz){if(null===a)return"unknown";let e=Date.parse(a);return Number.isFinite(e)?b-e>=c?"stale":"live":"unknown"}(a.lastReceivedAt,b,c)}function h(a){if(null==a||!Number.isFinite(a)||a<0)return"—";let b=["B","KiB","MiB","GiB","TiB"],c=a,d=0;for(;c>=1024&&d<b.length-1;)c/=1024,d+=1;return 0===d?`${Math.round(c)} B`:`${c.toFixed(1)} ${b[d]}`}function i(a){return null!=a&&Number.isFinite(a)?`${a.toFixed(1)}%`:"—"}function j(a){if(null===a||!Number.isFinite(a))return"—";let b=Math.round(Math.max(0,a)/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60){let a=b%60;return 0===a?`${c}m ago`:`${c}m ${a}s ago`}let d=Math.floor(c/60);if(d<24){let a=c%60;return 0===a?`${d}h ago`:`${d}h ${a}m ago`}let e=Math.floor(d/24),f=d%24;return 0===f?`${e}d ago`:`${e}d ${f}h ago`}function k(a,b){if(null===a)return null;let c=Date.parse(a);return Number.isFinite(c)?b-c:null}function l(a){switch(a){case"ok":return"Live";case"degraded":return"Degraded";case"stale":return"Stale";case"disconnected":return"Disconnected";case"unseen":return"No sample yet"}}function m(a,b=d.mq){let c=a.metrics;if(!c)return{kind:"unknown"};let e=Date.parse(c.capturedAt),f=Date.parse(c.receivedAt);if(!Number.isFinite(e)||!Number.isFinite(f))return{kind:"unknown"};let g=e-f;return g>b?{kind:"ahead",skewMs:g}:g<-b?{kind:"behind",skewMs:-g}:{kind:"none"}}function n(a,b,c=e(a.expectedIntervalMs)){return{freshness:g(a,b,c),attention:function(a,b,c=e(a.expectedIntervalMs)){var d;let f=g(a,b,c);return a.metrics&&"unknown"!==f?"stale"===f?"stale":(d=a.metrics)&&("unavailable"===d.payload.cpu.status||"unavailable"===d.payload.memory.status)?"degraded":a.connected?"ok":"disconnected":"unseen"}(a,b,c),connection:a.connected?"connected":"disconnected",skew:m(a),thresholdMs:c}}},96487:()=>{}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=168,exports.ids=[168],exports.modules={11449:(a,b,c)=>{c.d(b,{Cv:()=>e,H9:()=>d,Lf:()=>j,P$:()=>f,RL:()=>q,bP:()=>p,er:()=>m,oB:()=>i,ue:()=>o,yv:()=>l});let d=[{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 e(a,b){return a.filter(c=>{for(let[d,e,f]of[["memory","memory.used","memory.usage"],["filesystem","fs.used","fs.usage"]])if(a.includes(e)&&a.includes(f)&&(c===e||c===f))return c===("percent"===b[d]?f:e);return!0})}let f=[{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"]}],g=["var(--cpu)","var(--mem)","color-mix(in oklab, var(--swap) 75%, var(--foreground))","var(--warn)","var(--crit)","var(--accent)"],h=[void 0,"7 4","2 3","10 3 2 3","4 4","1 3"];function i(a){return d.find(b=>b.metric===a)??null}function j(a,b){let c=Math.max(0,b),d=a.colorSlot+c,e=(c+Math.floor(d/g.length))%h.length;return{color:g[d%g.length],dash:h[e]}}let k={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPU metrics",disks:"Disk metrics",network:"Network metrics"};function l(a,b){let c=i(b);if(null===c||void 0===a)return{available:!0,reason:null};let d=a.inventory?.capabilities?.[c.family];if(!d||"supported"===d.status)return{available:!0,reason:null};let e=d.reason?.trim();return{available:!1,reason:e?`${k[c.family]}: ${d.status} — ${e}`:`${k[c.family]} are ${d.status} on this machine.`}}function m(a){if(void 0===a)return[];let b=[],c=c=>{!(b.length>=16)&&l(a,c).available&&b.push(c)};c("cpu.usage"),c("memory.used");let d=function(a){let b=a.inventory?.memory.swapTotalBytes;if("number"==typeof b)return b;let c=a.metrics?.payload.swap;return c?.status==="ok"?c.totalBytes:null}(a);return null!==d&&d>0&&c("swap.used"),o(a,[]).length>0&&(c("gpu.utilization"),c("gpu.memory.used")),b}function n(a){let b=a.includes(":")?a.slice(a.indexOf(":")+1):a;return b.length<=18?b:`${b.slice(0,10)}…${b.slice(-4)}`}function o(a,b){let c=new Set(b.filter(a=>a.metric.startsWith("gpu.")&&""!==a.resourceId).map(a=>a.resourceId)),d=[],e=new Set;(a?.inventory?.gpus??[]).forEach(a=>{let b="supported"===a.telemetry;(b||c.has(a.id))&&(e.add(a.id),d.push({id:a.id,label:a.name.trim()||n(a.id),index:d.length,totalBytes:a.memoryTotalBytes,supported:b,hasHistory:c.has(a.id)}))});let f=a?.metrics?.payload.gpus;if(f?.status==="ok")for(let a of f.devices)e.has(a.id)||"ok"!==a.status||(e.add(a.id),d.push({id:a.id,label:n(a.id),index:d.length,totalBytes:a.memoryTotalBytes,supported:!0,hasHistory:c.has(a.id)}));for(let a of[...c].sort())e.has(a)||d.push({id:a,label:n(a),index:d.length,totalBytes:null,supported:!0,hasHistory:!0});return d}function p(a,b,c){if(""===c)return i(b)?.shortLabel??"Total";let d=i(b);if(null===d)return n(c);switch(d.family){case"gpus":{let b=a?.inventory?.gpus.find(a=>a.id===c);return b?.name.trim()||n(c)}case"disks":{if(b.startsWith("fs.")){let b=a?.inventory?.filesystems.find(a=>a.id===c);return b?.mountPoint||n(c)}let d=a?.inventory?.disks.find(a=>a.id===c);return d?.name||n(c)}case"network":{let b=a?.inventory?.network.find(a=>a.id===c);return b?.name||n(c)}case"cpu":{let a=/^core:(\d+)$/.exec(c);return a?`Core ${a[1]}`:n(c)}default:return n(c)}}function q(a){switch(a){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 a}}},15670:(a,b,c)=>{c.d(b,{t:()=>k});var d=c(48249),e=c(67484),f=c(96480),g=c(66338),h=c(11449),i=c(55280),j=c(47978);function k(a){let{title:b,unit:c,series:k,fromMs:l,toMs:m,stepMs:n,gaps:o,hiddenKeys:p,onToggleSeries:q,emptyMessage:r,note:s}=a,t=(0,e.useMemo)(()=>k.filter(a=>!p.has(a.key)),[k,p]),u=(0,j.Au)({series:t,fromMs:l,toMs:m,stepMs:n,gaps:o}),v=t.flatMap(a=>a.points),w=v.some(a=>null!==a.avg||null!==a.min||null!==a.max),x=Math.max(1,m-l),y=(0,f.$z)(o,l,m),z=(0,f.kk)(c,v.flatMap(a=>[a.min,a.max,a.avg]).filter(a=>null!==a)),A=Math.max(1e-9,z.max-z.min),B=a=>6+(Math.min(m,Math.max(l,a))-l)/x*788,C=a=>6+(1-(a-z.min)/A)*148,D=(0,e.useMemo)(()=>t.map(b=>{let c=(0,f.SG)(b.points,a.maxDrawPoints??601,n),d=(0,f.o)(c,{stepMs:n,gaps:o,fromMs:l,toMs:m});return{...b,segments:d}}),[t,a.maxDrawPoints,n,o,l,m]),E=function(a,b,c,d,e,h){if(0===c.length)return`${a} chart: no series selected.`;let i=c.map(a=>{let c=(0,f.T6)(a.points);return`${a.label}: ${function(a,b){let c=[];if(null!==a.latest){let d=null!==a.latestT?(0,g.ei)(a.latestT):null;c.push(`latest ${(0,g.dd)(a.latest,b)}${d?` at ${d}`:""}`)}return c.push(`average ${(0,g.dd)(a.avg,b)}`),null!==a.min&&null!==a.max&&c.push(`recorded range ${(0,g.dd)(a.min,b)} to ${(0,g.dd)(a.max,b)}`),c.join(", ")}(c,b)}`}),j=h>0?`${h} shaded interval${1===h?"":"s"} without stored data.`:"";return`${a} time-series chart. ${i.join(". ")}. ${j} Time range ${(0,g.ei)(d)} to ${(0,g.ei)(e)}.`}(b,c,t,l,m,y.length),F=null===u.timeMs?[]:t.map(a=>({...a,point:(0,i.bO)(a.points,u.timeMs,n,o)})),G=null===u.timeMs?null:B(u.timeMs),H=`${u.id}-tooltip`,I=`${u.id}-instructions`;return(0,d.jsxs)("figure",{className:`flex min-w-0 flex-col gap-2 ${a.className??""}`,children:[(0,d.jsxs)("div",{className:"flex min-h-8 flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("h3",{className:"text-xs font-medium tracking-tight text-foreground",children:b}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"tnum shrink-0 text-xs text-muted-foreground",children:s??(0,h.RL)(c)}),a.action]})]}),w?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,d.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:[...z.ticks].reverse().map(a=>(0,d.jsx)("span",{children:(0,g.Ah)(a,c)},a))}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"relative",onPointerLeave:u.clear,children:[(0,d.jsx)("p",{id:I,className:"sr-only",children:"Use Left and Right arrows to inspect recorded readings, Home or End to jump, and Escape to dismiss."}),(0,d.jsxs)("svg",{viewBox:"0 0 800 160",preserveAspectRatio:"none",role:"img","aria-label":E,tabIndex:0,"aria-describedby":`${I}${u.active?` ${H}`:""}`,onPointerMove:a=>{let b=a.currentTarget.getBoundingClientRect();u.inspect((0,i.yk)(a.clientX,b.left,b.width,l,m,.0075))},onFocus:u.onFocus,onBlur:u.clear,onKeyDown:u.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,d.jsx)("title",{children:b}),z.ticks.map(a=>(0,d.jsx)("line",{x1:6,x2:794,y1:C(a),y2:C(a),stroke:"var(--border)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${a}`)),y.map(a=>(0,d.jsx)("rect",{x:B(a.fromMs),y:6,width:Math.max(1,B(a.toMs)-B(a.fromMs)),height:148,fill:"var(--muted-foreground)",opacity:"0.09"},`gap-${a.fromMs}-${a.toMs}-${a.kind}`)),D.map(a=>{var b;let c=(b=a.segments,b.filter(a=>a.length>1).map(a=>{let b=a.map(a=>`${B(a.t).toFixed(2)},${C(a.max??a.avg).toFixed(2)}`),c=[...a].reverse().map(a=>`${B(a.t).toFixed(2)},${C(a.min??a.avg).toFixed(2)}`);return`M${b.join("L")}L${c.join("L")}Z`}).join(" "));return""===c?null:(0,d.jsx)("path",{d:c,fill:a.color,opacity:"0.14",stroke:"none"},`band-${a.key}`)}),D.map(a=>{var b;let c=(b=a.segments,b.filter(a=>a.length>1).map(a=>a.map((a,b)=>`${0===b?"M":"L"}${B(a.t).toFixed(2)},${C(a.avg).toFixed(2)}`).join(" ")).join(" "));return""===c?null:(0,d.jsx)("path",{d:c,fill:"none",stroke:a.color,strokeWidth:"2",strokeDasharray:a.dash,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},`line-${a.key}`)}),D.flatMap(a=>a.segments.filter(a=>1===a.length).map(b=>{let c=b[0],e=B(c.t),f=C(c.avg);return(0,d.jsx)("line",{x1:e-2.5,x2:e+2.5,y1:f,y2:f,stroke:a.color,strokeWidth:"2.5",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"},`dot-${a.key}-${c.t}`)})),null!==G?(0,d.jsxs)("g",{"aria-hidden":!0,pointerEvents:"none",children:[(0,d.jsx)("line",{x1:G,x2:G,y1:6,y2:154,stroke:"var(--muted-foreground)",strokeWidth:"1",strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke"}),F.map(({key:a,color:b,point:c})=>c?.avg==null?null:(0,d.jsx)("circle",{cx:B(c.t),cy:C(c.avg),r:"3.5",fill:b,stroke:"var(--card)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"},a))]}):null]}),u.active&&null!==u.timeMs&&null!==G?(0,d.jsx)(j.eg,{id:H,timeMs:u.timeMs,fraction:G/800,unit:c,readings:F}):null]}),(0,d.jsx)("div",{"aria-hidden":!0,className:"mt-1 flex justify-between gap-2 text-xs leading-tight tnum text-muted-foreground",children:(0,f.Cf)(l,m).map((a,b,c)=>(0,d.jsx)("span",{className:`${0===b?"text-left":b===c.length-1?"text-right":"hidden text-center sm:inline"}`,children:(0,g.O5)(a,x)},a))})]})]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:k.map(a=>{let b=!p.has(a.key),e=(0,f.T6)(a.points);return(0,d.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",title:b?`Hide ${a.label}`:`Show ${a.label}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:()=>q(a.key),className:"peer sr-only"}),(0,d.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,d.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,d.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:a.color,strokeWidth:"2.5",strokeDasharray:a.dash,strokeLinecap:"round"})})}),(0,d.jsx)("span",{className:b?"text-foreground":"text-muted-foreground line-through",children:a.label}),(0,d.jsx)("span",{className:"tnum text-muted-foreground",children:(0,g.dd)(e.latest,c)})]},`legend-${a.key}`)})})]}):(0,d.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===k.length?r:0===t.length?"All series are hidden. Re-enable one in the legend below.":r}),!w&&k.length>0?(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:k.map(a=>{let b=!p.has(a.key);return(0,d.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:()=>q(a.key),className:"peer sr-only"}),(0,d.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,d.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,d.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:a.color,strokeWidth:"2.5",strokeDasharray:a.dash,strokeLinecap:"round"})})}),(0,d.jsx)("span",{className:b?"text-foreground":"text-muted-foreground line-through",children:a.label})]},`legend-empty-${a.key}`)})}):null]})}},43607:(a,b,c)=>{c.d(b,{n:()=>e});var d=c(67484);function e({machineId:a,metricsKey:b,coreIdsKey:c,range:f,enabled:g=!0,autoRefresh:h=!0,refreshNonce:i=0}){let[j,k]=(0,d.useState)({machineId:a,metricsKey:b,coreIdsKey:c,range:f}),l=j.machineId===a&&j.range===f?j:{machineId:a,metricsKey:b,coreIdsKey:c,range:f},m=l.metricsKey,n=l.coreIdsKey,o=`${a}|${m}|${f}|${n??"all"}`,[p,q]=(0,d.useState)(null),[r,s]=(0,d.useState)(null),[t,u]=(0,d.useState)(null);return(0,d.useRef)(i),{data:g&&p?.result.machineId===a&&p.range===f?p:null,error:g&&r?.key===o?r.error:null,loading:g&&t?.key===o,manualRefreshing:g&&t?.key===o&&t.manual}}c(66338)},47978:(a,b,c)=>{c.d(b,{Au:()=>j,_C:()=>i,eg:()=>k});var d=c(48249),e=c(67484),f=c(55280),g=c(66338);let h=(0,e.createContext)(null);function i({children:a}){let[b,c]=(0,e.useState)(null),f=(0,e.useCallback)(a=>c(b=>b?.timeMs===a?.timeMs&&b?.source===a?.source?b:a),[]),g=(0,e.useMemo)(()=>({cursor:b,setCursor:f}),[b,f]);return(0,d.jsx)(h.Provider,{value:g,children:a})}function j({series:a,fromMs:b,toMs:c,stepMs:d,gaps:g}){let i=(0,e.useId)(),[k,l]=(0,e.useState)(null),m=(0,e.useContext)(h),n=m?m.cursor:k,o=m?m.setCursor:l,p=(0,e.useMemo)(()=>(0,f.X)(a).filter(a=>a.t<=c&&a.t+d/2>=b),[a,b,c,d]),q=n&&n.timeMs>=b-d/2&&n.timeMs<=c?n.timeMs:null,r=null!==q&&n?.source===i,s=a=>{let e=Math.max(b,Math.min(c,a)),h=(0,f.bO)(p,e,d,g);o({timeMs:h?.t??e,source:i})},t=()=>{n?.source===i&&o(null)};return{id:i,timeMs:q,active:r,inspect:s,clear:t,onKeyDown:a=>{if("Escape"===a.key)a.preventDefault(),t();else if(["ArrowLeft","ArrowRight","Home","End"].includes(a.key)){a.preventDefault();let b=(0,f.o7)(p,q,a.key);null!==b&&o({timeMs:b,source:i})}},onFocus:()=>s(p.at(-1)?.t??c)}}function k({id:a,timeMs:b,fraction:c,unit:e,readings:f}){return(0,d.jsxs)("div",{id:a,role:"tooltip",className:"absolute top-2 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",style:{left:`clamp(8px, calc(${100*c}% ${c>.5?"- 14rem - 12px":"+ 12px"}), max(8px, calc(100% - 14rem - 8px)))`},children:[(0,d.jsx)("p",{className:"tnum font-medium",children:(0,g.r6)(b)}),(0,d.jsx)("p",{className:"mb-2 text-muted-foreground",children:"Recorded bucket average"}),(0,d.jsx)("dl",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-4 gap-y-1.5",children:f.map(({key:a,label:c,color:f,point:h})=>(0,d.jsxs)("div",{className:"contents",children:[(0,d.jsxs)("dt",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:f}}),(0,d.jsx)("span",{className:"break-words",children:c})]}),(0,d.jsxs)("dd",{className:"tnum text-right",children:[h?.avg==null?"No reading":(0,g.dd)(h.avg,e),h&&h.t!==b?(0,d.jsx)("span",{className:"block text-muted-foreground",children:(0,g.ei)(h.t)}):null]})]},a))})]})}},55280:(a,b,c)=>{function d(a,b,c,d){if(d.some(a=>b>a.fromMs&&b<a.toMs))return null;let e=0,f=a.length;for(;e<f;){let c=e+f>>>1;a[c].t<b?e=c+1:f=c}let g=a[e-1],h=a[e],i=g&&(!h||b-g.t<=h.t-b)?g:h;return!i||Math.abs(i.t-b)>c/2||d.some(a=>a.toMs>Math.min(b,i.t)&&a.fromMs<Math.max(b,i.t))?null:i}function e(a){return[...new Set(a.flatMap(a=>a.points.map(a=>a.t)))].sort((a,b)=>a-b).map(a=>({t:a,min:null,max:null,avg:null}))}function f(a,b,c,d,e,g=0){return Math.round(d+Math.max(0,Math.min(1,((c>0?(a-b)/c:0)-g)/(1-2*g)))*(e-d))}function g(a,b,c){return 0===a.length?null:"Home"===c?a[0].t:"End"===c||null===b?a.at(-1).t:"ArrowLeft"===c?[...a].reverse().find(a=>a.t<b)?.t??a[0].t:"ArrowRight"===c?a.find(a=>a.t>b)?.t??a.at(-1).t:b}c.d(b,{X:()=>e,bO:()=>d,o7:()=>g,yk:()=>f})},66338:(a,b,c)=>{c.d(b,{Ah:()=>l,I_:()=>p,O5:()=>o,Vw:()=>v,bf:()=>u,dd:()=>k,ei:()=>m,fH:()=>q,ly:()=>e,pI:()=>d,r6:()=>n,zp:()=>f});let d=[{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 e(a){return d.find(b=>b.id===a)??d[0]}function f(a){return e(a).refreshMs}let g=["B","KiB","MiB","GiB","TiB","PiB"];function h(a){let b=Math.abs(a),c=0;for(;b>=1024&&c<g.length-1;)b/=1024,c+=1;return{value:a<0?-b:b,unit:g[c]}}function i(a,b){return String(Number(a.toFixed(b)))}function j(a,b=""){let{value:c,unit:d}=h(a),e=Math.abs(c)>=100?0:1;return`${i(c,e)} ${d}${b}`}function k(a,b){if(null==a||!Number.isFinite(a))return"—";switch(b){case"percent":return`${i(a,1)}%`;case"bytes":return j(a);case"bytes_per_second":return j(a,"/s");case"celsius":return`${i(a,1)}\xb0C`;case"watts":return`${i(a,1)} W`;case"milliseconds":return`${i(a,10>Math.abs(a)?2:1)} ms`;default:return i(a,2)}}function l(a,b){if(!Number.isFinite(a))return"—";switch(b){case"percent":return`${i(a,0)}%`;case"bytes":case"bytes_per_second":{let{value:c,unit:d}=h(a),e=Math.abs(c)>=10||0===c?0:1;return`${i(c,e)} ${d}${"bytes_per_second"===b?"/s":""}`}case"celsius":return`${i(a,0)}\xb0C`;case"watts":return`${i(a,0)} W`;case"milliseconds":return`${i(a,+(10>Math.abs(a)))} ms`;default:return i(a,1)}}function m(a){return new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function n(a){return new Date(a).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"medium"})}function o(a,b){let c=new Date(a);return b>=1728e5?c.toLocaleDateString(void 0,{month:"short",day:"numeric"}):b>=864e5?c.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function p(a){let b=Math.max(0,a);return b>=36e5?`${i(b/36e5,1)} h`:b>=6e4?`${i(b/6e4,1)} min`:`${i(b/1e3,1)} s`}function q(a,b,c){let d=a.filter(a=>a.toMs>=b&&a.fromMs<=c);if(0===d.length)return"No recorded gaps in this range.";let e=d.filter(a=>"dropped"===a.kind).length,f=d.length-e,g=[];f>0&&g.push(`${f} missed interval${1===f?"":"s"}`),e>0&&g.push(`${e} dropped report${1===e?"":"s"}`);let h=[...new Set(d.map(a=>a.reason).filter(a=>"string"==typeof a&&a.length>0))],i=h.length>0?` (${h.slice(0,3).join("; ")})`:"";return`${g.join(" and ")}${i}.`}function r(a){return null!==a&&"object"==typeof a&&!Array.isArray(a)}function s(a){return"number"==typeof a&&Number.isFinite(a)}function t(a){return null===a||s(a)}function u(a){if(!r(a)||"string"!=typeof a.machineId||0===a.machineId.length||!s(a.fromMs)||!s(a.toMs)||a.toMs<=a.fromMs||!s(a.stepMs)||a.stepMs<=0||"raw"!==a.tier&&"1m"!==a.tier&&"1h"!==a.tier||"boolean"!=typeof a.truncated||!s(a.elapsedMs)||!Array.isArray(a.series)||!Array.isArray(a.gaps))return null;let b=[];for(let c of a.series){if(!r(c)||"string"!=typeof c.metric||"string"!=typeof c.resourceId||"string"!=typeof c.unit||!Array.isArray(c.points))return null;let a=[];for(let b of c.points){if(!r(b)||!s(b.t)||!t(b.min)||!t(b.max)||!t(b.avg))return null;a.push({t:b.t,min:b.min,max:b.max,avg:b.avg})}b.push({metric:c.metric,resourceId:c.resourceId,unit:c.unit,points:a})}let c=[];for(let b of a.gaps){if(!r(b)||!s(b.fromMs)||!s(b.toMs)||"missing"!==b.kind&&"dropped"!==b.kind)return null;let a={fromMs:b.fromMs,toMs:b.toMs,kind:b.kind};"string"==typeof b.reason&&(a.reason=b.reason),s(b.droppedRecords)&&(a.droppedRecords=b.droppedRecords),c.push(a)}return{machineId:a.machineId,fromMs:a.fromMs,toMs:a.toMs,stepMs:a.stepMs,tier:a.tier,series:b,gaps:c,truncated:a.truncated,elapsedMs:a.elapsedMs}}function v(a,b,c,d,f=600,g){let{fromMs:h,toMs:i}={fromMs:d-e(c).ms,toMs:d},j=new URLSearchParams({machineId:a,metrics:b.join(","),from:String(Math.floor(h)),to:String(Math.floor(i)),maxPoints:String(f)});return void 0!==g&&j.set("coreIds",g.join(",")),`/api/history?${j.toString()}`}},96480:(a,b,c)=>{function d(a){return null!==a.avg&&Number.isFinite(a.avg)}function e(a){return null!==a&&Number.isFinite(a)?a:null}function f(a,b,c){let d=a.map(a=>({...a,fromMs:Math.max(b,a.fromMs),toMs:Math.min(c,a.toMs)})).filter(a=>a.toMs>a.fromMs).sort((a,b)=>a.fromMs-b.fromMs||a.toMs-b.toMs),e=[];for(let a of d){let b=e.at(-1);if(void 0!==b&&a.fromMs<=b.toMs){b.toMs=Math.max(b.toMs,a.toMs),"missing"===b.kind&&"dropped"===a.kind&&(b.kind="dropped"),void 0===b.reason&&void 0!==a.reason&&(b.reason=a.reason),void 0===b.droppedRecords&&void 0!==a.droppedRecords&&(b.droppedRecords=a.droppedRecords);continue}e.push({...a})}return e}function g(a,b,c){return Math.max(a,"1h"===b?36e5:"1m"===b?6e4:100,c??0)}function h(a,b){let c=[...a].sort((a,b)=>a.t-b.t),e=f(b.gaps,b.fromMs,b.toMs),g=Math.max(1,b.stepMs),h=[],i=[],j=()=>{i.length>0&&h.push(i),i=[]};for(let a of c){if(!d(a)){j();continue}let b=i.at(-1);if(void 0!==b){let c=!a.merged&&!b.merged&&(a.t<b.t||a.t-b.t>1.5*g),d=!0===a.gapBefore||function(a,b,c){return c.some(c=>c.toMs>a&&c.fromMs<b)}(b.t,a.t,e);(c||d)&&j()}i.push(a)}return j(),h}function i(a,b,c){if(b<=0)return[];let f=[...a].sort((a,b)=>a.t-b.t);if(f.length<=b)return f.map(a=>({...a}));let g=Math.max(2,Math.ceil(f.length/b)),h=Math.max(1,c),i=[],j=[],k=!1,l=null,m=()=>{if(0===j.length)return;let a=null,b=null,c=0,d=0;for(let f of j){let g=e(f.min),h=e(f.max);null!==g&&(null===a||g<a)&&(a=g),null!==h&&(null===b||h>b)&&(b=h);let i=e(f.avg);null!==i&&(c+=i,d+=1)}i.push({t:j[0].t,min:a,max:b,avg:d>0?c/d:null,...j.length>1?{merged:!0}:{},...k?{gapBefore:!0}:{}}),j=[],k=!1};for(let a of f){if(!d(a)){m(),i.push({...a}),l=null;continue}let b=null!==l&&a.t>=l.t&&a.t-l.t<=1.5*h;j.length>0&&(!b||j.length>=g)&&m(),0===j.length&&(k=null!==l&&!b),j.push(a),l=a}return m(),i}function j(a){let b=null,c=null,d=0,f=0,g=null,h=null,i=null,j=null;for(let k of a){if(null===k.avg)continue;(null===i||k.t<i)&&(i=k.t),(null===j||k.t>j)&&(j=k.t);let a=e(k.min),l=e(k.max);null!==a&&(null===b||a<b)&&(b=a),null!==l&&(null===c||l>c)&&(c=l),null!==k.avg&&Number.isFinite(k.avg)&&(d+=k.avg,f+=1,g=k.avg,h=k.t)}return{count:f,min:b,max:c,avg:f>0?d/f:null,latest:g,latestT:h,firstT:i,lastT:j}}function k(a){if(!Number.isFinite(a)||a<=0)return 1;let b=Math.pow(10,Math.floor(Math.log10(a))),c=a/b;return(c<=1?1:c<=2?2:c<=5?5:10)*b}function l(a,b){if("percent"===a)return{min:0,max:100,ticks:[0,25,50,75,100]};let c=b.filter(a=>null!==a&&Number.isFinite(a));if(0===c.length)return{min:0,max:1,ticks:[0,1]};let d=Math.min(...c),e=Math.max(...c);if("celsius"===a){let a=Math.max(1,(e-d)*.1);d=5*Math.floor((d-a)/5),e=5*Math.ceil((e+a)/5)}else d=0,e=e>0?e:1;e<=d&&(e=d+1);let f=k((e-d)/4),g=Math.floor(d/f)*f,h=Math.ceil(e/f)*f,i=function(a,b,c=4){if(!Number.isFinite(a)||!Number.isFinite(b))return[0,1];if(b<=a)return[a];let d=k((b-a)/Math.max(1,c)),e=Math.ceil(a/d)*d,f=[];for(let a=e;a<=b+.001*d&&f.length<20;a+=d)f.push(Number(a.toPrecision(12)));return f.length>0?f:[a,b]}(g,h,4);return{min:g,max:h,ticks:i}}function m(a,b,c=4){let d=Math.max(2,Math.floor(c)),e=Math.max(0,b-a);return Array.from({length:d},(b,c)=>a+e*c/(d-1))}c.d(b,{$z:()=>f,Cf:()=>m,SG:()=>i,T6:()=>j,jl:()=>g,kk:()=>l,o:()=>h})}};
|
|
1
|
+
"use strict";exports.id=168,exports.ids=[168],exports.modules={11449:(a,b,c)=>{c.d(b,{Cv:()=>e,H9:()=>d,Lf:()=>j,P$:()=>f,RL:()=>q,bP:()=>p,er:()=>m,oB:()=>i,ue:()=>o,yv:()=>l});let d=[{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 e(a,b){return a.filter(c=>{for(let[d,e,f]of[["memory","memory.used","memory.usage"],["filesystem","fs.used","fs.usage"]])if(a.includes(e)&&a.includes(f)&&(c===e||c===f))return c===("percent"===b[d]?f:e);return!0})}let f=[{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"]}],g=["var(--cpu)","var(--mem)","color-mix(in oklab, var(--swap) 75%, var(--foreground))","var(--warn)","var(--crit)","var(--accent)"],h=[void 0,"7 4","2 3","10 3 2 3","4 4","1 3"];function i(a){return d.find(b=>b.metric===a)??null}function j(a,b){let c=Math.max(0,b),d=a.colorSlot+c,e=(c+Math.floor(d/g.length))%h.length;return{color:g[d%g.length],dash:h[e]}}let k={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPU metrics",disks:"Disk metrics",network:"Network metrics"};function l(a,b){let c=i(b);if(null===c||void 0===a)return{available:!0,reason:null};let d=a.inventory?.capabilities?.[c.family];if(!d||"supported"===d.status)return{available:!0,reason:null};let e=d.reason?.trim();return{available:!1,reason:e?`${k[c.family]}: ${d.status} — ${e}`:`${k[c.family]} are ${d.status} on this machine.`}}function m(a){if(void 0===a)return[];let b=[],c=c=>{!(b.length>=16)&&l(a,c).available&&b.push(c)};c("cpu.usage"),c("memory.used");let d=function(a){let b=a.inventory?.memory.swapTotalBytes;if("number"==typeof b)return b;let c=a.metrics?.payload.swap;return c?.status==="ok"?c.totalBytes:null}(a);return null!==d&&d>0&&c("swap.used"),o(a,[]).length>0&&(c("gpu.utilization"),c("gpu.memory.used")),b}function n(a){let b=a.includes(":")?a.slice(a.indexOf(":")+1):a;return b.length<=18?b:`${b.slice(0,10)}…${b.slice(-4)}`}function o(a,b){let c=new Set(b.filter(a=>a.metric.startsWith("gpu.")&&""!==a.resourceId).map(a=>a.resourceId)),d=[],e=new Set;(a?.inventory?.gpus??[]).forEach(a=>{let b="supported"===a.telemetry;(b||c.has(a.id))&&(e.add(a.id),d.push({id:a.id,label:a.name.trim()||n(a.id),index:d.length,totalBytes:a.memoryTotalBytes,supported:b,hasHistory:c.has(a.id)}))});let f=a?.metrics?.payload.gpus;if(f?.status==="ok")for(let a of f.devices)e.has(a.id)||"ok"!==a.status||(e.add(a.id),d.push({id:a.id,label:n(a.id),index:d.length,totalBytes:a.memoryTotalBytes,supported:!0,hasHistory:c.has(a.id)}));for(let a of[...c].sort())e.has(a)||d.push({id:a,label:n(a),index:d.length,totalBytes:null,supported:!0,hasHistory:!0});return d}function p(a,b,c){if(""===c)return i(b)?.shortLabel??"Total";let d=i(b);if(null===d)return n(c);switch(d.family){case"gpus":{let b=a?.inventory?.gpus.find(a=>a.id===c);return b?.name.trim()||n(c)}case"disks":{if(b.startsWith("fs.")){let b=a?.inventory?.filesystems.find(a=>a.id===c);return b?.mountPoint||n(c)}let d=a?.inventory?.disks.find(a=>a.id===c);return d?.name||n(c)}case"network":{let b=a?.inventory?.network.find(a=>a.id===c);return b?.name||n(c)}case"cpu":{let a=/^core:(\d+)$/.exec(c);return a?`Core ${a[1]}`:n(c)}default:return n(c)}}function q(a){switch(a){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 a}}},15670:(a,b,c)=>{c.d(b,{t:()=>k});var d=c(48249),e=c(67484),f=c(96480),g=c(66338),h=c(11449),i=c(55280),j=c(47978);function k(a){let{title:b,unit:c,series:k,fromMs:l,toMs:m,stepMs:n,gaps:o,hiddenKeys:p,onToggleSeries:q,emptyMessage:r,note:s}=a,t=(0,e.useMemo)(()=>k.filter(a=>!p.has(a.key)),[k,p]),u=(0,j.Au)({series:t,fromMs:l,toMs:m,stepMs:n,gaps:o}),v=(0,e.useRef)(null),w=(0,e.useMemo)(()=>t.flatMap(a=>a.points),[t]),x=w.some(a=>null!==a.avg||null!==a.min||null!==a.max),y=Math.max(1,m-l),z=(0,e.useMemo)(()=>(0,f.$z)(o,l,m,w),[o,l,m,w]),A=(0,e.useMemo)(()=>(0,f.kk)(c,w.flatMap(a=>[a.min,a.max,a.avg]).filter(a=>null!==a)),[c,w]),B=Math.max(1e-9,A.max-A.min),C=(0,e.useCallback)(a=>6+(Math.min(m,Math.max(l,a))-l)/y*788,[l,m,y]),D=(0,e.useCallback)(a=>6+(1-(a-A.min)/B)*148,[A.min,B]),E=(0,e.useMemo)(()=>t.map(b=>{let c=(0,f.o)(b.points,{stepMs:n,gaps:z,fromMs:l,toMs:m}).map(b=>(0,f.SG)(b,a.maxDrawPoints??601,n));return{...b,segments:c,envelope:c.filter(a=>a.length>1).map(a=>{let b=a.map(a=>`${C(a.t).toFixed(2)},${D(a.max??a.avg).toFixed(2)}`),c=[...a].reverse().map(a=>`${C(a.t).toFixed(2)},${D(a.min??a.avg).toFixed(2)}`);return`M${b.join("L")}L${c.join("L")}Z`}).join(" "),path:c.filter(a=>a.length>1).map(a=>a.map((a,b)=>`${0===b?"M":"L"}${C(a.t).toFixed(2)},${D(a.avg).toFixed(2)}`).join(" ")).join(" ")}}),[t,a.maxDrawPoints,n,z,l,m,C,D]),F=(0,e.useMemo)(()=>(function(a,b,c,d,e,h){if(0===c.length)return`${a} chart: no series selected.`;let i=c.map(a=>{let c=(0,f.T6)(a.points);return`${a.label}: ${function(a,b){let c=[];if(null!==a.latest){let d=null!==a.latestT?(0,g.ei)(a.latestT):null;c.push(`latest ${(0,g.dd)(a.latest,b)}${d?` at ${d}`:""}`)}return c.push(`average ${(0,g.dd)(a.avg,b)}`),null!==a.min&&null!==a.max&&c.push(`recorded range ${(0,g.dd)(a.min,b)} to ${(0,g.dd)(a.max,b)}`),c.join(", ")}(c,b)}`}),j=h>0?`${h} shaded interval${1===h?"":"s"} without stored data.`:"";return`${a} time-series chart. ${i.join(". ")}. ${j} Time range ${(0,g.ei)(d)} to ${(0,g.ei)(e)}.`})(b,c,t,l,m,z.length),[b,c,t,l,m,z.length]),G=(0,e.useMemo)(()=>new Map(k.map(a=>[a.key,(0,f.T6)(a.points)])),[k]),H=null===u.timeMs?[]:t.map(a=>({...a,point:(0,i.bO)(a.points,u.timeMs,n,o)})),I=null===u.timeMs?null:C(u.timeMs),J=`${u.id}-tooltip`,K=`${u.id}-instructions`,L=(0,e.useMemo)(()=>(0,d.jsxs)(d.Fragment,{children:[A.ticks.map(a=>(0,d.jsx)("line",{x1:6,x2:794,y1:D(a),y2:D(a),stroke:"var(--border)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${a}`)),z.map(a=>(0,d.jsx)("rect",{x:C(a.fromMs),y:6,width:Math.max(1,C(a.toMs)-C(a.fromMs)),height:148,fill:"var(--muted-foreground)",opacity:"0.09"},`gap-${a.fromMs}-${a.toMs}-${a.kind}`)),E.map(a=>{let b=a.envelope;return""===b?null:(0,d.jsx)("path",{d:b,fill:a.color,opacity:"0.14",stroke:"none"},`band-${a.key}`)}),E.map(a=>{let b=a.path;return""===b?null:(0,d.jsx)("path",{d:b,fill:"none",stroke:a.color,strokeWidth:"2",strokeDasharray:a.dash,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},`line-${a.key}`)}),E.flatMap(a=>a.segments.filter(a=>1===a.length).map(b=>{let c=b[0],e=C(c.t),f=D(c.avg);return(0,d.jsx)("line",{x1:e-2.5,x2:e+2.5,y1:f,y2:f,stroke:a.color,strokeWidth:"2.5",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"},`dot-${a.key}-${c.t}`)}))]}),[A,C,D,z,E]);return(0,d.jsxs)("figure",{className:`flex min-w-0 flex-col gap-2 ${a.className??""}`,children:[(0,d.jsxs)("div",{className:"flex min-h-8 flex-wrap items-center justify-between gap-2",children:[(0,d.jsx)("h3",{className:"text-xs font-medium tracking-tight text-foreground",children:b}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"tnum shrink-0 text-xs text-muted-foreground",children:s??(0,h.RL)(c)}),a.action]})]}),x?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,d.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:[...A.ticks].reverse().map(a=>(0,d.jsx)("span",{children:(0,g.Ah)(a,c)},a))}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"relative",onPointerLeave:u.clear,onPointerMove:a=>{let b=v.current?.getBoundingClientRect();b&&u.inspect((0,i.yk)(a.clientX,b.left,b.width,l,m,.0075))},children:[(0,d.jsx)("p",{id:K,className:"sr-only",children:"Use Left and Right arrows to inspect recorded readings, Home or End to jump, and Escape to dismiss."}),(0,d.jsxs)("svg",{ref:v,viewBox:"0 0 800 160",preserveAspectRatio:"none",role:"img","aria-label":F,tabIndex:0,"aria-describedby":`${K}${u.active?` ${J}`:""}`,onFocus:u.onFocus,onBlur:u.clear,onKeyDown:u.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,d.jsx)("title",{children:b}),L,null!==I?(0,d.jsxs)("g",{"aria-hidden":!0,pointerEvents:"none",children:[(0,d.jsx)("line",{x1:I,x2:I,y1:6,y2:154,stroke:"var(--muted-foreground)",strokeWidth:"1",strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke"}),H.map(({key:a,color:b,point:c})=>c?.avg==null?null:(0,d.jsx)("circle",{cx:C(c.t),cy:D(c.avg),r:"3.5",fill:b,stroke:"var(--card)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"},a))]}):null]}),u.active&&null!==u.timeMs&&null!==I?(0,d.jsx)(j.eg,{id:J,timeMs:u.timeMs,fraction:I/800,unit:c,readings:H}):null]}),(0,d.jsx)("div",{"aria-hidden":!0,className:"mt-1 flex justify-between gap-2 text-xs leading-tight tnum text-muted-foreground",children:(0,f.Cf)(l,m).map((a,b,c)=>(0,d.jsx)("span",{className:`${0===b?"text-left":b===c.length-1?"text-right":"hidden text-center sm:inline"}`,children:(0,g.O5)(a,y)},a))})]})]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:k.map(a=>{let b=!p.has(a.key),e=G.get(a.key);return(0,d.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",title:b?`Hide ${a.label}`:`Show ${a.label}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:()=>q(a.key),className:"peer sr-only"}),(0,d.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,d.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,d.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:a.color,strokeWidth:"2.5",strokeDasharray:a.dash,strokeLinecap:"round"})})}),(0,d.jsx)("span",{className:b?"text-foreground":"text-muted-foreground line-through",children:a.label}),(0,d.jsx)("span",{className:"tnum text-muted-foreground",children:(0,g.dd)(e.latest,c)})]},`legend-${a.key}`)})})]}):(0,d.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===k.length?r:0===t.length?"All series are hidden. Re-enable one in the legend below.":r}),!x&&k.length>0?(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:k.map(a=>{let b=!p.has(a.key);return(0,d.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:()=>q(a.key),className:"peer sr-only"}),(0,d.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,d.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,d.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:a.color,strokeWidth:"2.5",strokeDasharray:a.dash,strokeLinecap:"round"})})}),(0,d.jsx)("span",{className:b?"text-foreground":"text-muted-foreground line-through",children:a.label})]},`legend-empty-${a.key}`)})}):null]})}},43607:(a,b,c)=>{c.d(b,{n:()=>e});var d=c(67484);function e({machineId:a,metricsKey:b,coreIdsKey:c,range:f,enabled:g=!0,autoRefresh:h=!0,refreshNonce:i=0}){let[j,k]=(0,d.useState)({machineId:a,metricsKey:b,coreIdsKey:c,range:f}),l=j.machineId===a&&j.range===f?j:{machineId:a,metricsKey:b,coreIdsKey:c,range:f},m=l.metricsKey,n=l.coreIdsKey,o=`${a}|${m}|${f}|${n??"all"}`,[p,q]=(0,d.useState)(null),[r,s]=(0,d.useState)(null),[t,u]=(0,d.useState)(null);return(0,d.useRef)(i),{data:g&&p?.result.machineId===a&&p.range===f?p:null,error:g&&r?.key===o?r.error:null,loading:g&&t?.key===o,manualRefreshing:g&&t?.key===o&&t.manual}}c(66338)},47978:(a,b,c)=>{c.d(b,{Au:()=>j,_C:()=>i,eg:()=>k});var d=c(48249),e=c(67484),f=c(55280),g=c(66338);let h=(0,e.createContext)(null);function i({children:a}){let[b,c]=(0,e.useState)(null),f=(0,e.useCallback)(a=>c(b=>b?.timeMs===a?.timeMs&&b?.source===a?.source?b:a),[]),g=(0,e.useMemo)(()=>({cursor:b,setCursor:f}),[b,f]);return(0,d.jsx)(h.Provider,{value:g,children:a})}function j({series:a,fromMs:b,toMs:c,stepMs:d,gaps:g}){let i=(0,e.useId)(),[k,l]=(0,e.useState)(null),m=(0,e.useContext)(h),n=m?m.cursor:k,o=m?m.setCursor:l,p=(0,e.useRef)(null),q=(0,e.useRef)(null),r=(0,e.useCallback)(()=>{null!==p.current&&cancelAnimationFrame(p.current),p.current=null,q.current=null},[]),s=(0,e.useMemo)(()=>(0,f.X)(a).filter(a=>a.t<=c&&a.t+d/2>=b),[a,b,c,d]),t=n&&n.timeMs>=b-d/2&&n.timeMs<=c?n.timeMs:null,u=null!==t&&n?.source===i,v=()=>{r(),n?.source===i&&o(null)};return{id:i,timeMs:t,active:u,inspect:a=>{let e=Math.max(b,Math.min(c,a)),h=(0,f.bO)(s,e,d,g);q.current={timeMs:h?.t??e,source:i},null===p.current&&(p.current=requestAnimationFrame(()=>{p.current=null,o(q.current),q.current=null}))},clear:v,onKeyDown:a=>{if(r(),"Escape"===a.key)a.preventDefault(),v();else if(["ArrowLeft","ArrowRight","Home","End"].includes(a.key)){a.preventDefault();let b=(0,f.o7)(s,t,a.key);null!==b&&o({timeMs:b,source:i})}},onFocus:()=>{r(),o({timeMs:s.at(-1)?.t??c,source:i})}}}function k({id:a,timeMs:b,fraction:c,unit:f,readings:h}){let[i]=(0,e.useState)(()=>c>.5?"left":"right");return(0,d.jsxs)("div",{id:a,role:"tooltip",className:`absolute top-2 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"===i?"left-2":"right-2"}`,children:[(0,d.jsx)("p",{className:"tnum font-medium",children:(0,g.r6)(b)}),(0,d.jsx)("p",{className:"mb-2 text-muted-foreground",children:"Recorded bucket average"}),(0,d.jsx)("dl",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-4 gap-y-1.5",children:h.map(({key:a,label:c,color:e,point:h})=>(0,d.jsxs)("div",{className:"contents",children:[(0,d.jsxs)("dt",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e}}),(0,d.jsx)("span",{className:"break-words",children:c})]}),(0,d.jsxs)("dd",{className:"tnum text-right",children:[h?.avg==null?"No reading":(0,g.dd)(h.avg,f),h&&h.t!==b?(0,d.jsx)("span",{className:"block text-muted-foreground",children:(0,g.ei)(h.t)}):null]})]},a))})]})}},55280:(a,b,c)=>{function d(a,b,c,d){if(d.some(a=>b>a.fromMs&&b<a.toMs))return null;let e=0,f=a.length;for(;e<f;){let c=e+f>>>1;a[c].t<b?e=c+1:f=c}let g=a[e-1],h=a[e],i=g&&(!h||b-g.t<=h.t-b)?g:h;return!i||Math.abs(i.t-b)>c/2||d.some(a=>a.toMs>Math.min(b,i.t)&&a.fromMs<Math.max(b,i.t))?null:i}function e(a){return[...new Set(a.flatMap(a=>a.points.map(a=>a.t)))].sort((a,b)=>a-b).map(a=>({t:a,min:null,max:null,avg:null}))}function f(a,b,c,d,e,g=0){return Math.round(d+Math.max(0,Math.min(1,((c>0?(a-b)/c:0)-g)/(1-2*g)))*(e-d))}function g(a,b,c){return 0===a.length?null:"Home"===c?a[0].t:"End"===c||null===b?a.at(-1).t:"ArrowLeft"===c?[...a].reverse().find(a=>a.t<b)?.t??a[0].t:"ArrowRight"===c?a.find(a=>a.t>b)?.t??a.at(-1).t:b}c.d(b,{X:()=>e,bO:()=>d,o7:()=>g,yk:()=>f})},66338:(a,b,c)=>{c.d(b,{Ah:()=>l,I_:()=>p,O5:()=>o,Vw:()=>v,bf:()=>u,dd:()=>k,ei:()=>m,fH:()=>q,ly:()=>e,pI:()=>d,r6:()=>n,zp:()=>f});let d=[{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 e(a){return d.find(b=>b.id===a)??d[0]}function f(a){return e(a).refreshMs}let g=["B","KiB","MiB","GiB","TiB","PiB"];function h(a){let b=Math.abs(a),c=0;for(;b>=1024&&c<g.length-1;)b/=1024,c+=1;return{value:a<0?-b:b,unit:g[c]}}function i(a,b){return String(Number(a.toFixed(b)))}function j(a,b=""){let{value:c,unit:d}=h(a),e=Math.abs(c)>=100?0:1;return`${i(c,e)} ${d}${b}`}function k(a,b){if(null==a||!Number.isFinite(a))return"—";switch(b){case"percent":return`${i(a,1)}%`;case"bytes":return j(a);case"bytes_per_second":return j(a,"/s");case"celsius":return`${i(a,1)}\xb0C`;case"watts":return`${i(a,1)} W`;case"milliseconds":return`${i(a,10>Math.abs(a)?2:1)} ms`;default:return i(a,2)}}function l(a,b){if(!Number.isFinite(a))return"—";switch(b){case"percent":return`${i(a,0)}%`;case"bytes":case"bytes_per_second":{let{value:c,unit:d}=h(a),e=Math.abs(c)>=10||0===c?0:1;return`${i(c,e)} ${d}${"bytes_per_second"===b?"/s":""}`}case"celsius":return`${i(a,0)}\xb0C`;case"watts":return`${i(a,0)} W`;case"milliseconds":return`${i(a,+(10>Math.abs(a)))} ms`;default:return i(a,1)}}function m(a){return new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function n(a){return new Date(a).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"medium"})}function o(a,b){let c=new Date(a);return b>=1728e5?c.toLocaleDateString(void 0,{month:"short",day:"numeric"}):b>=864e5?c.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function p(a){let b=Math.max(0,a);return b>=36e5?`${i(b/36e5,1)} h`:b>=6e4?`${i(b/6e4,1)} min`:`${i(b/1e3,1)} s`}function q(a,b,c){let d=a.filter(a=>a.toMs>=b&&a.fromMs<=c);if(0===d.length)return"No recorded gaps in this range.";let e=d.filter(a=>"dropped"===a.kind).length,f=d.length-e,g=[];f>0&&g.push(`${f} missed interval${1===f?"":"s"}`),e>0&&g.push(`${e} dropped report${1===e?"":"s"}`);let h=[...new Set(d.map(a=>a.reason).filter(a=>"string"==typeof a&&a.length>0))],i=h.length>0?` (${h.slice(0,3).join("; ")})`:"";return`${g.join(" and ")}${i}.`}function r(a){return null!==a&&"object"==typeof a&&!Array.isArray(a)}function s(a){return"number"==typeof a&&Number.isFinite(a)}function t(a){return null===a||s(a)}function u(a){if(!r(a)||"string"!=typeof a.machineId||0===a.machineId.length||!s(a.fromMs)||!s(a.toMs)||a.toMs<=a.fromMs||!s(a.stepMs)||a.stepMs<=0||"raw"!==a.tier&&"1m"!==a.tier&&"1h"!==a.tier||"boolean"!=typeof a.truncated||!s(a.elapsedMs)||!Array.isArray(a.series)||!Array.isArray(a.gaps))return null;let b=[];for(let c of a.series){if(!r(c)||"string"!=typeof c.metric||"string"!=typeof c.resourceId||"string"!=typeof c.unit||!Array.isArray(c.points))return null;let a=[];for(let b of c.points){if(!r(b)||!s(b.t)||!t(b.min)||!t(b.max)||!t(b.avg))return null;a.push({t:b.t,min:b.min,max:b.max,avg:b.avg})}b.push({metric:c.metric,resourceId:c.resourceId,unit:c.unit,points:a})}let c=[];for(let b of a.gaps){if(!r(b)||!s(b.fromMs)||!s(b.toMs)||"missing"!==b.kind&&"dropped"!==b.kind)return null;let a={fromMs:b.fromMs,toMs:b.toMs,kind:b.kind};"string"==typeof b.reason&&(a.reason=b.reason),s(b.droppedRecords)&&(a.droppedRecords=b.droppedRecords),c.push(a)}return{machineId:a.machineId,fromMs:a.fromMs,toMs:a.toMs,stepMs:a.stepMs,tier:a.tier,series:b,gaps:c,truncated:a.truncated,elapsedMs:a.elapsedMs}}function v(a,b,c,d,f=600,g){let{fromMs:h,toMs:i}={fromMs:d-e(c).ms,toMs:d},j=new URLSearchParams({machineId:a,metrics:b.join(","),from:String(Math.floor(h)),to:String(Math.floor(i)),maxPoints:String(f)});return void 0!==g&&j.set("coreIds",g.join(",")),`/api/history?${j.toString()}`}},96480:(a,b,c)=>{function d(a){return null!==a.avg&&Number.isFinite(a.avg)}function e(a){return null!==a&&Number.isFinite(a)?a:null}function f(a){let b=[];for(let c of a){let a=b.at(-1);if(void 0!==a&&c.fromMs<=a.toMs){a.toMs=Math.max(a.toMs,c.toMs),"missing"===a.kind&&"dropped"===c.kind&&(a.kind="dropped"),void 0===a.reason&&void 0!==c.reason&&(a.reason=c.reason),void 0===a.droppedRecords&&void 0!==c.droppedRecords&&(a.droppedRecords=c.droppedRecords);continue}b.push({...c})}return b}function g(a,b,c,e){let g=f(a.map(a=>({...a,fromMs:Math.max(b,a.fromMs),toMs:Math.min(c,a.toMs)})).filter(a=>a.toMs>a.fromMs).sort((a,b)=>a.fromMs-b.fromMs||a.toMs-b.toMs));return void 0===e?g:function(a,b,c,e){if(0===a.length)return[];let g=[...new Set(b.filter(d).map(a=>a.t).filter(a=>Number.isFinite(a)))].sort((a,b)=>a-b),h=[];for(let b of a){let a=Math.max(c,Math.min(e,b.fromMs)),d=Math.max(c,Math.min(e,b.toMs));if(d<=a)continue;let f=Math.max(c,function(a,b){let c=0,d=a.length;for(;c<d;){let e=c+d>>>1;a[e]<=b?c=e+1:d=e}return c>0?a[c-1]:null}(g,a)??a),i=Math.min(e,function(a,b){let c=0,d=a.length;for(;c<d;){let e=c+d>>>1;a[e]<b?c=e+1:d=e}return c<a.length?a[c]:null}(g,d)??d);i<=f||h.push({...b,fromMs:f,toMs:i})}return h.sort((a,b)=>a.fromMs-b.fromMs||a.toMs-b.toMs),f(h)}(g,e,b,c)}function h(a,b,c){return Math.max(a,"1h"===b?36e5:"1m"===b?6e4:100,c??0)}function i(a,b){let c=[...a].sort((a,b)=>a.t-b.t),e=g(b.gaps,b.fromMs,b.toMs),f=Math.max(1,b.stepMs),h=[],i=[],j=()=>{i.length>0&&h.push(i),i=[]};for(let a of c){if(!d(a)){j();continue}let b=i.at(-1);if(void 0!==b){let c=!a.merged&&!b.merged&&(a.t<b.t||a.t-b.t>1.5*f),d=!0===a.gapBefore||function(a,b,c){return c.some(c=>c.toMs>a&&c.fromMs<b)}(b.t,a.t,e);(c||d)&&j()}i.push(a)}return j(),h}function j(a,b,c){if(b<=0)return[];let f=[...a].sort((a,b)=>a.t-b.t);if(f.length<=b)return f.map(a=>({...a}));let g=Math.max(2,Math.ceil(f.length/b)),h=Math.max(1,c),i=[],j=[],k=!1,l=null,m=()=>{if(0===j.length)return;let a=null,b=null,c=0,d=0;for(let f of j){let g=e(f.min),h=e(f.max);null!==g&&(null===a||g<a)&&(a=g),null!==h&&(null===b||h>b)&&(b=h);let i=e(f.avg);null!==i&&(c+=i,d+=1)}i.push({t:j[0].t,min:a,max:b,avg:d>0?c/d:null,...j.length>1?{merged:!0}:{},...k?{gapBefore:!0}:{}}),j=[],k=!1};for(let a of f){if(!d(a)){m(),i.push({...a}),l=null;continue}let b=null!==l&&a.t>=l.t&&a.t-l.t<=1.5*h;j.length>0&&(!b||j.length>=g)&&m(),0===j.length&&(k=null!==l&&!b),j.push(a),l=a}return m(),i}function k(a){let b=null,c=null,d=0,f=0,g=null,h=null,i=null,j=null;for(let k of a){if(null===k.avg)continue;(null===i||k.t<i)&&(i=k.t),(null===j||k.t>j)&&(j=k.t);let a=e(k.min),l=e(k.max);null!==a&&(null===b||a<b)&&(b=a),null!==l&&(null===c||l>c)&&(c=l),null!==k.avg&&Number.isFinite(k.avg)&&(d+=k.avg,f+=1,g=k.avg,h=k.t)}return{count:f,min:b,max:c,avg:f>0?d/f:null,latest:g,latestT:h,firstT:i,lastT:j}}function l(a){if(!Number.isFinite(a)||a<=0)return 1;let b=Math.pow(10,Math.floor(Math.log10(a))),c=a/b;return(c<=1?1:c<=2?2:c<=5?5:10)*b}function m(a,b){if("percent"===a)return{min:0,max:100,ticks:[0,25,50,75,100]};let c=b.filter(a=>null!==a&&Number.isFinite(a));if(0===c.length)return{min:0,max:1,ticks:[0,1]};let d=Math.min(...c),e=Math.max(...c);if("celsius"===a){let a=Math.max(1,(e-d)*.1);d=5*Math.floor((d-a)/5),e=5*Math.ceil((e+a)/5)}else d=0,e=e>0?e:1;e<=d&&(e=d+1);let f=l((e-d)/4),g=Math.floor(d/f)*f,h=Math.ceil(e/f)*f,i=function(a,b,c=4){if(!Number.isFinite(a)||!Number.isFinite(b))return[0,1];if(b<=a)return[a];let d=l((b-a)/Math.max(1,c)),e=Math.ceil(a/d)*d,f=[];for(let a=e;a<=b+.001*d&&f.length<20;a+=d)f.push(Number(a.toPrecision(12)));return f.length>0?f:[a,b]}(g,h,4);return{min:g,max:h,ticks:i}}function n(a,b,c=4){let d=Math.max(2,Math.floor(c)),e=Math.max(0,b-a);return Array.from({length:d},(b,c)=>a+e*c/(d-1))}c.d(b,{$z:()=>g,Cf:()=>n,SG:()=>j,T6:()=>k,jl:()=>h,kk:()=>m,o:()=>i})}};
|
|
@@ -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/xjSDCOO8Gpm5iPO9tyRG5/_buildManifest.js","static/xjSDCOO8Gpm5iPO9tyRG5/_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":[]}};
|