rigscope 0.1.4 → 0.1.6
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 +3 -3
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +6 -6
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/administration/page.js +1 -1
- package/.next/server/app/administration/page.js.nft.json +1 -1
- package/.next/server/app/administration/page_client-reference-manifest.js +1 -1
- package/.next/server/app/administration.html +1 -1
- package/.next/server/app/administration.rsc +6 -6
- package/.next/server/app/administration.segments/_full.segment.rsc +6 -6
- package/.next/server/app/administration.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/administration.segments/administration/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/alerts/page.js +1 -1
- package/.next/server/app/alerts/page.js.nft.json +1 -1
- package/.next/server/app/alerts/page_client-reference-manifest.js +1 -1
- package/.next/server/app/alerts.html +1 -1
- package/.next/server/app/alerts.rsc +6 -6
- package/.next/server/app/alerts.segments/_full.segment.rsc +6 -6
- package/.next/server/app/alerts.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/alerts.segments/alerts/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/connections/page.js +1 -1
- package/.next/server/app/connections/page.js.nft.json +1 -1
- package/.next/server/app/connections/page_client-reference-manifest.js +1 -1
- package/.next/server/app/connections.html +1 -1
- package/.next/server/app/connections.rsc +7 -7
- package/.next/server/app/connections.segments/_full.segment.rsc +7 -7
- package/.next/server/app/connections.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/connections.segments/connections/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/history/page.js +2 -2
- package/.next/server/app/history/page.js.nft.json +1 -1
- package/.next/server/app/history/page_client-reference-manifest.js +1 -1
- package/.next/server/app/history.html +1 -1
- package/.next/server/app/history.rsc +26 -22
- package/.next/server/app/history.segments/_full.segment.rsc +26 -22
- package/.next/server/app/history.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/history.segments/history/__PAGE__.segment.rsc +23 -20
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +7 -7
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/index.segments/_full.segment.rsc +7 -7
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/machines/[machineId]/page.js +1 -1
- package/.next/server/app/machines/[machineId]/page.js.nft.json +1 -1
- package/.next/server/app/machines/[machineId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/processes/page.js +2 -2
- package/.next/server/app/processes/page.js.nft.json +1 -1
- package/.next/server/app/processes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/processes.html +1 -1
- package/.next/server/app/processes.rsc +21 -19
- package/.next/server/app/processes.segments/_full.segment.rsc +21 -19
- package/.next/server/app/processes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/processes.segments/processes/__PAGE__.segment.rsc +21 -19
- package/.next/server/app-paths-manifest.json +3 -3
- package/.next/server/chunks/168.js +1 -1
- package/.next/server/chunks/350.js +1 -0
- package/.next/server/chunks/364.js +1 -0
- package/.next/server/chunks/751.js +1 -1
- package/.next/server/chunks/894.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/103-976549d31902404e.js +1 -0
- package/.next/static/chunks/{227-417939c480f50747.js → 130-e940915010276f88.js} +1 -1
- package/.next/static/chunks/408-9fdba9e4e956ef08.js +1 -0
- package/.next/static/chunks/944-a7fe1d96f1d20531.js +1 -0
- package/.next/static/chunks/app/administration/page-b62f6610cda5381f.js +1 -0
- package/.next/static/chunks/app/alerts/{page-fe0e877778c60af8.js → page-3445bc100ee03d4e.js} +1 -1
- package/.next/static/chunks/app/connections/{page-99cd54d6929b3f1f.js → page-75abd16fc495fcbd.js} +1 -1
- package/.next/static/chunks/app/history/page-a25ba8fab7bd7cb9.js +3 -0
- package/.next/static/chunks/app/machines/[machineId]/{page-1a25a267563c18c0.js → page-89143e71c34b542b.js} +1 -1
- package/.next/static/chunks/app/{page-1ae9fc94c897785b.js → page-9c9c89166eee4c92.js} +1 -1
- package/.next/static/chunks/app/processes/page-3fdebd2f98b52044.js +3 -0
- package/.next/static/css/f5d3162842dcac31.css +1 -0
- package/CHANGELOG.md +26 -0
- package/DESIGN.md +27 -16
- package/dist/cli.cjs +1 -0
- package/dist/collector.cjs +1 -1
- package/dist/hub.cjs +1 -1
- package/docs/installation.md +6 -3
- package/docs/releasing.md +12 -12
- package/package.json +1 -1
- package/.next/server/chunks/721.js +0 -1
- package/.next/server/chunks/877.js +0 -1
- package/.next/static/chunks/103-c47318242b24e9ac.js +0 -1
- package/.next/static/chunks/157-0d36ebf66af048ac.js +0 -1
- package/.next/static/chunks/408-29f55984738967db.js +0 -1
- package/.next/static/chunks/app/administration/page-4b16b19bb6a39c36.js +0 -1
- package/.next/static/chunks/app/history/page-69ea64476ee5db85.js +0 -3
- package/.next/static/chunks/app/processes/page-0e98a4a64e829c5f.js +0 -3
- package/.next/static/css/3fbf75e4c471c6a8.css +0 -1
- /package/.next/static/{-mNveXe-cHv8irQe97wI_ → KBskG-P4uSZx1zfnYp1nL}/_buildManifest.js +0 -0
- /package/.next/static/{-mNveXe-cHv8irQe97wI_ → KBskG-P4uSZx1zfnYp1nL}/_ssgManifest.js +0 -0
package/docs/installation.md
CHANGED
|
@@ -27,7 +27,7 @@ install or source checkout is needed. The launcher and services use the installe
|
|
|
27
27
|
runtime, so removing the npx cache does not break them.
|
|
28
28
|
|
|
29
29
|
Releases are on [npm](https://www.npmjs.com/package/rigscope). `@latest` selects
|
|
30
|
-
the current stable release; replace it with `@0.1.
|
|
30
|
+
the current stable release; replace it with `@0.1.6` to select that exact version.
|
|
31
31
|
|
|
32
32
|
### Installation options
|
|
33
33
|
|
|
@@ -53,7 +53,7 @@ For a downloaded package or one built from source, run from the directory
|
|
|
53
53
|
containing the archive, or give its absolute path:
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
|
-
npx --yes --package ./rigscope-0.1.
|
|
56
|
+
npx --yes --package ./rigscope-0.1.6.tgz rigscope install --boot
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
The same installation options apply. npm still needs registry access or cached
|
|
@@ -135,6 +135,9 @@ DNS name. Choose the section for a new or existing installation.
|
|
|
135
135
|
|
|
136
136
|
### New HTTPS installation
|
|
137
137
|
|
|
138
|
+
`--origin` accepts a root URL with or without a trailing slash and saves it
|
|
139
|
+
without the slash. Paths, query strings and fragments are not allowed.
|
|
140
|
+
|
|
138
141
|
```sh
|
|
139
142
|
npx --yes rigscope@latest install \
|
|
140
143
|
--origin https://machine.example.ts.net:8081 --boot
|
|
@@ -292,7 +295,7 @@ settings and collector identities.
|
|
|
292
295
|
|
|
293
296
|
| Alternative | Command |
|
|
294
297
|
| --- | --- |
|
|
295
|
-
| Select an exact published version | `rigscope upgrade --from rigscope@0.1.
|
|
298
|
+
| Select an exact published version | `rigscope upgrade --from rigscope@0.1.6` |
|
|
296
299
|
| Install a local archive | `rigscope upgrade --from ./rigscope-VERSION.tgz` |
|
|
297
300
|
| Return to the retained previous runtime | `rigscope rollback` |
|
|
298
301
|
|
package/docs/releasing.md
CHANGED
|
@@ -5,7 +5,7 @@ The first public version, `0.1.0`, is published on
|
|
|
5
5
|
[GitHub](https://github.com/Triet1402/rigscope). The package includes MIT licensing,
|
|
6
6
|
dependency notices, the security policy and [release notes](../CHANGELOG.md).
|
|
7
7
|
|
|
8
|
-
The commands below use `0.1.
|
|
8
|
+
The commands below use `0.1.6` as an example. For a new release, substitute its
|
|
9
9
|
new version everywhere; do not attempt to republish an already published version.
|
|
10
10
|
Documentation edits can be committed and pushed to GitHub independently. The published archive and
|
|
11
11
|
its bundled documentation stay unchanged; ship updated package documentation
|
|
@@ -21,7 +21,7 @@ with the next version. Keep each release tag on the revision used to build it.
|
|
|
21
21
|
4. Run the publish dry run, check the npm account, and publish the verified archive.
|
|
22
22
|
5. Verify the registry version and install it into a disposable test installation.
|
|
23
23
|
Check sign-in, fresh telemetry and the installed command.
|
|
24
|
-
6. Tag the exact source revision as `v0.1.
|
|
24
|
+
6. Tag the exact source revision as `v0.1.6`, push the tag, and create a GitHub
|
|
25
25
|
Release with the release notes, verified archive and checksum. Announce it
|
|
26
26
|
after the registry installation works.
|
|
27
27
|
|
|
@@ -45,14 +45,14 @@ npm pack --pack-destination out/release
|
|
|
45
45
|
`npm pack` runs `prepack`, which regenerates dependency notices, builds fresh
|
|
46
46
|
runtime/UI artifacts and verifies them. If notice generation changes a tracked
|
|
47
47
|
file, include that change in the release commit before producing the final
|
|
48
|
-
archive. Reuse the archive for every check below. Replace `0.1.
|
|
48
|
+
archive. Reuse the archive for every check below. Replace `0.1.6` in these
|
|
49
49
|
commands when releasing another version.
|
|
50
50
|
|
|
51
51
|
## Verify the exact archive
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
|
-
node scripts/verify-package.cjs ./out/release/rigscope-0.1.
|
|
55
|
-
npm run verify:installed -- --archive ./out/release/rigscope-0.1.
|
|
54
|
+
node scripts/verify-package.cjs ./out/release/rigscope-0.1.6.tgz
|
|
55
|
+
npm run verify:installed -- --archive ./out/release/rigscope-0.1.6.tgz
|
|
56
56
|
npm test
|
|
57
57
|
node scripts/test-runtime.cjs
|
|
58
58
|
node scripts/test.cjs --suite development
|
|
@@ -69,9 +69,9 @@ create disposable installations with separate state, launchers, ports and unit
|
|
|
69
69
|
names, then remove their services. They do not select an existing installation.
|
|
70
70
|
|
|
71
71
|
```sh
|
|
72
|
-
RIGSCOPE_TEST_ARCHIVE="$PWD/out/release/rigscope-0.1.
|
|
72
|
+
RIGSCOPE_TEST_ARCHIVE="$PWD/out/release/rigscope-0.1.6.tgz" \
|
|
73
73
|
node --import tsx --test tests/cli-install.integration.ts tests/cli-reset.integration.ts
|
|
74
|
-
node scripts/verify-operations.cjs ./out/release/rigscope-0.1.
|
|
74
|
+
node scripts/verify-operations.cjs ./out/release/rigscope-0.1.6.tgz
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
These cover installation, pairing, independent component controls, bootstrap
|
|
@@ -93,7 +93,7 @@ Record the final checksum after verification:
|
|
|
93
93
|
|
|
94
94
|
```sh
|
|
95
95
|
cd out/release
|
|
96
|
-
sha256sum rigscope-0.1.
|
|
96
|
+
sha256sum rigscope-0.1.6.tgz > SHA256SUMS
|
|
97
97
|
sha256sum --check SHA256SUMS
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -110,7 +110,7 @@ then verify the account and preview the exact archive:
|
|
|
110
110
|
```sh
|
|
111
111
|
npm login --registry=https://registry.npmjs.org
|
|
112
112
|
npm whoami --registry=https://registry.npmjs.org
|
|
113
|
-
npm publish ./out/release/rigscope-0.1.
|
|
113
|
+
npm publish ./out/release/rigscope-0.1.6.tgz --access public --tag latest \
|
|
114
114
|
--registry=https://registry.npmjs.org --dry-run
|
|
115
115
|
```
|
|
116
116
|
|
|
@@ -120,12 +120,12 @@ to publish or complete two-factor authentication.
|
|
|
120
120
|
When releasing, this command actually publishes the verified archive publicly:
|
|
121
121
|
|
|
122
122
|
```sh
|
|
123
|
-
npm publish ./out/release/rigscope-0.1.
|
|
123
|
+
npm publish ./out/release/rigscope-0.1.6.tgz --access public --tag latest \
|
|
124
124
|
--registry=https://registry.npmjs.org
|
|
125
|
-
npm view rigscope@0.1.
|
|
125
|
+
npm view rigscope@0.1.6 version dist.integrity --registry=https://registry.npmjs.org
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
Then use `npx --yes rigscope@0.1.
|
|
128
|
+
Then use `npx --yes rigscope@0.1.6 install` with a disposable `--state-dir`, an
|
|
129
129
|
unused `--port` and an isolated `XDG_BIN_HOME` for the registry installation
|
|
130
130
|
check. Uninstall that test installation afterward. Use the same isolation
|
|
131
131
|
settings for all test commands so the check does not select a real installation.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=721,exports.ids=[721],exports.modules={2116:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0});var d={default:function(){return p},useLinkStatus:function(){return r}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(24814),g=c(48249),h=f._(c(67484)),i=c(79925),j=c(30836),k=c(57272),l=c(30167),m=c(75729);c(52204);let n=c(78756);c(52836);let o=c(10881);function p(a){var b;let c,d,e,[f,p]=(0,h.useOptimistic)(n.IDLE_LINK_STATUS),r=(0,h.useRef)(null),{href:s,as:t,children:u,prefetch:v=null,passHref:w,replace:x,shallow:y,scroll:z,onClick:A,onMouseEnter:B,onTouchStart:C,legacyBehavior:D=!1,onNavigate:E,transitionTypes:F,ref:G,unstable_dynamicOnHover:H,...I}=a;c=u,D&&("string"==typeof c||"number"==typeof c)&&(c=(0,g.jsx)("a",{children:c}));let J=h.default.useContext(j.AppRouterContext),K=!1!==v,L=!1===v?"none":!0===v?"full":"auto",M="none"!==L?"auto"===L?o.FetchStrategy.PPR:o.FetchStrategy.Full:o.FetchStrategy.PPR,N="string"==typeof(b=t||s)?b:(0,i.formatUrl)(b);if(D){if(c?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");d=h.default.Children.only(c)}let O=D?d&&"object"==typeof d&&d.ref:G,P,Q=h.default.useCallback(a=>(null!==J&&(r.current=(0,n.mountLinkInstance)(a,N,J,M,K,p,P)),()=>{r.current&&((0,n.unmountLinkForCurrentNavigation)(r.current),r.current=null),(0,n.unmountPrefetchableInstance)(a)}),[K,N,J,M,p,P]),R={ref:(0,k.useMergedRef)(Q,O),onClick(a){D||"function"!=typeof A||A(a),D&&d.props&&"function"==typeof d.props.onClick&&d.props.onClick(a),!J||a.defaultPrevented||function(a="none"){}(L)},onMouseEnter(a){D||"function"!=typeof B||B(a),D&&d.props&&"function"==typeof d.props.onMouseEnter&&d.props.onMouseEnter(a),J&&K&&(0,n.onNavigationIntent)(a.currentTarget,!0===H)},onTouchStart:function(a){D||"function"!=typeof C||C(a),D&&d.props&&"function"==typeof d.props.onTouchStart&&d.props.onTouchStart(a),J&&K&&(0,n.onNavigationIntent)(a.currentTarget,!0===H)}};return(0,l.isAbsoluteUrl)(N)?R.href=N:D&&!w&&("a"!==d.type||"href"in d.props)||(R.href=(0,m.addBasePath)(N)),e=D?h.default.cloneElement(d,R):(0,g.jsx)("a",{...I,...R,children:c}),(0,g.jsx)(q.Provider,{value:f,children:e})}let q=(0,h.createContext)(n.IDLE_LINK_STATUS),r=()=>(0,h.useContext)(q);("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},8696:(a,b,c)=>{c.d(b,{D:()=>j,N:()=>k});var d=c(67484),e=(a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}},f=["light","dark"],g="(prefers-color-scheme: dark)",h=d.createContext(void 0),i={setTheme:a=>{},themes:[]},j=()=>{var a;return null!=(a=d.useContext(h))?a:i},k=a=>d.useContext(h)?d.createElement(d.Fragment,null,a.children):d.createElement(m,{...a}),l=["light","dark"],m=({forcedTheme:a,disableTransitionOnChange:b=!1,enableSystem:c=!0,enableColorScheme:e=!0,storageKey:i="theme",themes:j=l,defaultTheme:k=c?"system":"light",attribute:m="data-theme",value:r,children:s,nonce:t,scriptProps:u})=>{let[v,w]=d.useState(()=>o(i,k)),[x,y]=d.useState(()=>"system"===v?q():v),z=r?Object.values(r):j,A=d.useCallback(a=>{let d=a;if(!d)return;"system"===a&&c&&(d=q());let g=r?r[d]:d,h=b?p(t):null,i=document.documentElement,j=a=>{"class"===a?(i.classList.remove(...z),g&&i.classList.add(g)):a.startsWith("data-")&&(g?i.setAttribute(a,g):i.removeAttribute(a))};if(Array.isArray(m)?m.forEach(j):j(m),e){let a=f.includes(k)?k:null,b=f.includes(d)?d:a;i.style.colorScheme=b}null==h||h()},[t]),B=d.useCallback(a=>{let b="function"==typeof a?a(v):a;w(b);try{localStorage.setItem(i,b)}catch(a){}},[v]),C=d.useCallback(b=>{y(q(b)),"system"===v&&c&&!a&&A("system")},[v,a]);d.useEffect(()=>{let a=window.matchMedia(g);return a.addListener(C),C(a),()=>a.removeListener(C)},[C]),d.useEffect(()=>{let a=a=>{a.key===i&&(a.newValue?w(a.newValue):B(k))};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[B]),d.useEffect(()=>{A(null!=a?a:v)},[a,v]);let D=d.useMemo(()=>({theme:v,setTheme:B,forcedTheme:a,resolvedTheme:"system"===v?x:v,themes:c?[...j,"system"]:j,systemTheme:c?x:void 0}),[v,B,a,x,c,j]);return d.createElement(h.Provider,{value:D},d.createElement(n,{forcedTheme:a,storageKey:i,attribute:m,enableSystem:c,enableColorScheme:e,defaultTheme:k,value:r,themes:j,nonce:t,scriptProps:u}),s)},n=d.memo(({forcedTheme:a,storageKey:b,attribute:c,enableSystem:f,enableColorScheme:g,defaultTheme:h,value:i,themes:j,nonce:k,scriptProps:l})=>{let m=JSON.stringify([c,b,h,a,j,i,f,g]).slice(1,-1);return d.createElement("script",{...l,suppressHydrationWarning:!0,nonce:k,dangerouslySetInnerHTML:{__html:`(${e.toString()})(${m})`}})}),o=(a,b)=>{},p=a=>{let b=document.createElement("style");return a&&b.setAttribute("nonce",a),b.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(b),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(b)},1)}},q=a=>(a||(a=window.matchMedia(g)),a.matches?"dark":"light")},12421:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},19099:(a,b,c)=>{var d=c(54839);c.o(d,"usePathname")&&c.d(b,{usePathname:function(){return d.usePathname}}),c.o(d,"useRouter")&&c.d(b,{useRouter:function(){return d.useRouter}}),c.o(d,"useSearchParams")&&c.d(b,{useSearchParams:function(){return d.useSearchParams}})},27346:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},31742:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},44999:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},49187:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},50132:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},51589:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},51872:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},52836:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"isLocalURL",{enumerable:!0,get:function(){return f}});let d=c(30167),e=c(71742);function f(a){if(!(0,d.isAbsoluteUrl)(a))return!0;try{let b=(0,d.getLocationOrigin)(),c=new URL(a,b);return c.origin===b&&(0,e.hasBasePath)(c.pathname)}catch(a){return!1}}},55091:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return f}});let d=c(5735),e=c(22675);function f(){return(0,d.jsx)(e.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},57272:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"useMergedRef",{enumerable:!0,get:function(){return e}});let d=c(67484);function e(a,b){let c=(0,d.useRef)(null),e=(0,d.useRef)(null);return(0,d.useCallback)(d=>{if(null===d){let a=c.current;a&&(c.current=null,a());let b=e.current;b&&(e.current=null,b())}else a&&(c.current=f(a,d)),b&&(e.current=f(b,d))},[a,b])}function f(a,b){if("function"!=typeof a)return a.current=b,()=>{a.current=null};{let c=a(b);return"function"==typeof c?c:()=>a(null)}}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},65366:(a,b,c)=>{c.d(b,{A:()=>h});var d=c(67484);let e=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim();var f={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let g=(0,d.forwardRef)(({color:a="currentColor",size:b=24,strokeWidth:c=2,absoluteStrokeWidth:g,className:h="",children:i,iconNode:j,...k},l)=>(0,d.createElement)("svg",{ref:l,...f,width:b,height:b,stroke:a,strokeWidth:g?24*Number(c)/Number(b):c,className:e("lucide",h),...k},[...j.map(([a,b])=>(0,d.createElement)(a,b)),...Array.isArray(i)?i:[i]])),h=(a,b)=>{let c=(0,d.forwardRef)(({className:c,...f},h)=>(0,d.createElement)(g,{ref:h,iconNode:b,className:e(`lucide-${a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,c),...f}));return c.displayName=`${a}`,c}},71e3:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"addPathPrefix",{enumerable:!0,get:function(){return e}});let d=c(10571);function e(a,b){if(!a.startsWith("/")||!b)return a;let{pathname:c,query:e,hash:f}=(0,d.parsePath)(a);return`${b}${c}${e}${f}`}},71327:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},75729:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"addBasePath",{enumerable:!0,get:function(){return f}});let d=c(71e3),e=c(34956);function f(a,b){return(0,e.normalizePathTrailingSlash)((0,d.addPathPrefix)(a,""))}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},78607:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]])},79925:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0});var d={formatUrl:function(){return h},formatWithValidation:function(){return j},urlObjectKeys:function(){return i}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(24814)._(c(90485)),g=/https?|ftp|gopher|file/;function h(a){let{auth:b,hostname:c}=a,d=a.protocol||"",e=a.pathname||"",h=a.hash||"",i=a.query||"",j=!1;b=b?encodeURIComponent(b).replace(/%3A/i,":")+"@":"",a.host?j=b+a.host:c&&(j=b+(~c.indexOf(":")?`[${c}]`:c),a.port&&(j+=":"+a.port)),i&&"object"==typeof i&&(i=String(f.urlQueryToSearchParams(i)));let k=a.search||i&&`?${i}`||"";return d&&!d.endsWith(":")&&(d+=":"),a.slashes||(!d||g.test(d))&&!1!==j?(j="//"+(j||""),e&&"/"!==e[0]&&(e="/"+e)):j||(j=""),h&&"#"!==h[0]&&(h="#"+h),k&&"?"!==k[0]&&(k="?"+k),e=e.replace(/[?#]/g,encodeURIComponent),k=k.replace("#","%23"),`${d}${j}${e}${k}${h}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function j(a){return h(a)}},82437:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]])},89313:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},90162:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])},93484:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=877,exports.ids=[877],exports.modules={4155:(a,b,c)=>{c.d(b,{E:()=>r,x:()=>q});var d=c(48249),e=c(2116),f=c.n(e),g=c(31742),h=c(50132),i=c(49187),j=c(90606),k=c(93484),l=c(12421),m=c(22338),n=c(58910);function o(a){return(0,d.jsxs)("button",{type:"button",onClick:a.onClick,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:[(0,d.jsx)(g.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),a.children]})}function p(a){return(0,d.jsx)(f(),{href:a.href,className:a.primary?"inline-flex items-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90":"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:a.children})}function q(){let{session:a,phase:b,retryConnection:c}=(0,n.M)();switch(a.kind){case"restoring":return(0,d.jsx)(m.Z,{title:"Checking session",className:"mx-auto my-12 max-w-md",children:(0,d.jsx)(m.p,{icon:h.A,note:"Checking your session…"})});case"restore-failed":return(0,d.jsxs)(m.Z,{title:"Hub unreachable",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:i.A,note:"The hub is unreachable right now."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(o,{onClick:c,children:"Check again"})})]});case"signed-out":if("expired"===b)return(0,d.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:j.A,note:"Your session ended."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]});return(0,d.jsxs)(m.Z,{title:"Sign in required",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:h.A,note:"Sign in required."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]});case"auth-unavailable":return(0,d.jsx)(m.Z,{title:"Sign-in unavailable",className:"mx-auto my-12 max-w-md",children:(0,d.jsx)(m.p,{icon:k.A,note:"Browser sign-in is not configured on this hub."})})}return"expired"===b?(0,d.jsxs)(m.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:j.A,note:"Your session ended."}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(p,{href:"/login",primary:!0,children:"Sign in"})})]}):"no-permission"===b?(0,d.jsxs)(m.Z,{title:"No permission",className:"mx-auto my-12 max-w-md",children:[(0,d.jsx)(m.p,{icon:k.A,note:`You are signed in as ${a.user.username}, but this hub grants no machine view to this account.`}),(0,d.jsx)("div",{className:"flex justify-center",children:(0,d.jsx)(o,{onClick:c,children:"Check again"})})]}):null}function r(){let{phase:a,retryConnection:b}=(0,n.M)();return"reconnecting"!==a&&"disconnected"!==a&&"connecting"!==a?null:"connecting"===a?(0,d.jsxs)("div",{role:"status",className:"mb-5 flex items-center gap-2 rounded-lg border border-border bg-card px-4 py-2.5 text-xs text-muted-foreground",children:[(0,d.jsx)(g.A,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),"Connecting to the live feed — waiting for the first snapshot."]}):(0,d.jsxs)("div",{role:"status",className:"mb-5 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border border-border bg-card px-4 py-2.5 text-xs text-muted-foreground",children:[(0,d.jsx)(l.A,{className:"h-3.5 w-3.5 shrink-0 text-warn","aria-hidden":!0}),(0,d.jsxs)("span",{children:["Connection lost — values below are ",(0,d.jsx)("strong",{className:"font-medium text-foreground",children:"last known"}),", not live measurements","reconnecting"===a?" — retrying with backoff…":" — retries stopped."]}),"disconnected"===a?(0,d.jsx)(o,{onClick:b,children:"Retry now"}):null]})}},29356:(a,b,c)=>{c.d(b,{c:()=>e});var d=c(67484);function e(a=1e3){let[b,c]=(0,d.useState)(()=>Date.now());return b}},50280:(a,b,c)=>{c.d(b,{iL:()=>k,jB:()=>m,vw:()=>n});var d=c(48249),e=c(93224),f=c(22127);let g=2*Math.PI*70;function h(a){return Number.isFinite(a)?Math.min(100,Math.max(0,a)):0}function i(a){let{reason:b,ageLabel:c,center:e}=a;return(0,d.jsxs)("p",{className:e?"max-w-[16rem] text-center text-xs text-warn":"text-xs text-warn",children:["Unavailable — ",b,c?(0,d.jsxs)("span",{className:"text-muted-foreground",children:[" (last update ",c,")"]}):null]})}function j(a){let{reason:b,ageLabel:c}=a;return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("div",{role:"img","aria-label":`Unavailable — ${b}`,className:"flex h-40 w-40 shrink-0 items-center justify-center rounded-full border-[5px] border-dashed border-border",children:(0,d.jsx)("span",{className:"tnum text-xl font-semibold text-muted-foreground",children:"—"})}),(0,d.jsx)(i,{reason:b,ageLabel:c,center:!0})]})}function k(a){let{metricName:b,field:c,ageLabel:i,isHeld:k,thresholdMs:l}=a;if("unavailable"===c.out)return(0,d.jsx)(j,{reason:c.reason,ageLabel:i??null});if("absent"===c.out)return(0,d.jsx)(j,{reason:"No sample has arrived yet.",ageLabel:i??null});let m="stale"===c.out,n=h(c.value),o=g*(1-n/100),p=m?`${b} last known ${(0,e.l9)(n)}, stale`:`${b} ${(0,e.l9)(n)}`;return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,d.jsxs)("svg",{role:"img","aria-label":p,viewBox:"0 0 160 160",className:"h-40 w-40 shrink-0",children:[(0,d.jsx)("circle",{cx:80,cy:80,r:70,fill:"none",stroke:"var(--border)",strokeWidth:8}),(0,d.jsx)("circle",{cx:80,cy:80,r:70,fill:"none",stroke:m?"var(--warn)":"var(--cpu)",strokeWidth:8,strokeLinecap:"round",strokeDasharray:g,strokeDashoffset:o,transform:"rotate(-90 80 80)"}),(0,d.jsx)("text",{x:"50%",y:m||k?"45%":"50%",dominantBaseline:"central",textAnchor:"middle",className:"fill-foreground text-xl font-semibold tnum",children:(0,e.l9)(n)}),m?(0,d.jsx)("text",{x:"50%",y:102,textAnchor:"middle",className:"fill-warn text-xs tnum",children:"last known"}):k?(0,d.jsx)("text",{x:"50%",y:102,textAnchor:"middle",className:"fill-muted-foreground text-xs tnum",children:"held"}):null]}),(0,d.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:m?`Last known value — no update for over ${(0,e.$)(l??f.vz)}${i?` (${i})`:""}`:i??""})]})}function l(a){let{reason:b,ageLabel:c}=a;return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)("div",{role:"img","aria-label":`Memory unavailable — ${b}`,className:"h-3 w-full max-w-64 rounded-full border border-dashed border-border"}),(0,d.jsx)(i,{reason:b,ageLabel:c})]})}function m(a){let{field:b,ageLabel:c,isHeld:g,thresholdMs:i}=a;if("unavailable"===b.out)return(0,d.jsx)(l,{reason:b.reason,ageLabel:c??null});if("absent"===b.out)return(0,d.jsx)(l,{reason:"No sample has arrived yet.",ageLabel:c??null});let j="stale"===b.out,k=b.totalBytes,m=b.usedBytes,o=k>0?h(m/k*100)/100:0,p=j?`Memory last known ${(0,e.z3)(m)} of ${(0,e.z3)(k)}, stale`:`Memory ${(0,e.z3)(m)} of ${(0,e.z3)(k)}`;return(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{role:"img","aria-label":p,className:"flex h-3 w-full max-w-64 items-stretch overflow-hidden rounded-full bg-card-strong",children:(0,d.jsx)("div",{className:"h-full rounded-full",style:{width:`${100*o}%`,backgroundColor:j?"var(--warn)":"var(--mem)",minWidth:k>0?void 0:0}})}),(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("p",{className:"tnum text-sm",children:k>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"font-semibold",children:(0,e.z3)(m)}),(0,d.jsxs)("span",{className:"text-muted-foreground",children:[" of ",(0,e.z3)(k)]}),(0,d.jsxs)("span",{className:"text-muted-foreground",children:[" ","\xb7 ",(0,e.l9)(k>0?m/k*100:null)]})]}):(0,d.jsxs)("span",{className:"text-muted-foreground",children:[(0,e.z3)(m)," used — total size unavailable"]})}),j?(0,d.jsx)(n,{text:"last known",title:`No update for over ${(0,e.$)(i??f.vz)}`}):null,g&&!j?(0,d.jsx)(n,{text:"held",title:"Value kept while the connection is down"}):null]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:j?`Retained from the last accepted sample${c?` (${c})`:""}.`:c??""})]})}function n(a){let{text:b,title:c}=a;return(0,d.jsx)("span",{title:c,className:"tnum shrink-0 rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",children:b})}},90606:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},99837:(a,b,c)=>{c.d(b,{B4:()=>o,CE:()=>k,V5:()=>i,YL:()=>n,Zf:()=>p,cH:()=>l,cy:()=>C,d5:()=>m,fp:()=>z,hL:()=>x,rn:()=>j,v4:()=>h});var d=c(93224);function e(a,b){return{state:"value",value:a,stale:b}}function f(a){return{state:"unavailable",reason:a}}function g(a){return{state:"absent",reason:a}}function h(a){let b=a.displayName?.trim();if(b)return b;let c=a.hostname?.trim();return c||a.machineId}function i(a){let b=new Set,c=[];for(let d of a.tags??[]){if("string"!=typeof d)continue;let a=d.trim();if(!(""===a||b.has(a.toLowerCase()))&&(b.add(a.toLowerCase()),c.push(a),c.length>=32))break}return c}function j(a,b){let c=b.trim().toLowerCase().split(/\s+/).filter(Boolean);return 0===c.length?[...a]:a.filter(a=>{let b=[h(a),a.hostname,a.machineId,a.collectorId,...i(a)].filter(a=>"string"==typeof a&&""!==a.trim()).join(" ").toLowerCase();return c.every(a=>b.includes(a))})}function k(a){return null!=a&&Number.isFinite(a)?`${(0,d.z3)(a)}/s`:"—"}function l(a){return null!=a&&Number.isFinite(a)?`${Math.round(a)} \xb0C`:"—"}function m(a){return null!=a&&Number.isFinite(a)?`${Math.round(a)} W`:"—"}function n(a){return null==a||!Number.isFinite(a)||a<0?"—":`${a<10?a.toFixed(2):a.toFixed(1)} ms`}function o(a){return null!=a&&Number.isFinite(a)?Math.round(a).toLocaleString():"—"}function p(a){return null!=a&&Number.isFinite(a)?`${Math.round(a)} Mb/s`:"—"}function q(a){let b=a.filter(a=>"supported"===a.telemetry);return b.some(a=>"ok"===a.state)&&b.some(a=>"ok"!==a.state)}let r="The collector has not reported this metric family to this hub.";function s(a){return a.metrics?.payload??null}function t(a){return"number"==typeof a&&Number.isFinite(a)?a:null}function u(a){let b=t(a);return null!==b&&b>=0?b:null}function v(a,b,c,d,h=!0){if(null===a||"object"!=typeof a)return g(d);if("unavailable"===a.status)return f(("string"==typeof a.reason?a.reason.trim():"")||"This metric family is unavailable.");if("ok"!==a.status)return g(d);let i=(h?u:t)(a[b]);return null===i?f("Not reported for this sample."):e(i,c)}function w(a){let b=s(a);return null!==b?"ok"===b.disks.status?{state:"available"}:{state:"unavailable",reason:b.disks.reason}:{state:"absent",reason:r}}function x(a,b){var c;let j,k,l,m,n,o,p,t,x,y=(0,d.vj)(a,b),z="stale"===y,A=function(a,b){let c=a.inventory?.gpus??[],d=s(a),e=d?.gpus.status==="ok"?d.gpus.devices:[],f=d?.gpus.status==="unavailable"?d.gpus.reason:null,g=new Map(e.map(a=>[a.id,a])),h=new Map(c.map(a=>[a.id,a])),i=[];for(let a of c)i.push(a.id);for(let a of e)h.has(a.id)||i.push(a.id);let j=[];for(let a of i){let c=h.get(a),d=g.get(a),e={id:a,name:c?.name??a.replace(/^gpu:/,""),vendor:c?.vendor??"other",pciBusId:c?.pciBusId??null,telemetry:c?.telemetry??"supported",stale:b};if(d?.status==="ok"){j.push({...e,state:"ok",reason:null,utilizationPercent:d.utilizationPercent,memoryUsedBytes:d.memoryUsedBytes,memoryTotalBytes:d.memoryTotalBytes??c?.memoryTotalBytes??null,temperatureC:d.temperatureC,powerWatts:d.powerWatts});continue}if(d?.status==="unavailable"){j.push({...e,state:"unavailable",reason:d.reason,utilizationPercent:null,memoryUsedBytes:null,memoryTotalBytes:c?.memoryTotalBytes??null,temperatureC:null,powerWatts:null});continue}if(c?.telemetry==="unsupported"){j.push({...e,state:"unsupported",reason:c.reason??"No supported telemetry for this adapter.",utilizationPercent:null,memoryUsedBytes:null,memoryTotalBytes:null,temperatureC:null,powerWatts:null});continue}j.push({...e,state:"unavailable",reason:f??"No current reading for this device.",utilizationPercent:null,memoryUsedBytes:null,memoryTotalBytes:c?.memoryTotalBytes??null,temperatureC:null,powerWatts:null})}return j}(a,z);return{displayName:h(a),tags:i(a),freshness:y,thresholdMs:(0,d.Cj)(a.expectedIntervalMs),stale:z,cpu:{total:void 0===(l=a.metrics?.payload.cpu)?g("No CPU reading has been received yet."):"ok"===l.status?e(l.usagePercent,z):f(l.reason),perCore:void 0===(m=a.metrics?.payload.cpu)?g("No CPU reading has been received yet; per-core values are unknown."):"ok"===m.status?e([...m.perCore],z):f(m.reason)},memory:void 0===(n=a.metrics?.payload.memory)?g("No memory reading has been received yet."):"ok"===n.status?e({usedBytes:n.usedBytes,totalBytes:n.totalBytes},z):f(n.reason),swap:void 0===(o=a.metrics?.payload.swap)?g("No swap reading has been received yet."):"ok"===o.status?e({usedBytes:o.usedBytes,totalBytes:o.totalBytes},z):f(o.reason),bottlenecks:(p=a.metrics?.payload.cpu,t=a.metrics?.payload.memory,x=a.metrics?.payload.disks,{cpuTemperature:v(p,"temperatureC",z,"No CPU reading has been received yet.",!1),cpuPower:v(p,"powerWatts",z,"No CPU reading has been received yet."),cpuIowait:v(p,"iowaitPercent",z,"No CPU reading has been received yet."),cpuPressure:v(p,"pressureSomePercent",z,"No CPU reading has been received yet."),memoryPressureSome:v(t,"pressureSomePercent",z,"No memory reading has been received yet."),memoryPressureFull:v(t,"pressureFullPercent",z,"No memory reading has been received yet."),ioPressureSome:v(x,"pressureSomePercent",z,"No disk reading has been received yet."),ioPressureFull:v(x,"pressureFullPercent",z,"No disk reading has been received yet.")}),gpus:{family:null!==(j=s(c=a))?"ok"===j.gpus.status?{state:"available"}:{state:"unavailable",reason:j.gpus.reason}:(c.inventory?.gpus.length??0)>0?{state:"absent",reason:"No GPU readings have been received yet."}:{state:"absent",reason:r+" GPU telemetry is unknown until inventory or a reading arrives."},cards:A,partial:q(A)},filesystems:{family:w(a),items:function(a,b){let c=a.inventory?.filesystems??[],d=s(a),e=d?.disks.status==="ok"?d.disks.filesystems:[],f=d?.disks.status==="unavailable"?d.disks.reason:null,g=new Map(e.map(a=>[a.id,a])),h=new Map(c.map(a=>[a.id,a])),i=[];for(let a of c)i.push(a.id);for(let a of e)h.has(a.id)||i.push(a.id);return i.map(a=>{let c=h.get(a),e=g.get(a),i={id:a,mountPoint:c?.mountPoint??a.replace(/^fs:/,""),device:c?.device??"",fsType:c?.fsType??"unknown",totalBytes:c?.totalBytes??null,inodesUsed:null,inodesTotal:null,stale:b};return e?.status==="ok"?{...i,usedBytes:e.usedBytes,totalBytes:e.totalBytes,inodesUsed:u(e.inodesUsed),inodesTotal:u(e.inodesTotal),state:"ok",reason:null}:e?.status==="unavailable"?{...i,usedBytes:null,state:"unavailable",reason:e.reason}:null!==f?{...i,usedBytes:null,state:"unavailable",reason:f}:{...i,usedBytes:null,state:"inventory",reason:null===d?r:"No current usage reading for this filesystem."}})}(a,z)},disks:{family:w(a),items:function(a,b){let c=a.inventory?.disks??[],d=s(a),e=d?.disks.status==="ok"?d.disks.devices:[],f=d?.disks.status==="unavailable"?d.disks.reason:null,g=new Map(e.map(a=>[a.id,a])),h=new Map(c.map(a=>[a.id,a])),i=[];for(let a of c)i.push(a.id);for(let a of e)h.has(a.id)||i.push(a.id);return i.map(a=>{let c=h.get(a),e=g.get(a),i={id:a,name:c?.name??a.replace(/^disk:/,""),model:c?.model??null,rotational:c?.rotational??null,sizeBytes:c?.sizeBytes??null,readLatencyMs:null,writeLatencyMs:null,ioUtilizationPercent:null,stale:b};return e?.status==="ok"?{...i,state:"ok",reason:null,readBytesPerSec:e.readBytesPerSec,writeBytesPerSec:e.writeBytesPerSec,readLatencyMs:u(e.readLatencyMs),writeLatencyMs:u(e.writeLatencyMs),ioUtilizationPercent:u(e.ioUtilizationPercent)}:e?.status==="unavailable"?{...i,state:"unavailable",reason:e.reason,readBytesPerSec:null,writeBytesPerSec:null}:null!==f?{...i,state:"unavailable",reason:f,readBytesPerSec:null,writeBytesPerSec:null}:{...i,state:"inventory",reason:null===d?r:"No current I/O reading for this device.",readBytesPerSec:null,writeBytesPerSec:null}})}(a,z)},network:{family:null!==(k=s(a))?"ok"===k.network.status?{state:"available"}:{state:"unavailable",reason:k.network.reason}:{state:"absent",reason:r},items:function(a,b){let c=a.inventory?.network??[],d=s(a),e=d?.network.status==="ok"?d.network.interfaces:[],f=d?.network.status==="unavailable"?d.network.reason:null,g=new Map(e.map(a=>[a.id,a])),h=new Map(c.map(a=>[a.id,a])),i=[];for(let a of c)i.push(a.id);for(let a of e)h.has(a.id)||i.push(a.id);return i.map(a=>{let c=h.get(a),e=g.get(a),i={id:a,name:c?.name??a.replace(/^net:/,""),mac:c?.mac??null,addresses:c?.addresses??[],virtual:c?.virtual??!1,linkState:c?.state??"unknown",speedMbps:c?.speedMbps??null,stale:b};return e?.status==="ok"?{...i,state:"ok",reason:null,rxBytesPerSec:e.rxBytesPerSec,txBytesPerSec:e.txBytesPerSec}:e?.status==="unavailable"?{...i,state:"unavailable",reason:e.reason,rxBytesPerSec:null,txBytesPerSec:null}:null!==f?{...i,state:"unavailable",reason:f,rxBytesPerSec:null,txBytesPerSec:null}:{...i,state:"inventory",reason:null===d?r:"No current rate reading for this interface.",rxBytesPerSec:null,txBytesPerSec:null}})}(a,z)}}}function y(a){if(0===a.length||a.some(a=>null===a))return null;let b=0;for(let c of a)b+=c;return b}function z(a,b){let c,d,e,f,g,h,i=x(a,b),j=i.gpus.cards,k=0===j.length?null:(e=(d=(c=j.filter(a=>"supported"===a.telemetry)).filter(a=>"ok"===a.state)).map(a=>a.utilizationPercent).filter(a=>null!==a),f=y(c.map(a=>a.memoryUsedBytes)),g=y(c.map(a=>a.memoryTotalBytes)),h=0===d.length?"unavailable"===i.gpus.family.state||"absent"===i.gpus.family.state?i.gpus.family.reason:0===c.length?"No telemetry-supported GPU was reported.":"No current GPU reading.":null,{count:j.length,supportedCount:c.length,okCount:d.length,partial:q(j),maxUtilizationPercent:0===e.length?null:Math.max(...e),memoryUsedBytes:f,memoryTotalBytes:g,stale:i.stale,reason:h}),l=i.filesystems.items.filter(a=>"ok"===a.state&&null!==a.usedBytes&&null!==a.totalBytes&&a.totalBytes>0).map(a=>a.usedBytes/a.totalBytes*100),m=0===i.filesystems.items.length?null:{maxUsedPercent:0===l.length?null:Math.max(...l),stale:i.stale,reason:0===l.length?"available"===i.filesystems.family.state?"No current filesystem usage reading.":i.filesystems.family.reason:null},n=i.network.items.filter(a=>"ok"===a.state&&null!==a.rxBytesPerSec&&null!==a.txBytesPerSec),o=0===i.network.items.length?null:{rxBytesPerSec:n.reduce((a,b)=>a+b.rxBytesPerSec,0),txBytesPerSec:n.reduce((a,b)=>a+b.txBytesPerSec,0),stale:i.stale,reason:0===n.length?"available"===i.network.family.state?"No current interface rate reading.":i.network.family.reason:null};return{cpu:i.cpu.total,memory:i.memory,gpu:k,disk:m,network:o}}let A=["cpu","memory","swap","gpus","disks","network","processes"],B={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPUs",disks:"Disks",network:"Network",processes:"Processes"};function C(a,b){return a.map(a=>{var c;return{machineId:a.machineId,name:h(a),collectorId:a.collectorId,connected:a.connected,cadenceMs:a.expectedIntervalMs??null,thresholdMs:(0,d.Cj)(a.expectedIntervalMs),lastReceivedAt:a.lastReceivedAt,freshness:(0,d.vj)(a,b),delivery:a.delivery?.delivery??null,deliveryCapturedAt:a.delivery?.capturedAt??null,failures:a.delivery?.failures??[],capabilities:void 0===(c=a.inventory)?null:A.map(a=>{let b=c.capabilities[a];return{key:a,label:B[a],status:b.status,reason:b.reason??null}})}})}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[103],{802:(e,n,r)=>{r.d(n,{B:()=>l});var t=r(5155),i=r(8500),s=r.n(i),a=r(9939);function l(){let{session:e,phase:n,signOut:r}=(0,a.M)();return"signed-in"===e.kind?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"hidden max-w-[12rem] truncate text-xs text-muted-foreground sm:inline",children:e.user.username}),(0,t.jsx)("button",{type:"button",onClick:()=>void r(),className:"rounded-md px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-card-strong hover:text-foreground",children:"Sign out"})]}):"restoring"===e.kind||"auth-unavailable"===e.kind?null:(0,t.jsx)("div",{className:"flex items-center gap-1",children:(0,t.jsx)(s(),{href:"/login",className:"rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:"Sign in"})})}},940:(e,n,r)=>{r.d(n,{$E:()=>d,TK:()=>o});var t=r(5155),i=r(9939);let s={ok:"bg-ok",warn:"bg-warn",crit:"bg-crit",muted:"bg-muted-foreground/50"};function a(e,n){switch(e.kind){case"restoring":return{label:"Checking session…",tone:"muted"};case"restore-failed":return{label:"Hub unreachable",tone:"crit"};case"signed-out":return{label:"Signed out",tone:"muted"};case"auth-unavailable":return{label:"Sign-in unavailable",tone:"warn"}}switch(n){case"idle":return{label:"Not connected",tone:"muted"};case"connecting":return{label:"Connecting…",tone:"warn"};case"live":return{label:"Live",tone:"ok"};case"reconnecting":return{label:"Reconnecting…",tone:"warn"};case"disconnected":return{label:"Disconnected",tone:"crit"};case"expired":return{label:"Session ended",tone:"crit"};case"no-permission":return{label:"No permission",tone:"warn"}}}function l({tone:e}){return(0,t.jsx)("span",{className:`inline-block h-2 w-2 shrink-0 rounded-full ${s[e]}`,"aria-hidden":!0})}function d(){let{session:e,phase:n,lastEventKind:r,notice:s,dismissNotice:d}=(0,i.M)(),o=a(e,n),c="reset"===r&&"live"===n?"Stream resynchronized with a fresh snapshot.":null;return(0,t.jsxs)("div",{role:"status","aria-label":`Live feed status: ${o.label}`,className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(l,{tone:o.tone}),(0,t.jsx)("span",{className:"tnum truncate text-xs text-muted-foreground",children:o.label}),c?(0,t.jsxs)("span",{className:"tnum hidden truncate text-xs text-muted-foreground lg:inline",title:c,children:["\xb7 ",c]}):null,s?(0,t.jsxs)("button",{type:"button",onClick:d,className:"max-w-[16rem] truncate rounded-md border border-border px-2 py-0.5 text-xs text-foreground transition-colors hover:bg-card-strong",title:`${s} Click to dismiss.`,children:[s,(0,t.jsx)("span",{"aria-hidden":!0,children:" ✕"})]}):null]})}function o(){let{session:e,phase:n}=(0,i.M)(),r=a(e,n);return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 text-xs",children:[(0,t.jsx)(l,{tone:r.tone}),(0,t.jsx)("span",{className:"truncate",role:"status","aria-label":`Live feed status: ${r.label}`,children:r.label})]})}},1721:(e,n,r)=>{r.d(n,{MachineBreadcrumb:()=>d});var t=r(5155),i=r(8500),s=r.n(i),a=r(9939),l=r(8664);function d({machineId:e,title:n,view:r}){let{machines:i}=(0,a.M)(),o=(0,l.FM)(),c=i.find(n=>n.machineId===e),m=c?.displayName||c?.hostname||"Machine";return(0,t.jsxs)("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,t.jsx)(s(),{href:"/",className:"hidden text-muted-foreground hover:text-foreground sm:inline",children:"Fleet"}),(0,t.jsx)("span",{"aria-hidden":!0,className:"hidden text-muted-foreground sm:inline",children:"/"}),(0,t.jsx)(s(),{href:(0,l.Y2)(e,"overview"),className:"hidden max-w-48 truncate text-muted-foreground hover:text-foreground md:inline",children:m}),(0,t.jsx)("select",{"aria-label":"Machine",value:e,onChange:e=>o(e.target.value,r),className:"h-8 min-w-0 max-w-32 rounded-md border border-border bg-card px-1.5 text-sm md:hidden",children:i.map(e=>(0,t.jsx)("option",{value:e.machineId,children:e.displayName||e.hostname||e.machineId},e.machineId))}),(0,t.jsx)("span",{"aria-hidden":!0,className:"text-muted-foreground",children:"/"}),(0,t.jsx)("h1",{className:"truncate text-lg font-semibold tracking-tight",children:n})]})}},2394:(e,n,r)=>{r.d(n,{ThemeToggle:()=>l});var t=r(5155),i=r(1134),s=r(9145),a=r(460);function l(){let{resolvedTheme:e,setTheme:n}=(0,a.D)();return(0,t.jsxs)("button",{type:"button",onClick:()=>n("dark"===e?"light":"dark"),"aria-label":"Toggle theme",className:"flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-selected hover:text-foreground",children:[(0,t.jsx)(i.A,{className:"h-4.5 w-4.5 dark:hidden"}),(0,t.jsx)(s.A,{className:"hidden h-4.5 w-4.5 dark:block"})]})}},2701:(e,n,r)=>{r.d(n,{Sidebar:()=>w});var t=r(5155),i=r(8500),s=r.n(i),a=r(3321),l=r(257),d=r(7233),o=r(2955),c=r(3896),m=r(9764),u=r(4201),h=r(8731),x=r(8664),f=r(8773),b=r(940),g=r(9939);let p=[{href:"/alerts",label:"Alerts",icon:l.A},{href:"/connections",label:"Connections",icon:d.A}],v=[{view:"overview",label:"Overview",icon:o.A},{view:"history",label:"History",icon:c.A},{view:"processes",label:"Processes",icon:m.A}],j=e=>["flex min-h-9 min-w-0 items-center gap-3 rounded-md px-2 text-sm transition-colors md:px-3",e?"bg-selected font-medium text-foreground":"text-muted-foreground hover:bg-card-strong hover:text-foreground"].join(" ");function w({machineId:e,machineView:n}){let r=(0,a.usePathname)(),{session:i,machines:l}=(0,g.M)(),{machine:d,view:o,selectMachine:c}=(0,x.PY)(e,n),m="signed-in"===i.kind&&!0===i.user.admin?[...p,{href:"/administration",label:"Administration",icon:u.A}]:p;return(0,t.jsxs)("aside",{className:"flex w-14 shrink-0 flex-col border-r border-border bg-card md:w-56",children:[(0,t.jsxs)(s(),{href:"/","aria-label":"Rigscope",className:"flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-3 md:px-5",children:[(0,t.jsx)(f.R,{className:"h-5 w-5 shrink-0 text-accent","aria-hidden":!0}),(0,t.jsx)("span",{className:"hidden text-sm font-semibold tracking-tight text-foreground md:inline",children:"Rigscope"})]}),(0,t.jsxs)("nav",{"aria-label":"Primary",className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-2 md:p-3",children:[(0,t.jsxs)(s(),{href:"/","aria-current":"/"===r?"page":void 0,title:"Fleet",className:j("/"===r),children:[(0,t.jsx)(h.A,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"hidden md:inline",children:"Fleet"})]}),d?(0,t.jsxs)("div",{className:"mb-4 mt-2 md:ms-3 md:border-s md:border-border md:ps-3",children:[(0,t.jsx)("label",{htmlFor:"sidebar-machine",className:"sr-only",children:"Machine"}),(0,t.jsx)("select",{id:"sidebar-machine",value:d.machineId,onChange:e=>c(e.target.value),className:"mb-1 hidden h-9 w-full min-w-0 rounded-md border border-border bg-background px-2 text-sm font-medium md:block",children:l.map(e=>(0,t.jsx)("option",{value:e.machineId,children:e.displayName||e.hostname||e.machineId},e.machineId))}),(0,t.jsx)("nav",{"aria-label":"Selected machine",className:"flex flex-col gap-1",children:v.map(({view:e,label:n,icon:r})=>(0,t.jsxs)(s(),{href:(0,x.Y2)(d.machineId,e),"aria-current":o===e?"page":void 0,title:`${d.displayName||d.hostname}: ${n}`,className:j(o===e),children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"hidden md:inline",children:n})]},e))})]}):null,(0,t.jsx)("div",{className:"flex flex-col gap-1 border-t border-border pt-3",children:m.map(({href:e,label:n,icon:i})=>(0,t.jsxs)(s(),{href:e,"aria-current":r===e?"page":void 0,title:n,className:j(r===e),children:[(0,t.jsx)(i,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"hidden md:inline",children:n})]},e))})]}),(0,t.jsx)("footer",{className:"hidden shrink-0 border-t border-border p-3 md:block",children:(0,t.jsx)(b.TK,{})})]})}},3440:(e,n,r)=>{r.d(n,{Z:()=>i,p:()=>s});var t=r(5155);function i({title:e,action:n,className:r,children:s}){return(0,t.jsxs)("section",{className:["flex min-w-0 flex-col rounded-xl border border-border bg-card p-5",r].filter(Boolean).join(" "),children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[(0,t.jsx)("h2",{className:"text-sm font-medium tracking-tight",children:e}),n?(0,t.jsx)("div",{className:"text-xs tabular-nums",children:n}):null]}),(0,t.jsx)("div",{className:"mt-4 flex min-h-0 flex-1 flex-col",children:s})]})}function s({icon:e,note:n,className:r}){return(0,t.jsxs)("div",{className:["flex flex-1 flex-col items-center justify-center gap-2.5 rounded-lg border border-dashed border-border px-6 py-10 text-center",r].filter(Boolean).join(" "),children:[(0,t.jsx)(e,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n})]})}},4173:(e,n,r)=>{r.d(n,{G:()=>l});var t=r(5155),i=r(1721),s=r(2701),a=r(2394);function l({title:e,headerRight:n,children:r,workspace:d=!1,machineId:o,machineView:c}){return(0,t.jsxs)("div",{className:"relative flex h-dvh overflow-hidden bg-background text-foreground",children:[(0,t.jsx)("a",{href:"#main-content",className:"sr-only z-50 rounded-md bg-card px-4 py-2 text-foreground focus:not-sr-only focus:absolute focus:start-2 focus:top-2 focus:outline-2 focus:outline-accent",children:"Skip to content"}),(0,t.jsx)(s.Sidebar,{machineId:o,machineView:c}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsxs)("header",{className:"flex min-h-14 shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-2 md:px-6",children:[o&&c?(0,t.jsx)(i.MachineBreadcrumb,{machineId:o,title:e,view:c}):(0,t.jsx)("h1",{className:"truncate text-lg font-semibold tracking-tight",children:e}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[n?(0,t.jsx)("div",{className:"flex min-w-0 items-center gap-3",children:n}):null,(0,t.jsx)(a.ThemeToggle,{})]})]}),(0,t.jsx)("main",{id:"main-content",tabIndex:-1,className:`relative min-h-0 min-w-0 flex-1 overflow-x-hidden overscroll-contain p-4 outline-offset-[-2px] md:p-6 ${d?"flex flex-col overflow-y-hidden":"overflow-y-auto"}`,children:(0,t.jsx)("div",{className:d?"mx-auto flex h-full w-full min-h-0 min-w-0 max-w-[1500px] flex-1 flex-col":"mx-auto flex w-full min-w-0 max-w-[1500px] flex-col",children:r})})]})]})}},6114:(e,n,r)=>{r.d(n,{u:()=>u});var t=r(2115);let i="rigscope:",s=new Map,a=new Map,l=new Map,d=!1;function o(e){try{return"local"===e?window.localStorage:window.sessionStorage}catch{return null}}function c(e,n){return`${e}:${n}`}function m(e,n,r,t){let a=c(e,n);if(s.has(a))return s.get(a);let l=r,d=o(e);if(null!==d)try{let e=d.getItem(i+n);if(null!==e){let n=t(JSON.parse(e));null!==n&&(l=n)}}catch{}return s.set(a,l),l}function u(e,n,r,h="local"){let x=c(h,e);return[(0,t.useSyncExternalStore)((0,t.useCallback)(e=>{let n;return void 0===(n=a.get(x))&&(n=new Set,a.set(x,n)),n.add(e),()=>{n.delete(e)}},[x]),()=>m(h,e,n,r),()=>n),(0,t.useCallback)(t=>{let u=m(h,e,n,r),f="function"==typeof t?t(u):t;if(!Object.is(f,u)){s.set(x,f);let n=c(h,e),r=l.get(n);void 0!==r&&clearTimeout(r.timer);let t=()=>{let r=l.get(n);r&&clearTimeout(r.timer),l.delete(n);let t=o(h);if(null!==t)try{t.setItem(i+e,JSON.stringify(s.get(n)))}catch{}};if(l.set(n,{timer:setTimeout(t,250),flush:t}),!d){d=!0;let e=()=>l.forEach(e=>e.flush());window.addEventListener("pagehide",e),document.addEventListener("visibilitychange",()=>{document.hidden&&e()})}a.get(x)?.forEach(e=>e())}},[n,x,e,h,r])]}},8664:(e,n,r)=>{r.d(n,{FM:()=>f,JG:()=>x,PY:()=>b,Y2:()=>l});var t=r(2115),i=r(3321),s=r(6114),a=r(9939);function l(e,n){let r=encodeURIComponent(e);return"overview"===n?`/machines/${r}`:`/${n}?machineId=${r}`}function d(e){let n=e.inventory?.capabilities?.processes;return void 0===n||"supported"===n.status}let o={overview:e=>e[0],history:e=>e[0],processes:e=>e.find(d)??e[0]};function c({view:e,requestedMachineId:n,rememberedMachineId:r,machines:t}){if(0===t.length)return{kind:"fleet-empty"};if(n){let e=t.find(e=>e.machineId===n);return e?{kind:"resolved",machine:e,via:"requested"}:{kind:"missing",requestedMachineId:n}}if(r){let e=t.find(e=>e.machineId===r);if(e)return{kind:"resolved",machine:e,via:"remembered"}}let i=o[e](t);return i?{kind:"resolved",machine:i,via:"fallback"}:{kind:"fleet-empty"}}let m=e=>"string"==typeof e?e:null;function u(){return(0,s.u)("machine.selected","",m,"session")}let h=new Set(["history"]);function x(e,n){let{session:r,machines:s}=(0,a.M)(),l=(0,i.useRouter)(),d=(0,i.usePathname)()||`/${e}`,o=(0,i.useSearchParams)(),[m,x]=u(),f="overview"===e?n??"":o.get("machineId")||null,b=(0,t.useMemo)(()=>c({view:e,requestedMachineId:f,rememberedMachineId:m,machines:s}),[e,f,m,s]),g="resolved"===b.kind?b.machine:void 0,p=g?.machineId??"",v="overview"===e?f??"":"processes"===e?g?.machineId??f??"":p;(0,t.useEffect)(()=>{p&&x(p)},[p,x]);let j=h.has(e);return(0,t.useEffect)(()=>{if(!j||"signed-in"!==r.kind||0===s.length||null!==f||""===p)return;let e=function(e,n,r){if(n.get("machineId"))return null;let t=new URLSearchParams(n.toString());return t.set("machineId",r),`${e}?${t.toString()}`}(d,o,p);e&&l.replace(e,{scroll:!1})},[j,r.kind,s,f,p,o,l,d]),{resolution:b,machine:g,machineId:p,navMachineId:v,requestedMachineId:f}}function f(){let e=(0,i.useRouter)(),[,n]=u();return(0,t.useCallback)((r,t)=>{n(r),e.push(l(r,t))},[n,e])}function b(e,n){let r=(0,i.usePathname)()||"/",{machines:t}=(0,a.M)(),[s]=u(),l=f(),d=n??(r.startsWith("/machines/")?"overview":"/history"===r?"history":"/processes"===r?"processes":null),o=c({view:d??"overview",requestedMachineId:t.some(n=>n.machineId===e)?e:null,rememberedMachineId:s,machines:t});return{view:d,machine:"resolved"===o.kind?o.machine:void 0,selectMachine:e=>l(e,d??"overview")}}},8773:(e,n,r)=>{r.d(n,{R:()=>i});var t=r(5155);function i(e){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...e,children:[(0,t.jsx)("path",{d:"M8 3H4v18h4M16 3h4v18h-4"}),(0,t.jsx)("path",{d:"m8 15 4-6 4 3M8 8h.01M16 17h.01"})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[157],{91:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return s},urlObjectKeys:function(){return i}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6388)._(r(1393)),l=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",u=e.hash||"",i=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),i&&"object"==typeof i&&(i=String(o.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==s?(s="//"+(s||""),a&&"/"!==a[0]&&(a="/"+a)):s||(s=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${a}${c}${u}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return u(e)}},257:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]])},460:(e,t,r)=>{r.d(t,{D:()=>s,N:()=>c});var n=r(2115),a=(e,t,r,n,a,o,l,u)=>{let i=document.documentElement,s=["light","dark"];function c(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&o?a.map(e=>o[e]||e):a;r?(i.classList.remove(...n),i.classList.add(o&&o[t]?o[t]:t)):i.setAttribute(e,t)}),r=t,u&&s.includes(r)&&(i.style.colorScheme=r)}if(n)c(n);else try{let e=localStorage.getItem(t)||r,n=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(n)}catch(e){}},o=["light","dark"],l="(prefers-color-scheme: dark)",u=n.createContext(void 0),i={setTheme:e=>{},themes:[]},s=()=>{var e;return null!=(e=n.useContext(u))?e:i},c=e=>n.useContext(u)?n.createElement(n.Fragment,null,e.children):n.createElement(h,{...e}),d=["light","dark"],h=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:a=!0,storageKey:i="theme",themes:s=d,defaultTheme:c=r?"system":"light",attribute:h="data-theme",value:g,children:k,nonce:v,scriptProps:b})=>{let[M,A]=n.useState(()=>p(i,c)),[w,S]=n.useState(()=>"system"===M?m():M),x=g?Object.values(g):s,C=n.useCallback(e=>{let n=e;if(!n)return;"system"===e&&r&&(n=m());let l=g?g[n]:n,u=t?y(v):null,i=document.documentElement,s=e=>{"class"===e?(i.classList.remove(...x),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(h)?h.forEach(s):s(h),a){let e=o.includes(c)?c:null,t=o.includes(n)?n:e;i.style.colorScheme=t}null==u||u()},[v]),E=n.useCallback(e=>{let t="function"==typeof e?e(M):e;A(t);try{localStorage.setItem(i,t)}catch(e){}},[M]),P=n.useCallback(t=>{S(m(t)),"system"===M&&r&&!e&&C("system")},[M,e]);n.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(P),P(e),()=>e.removeListener(P)},[P]),n.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?A(e.newValue):E(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),n.useEffect(()=>{C(null!=e?e:M)},[e,M]);let j=n.useMemo(()=>({theme:M,setTheme:E,forcedTheme:e,resolvedTheme:"system"===M?w:M,themes:r?[...s,"system"]:s,systemTheme:r?w:void 0}),[M,E,e,w,r,s]);return n.createElement(u.Provider,{value:j},n.createElement(f,{forcedTheme:e,storageKey:i,attribute:h,enableSystem:r,enableColorScheme:a,defaultTheme:c,value:g,themes:s,nonce:v,scriptProps:b}),k)},f=n.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:o,enableColorScheme:l,defaultTheme:u,value:i,themes:s,nonce:c,scriptProps:d})=>{let h=JSON.stringify([r,t,u,e,s,i,o,l]).slice(1,-1);return n.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:`(${a.toString()})(${h})`}})}),p=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},m=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},857:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={DecodeError:function(){return m},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return v},NormalizeError:function(){return g},PageNotFoundError:function(){return k},SP:function(){return p},ST:function(){return y},WEB_VITALS:function(){return a},execOnce:function(){return o},getDisplayName:function(){return c},getLocationOrigin:function(){return i},getURL:function(){return s},isAbsoluteUrl:function(){return u},isResSent:function(){return d},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return M}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=["CLS","FCP","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function i(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function s(){let{href:e}=window.location,t=i();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let p="u">typeof performance,y=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class g extends Error{}class k extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function M(e){return JSON.stringify({message:e.message,stack:e.stack})}},1134:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},1172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=r(2115);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1735:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},2955:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},3321:(e,t,r)=>{var n=r(4645);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},3896:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},4201:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},6914:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},7029:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},7233:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]])},7422:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},8500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return v}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6388),l=r(5155),u=o._(r(2115)),i=r(91),s=r(2909),c=r(1172),d=r(857),h=r(127),f=r(4616),p=r(4972),y=r(9470),m=r(7565);function g(e){var t;let n,a,o,[g,v]=(0,u.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,u.useRef)(null),{href:M,as:A,children:w,prefetch:S=null,passHref:x,replace:C,shallow:E,scroll:P,onClick:j,onMouseEnter:L,onTouchStart:T,legacyBehavior:_=!1,onNavigate:N,transitionTypes:O,ref:z,unstable_dynamicOnHover:R,...$}=e;n=w,_&&("string"==typeof n||"number"==typeof n)&&(n=(0,l.jsx)("a",{children:n}));let I=u.default.useContext(s.AppRouterContext),U=!1!==S,B=!1===S?"none":!0===S?"full":"auto",F="none"!==B?"auto"===B?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,V="string"==typeof(t=A||M)?t:(0,i.formatUrl)(t);if(_){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");a=u.default.Children.only(n)}let q=_?a&&"object"==typeof a&&a.ref:z,D,K=u.default.useCallback(e=>(null!==I&&(b.current=(0,p.mountLinkInstance)(e,V,I,F,U,v,D)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,V,I,F,v,D]),W={ref:(0,c.useMergedRef)(K,q),onClick(e){_||"function"!=typeof j||j(e),_&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(e),!I||e.defaultPrevented||function(e,t,n,a,o,l,u,i="none"){{let s,{nodeName:c}=e.currentTarget;if("A"===c.toUpperCase()&&((s=e.currentTarget.getAttribute("target"))&&"_self"!==s||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))return;if(!(0,y.isLocalURL)(t)){a&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=r(5287);d(t,a?"replace":"push",!1===o?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,u,i)}}(e,V,b,C,P,N,O,B)},onMouseEnter(e){_||"function"!=typeof L||L(e),_&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)},onTouchStart:function(e){_||"function"!=typeof T||T(e),_&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)}};return(0,d.isAbsoluteUrl)(V)?W.href=V:_&&!x&&("a"!==a.type||"href"in a.props)||(W.href=(0,h.addBasePath)(V)),o=_?u.default.cloneElement(a,W):(0,l.jsx)("a",{...$,...W,children:n}),(0,l.jsx)(k.Provider,{value:g,children:o})}let k=(0,u.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,u.useContext)(k);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8698:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(2115);let a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,n.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:u="",children:i,iconNode:s,...c},d)=>(0,n.createElement)("svg",{ref:d,...o,width:t,height:t,stroke:e,strokeWidth:l?24*Number(r)/Number(t):r,className:a("lucide",u),...c},[...s.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(i)?i:[i]])),u=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...o},u)=>(0,n.createElement)(l,{ref:u,iconNode:t,className:a(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o}));return r.displayName=`${e}`,r}},8731:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},9145:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},9470:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=r(857),a=r(8512);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},9764:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[408],{4150:(e,t,r)=>{r.d(t,{Au:()=>u,_C:()=>a,eg:()=>c});var s=r(5155),n=r(2115),i=r(6304),l=r(5078);let o=(0,n.createContext)(null);function a({children:e}){let[t,r]=(0,n.useState)(null),i=(0,n.useCallback)(e=>r(t=>t?.timeMs===e?.timeMs&&t?.source===e?.source?t:e),[]),l=(0,n.useMemo)(()=>({cursor:t,setCursor:i}),[t,i]);return(0,s.jsx)(o.Provider,{value:l,children:e})}function u({series:e,fromMs:t,toMs:r,stepMs:s,gaps:l}){let a=(0,n.useId)(),[c,d]=(0,n.useState)(null),m=(0,n.useContext)(o),f=m?m.cursor:c,p=m?m.setCursor:d,h=(0,n.useRef)(null),g=(0,n.useRef)(null),y=(0,n.useCallback)(()=>{null!==h.current&&cancelAnimationFrame(h.current),h.current=null,g.current=null},[]);(0,n.useEffect)(()=>y,[y]);let x=(0,n.useMemo)(()=>(0,i.X)(e).filter(e=>e.t<=r&&e.t+s/2>=t),[e,t,r,s]),b=f&&f.timeMs>=t-s/2&&f.timeMs<=r?f.timeMs:null,v=null!==b&&f?.source===a;(0,n.useEffect)(()=>{if(!v)return;let e=e=>{"Escape"===e.key&&(y(),p(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v,p,y]);let M=()=>{y(),f?.source===a&&p(null)};return{id:a,timeMs:b,active:v,inspect:e=>{let n=Math.max(t,Math.min(r,e)),o=(0,i.bO)(x,n,s,l);g.current={timeMs:o?.t??n,source:a},null===h.current&&(h.current=requestAnimationFrame(()=>{h.current=null,p(g.current),g.current=null}))},clear:M,onKeyDown:e=>{if(y(),"Escape"===e.key)e.preventDefault(),M();else if(["ArrowLeft","ArrowRight","Home","End"].includes(e.key)){e.preventDefault();let t=(0,i.o7)(x,b,e.key);null!==t&&p({timeMs:t,source:a})}},onFocus:()=>{y(),p({timeMs:x.at(-1)?.t??r,source:a})}}}function c({id:e,timeMs:t,fraction:r,unit:i,readings:o}){let[a]=(0,n.useState)(()=>r>.5?"left":"right");return(0,s.jsxs)("div",{id:e,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"===a?"left-2":"right-2"}`,children:[(0,s.jsx)("p",{className:"tnum font-medium",children:(0,l.r6)(t)}),(0,s.jsx)("p",{className:"mb-2 text-muted-foreground",children:"Recorded bucket average"}),(0,s.jsx)("dl",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-4 gap-y-1.5",children:o.map(({key:e,label:r,color:n,point:o})=>(0,s.jsxs)("div",{className:"contents",children:[(0,s.jsxs)("dt",{className:"flex min-w-0 items-center gap-1.5",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:n}}),(0,s.jsx)("span",{className:"break-words",children:r})]}),(0,s.jsxs)("dd",{className:"tnum text-right",children:[o?.avg==null?"No reading":(0,l.dd)(o.avg,i),o&&o.t!==t?(0,s.jsx)("span",{className:"block text-muted-foreground",children:(0,l.ei)(o.t)}):null]})]},e))})]})}},4567:(e,t,r)=>{r.d(t,{Cv:()=>n,H9:()=>s,Lf:()=>u,P$:()=>i,RL:()=>g,bP:()=>h,er:()=>m,oB:()=>a,ue:()=>p,yv:()=>d});let s=[{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 n(e,t){return e.filter(r=>{for(let[s,n,i]of[["memory","memory.used","memory.usage"],["filesystem","fs.used","fs.usage"]])if(e.includes(n)&&e.includes(i)&&(r===n||r===i))return r===("percent"===t[s]?i:n);return!0})}let i=[{id:"cpu",label:"CPU",metrics:["cpu.usage","cpu.core","cpu.iowait","cpu.pressure","cpu.temperature","cpu.power"]},{id:"memory",label:"Memory",metrics:["memory.used","memory.usage","swap.used","memory.pressure.some","memory.pressure.full"]},{id:"gpu",label:"GPU",metrics:["gpu.utilization","gpu.memory.used","gpu.temperature","gpu.power"]},{id:"disk",label:"Storage",metrics:["fs.used","fs.usage","fs.inodes.usage","disk.read","disk.write","disk.read.latency","disk.write.latency","disk.utilization","io.pressure.some","io.pressure.full"]},{id:"network",label:"Network",metrics:["net.rx","net.tx"]}],l=["var(--cpu)","var(--mem)","color-mix(in oklab, var(--swap) 75%, var(--foreground))","var(--warn)","var(--crit)","var(--accent)"],o=[void 0,"7 4","2 3","10 3 2 3","4 4","1 3"];function a(e){return s.find(t=>t.metric===e)??null}function u(e,t){let r=Math.max(0,t),s=e.colorSlot+r,n=(r+Math.floor(s/l.length))%o.length;return{color:l[s%l.length],dash:o[n]}}let c={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPU metrics",disks:"Disk metrics",network:"Network metrics"};function d(e,t){let r=a(t);if(null===r||void 0===e)return{available:!0,reason:null};let s=e.inventory?.capabilities?.[r.family];if(!s||"supported"===s.status)return{available:!0,reason:null};let n=s.reason?.trim();return{available:!1,reason:n?`${c[r.family]}: ${s.status} — ${n}`:`${c[r.family]} are ${s.status} on this machine.`}}function m(e){if(void 0===e)return[];let t=[],r=r=>{!(t.length>=16)&&d(e,r).available&&t.push(r)};r("cpu.usage"),r("memory.used");let s=function(e){let t=e.inventory?.memory.swapTotalBytes;if("number"==typeof t)return t;let r=e.metrics?.payload.swap;return r?.status==="ok"?r.totalBytes:null}(e);return null!==s&&s>0&&r("swap.used"),p(e,[]).length>0&&(r("gpu.utilization"),r("gpu.memory.used")),t}function f(e){let t=e.includes(":")?e.slice(e.indexOf(":")+1):e;return t.length<=18?t:`${t.slice(0,10)}…${t.slice(-4)}`}function p(e,t){let r=new Set(t.filter(e=>e.metric.startsWith("gpu.")&&""!==e.resourceId&&e.points.some(e=>null!==e.avg||null!==e.min||null!==e.max)).map(e=>e.resourceId)),s=[],n=new Set;(e?.inventory?.gpus??[]).forEach(e=>{let t="supported"===e.telemetry;(t||r.has(e.id))&&(n.add(e.id),s.push({id:e.id,label:e.name.trim()||f(e.id),index:s.length,totalBytes:e.memoryTotalBytes,supported:t,hasHistory:r.has(e.id)}))});let i=e?.metrics?.payload.gpus;if(i?.status==="ok")for(let e of i.devices)n.has(e.id)||"ok"!==e.status||(n.add(e.id),s.push({id:e.id,label:f(e.id),index:s.length,totalBytes:e.memoryTotalBytes,supported:!0,hasHistory:r.has(e.id)}));for(let e of[...r].sort())n.has(e)||s.push({id:e,label:e.startsWith("pci:")?`Previously detected GPU (${f(e)})`:f(e),index:s.length,totalBytes:null,supported:!0,hasHistory:!0});return s}function h(e,t,r){if(""===r)return a(t)?.shortLabel??"Total";let s=a(t);if(null===s)return f(r);switch(s.family){case"gpus":{let t=e?.inventory?.gpus.find(e=>e.id===r);return t?.name.trim()||f(r)}case"disks":{if(t.startsWith("fs.")){let t=e?.inventory?.filesystems.find(e=>e.id===r);return t?.mountPoint||f(r)}let s=e?.inventory?.disks.find(e=>e.id===r);return s?.name||f(r)}case"network":{let t=e?.inventory?.network.find(e=>e.id===r);return t?.name||f(r)}case"cpu":{let e=/^core:(\d+)$/.exec(r);return e?`Core ${e[1]}`:f(r)}default:return f(r)}}function g(e){switch(e){case"percent":return"%";case"bytes":return"bytes";case"bytes_per_second":return"bytes/s";case"celsius":return"\xb0C";case"watts":return"W";case"milliseconds":return"ms";default:return e}}},5078:(e,t,r)=>{r.d(t,{Ah:()=>d,I_:()=>h,O5:()=>p,Vw:()=>M,bf:()=>v,dd:()=>c,ei:()=>m,fH:()=>g,ly:()=>n,pI:()=>s,r6:()=>f,zp:()=>i});let s=[{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 n(e){return s.find(t=>t.id===e)??s[0]}function i(e){return n(e).refreshMs}let l=["B","KiB","MiB","GiB","TiB","PiB"];function o(e){let t=Math.abs(e),r=0;for(;t>=1024&&r<l.length-1;)t/=1024,r+=1;return{value:e<0?-t:t,unit:l[r]}}function a(e,t){return String(Number(e.toFixed(t)))}function u(e,t=""){let{value:r,unit:s}=o(e),n=Math.abs(r)>=100?0:1;return`${a(r,n)} ${s}${t}`}function c(e,t){if(null==e||!Number.isFinite(e))return"—";switch(t){case"percent":return`${a(e,1)}%`;case"bytes":return u(e);case"bytes_per_second":return u(e,"/s");case"celsius":return`${a(e,1)}\xb0C`;case"watts":return`${a(e,1)} W`;case"milliseconds":return`${a(e,10>Math.abs(e)?2:1)} ms`;default:return a(e,2)}}function d(e,t){if(!Number.isFinite(e))return"—";switch(t){case"percent":return`${a(e,0)}%`;case"bytes":case"bytes_per_second":{let{value:r,unit:s}=o(e),n=Math.abs(r)>=10||0===r?0:1;return`${a(r,n)} ${s}${"bytes_per_second"===t?"/s":""}`}case"celsius":return`${a(e,0)}\xb0C`;case"watts":return`${a(e,0)} W`;case"milliseconds":return`${a(e,+(10>Math.abs(e)))} ms`;default:return a(e,1)}}function m(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function f(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"medium"})}function p(e,t){let r=new Date(e);return t>=1728e5?r.toLocaleDateString(void 0,{month:"short",day:"numeric"}):t>=864e5?r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function h(e){let t=Math.max(0,e);return t>=36e5?`${a(t/36e5,1)} h`:t>=6e4?`${a(t/6e4,1)} min`:`${a(t/1e3,1)} s`}function g(e,t,r){let s=e.filter(e=>e.toMs>=t&&e.fromMs<=r);if(0===s.length)return"No recorded gaps in this range.";let n=s.filter(e=>"dropped"===e.kind).length,i=s.length-n,l=[];i>0&&l.push(`${i} missed interval${1===i?"":"s"}`),n>0&&l.push(`${n} dropped report${1===n?"":"s"}`);let o=[...new Set(s.map(e=>e.reason).filter(e=>"string"==typeof e&&e.length>0))],a=o.length>0?` (${o.slice(0,3).join("; ")})`:"";return`${l.join(" and ")}${a}.`}function y(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function x(e){return"number"==typeof e&&Number.isFinite(e)}function b(e){return null===e||x(e)}function v(e){if(!y(e)||"string"!=typeof e.machineId||0===e.machineId.length||!x(e.fromMs)||!x(e.toMs)||e.toMs<=e.fromMs||!x(e.stepMs)||e.stepMs<=0||"raw"!==e.tier&&"1m"!==e.tier&&"1h"!==e.tier||"boolean"!=typeof e.truncated||!x(e.elapsedMs)||!Array.isArray(e.series)||!Array.isArray(e.gaps))return null;let t=[];for(let r of e.series){if(!y(r)||"string"!=typeof r.metric||"string"!=typeof r.resourceId||"string"!=typeof r.unit||!Array.isArray(r.points))return null;let e=[];for(let t of r.points){if(!y(t)||!x(t.t)||!b(t.min)||!b(t.max)||!b(t.avg))return null;e.push({t:t.t,min:t.min,max:t.max,avg:t.avg})}t.push({metric:r.metric,resourceId:r.resourceId,unit:r.unit,points:e})}let r=[];for(let t of e.gaps){if(!y(t)||!x(t.fromMs)||!x(t.toMs)||"missing"!==t.kind&&"dropped"!==t.kind)return null;let e={fromMs:t.fromMs,toMs:t.toMs,kind:t.kind};"string"==typeof t.reason&&(e.reason=t.reason),x(t.droppedRecords)&&(e.droppedRecords=t.droppedRecords),r.push(e)}return{machineId:e.machineId,fromMs:e.fromMs,toMs:e.toMs,stepMs:e.stepMs,tier:e.tier,series:t,gaps:r,truncated:e.truncated,elapsedMs:e.elapsedMs}}function M(e,t,r,s,i=600,l){let{fromMs:o,toMs:a}={fromMs:s-n(r).ms,toMs:s},u=new URLSearchParams({machineId:e,metrics:t.join(","),from:String(Math.floor(o)),to:String(Math.floor(a)),maxPoints:String(i)});return void 0!==l&&u.set("coreIds",l.join(",")),`/api/history?${u.toString()}`}},6304:(e,t,r)=>{function s(e,t,r,s){if(s.some(e=>t>e.fromMs&&t<e.toMs))return null;let n=0,i=e.length;for(;n<i;){let r=n+i>>>1;e[r].t<t?n=r+1:i=r}let l=e[n-1],o=e[n],a=l&&(!o||t-l.t<=o.t-t)?l:o;return!a||Math.abs(a.t-t)>r/2||s.some(e=>e.toMs>Math.min(t,a.t)&&e.fromMs<Math.max(t,a.t))?null:a}function n(e){return[...new Set(e.flatMap(e=>e.points.map(e=>e.t)))].sort((e,t)=>e-t).map(e=>({t:e,min:null,max:null,avg:null}))}function i(e,t,r,s,n,l=0){return Math.round(s+Math.max(0,Math.min(1,((r>0?(e-t)/r:0)-l)/(1-2*l)))*(n-s))}function l(e,t,r){return 0===e.length?null:"Home"===r?e[0].t:"End"===r||null===t?e.at(-1).t:"ArrowLeft"===r?[...e].reverse().find(e=>e.t<t)?.t??e[0].t:"ArrowRight"===r?e.find(e=>e.t>t)?.t??e.at(-1).t:t}r.d(t,{X:()=>n,bO:()=>s,o7:()=>l,yk:()=>i})},7284:(e,t,r)=>{r.d(t,{t:()=>c});var s=r(5155),n=r(2115),i=r(7726),l=r(5078),o=r(4567),a=r(6304),u=r(4150);function c(e){let{title:t,unit:r,series:c,fromMs:d,toMs:m,stepMs:f,gaps:p,hiddenKeys:h,onToggleSeries:g,emptyMessage:y,note:x}=e,b=(0,n.useMemo)(()=>c.filter(e=>!h.has(e.key)),[c,h]),v=(0,u.Au)({series:b,fromMs:d,toMs:m,stepMs:f,gaps:p}),M=(0,n.useRef)(null),k=(0,n.useMemo)(()=>b.flatMap(e=>e.points),[b]),w=k.some(e=>null!==e.avg||null!==e.min||null!==e.max),$=Math.max(1,m-d),j=(0,n.useMemo)(()=>(0,i.$z)(p,d,m,k),[p,d,m,k]),S=(0,n.useMemo)(()=>(0,i.kk)(r,k.flatMap(e=>[e.min,e.max,e.avg]).filter(e=>null!==e)),[r,k]),L=Math.max(1e-9,S.max-S.min),N=(0,n.useCallback)(e=>6+(Math.min(m,Math.max(d,e))-d)/$*788,[d,m,$]),P=(0,n.useCallback)(e=>6+(1-(e-S.min)/L)*148,[S.min,L]),I=(0,n.useMemo)(()=>b.map(t=>{let r=(0,i.o)(t.points,{stepMs:f,gaps:j,fromMs:d,toMs:m}).map(t=>(0,i.SG)(t,e.maxDrawPoints??601,f));return{...t,segments:r,envelope:r.filter(e=>e.length>1).map(e=>{let t=e.map(e=>`${N(e.t).toFixed(2)},${P(e.max??e.avg).toFixed(2)}`),r=[...e].reverse().map(e=>`${N(e.t).toFixed(2)},${P(e.min??e.avg).toFixed(2)}`);return`M${t.join("L")}L${r.join("L")}Z`}).join(" "),path:r.filter(e=>e.length>1).map(e=>e.map((e,t)=>`${0===t?"M":"L"}${N(e.t).toFixed(2)},${P(e.avg).toFixed(2)}`).join(" ")).join(" ")}}),[b,e.maxDrawPoints,f,j,d,m,N,P]),C=(0,n.useMemo)(()=>(function(e,t,r,s,n,o){if(0===r.length)return`${e} chart: no series selected.`;let a=r.map(e=>{let r=(0,i.T6)(e.points);return`${e.label}: ${function(e,t){let r=[];if(null!==e.latest){let s=null!==e.latestT?(0,l.ei)(e.latestT):null;r.push(`latest ${(0,l.dd)(e.latest,t)}${s?` at ${s}`:""}`)}return r.push(`average ${(0,l.dd)(e.avg,t)}`),null!==e.min&&null!==e.max&&r.push(`recorded range ${(0,l.dd)(e.min,t)} to ${(0,l.dd)(e.max,t)}`),r.join(", ")}(r,t)}`}),u=o>0?`${o} shaded interval${1===o?"":"s"} without stored data.`:"";return`${e} time-series chart. ${a.join(". ")}. ${u} Time range ${(0,l.ei)(s)} to ${(0,l.ei)(n)}.`})(t,r,b,d,m,j.length),[t,r,b,d,m,j.length]),A=(0,n.useMemo)(()=>new Map(c.map(e=>[e.key,(0,i.T6)(e.points)])),[c]),F=null===v.timeMs?[]:b.map(e=>({...e,point:(0,a.bO)(e.points,v.timeMs,f,p)})),D=null===v.timeMs?null:N(v.timeMs),R=`${v.id}-tooltip`,U=`${v.id}-instructions`,E=(0,n.useMemo)(()=>(0,s.jsxs)(s.Fragment,{children:[S.ticks.map(e=>(0,s.jsx)("line",{x1:6,x2:794,y1:P(e),y2:P(e),stroke:"var(--border)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${e}`)),j.map(e=>(0,s.jsx)("rect",{x:N(e.fromMs),y:6,width:Math.max(1,N(e.toMs)-N(e.fromMs)),height:148,fill:"var(--muted-foreground)",opacity:"0.09"},`gap-${e.fromMs}-${e.toMs}-${e.kind}`)),I.map(e=>{let t=e.envelope;return""===t?null:(0,s.jsx)("path",{d:t,fill:e.color,opacity:"0.14",stroke:"none"},`band-${e.key}`)}),I.map(e=>{let t=e.path;return""===t?null:(0,s.jsx)("path",{d:t,fill:"none",stroke:e.color,strokeWidth:"2",strokeDasharray:e.dash,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},`line-${e.key}`)}),I.flatMap(e=>e.segments.filter(e=>1===e.length).map(t=>{let r=t[0],n=N(r.t),i=P(r.avg);return(0,s.jsx)("line",{x1:n-2.5,x2:n+2.5,y1:i,y2:i,stroke:e.color,strokeWidth:"2.5",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"},`dot-${e.key}-${r.t}`)}))]}),[S,N,P,j,I]);return(0,s.jsxs)("figure",{className:`flex min-w-0 flex-col gap-2 ${e.className??""}`,children:[(0,s.jsxs)("div",{className:"flex min-h-8 flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("h3",{className:"text-xs font-medium tracking-tight text-foreground",children:t}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"tnum shrink-0 text-xs text-muted-foreground",children:x??(0,o.RL)(r)}),e.action]})]}),w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,s.jsx)("div",{"aria-hidden":!0,className:"flex h-40 w-14 shrink-0 flex-col justify-between py-0.5 text-right text-xs leading-none tnum text-muted-foreground",children:[...S.ticks].reverse().map(e=>(0,s.jsx)("span",{children:(0,l.Ah)(e,r)},e))}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"relative",onPointerLeave:v.clear,onPointerMove:e=>{let t=M.current?.getBoundingClientRect();t&&v.inspect((0,a.yk)(e.clientX,t.left,t.width,d,m,.0075))},children:[(0,s.jsx)("p",{id:U,className:"sr-only",children:"Use Left and Right arrows to inspect recorded readings, Home or End to jump, and Escape to dismiss."}),(0,s.jsxs)("svg",{ref:M,viewBox:"0 0 800 160",preserveAspectRatio:"none",role:"img","aria-label":C,tabIndex:0,"aria-describedby":`${U}${v.active?` ${R}`:""}`,onFocus:v.onFocus,onBlur:v.clear,onKeyDown:v.onKeyDown,className:"block h-40 w-full cursor-crosshair rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:[(0,s.jsx)("title",{children:t}),E,null!==D?(0,s.jsxs)("g",{"aria-hidden":!0,pointerEvents:"none",children:[(0,s.jsx)("line",{x1:D,x2:D,y1:6,y2:154,stroke:"var(--muted-foreground)",strokeWidth:"1",strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke"}),F.map(({key:e,color:t,point:r})=>r?.avg==null?null:(0,s.jsx)("circle",{cx:N(r.t),cy:P(r.avg),r:"3.5",fill:t,stroke:"var(--card)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"},e))]}):null]}),v.active&&null!==v.timeMs&&null!==D?(0,s.jsx)(u.eg,{id:R,timeMs:v.timeMs,fraction:D/800,unit:r,readings:F}):null]}),(0,s.jsx)("div",{"aria-hidden":!0,className:"mt-1 flex justify-between gap-2 text-xs leading-tight tnum text-muted-foreground",children:(0,i.Cf)(d,m).map((e,t,r)=>(0,s.jsx)("span",{className:`${0===t?"text-left":t===r.length-1?"text-right":"hidden text-center sm:inline"}`,children:(0,l.O5)(e,$)},e))})]})]}),(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:c.map(e=>{let t=!h.has(e.key),n=A.get(e.key);return(0,s.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",title:t?`Hide ${e.label}`:`Show ${e.label}`,children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>g(e.key),className:"peer sr-only"}),(0,s.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,s.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,s.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:e.color,strokeWidth:"2.5",strokeDasharray:e.dash,strokeLinecap:"round"})})}),(0,s.jsx)("span",{className:t?"text-foreground":"text-muted-foreground line-through",children:e.label}),(0,s.jsx)("span",{className:"tnum text-muted-foreground",children:(0,l.dd)(n.latest,r)})]},`legend-${e.key}`)})})]}):(0,s.jsx)("div",{className:"flex min-h-32 items-center justify-center rounded-lg border border-dashed border-border px-4 py-6 text-center text-xs text-muted-foreground",children:0===c.length?y:0===b.length?"All series are hidden. Re-enable one in the legend below.":y}),!w&&c.length>0?(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:c.map(e=>{let t=!h.has(e.key);return(0,s.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>g(e.key),className:"peer sr-only"}),(0,s.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,s.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,s.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:e.color,strokeWidth:"2.5",strokeDasharray:e.dash,strokeLinecap:"round"})})}),(0,s.jsx)("span",{className:t?"text-foreground":"text-muted-foreground line-through",children:e.label})]},`legend-empty-${e.key}`)})}):null]})}},7726:(e,t,r)=>{function s(e){return null!==e.avg&&Number.isFinite(e.avg)}function n(e){return null!==e&&Number.isFinite(e)?e:null}function i(e){let t=[];for(let r of e){let e=t.at(-1);if(void 0!==e&&r.fromMs<=e.toMs){e.toMs=Math.max(e.toMs,r.toMs),"missing"===e.kind&&"dropped"===r.kind&&(e.kind="dropped"),void 0===e.reason&&void 0!==r.reason&&(e.reason=r.reason),void 0===e.droppedRecords&&void 0!==r.droppedRecords&&(e.droppedRecords=r.droppedRecords);continue}t.push({...r})}return t}function l(e,t,r,n){let l=i(e.map(e=>({...e,fromMs:Math.max(t,e.fromMs),toMs:Math.min(r,e.toMs)})).filter(e=>e.toMs>e.fromMs).sort((e,t)=>e.fromMs-t.fromMs||e.toMs-t.toMs));return void 0===n?l:function(e,t,r,n){if(0===e.length)return[];let l=[...new Set(t.filter(s).map(e=>e.t).filter(e=>Number.isFinite(e)))].sort((e,t)=>e-t),o=[];for(let t of e){let e=Math.max(r,Math.min(n,t.fromMs)),s=Math.max(r,Math.min(n,t.toMs));if(s<=e)continue;let i=Math.max(r,function(e,t){let r=0,s=e.length;for(;r<s;){let n=r+s>>>1;e[n]<=t?r=n+1:s=n}return r>0?e[r-1]:null}(l,e)??e),a=Math.min(n,function(e,t){let r=0,s=e.length;for(;r<s;){let n=r+s>>>1;e[n]<t?r=n+1:s=n}return r<e.length?e[r]:null}(l,s)??s);a<=i||o.push({...t,fromMs:i,toMs:a})}return o.sort((e,t)=>e.fromMs-t.fromMs||e.toMs-t.toMs),i(o)}(l,n,t,r)}function o(e,t,r){return Math.max(e,"1h"===t?36e5:"1m"===t?6e4:100,r??0)}function a(e,t){let r=[...e].sort((e,t)=>e.t-t.t),n=l(t.gaps,t.fromMs,t.toMs),i=Math.max(1,t.stepMs),o=[],a=[],u=()=>{a.length>0&&o.push(a),a=[]};for(let e of r){if(!s(e)){u();continue}let t=a.at(-1);if(void 0!==t){let r=!e.merged&&!t.merged&&(e.t<t.t||e.t-t.t>1.5*i),s=!0===e.gapBefore||function(e,t,r){return r.some(r=>r.toMs>e&&r.fromMs<t)}(t.t,e.t,n);(r||s)&&u()}a.push(e)}return u(),o}function u(e,t,r){if(t<=0)return[];let i=[...e].sort((e,t)=>e.t-t.t);if(i.length<=t)return i.map(e=>({...e}));let l=Math.max(2,Math.ceil(i.length/t)),o=Math.max(1,r),a=[],u=[],c=!1,d=null,m=()=>{if(0===u.length)return;let e=null,t=null,r=0,s=0;for(let i of u){let l=n(i.min),o=n(i.max);null!==l&&(null===e||l<e)&&(e=l),null!==o&&(null===t||o>t)&&(t=o);let a=n(i.avg);null!==a&&(r+=a,s+=1)}a.push({t:u[0].t,min:e,max:t,avg:s>0?r/s:null,...u.length>1?{merged:!0}:{},...c?{gapBefore:!0}:{}}),u=[],c=!1};for(let e of i){if(!s(e)){m(),a.push({...e}),d=null;continue}let t=null!==d&&e.t>=d.t&&e.t-d.t<=1.5*o;u.length>0&&(!t||u.length>=l)&&m(),0===u.length&&(c=null!==d&&!t),u.push(e),d=e}return m(),a}function c(e){let t=null,r=null,s=0,i=0,l=null,o=null,a=null,u=null;for(let c of e){if(null===c.avg)continue;(null===a||c.t<a)&&(a=c.t),(null===u||c.t>u)&&(u=c.t);let e=n(c.min),d=n(c.max);null!==e&&(null===t||e<t)&&(t=e),null!==d&&(null===r||d>r)&&(r=d),null!==c.avg&&Number.isFinite(c.avg)&&(s+=c.avg,i+=1,l=c.avg,o=c.t)}return{count:i,min:t,max:r,avg:i>0?s/i:null,latest:l,latestT:o,firstT:a,lastT:u}}function d(e){if(!Number.isFinite(e)||e<=0)return 1;let t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function m(e,t){if("percent"===e)return{min:0,max:100,ticks:[0,25,50,75,100]};let r=t.filter(e=>null!==e&&Number.isFinite(e));if(0===r.length)return{min:0,max:1,ticks:[0,1]};let s=Math.min(...r),n=Math.max(...r);if("celsius"===e){let e=Math.max(1,(n-s)*.1);s=5*Math.floor((s-e)/5),n=5*Math.ceil((n+e)/5)}else s=0,n=n>0?n:1;n<=s&&(n=s+1);let i=d((n-s)/4),l=Math.floor(s/i)*i,o=Math.ceil(n/i)*i,a=function(e,t,r=4){if(!Number.isFinite(e)||!Number.isFinite(t))return[0,1];if(t<=e)return[e];let s=d((t-e)/Math.max(1,r)),n=Math.ceil(e/s)*s,i=[];for(let e=n;e<=t+.001*s&&i.length<20;e+=s)i.push(Number(e.toPrecision(12)));return i.length>0?i:[e,t]}(l,o,4);return{min:l,max:o,ticks:a}}function f(e,t,r=4){let s=Math.max(2,Math.floor(r)),n=Math.max(0,t-e);return Array.from({length:s},(t,r)=>e+n*r/(s-1))}r.d(t,{$z:()=>l,Cf:()=>f,SG:()=>u,T6:()=>c,jl:()=>o,kk:()=>m,o:()=>a})},9429:(e,t,r)=>{r.d(t,{n:()=>l});var s=r(2115),n=r(5078);async function i(e){let t=null;try{let r=await e.json();if(null!==r&&"object"==typeof r&&"error"in r){let e=r.error;"string"==typeof e&&(t=e)}}catch{}switch(e.status){case 401:return{kind:"unauthorized",message:"Your session is no longer accepted."};case 403:return{kind:"denied",message:t??"You do not have access to this machine's history."};case 404:return{kind:"missing",message:t??"This machine is not available to the hub."};case 429:return{kind:"rate-limited",message:t??"The hub is limiting history requests."};case 503:return{kind:"unavailable",message:t??"History is temporarily unavailable."};default:return{kind:"invalid",message:t??`The hub could not answer this history query (${e.status}).`}}}function l({machineId:e,metricsKey:t,coreIdsKey:r,range:o,enabled:a=!0,autoRefresh:u=!0,refreshNonce:c=0}){let[d,m]=(0,s.useState)({machineId:e,metricsKey:t,coreIdsKey:r,range:o}),f=d.machineId===e&&d.range===o;(0,s.useEffect)(()=>{if(!f)return void m({machineId:e,metricsKey:t,coreIdsKey:r,range:o});let s=window.setTimeout(()=>m({machineId:e,metricsKey:t,coreIdsKey:r,range:o}),300);return()=>window.clearTimeout(s)},[e,t,r,o,f]);let p=f?d:{machineId:e,metricsKey:t,coreIdsKey:r,range:o},h=p.metricsKey,g=p.coreIdsKey,y=`${e}|${h}|${o}|${g??"all"}`,[x,b]=(0,s.useState)(null),[v,M]=(0,s.useState)(null),[k,w]=(0,s.useState)(null),$=(0,s.useRef)(c);return(0,s.useEffect)(()=>{let t=$.current!==c;if($.current=c,!a||!e||!h)return;let r=!0,s=!1,l=!1,d=-1/0,m=new AbortController,f=(0,n.zp)(o),p=async(t=!1)=>{if(r&&!s&&!l){s=!0,d=Date.now(),w({key:y,manual:t});try{let t=await fetch((0,n.Vw)(e,h.split(","),o,Date.now(),600,void 0===g?void 0:g.split(",").filter(Boolean)),{signal:"function"!=typeof AbortSignal.any||"function"!=typeof AbortSignal.timeout?m.signal:AbortSignal.any([m.signal,AbortSignal.timeout(2e4)]),cache:"no-store",headers:{Accept:"application/json"}});if(!t.ok)throw await i(t);let s=(0,n.bf)(await t.json());if(null===s||s.machineId!==e)throw{kind:"invalid",message:"Unexpected history response."};if(!r)return;b({key:y,range:o,result:s,loadedAt:Date.now()}),M(null)}catch(t){if(!r||m.signal.aborted)return;let e=null!==t&&"object"==typeof t&&"kind"in t&&"message"in t&&"string"==typeof t.message?t:{kind:"network",message:"Could not reach the hub. Try again."};l="rate-limited"===e.kind,["unauthorized","denied","missing"].includes(e.kind)&&b(null),M({key:y,error:e})}finally{s=!1,r&&w(null)}}},x=()=>{"visible"!==document.visibilityState||Date.now()-d<f||p()};p(t);let v=u?window.setInterval(x,f):null;return u&&document.addEventListener("visibilitychange",x),()=>{r=!1,m.abort(),null!==v&&window.clearInterval(v),document.removeEventListener("visibilitychange",x)}},[a,e,h,g,o,y,u,c]),{data:a&&x?.result.machineId===e&&x.range===o?x:null,error:a&&v?.key===y?v.error:null,loading:a&&k?.key===y,manualRefreshing:a&&k?.key===y&&k.manual}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[693],{3092:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},3612:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},4268:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},4891:(e,t,a)=>{Promise.resolve().then(a.bind(a,7044))},5798:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},7044:(e,t,a)=>{"use strict";a.d(t,{AdministrationView:()=>ee});var s=a(5155),n=a(8500),r=a.n(n),l=a(2115),i=a(6914),d=a(7029),c=a(828),o=a(7422),u=a(3092);class m extends Error{status;constructor(e,t){super(t),this.name="AdminApiError",this.status=e}}function h(){return new m(502,"The hub returned an unexpected response.")}var x=a(4173),p=a(3440),f=a(940),g=a(802),b=a(9939);let j="w-full min-w-0 rounded-md border border-border bg-background px-3 py-2 text-base text-foreground placeholder:text-muted-foreground aria-[invalid=true]:border-crit sm:text-sm",y="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50",v="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-card-strong disabled:cursor-not-allowed disabled:opacity-50",w="inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-card-strong hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",N="inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md border border-crit px-3 py-1.5 text-xs font-medium text-crit transition-colors hover:bg-crit-soft disabled:cursor-not-allowed disabled:opacity-50";function k({id:e,label:t,error:a,children:n}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,s.jsx)("label",{htmlFor:e,className:"text-xs font-medium text-foreground",children:t}),n,a?(0,s.jsx)("p",{id:`${e}-error`,className:"text-xs text-crit",children:a}):null]})}function C(e,t){if(t)return`${e}-error`}function A({children:e,tone:t="neutral"}){return(0,s.jsx)("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${{neutral:"border border-border text-muted-foreground",accent:"bg-selected text-foreground",ok:"bg-ok-soft text-foreground",warn:"bg-warn-soft text-foreground",crit:"bg-crit-soft text-foreground"}[t]}`,children:e})}function S({children:e,tone:t="info",role:a="status"}){return(0,s.jsx)("p",{role:a,className:`rounded-md px-3 py-2 text-xs ${{info:"text-muted-foreground",error:"bg-crit-soft text-foreground",success:"bg-ok-soft text-foreground",warn:"bg-warn-soft text-foreground"}[t]}`,children:e})}function I(e,t){return e instanceof m?e.message:t}function T(e){return e instanceof m&&401===e.status}function $(e){return e instanceof m&&403===e.status}function E(e){return"object"==typeof e&&null!==e&&"AbortError"===e.name}var R=a(8698);let M=(0,R.A)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),D=/^[\x21-\x7e]{1,128}$/,U=/[\u0000-\u001f\u007f]/;function L(e){let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):"Unknown time"}function G(e){let t=e.displayName?.trim();if(t)return t;let a=e.hostname?.trim();return a||e.machineId}function P(e){let{api:t,revision:a,onSessionLost:n}=e,[r,i]=(0,l.useState)([]),[d,o]=(0,l.useState)(!0),[u,m]=(0,l.useState)(null),h=(0,l.useRef)(null),x=(0,l.useCallback)(async()=>{h.current?.abort();let e=new AbortController;h.current=e,o(!0),m(null);try{let a=await t.listAudit(50,e.signal);e.signal.aborted||i(a)}catch(t){if(e.signal.aborted||E(t))return;if(T(t))return void n();m($(t)?"Administrator access is required to read the audit log.":I(t,"Could not load the audit log."))}finally{e.signal.aborted||o(!1)}},[t,n]);return(0,l.useEffect)(()=>(x(),()=>h.current?.abort()),[x,a]),(0,s.jsxs)(p.Z,{title:"Audit log",className:"min-w-0",action:(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>void x(),disabled:d,children:[(0,s.jsx)(c.A,{className:`h-3.5 w-3.5 ${d?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]}),children:[(0,s.jsx)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:(0,s.jsxs)("span",{className:"tnum text-xs text-muted-foreground",children:[r.length," event",1===r.length?"":"s"]})}),u?(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(S,{tone:"error",role:"alert",children:u}),(0,s.jsx)("button",{type:"button",className:w,onClick:()=>void x(),children:"Try again"})]}):null,d&&0===r.length&&!u?(0,s.jsx)("p",{role:"status",className:"py-6 text-sm text-muted-foreground",children:"Loading audit events…"}):null,d||u||0!==r.length?null:(0,s.jsx)(p.p,{icon:M,note:"No administrative changes recorded yet."}),r.length>0?(0,s.jsx)("ol",{className:"mt-2 max-h-96 divide-y divide-border overflow-y-auto border-t border-border",children:r.map((e,t)=>(0,s.jsxs)("li",{className:"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 py-2.5 text-xs",children:[(0,s.jsx)("time",{dateTime:e.at,className:"tnum shrink-0 text-muted-foreground",children:L(e.at)}),(0,s.jsx)("span",{className:"font-medium text-foreground",children:function(e){switch(e){case"user.create":return"Created user";case"user.update":return"Updated access";case"user.update-password":return"Changed password";case"user.delete":return"Deleted user";default:return e.replace(/[-_.]+/g," ")}}(e.action)}),(0,s.jsxs)("span",{className:"min-w-0 break-all text-muted-foreground",children:[e.target," ",(0,s.jsx)("span",{"aria-hidden":!0,children:"\xb7"})," by ",e.actor]})]},`${e.at}-${e.actor}-${e.action}-${e.target}-${t}`))}):null]})}let q=(0,R.A)("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]),F=(0,R.A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);var O=a(4268),Y=a(1735);let Z=(0,R.A)("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),V=[{value:3e5,label:"5 minutes"},{value:6e5,label:"10 minutes"},{value:9e5,label:"15 minutes"}];function B(e){let{api:t,csrfToken:a,sessionKey:n,machines:r,onAuditChange:i,onSessionLost:d}=e,o=(0,l.useId)(),u=e=>`${o}-${e}`,[m,h]=(0,l.useState)([]),[x,f]=(0,l.useState)(!0),[g,b]=(0,l.useState)(null),[C,R]=(0,l.useState)(""),[M,D]=(0,l.useState)(""),[U,P]=(0,l.useState)(9e5),[B,H]=(0,l.useState)(null),[z,_]=(0,l.useState)(null),[K,J]=(0,l.useState)(!1),[W,X]=(0,l.useState)(""),[Q,ee]=(0,l.useState)(null),[et,ea]=(0,l.useState)(!1),[es,en]=(0,l.useState)(null),er=(0,l.useRef)(null),el=(0,l.useRef)(!0),ei=(0,l.useRef)(null),ed=(0,l.useRef)(null);(0,l.useEffect)(()=>(el.current=!0,()=>{el.current=!1,er.current?.abort()}),[]),(0,l.useEffect)(()=>{H(null),X("")},[n]),(0,l.useEffect)(()=>{B&&(ei.current?.focus(),ei.current?.select())},[B]);let ec=(0,l.useCallback)(async()=>{er.current?.abort();let e=new AbortController;er.current=e,f(!0),b(null);try{let a=await t.listCollectors(e.signal);e.signal.aborted||h(a)}catch(t){if(e.signal.aborted||E(t))return;if(T(t))return void d();b($(t)?"Administrator access is required to inspect collector mappings.":I(t,"Could not load the collector registry."))}finally{e.signal.aborted||f(!1)}},[t,d]);(0,l.useEffect)(()=>{ec()},[ec]),(0,l.useEffect)(()=>{""!==M&&(m.some(e=>e.machineId===M&&!e.revoked)||D(""))},[m,M]);let eo=m.filter(e=>!e.revoked),eu=""!==M,em=B?function(e,t="https://your-hub"){let a=new URL(t);if(!["https:","http:"].includes(a.protocol)||a.username||a.password||a.search||a.hash)throw Error("Invalid hub origin");let s=a.origin.replace(/'/g,"%27");return{command:`rigscope connect '${s}'${"replacement"===e?" --replace":""}`,note:"replacement"===e?"Paste the grant at the prompt. The old credential stays active until replacement succeeds.":"Paste the grant at the prompt, then run rigscope start."}}(B.mode,window.location.origin):null,eh=async()=>{if(!K){_(null),J(!0);try{let e=await t.createGrant({ttlMs:U,...eu?{replaceMachineId:M}:{}},a);if(!el.current)return;H({...e,mode:eu?"replacement":"new"}),X(""),R("Grant created. Copy before leaving."),i()}catch(e){if(!el.current)return;if(T(e))return void d();if($(e))return void _(eu?"You do not have access to that machine, so a replacement grant cannot be created.":"A new installation needs a hub administrator with all-machine scope. Choose an existing mapping for a replacement grant, or ask the hub owner to widen your scope.");_(I(e,"Could not create an enrollment grant."))}finally{el.current&&J(!1)}}},ex=async()=>{if(B)try{if(!navigator.clipboard?.writeText)throw Error("clipboard unavailable");await navigator.clipboard.writeText(B.token),X("Grant copied to the clipboard.")}catch{X("Copy failed. Select the grant field and copy it manually.")}},ep=async()=>{if(em)try{if(!navigator.clipboard?.writeText)throw Error("clipboard unavailable");await navigator.clipboard.writeText(em.command),X("Command copied.")}catch{X("Copy failed. Select the command and copy it manually.")}},ef=async()=>{if(Q&&!et){ea(!0),en(null);try{if(await t.revokeCollector(Q.collectorId,a),!el.current)return;let e=`${Q.collectorId} on ${Q.machineId}`;ee(null),R(`Revoked ${e}. Its live stream was disconnected.`),i(),await ec()}catch(e){if(!el.current)return;if(T(e))return void d();en($(e)?"Your account does not have access to that collector's machine.":I(e,"Could not revoke that collector."))}finally{el.current&&ea(!1)}}},eg=e=>{let t=r.find(t=>t.machineId===e);return t?G(t):e};return(0,s.jsxs)(p.Z,{title:"Collectors",className:"min-w-0",action:(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>void ec(),disabled:x,children:[(0,s.jsx)(c.A,{className:`h-3.5 w-3.5 ${x?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]}),children:[(0,s.jsx)("p",{role:"status",className:C?"mb-3 rounded-md bg-ok-soft px-3 py-2 text-xs text-foreground":"sr-only",children:C}),g?(0,s.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(S,{tone:"error",role:"alert",children:g}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>void ec(),children:"Try again"})]}):null,(0,s.jsxs)("div",{className:"grid min-w-0 gap-6 lg:grid-cols-2",children:[(0,s.jsxs)("section",{"aria-labelledby":u("registry-heading"),className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,s.jsx)("h3",{id:u("registry-heading"),className:"text-sm font-medium tracking-tight",children:"Registry"}),(0,s.jsxs)("span",{className:"tnum text-xs text-muted-foreground",children:[eo.length," active / ",m.length," total"]})]}),x&&0===m.length?(0,s.jsx)("p",{role:"status",className:"py-6 text-sm text-muted-foreground",children:"Loading collector mappings…"}):null,x||g||0!==m.length?null:(0,s.jsx)(p.p,{icon:q,note:"No collector mappings are visible."}),m.length>0?(0,s.jsx)("ul",{className:"mt-2 divide-y divide-border border-t border-border",children:m.map(e=>{let t=Q?.collectorId===e.collectorId;return(0,s.jsxs)("li",{className:"min-w-0 py-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"break-words text-sm font-medium",children:eg(e.machineId)}),e.revoked?(0,s.jsx)(A,{tone:"crit",children:"Revoked"}):(0,s.jsx)(A,{tone:"ok",children:"Active"})]}),(0,s.jsxs)("dl",{className:"mt-1 flex flex-col gap-0.5 text-xs text-muted-foreground",children:[(0,s.jsxs)("div",{className:"flex min-w-0 gap-1.5",children:[(0,s.jsx)("dt",{className:"shrink-0",children:"Machine"}),(0,s.jsx)("dd",{className:"tnum break-all",children:e.machineId})]}),(0,s.jsxs)("div",{className:"flex min-w-0 gap-1.5",children:[(0,s.jsx)("dt",{className:"shrink-0",children:"Collector"}),(0,s.jsx)("dd",{className:"tnum break-all",children:e.collectorId})]}),(0,s.jsxs)("div",{className:"flex min-w-0 gap-1.5",children:[(0,s.jsx)("dt",{className:"shrink-0",children:"Updated"}),(0,s.jsx)("dd",{children:L(e.updatedAt)})]})]})]}),e.revoked?null:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>{D(e.machineId),_(null),requestAnimationFrame(()=>ed.current?.focus())},children:[(0,s.jsx)(F,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Replacement grant"]}),(0,s.jsxs)("button",{type:"button",className:w,"aria-expanded":t,onClick:()=>{en(null),ee(t?null:e)},children:[(0,s.jsx)(q,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Revoke"]})]})]}),t?(0,s.jsxs)("div",{role:"alert",className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md bg-crit-soft px-3 py-2",children:[(0,s.jsxs)("p",{className:"min-w-0 flex-1 text-xs text-foreground",children:["Revoke ",(0,s.jsx)("strong",{className:"font-medium",children:e.collectorId})," ","on ",(0,s.jsx)("strong",{className:"font-medium",children:eg(e.machineId)}),"? This disconnects the collector and invalidates its credential."]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,s.jsx)("button",{type:"button",className:N,onClick:()=>void ef(),disabled:et,children:et?"Revoking…":"Revoke collector"}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>ee(null),disabled:et,children:"Cancel"})]})]}):null,t&&es?(0,s.jsx)("p",{role:"alert",className:"mt-2 text-xs text-crit",children:es}):null]},e.collectorId)})}):null]}),(0,s.jsxs)("section",{"aria-labelledby":u("grant-heading"),className:"flex min-w-0 flex-col gap-3 border-t border-border pt-5 lg:border-l lg:border-t-0 lg:pl-6 lg:pt-0",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h3",{id:u("grant-heading"),className:"text-sm font-medium tracking-tight",children:"Add machine"})}),(0,s.jsx)(k,{id:u("target"),label:"Enrollment target",children:(0,s.jsxs)("select",{id:u("target"),value:M,onChange:e=>{D(e.target.value),_(null)},className:j,children:[(0,s.jsx)("option",{value:"",children:"New machine"}),eo.map(e=>(0,s.jsxs)("option",{value:e.machineId,children:["Replacement \xb7 ",eg(e.machineId)," \xb7 ",e.collectorId]},e.collectorId))]})}),(0,s.jsx)(k,{id:u("ttl"),label:"Grant lifetime",children:(0,s.jsx)("select",{id:u("ttl"),value:U,onChange:e=>P(Number(e.target.value)),className:j,children:V.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})}),z?(0,s.jsx)(S,{tone:"error",role:"alert",children:z}):null,(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,s.jsxs)("button",{ref:ed,type:"button",className:y,onClick:()=>void eh(),disabled:K,"aria-busy":K,children:[(0,s.jsx)(F,{className:"h-3.5 w-3.5","aria-hidden":!0}),K?"Creating…":eu?"Create replacement grant":"Create connection grant"]})}),B&&em?(0,s.jsxs)("section",{"aria-labelledby":u("grant-reveal-heading"),className:"flex min-w-0 flex-col gap-3 border-t border-border pt-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsx)("h4",{id:u("grant-reveal-heading"),className:"text-sm font-medium",children:"Copy this grant now"}),(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>{H(null),X(""),_(null),R("Grant dismissed."),requestAnimationFrame(()=>ed.current?.focus())},"aria-label":"Dismiss enrollment grant",children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Dismiss"]})]}),(0,s.jsx)(S,{tone:"warn",role:"alert",children:(0,s.jsxs)("span",{className:"flex items-start gap-2",children:[(0,s.jsx)(Y.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,s.jsxs)("span",{children:["Single-use grant \xb7 expires"," ",(0,s.jsx)("time",{dateTime:B.expiresAt,children:L(B.expiresAt)}),". Copy before leaving."]})]})}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,s.jsx)("label",{htmlFor:u("grant-token"),className:"text-xs font-medium",children:"One-time grant"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:[(0,s.jsx)("input",{ref:ei,id:u("grant-token"),readOnly:!0,autoComplete:"off",spellCheck:!1,value:B.token,onFocus:e=>e.currentTarget.select(),className:`${j} tnum min-w-0 flex-1 break-all`}),(0,s.jsxs)("button",{type:"button",className:v,onClick:()=>void ex(),children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Copy grant"]})]}),(0,s.jsx)("p",{className:"sr-only",role:"status",children:W}),W?(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:W}):null]}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-medium",children:"Run on the new machine"}),(0,s.jsx)("pre",{className:"mt-1.5 overflow-x-auto whitespace-pre-wrap break-all rounded-md bg-card-strong p-3 text-xs text-foreground",children:(0,s.jsx)("code",{children:em.command})}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:(0,s.jsxs)("button",{type:"button",className:v,onClick:()=>void ep(),children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Copy command"]})}),(0,s.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:em.note})]})]}):null]})]})]})}var H=a(8731);let z=(0,R.A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);function _(e){let{api:t,csrfToken:a,machines:n,machinesPending:r,onSessionLost:i}=e,d=(0,l.useId)(),o=e=>`${d}-${e}`,[u,m]=(0,l.useState)(""),[h,x]=(0,l.useState)(""),[f,g]=(0,l.useState)(""),[b,v]=(0,l.useState)(!1),[w,N]=(0,l.useState)({}),[A,E]=(0,l.useState)(null),[R,M]=(0,l.useState)(!1),[D,L]=(0,l.useState)(""),P=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(0===n.length){""!==u&&m("");return}if(n.some(e=>e.machineId===u))return;let e=n[0];m(e.machineId),x(e.displayName??""),g((e.tags??[]).join(", ")),v(!1)},[n,u]),(0,l.useEffect)(()=>{A&&P.current?.focus()},[A]);let q=n.find(e=>e.machineId===u),F=async e=>{let s,n,r;if(e.preventDefault(),!q||R)return;E(null);let l=(s=h.trim(),n={},s.length>128?n.displayName="Display name must be at most 128 characters.":U.test(s)&&(n.displayName="Display name cannot contain control characters."),null!==(r=function(e){let t=e.split(",").map(e=>e.trim()).filter(e=>e.length>0),a=[],s=new Set;for(let e of t){if(e.length>64)return{tags:a,error:"Each tag must be at most 64 characters."};if(U.test(e))return{tags:a,error:"Tags cannot contain control characters."};s.has(e)||(s.add(e),a.push(e))}return a.length>32?{tags:a,error:"Use at most 32 tags."}:{tags:a,error:null}}(f)).error&&(n.tags=r.error),{displayName:0===s.length?null:s,tags:r.tags,errors:n});if(N(l.errors),l.errors.displayName)return void document.getElementById(o("name"))?.focus();if(l.errors.tags)return void document.getElementById(o("tags"))?.focus();M(!0);try{await t.saveMachineMeta(q.machineId,{displayName:l.displayName,tags:l.tags},a),x(l.displayName??""),g(l.tags.join(", ")),v(!1),L(`Saved metadata for ${G(q)}. Fleet and machine views update from the live stream.`)}catch(e){if(T(e))return void i();E($(e)?"You do not have access to this machine, so its metadata cannot be changed.":I(e,"Could not save machine metadata."))}finally{M(!1)}};return(0,s.jsxs)(p.Z,{title:"Machine metadata",className:"min-w-0",children:[(0,s.jsx)("p",{role:"status",className:D?"mb-3 rounded-md bg-ok-soft px-3 py-2 text-xs text-foreground":"sr-only",children:D}),0===n.length?(0,s.jsx)(p.p,{icon:H.A,note:r?"Waiting for the live machine list…":"No machines are visible to your account."}):(0,s.jsxs)("form",{"aria-busy":R,className:"flex min-w-0 flex-col gap-4",onSubmit:e=>void F(e),children:[(0,s.jsx)(k,{id:o("machine"),label:"Machine",children:(0,s.jsx)("select",{id:o("machine"),value:u,onChange:e=>{var t;let a;return t=e.target.value,a=n.find(e=>e.machineId===t),void(m(t),x(a?.displayName??""),g((a?.tags??[]).join(", ")),v(!1),N({}),E(null),L(""))},className:j,children:n.map(e=>(0,s.jsx)("option",{value:e.machineId,children:G(e)},e.machineId))})}),(0,s.jsx)(k,{id:o("name"),label:"Display name",error:w.displayName,children:(0,s.jsx)("input",{id:o("name"),placeholder:q?.hostname||"Hostname",maxLength:128,value:h,onChange:e=>{x(e.target.value),v(!0)},"aria-invalid":!!w.displayName||void 0,"aria-describedby":C(o("name"),w.displayName),className:j})}),(0,s.jsx)(k,{id:o("tags"),label:"Tags (comma-separated)",error:w.tags,children:(0,s.jsx)("input",{id:o("tags"),value:f,onChange:e=>{g(e.target.value),v(!0)},"aria-invalid":!!w.tags||void 0,"aria-describedby":C(o("tags"),w.tags),className:j})}),A?(0,s.jsx)("div",{ref:P,tabIndex:-1,"aria-live":"assertive",children:(0,s.jsx)(S,{tone:"error",role:"alert",children:A})}):null,(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,s.jsx)("button",{type:"submit",className:y,disabled:R||!b,children:R?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}),"Saving…"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Save metadata"]})})})]})]})}var K=a(3612),J=a(5798),W=a(7241);function X(e){let{api:t,username:a,csrfToken:n,machines:r,machinesPending:d,onAuditChange:o,onSessionLost:m}=e,[h,x]=(0,l.useState)([]),[f,g]=(0,l.useState)(!0),[b,j]=(0,l.useState)(null),[k,C]=(0,l.useState)(""),[R,M]=(0,l.useState)(null),[D,U]=(0,l.useState)(null),[L,G]=(0,l.useState)(!1),[P,q]=(0,l.useState)(null),F=(0,l.useRef)(null),O=(0,l.useRef)(!0);(0,l.useEffect)(()=>(O.current=!0,()=>{O.current=!1,F.current?.abort()}),[]);let Y=(0,l.useCallback)(async()=>{F.current?.abort();let e=new AbortController;F.current=e,g(!0),j(null);try{let a=await t.listUsers(e.signal);e.signal.aborted||x(a)}catch(t){if(e.signal.aborted||E(t))return;if(T(t))return void m();j($(t)?"Administrator access is required. If your access just changed, sign in again.":I(t,"Could not load the browser user directory."))}finally{e.signal.aborted||g(!1)}},[t,m]);(0,l.useEffect)(()=>{Y()},[Y]);let Z=async()=>{if(D&&!L){G(!0),q(null);try{if(await t.deleteUser(D.username,n),!O.current)return;let e=D.username;U(null),C(`Deleted user ${e}. Any active sessions were ended.`),o(),await Y()}catch(e){if(!O.current)return;if(T(e))return void m();q($(e)?"Your account no longer has administrative access.":I(e,"Could not delete that user."))}finally{O.current&&G(!1)}}};return(0,s.jsxs)(p.Z,{title:"Browser users",className:"min-w-0",action:(0,s.jsxs)("button",{type:"button",className:y,"aria-expanded":R?.mode==="create",onClick:()=>{U(null),q(null),M(e=>e?.mode==="create"?null:{mode:"create"})},children:[(0,s.jsx)(K.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Add user"]}),children:[(0,s.jsx)("p",{role:"status",className:k?"rounded-md bg-ok-soft px-3 py-2 text-xs text-foreground":"sr-only",children:k}),(0,s.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsxs)("span",{className:"tnum text-xs text-muted-foreground",children:[h.length,"/",50]}),(0,s.jsxs)("button",{type:"button",className:w,onClick:()=>void Y(),disabled:f,children:[(0,s.jsx)(c.A,{className:`h-3.5 w-3.5 ${f?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]})]})}),R?(0,s.jsx)(Q,{api:t,csrfToken:n,existing:"edit"===R.mode?R.user:void 0,currentUsername:a,machines:r,machinesPending:d,onCancel:()=>M(null),onSaved:e=>{M(null),C(e),o(),Y()},onSessionLost:m},"edit"===R.mode?`edit-${R.user.username}`:"create"):null,(0,s.jsxs)("div",{className:"mt-4 flex min-w-0 flex-col gap-3",children:[b?(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)(S,{tone:"error",role:"alert",children:b}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>void Y(),children:"Try again"})]}):null,f&&0===h.length?(0,s.jsx)("p",{role:"status",className:"py-6 text-sm text-muted-foreground",children:"Loading browser users…"}):null,f||b||0!==h.length?null:(0,s.jsx)(p.p,{icon:i.A,note:"No browser users are stored yet."}),h.length>0?(0,s.jsx)("ul",{className:"divide-y divide-border border-t border-border",children:h.map(e=>{var t;let n=e.username===a,r=D?.username===e.username;return(0,s.jsxs)("li",{className:"min-w-0 py-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"break-words text-sm font-medium",children:e.username}),n?(0,s.jsx)(A,{tone:"accent",children:"You"}):null,e.admin?(0,s.jsxs)(A,{tone:"ok",children:[(0,s.jsx)(u.A,{className:"h-3 w-3","aria-hidden":!0}),"Administrator"]}):(0,s.jsx)(A,{children:"Viewer"}),e.disabled?(0,s.jsx)(A,{tone:"warn",children:"Disabled"}):null]}),(0,s.jsx)("p",{className:"mt-1 break-words text-xs text-muted-foreground",title:"*"===e.machineIds?"All machines":e.machineIds.join(", "),children:"*"===(t=e.machineIds)?"All machines":0===t.length?"No machines":1===t.length?t[0]:`${t.length} machines`})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,s.jsxs)("button",{type:"button",className:w,"aria-expanded":R?.mode==="edit"&&R.user.username===e.username,onClick:()=>{q(null),U(null),M(R?.mode==="edit"&&R.user.username===e.username?null:{mode:"edit",user:e})},children:[(0,s.jsx)(J.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),R?.mode==="edit"&&R.user.username===e.username?"Close editor":"Edit"]}),(0,s.jsxs)("button",{type:"button",className:w,"aria-expanded":r,onClick:()=>{M(null),q(null),U(r?null:e)},children:[(0,s.jsx)(W.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})]}),r?(0,s.jsxs)("div",{role:"alert",className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md bg-crit-soft px-3 py-2",children:[(0,s.jsxs)("p",{className:"min-w-0 flex-1 text-xs text-foreground",children:["Delete ",(0,s.jsx)("strong",{className:"font-medium",children:e.username}),"? Their active sessions end immediately, and this cannot be undone."]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,s.jsx)("button",{type:"button",className:N,onClick:()=>void Z(),disabled:L,children:L?"Deleting…":"Delete user"}),(0,s.jsx)("button",{type:"button",className:v,onClick:()=>U(null),disabled:L,children:"Cancel"})]})]}):null,r&&P?(0,s.jsx)("p",{role:"alert",className:"mt-2 text-xs text-crit",children:P}):null]},e.username)})}):null]})]})}function Q(e){let{api:t,csrfToken:a,existing:n,currentUsername:r,machines:i,machinesPending:d,onCancel:c,onSaved:o,onSessionLost:u}=e,m=(0,l.useId)(),h=e=>`${m}-${e}`,x=h("heading"),[p,f]=(0,l.useState)(n?.username??""),[g,b]=(0,l.useState)(""),[N,A]=(0,l.useState)(!!n&&"*"===n.machineIds),[E,R]=(0,l.useState)(n&&"*"!==n.machineIds?[...n.machineIds]:[]),[M,U]=(0,l.useState)(n?.admin??!1),[L,P]=(0,l.useState)(n?.disabled??!1),[q,F]=(0,l.useState)({}),[Z,V]=(0,l.useState)(null),[B,H]=(0,l.useState)(!1),z=(0,l.useRef)(null),_=(0,l.useRef)(!1);(0,l.useEffect)(()=>{_.current||(_.current=!0,document.getElementById(x)?.focus())},[x]),(0,l.useEffect)(()=>{Z&&z.current?.focus()},[Z]);let K=[...i].sort((e,t)=>{let a=G(e).toLocaleLowerCase(),s=G(t).toLocaleLowerCase();return a.localeCompare(s)||e.machineId.localeCompare(t.machineId)}),J=function(e,t){if("*"===e)return[];let a=new Set(t);return e.filter(e=>!a.has(e))}(E,K.map(e=>e.machineId)),W=N?"*":E,X=n?.username===r,Q=async e=>{if(e.preventDefault(),B)return;V(null);let s={username:n?.username??p,password:g,machineIds:W,admin:M,disabled:L},r=function(e,t){let a={};if(D.test(e.username)||(a.username="Use 1–128 printable characters without spaces."),t.existing||0!==e.password.length?e.password.length>1024&&(a.password="Password must be at most 1024 characters."):a.password="Choose a password for the new user.","*"===e.machineIds);else if(Array.isArray(e.machineIds)){let t=new Set,s=2;for(let n of e.machineIds){if(!D.test(n)){a.scope="Every machine ID must be a valid identifier.";break}if((s+=n.length+3)>8192){a.scope="Keep the explicit machine list under 8192 bytes.";break}if(t.has(n)){a.scope="Machine scope contains a duplicate ID.";break}t.add(n)}}else a.scope="Choose all machines or an explicit list of machine IDs.";let s=a.username?"username":a.password?"password":a.scope?"scope":null;return{errors:a,firstInvalid:s}}(s,{existing:void 0!==n});if(F(r.errors),null!==r.firstInvalid){let e="username"===r.firstInvalid?h("username"):"password"===r.firstInvalid?h("password"):h("scope-all");document.getElementById(e)?.focus();return}H(!0);try{await t.saveUser({username:s.username,machineIds:s.machineIds,admin:M,disabled:L,...g.length>0?{password:g}:{}},a),b(""),o(n?`Updated ${n.username}.`:`Created ${s.username}. They can sign in with the password you set.`)}catch(e){if(T(e))return void u();V($(e)?"Your account no longer has administrative access.":I(e,"Could not save that user."))}finally{H(!1)}};return(0,s.jsxs)("form",{"aria-labelledby":x,"aria-busy":B,className:"flex min-w-0 flex-col gap-4 border-t border-border py-4",onSubmit:e=>void Q(e),children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h3",{id:x,tabIndex:-1,className:"text-sm font-medium tracking-tight",children:n?`Edit ${n.username}`:"Add a browser user"})}),(0,s.jsx)("button",{type:"button",className:w,onClick:c,disabled:B,children:"Close"})]}),X?(0,s.jsx)(S,{tone:"warn",role:"status",children:(0,s.jsxs)("span",{className:"flex items-start gap-2",children:[(0,s.jsx)(Y.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,s.jsx)("span",{children:"Account changes may sign you out."})]})}):null,Z?(0,s.jsx)("div",{ref:z,tabIndex:-1,"aria-live":"assertive",children:(0,s.jsx)(S,{tone:"error",role:"alert",children:Z})}):null,(0,s.jsxs)("div",{className:"grid min-w-0 gap-4 sm:grid-cols-2",children:[n?(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Username"}),(0,s.jsx)("p",{className:"tnum break-words rounded-md border border-border bg-card-strong px-3 py-2 text-sm",children:n.username})]}):(0,s.jsx)(k,{id:h("username"),label:"Username",error:q.username,children:(0,s.jsx)("input",{id:h("username"),name:"username",autoComplete:"username",value:p,onChange:e=>f(e.target.value),"aria-invalid":!!q.username||void 0,"aria-describedby":C(h("username"),q.username),className:j})}),(0,s.jsx)(k,{id:h("password"),label:n?"New password (optional)":"Password",error:q.password,children:(0,s.jsx)("input",{id:h("password"),name:"new-password",type:"password",autoComplete:"new-password",value:g,onChange:e=>b(e.target.value),"aria-invalid":!!q.password||void 0,"aria-describedby":C(h("password"),q.password),className:j})})]}),(0,s.jsxs)("fieldset",{className:"flex min-w-0 flex-col gap-2","aria-invalid":!!q.scope||void 0,"aria-describedby":q.scope?h("scope-error"):void 0,children:[(0,s.jsx)("legend",{className:"text-xs font-medium text-foreground",children:"Machine access"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-5 gap-y-2",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{id:h("scope-all"),type:"radio",name:h("scope"),checked:N,onChange:()=>A(!0)}),"All machines"]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{id:h("scope-selected"),type:"radio",name:h("scope"),checked:!N,onChange:()=>A(!1)}),"Selected machines"]})]}),N?null:(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 border-t border-border pt-2",children:[0===K.length?(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d?"Waiting for machines…":"No machines available."}):(0,s.jsx)("div",{className:"max-h-56 overflow-y-auto pr-1",children:(0,s.jsx)("ul",{className:"flex flex-col gap-1.5",children:K.map(e=>(0,s.jsxs)("li",{className:"flex items-start gap-2",children:[(0,s.jsx)("input",{id:h(`machine-${e.machineId}`),type:"checkbox",className:"mt-0.5",checked:E.includes(e.machineId),onChange:()=>R(t=>{var a;return a=e.machineId,t.includes(a)?t.filter(e=>e!==a):[...t,a]})}),(0,s.jsxs)("label",{htmlFor:h(`machine-${e.machineId}`),className:"min-w-0 text-xs text-foreground",children:[(0,s.jsx)("span",{className:"block break-words",children:G(e)}),(0,s.jsx)("span",{className:"tnum block break-all text-muted-foreground",children:e.machineId})]})]},e.machineId))})}),J.length>0?(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Other saved machines"}),(0,s.jsx)("ul",{className:"flex flex-wrap gap-1.5",children:J.map(e=>(0,s.jsxs)("li",{className:"flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-xs",children:[(0,s.jsx)("span",{className:"tnum break-all",children:e}),(0,s.jsx)("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-card-strong hover:text-foreground",onClick:()=>R(t=>t.filter(t=>t!==e)),"aria-label":`Remove ${e} from the machine scope`,children:(0,s.jsx)(O.A,{className:"h-3 w-3","aria-hidden":!0})})]},e))})]}):null]}),q.scope?(0,s.jsx)("p",{id:h("scope-error"),className:"text-xs text-crit",children:q.scope}):null]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[(0,s.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:M,onChange:e=>U(e.target.checked)}),(0,s.jsxs)("span",{children:["Administrator",(0,s.jsx)("span",{className:"block text-muted-foreground",children:"Explicit administrative access. A wildcard machine scope alone never grants it."})]})]}),(0,s.jsxs)("label",{className:"flex items-start gap-2 text-xs text-foreground",children:[(0,s.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:L,onChange:e=>P(e.target.checked)}),(0,s.jsxs)("span",{children:["Disabled",(0,s.jsx)("span",{className:"block text-muted-foreground",children:"Blocks sign-in and ends active sessions. The account is kept for a later re-enable."})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("button",{type:"submit",className:y,disabled:B,children:B?"Saving…":n?"Save changes":"Create user"}),(0,s.jsx)("button",{type:"button",className:v,onClick:c,disabled:B,children:"Cancel"})]})]})}function ee(){let{session:e,machines:t,phase:a,retryConnection:n}=(0,b.M)(),j=(0,l.useMemo)(()=>(function(e={}){let t=e.fetchImpl??fetch;async function a(e,s={}){let n={Accept:"application/json"};void 0!==s.body&&(n["Content-Type"]="application/json"),void 0!==s.csrfToken&&(n["X-CSRF-Token"]=s.csrfToken);let r=await t(e,{method:s.method??"GET",headers:n,body:void 0===s.body?void 0:JSON.stringify(s.body),signal:s.signal,cache:"no-store",credentials:"same-origin",redirect:"error"}),l=await r.text(),i=null;if(l.length>0)try{i=JSON.parse(l)}catch{i=null}if(!r.ok)throw new m(r.status,function(e,t){if(null!==t&&"object"==typeof t){let e=t.error;if("string"==typeof e&&e.length>0&&e.length<=256)return e}return 400===e?"The request was not valid.":401===e?"Your session ended. Sign in again.":403===e?"Administrative access is required.":404===e?"That record no longer exists.":409===e?"That change conflicts with the current directory.":413===e?"The request was too large.":503===e?"Administration is temporarily unavailable.":"The hub could not complete that request."}(r.status,i));return i}return{async listUsers(e){let t=await a("/api/admin/users",{signal:e});if(!Array.isArray(t?.users))throw h();return t.users},async saveUser(e,t,s){await a("/api/admin/users",{method:"POST",body:e,csrfToken:t,signal:s})},async deleteUser(e,t,s){await a(`/api/admin/users?username=${encodeURIComponent(e)}`,{method:"DELETE",csrfToken:t,signal:s})},async listAudit(e=50,t){let s=Number.isSafeInteger(e)?Math.min(Math.max(e,1),1e3):50,n=await a(`/api/admin/audit?limit=${s}`,{signal:t});if(!Array.isArray(n?.events))throw h();return n.events},async listCollectors(e){let t=await a("/api/admin/collectors",{signal:e});if(!Array.isArray(t?.collectors))throw h();return t.collectors},async revokeCollector(e,t,s){await a("/api/admin/collectors",{method:"POST",body:{action:"revoke",collectorId:e},csrfToken:t,signal:s})},async createGrant(e,t,s){let n=await a("/api/admin/collector-grants",{method:"POST",body:e,csrfToken:t,signal:s});if("string"!=typeof n?.token||"string"!=typeof n.expiresAt)throw h();return{token:n.token,expiresAt:n.expiresAt}},async saveMachineMeta(e,t,s,n){await a(`/api/machines/meta?machineId=${encodeURIComponent(e)}`,{method:"POST",body:t,csrfToken:s,signal:n})}}})(),[]),[w,N]=(0,l.useState)(!1),[k,C]=(0,l.useState)(0),A="signed-in"===e.kind?`${e.user.username}:${e.user.csrfToken}`:e.kind;(0,l.useEffect)(()=>{N(!1)},[A]);let S=(0,l.useCallback)(()=>N(!0),[]),I=(0,l.useCallback)(()=>C(e=>e+1),[]),T=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.$E,{}),(0,s.jsx)(g.B,{})]});if("restoring"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsx)(p.Z,{title:"Checking session",className:"mx-auto my-12 max-w-md",children:(0,s.jsx)(p.p,{icon:i.A,note:"Checking your session…"})})});if("restore-failed"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Hub unreachable",className:"mx-auto my-12 max-w-md",children:[(0,s.jsx)(p.p,{icon:d.A,note:"The hub is unreachable right now."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsxs)("button",{type:"button",className:v,onClick:n,children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Try again"]})})]})});if("signed-out"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"expired"===a?"Session ended":"Sign in required",className:"mx-auto my-12 max-w-md",children:[(0,s.jsx)(p.p,{icon:i.A,note:"expired"===a?"Your session ended.":"Sign in required."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/login",className:y,children:"Sign in"})})]})});if("auth-unavailable"===e.kind)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsx)(p.Z,{title:"Sign-in unavailable",className:"mx-auto my-12 max-w-md",children:(0,s.jsx)(p.p,{icon:o.A,note:"Browser sign-in is not configured on this hub."})})});if("expired"===a)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Session ended",className:"mx-auto my-12 max-w-md",children:[(0,s.jsx)(p.p,{icon:o.A,note:"Your session ended."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/login",className:y,children:"Sign in"})})]})});if(!0!==e.user.admin)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Administrator access required",className:"mx-auto my-12 max-w-lg",children:[(0,s.jsx)(p.p,{icon:o.A,note:`You are signed in as ${e.user.username}, but this account is not an administrator.`}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/",className:v,children:"Back to fleet"})})]})});if(w)return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)(p.Z,{title:"Session ended",className:"mx-auto my-12 max-w-lg",children:[(0,s.jsx)(p.p,{icon:o.A,note:"Your administrative session is no longer valid."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r(),{href:"/login",className:y,children:"Sign in again"})})]})});let $=t.map(e=>({machineId:e.machineId,hostname:e.hostname,displayName:e.displayName,tags:e.tags})),E="connecting"===a||"idle"===a;return(0,s.jsx)(x.G,{title:"Administration",headerRight:T,children:(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,s.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-x-6 gap-y-3",children:(0,s.jsxs)("span",{className:"inline-flex min-w-0 max-w-full flex-wrap items-center gap-1.5 rounded-full bg-selected px-3 py-1 text-xs font-medium text-foreground",children:[(0,s.jsx)(u.A,{className:"h-3.5 w-3.5 shrink-0 text-accent","aria-hidden":!0}),(0,s.jsxs)("span",{className:"min-w-0 break-all",children:["Administrator \xb7 ",e.user.username]})]})}),(0,s.jsxs)("div",{className:"grid min-w-0 gap-5 xl:grid-cols-12",children:[(0,s.jsx)("div",{className:"min-w-0 xl:col-span-7",children:(0,s.jsx)(X,{api:j,username:e.user.username,csrfToken:e.user.csrfToken,machines:$,machinesPending:E,onAuditChange:I,onSessionLost:S})}),(0,s.jsx)("div",{className:"min-w-0 xl:col-span-5",children:(0,s.jsx)(_,{api:j,csrfToken:e.user.csrfToken,machines:$,machinesPending:E,onSessionLost:S})}),(0,s.jsx)("div",{id:"collectors",className:"min-w-0 scroll-mt-6 xl:col-span-12",children:(0,s.jsx)(B,{api:j,csrfToken:e.user.csrfToken,sessionKey:A,machines:$,onAuditChange:I,onSessionLost:S})}),(0,s.jsx)("div",{className:"min-w-0 xl:col-span-12",children:(0,s.jsx)(P,{api:j,revision:k,onSessionLost:S})})]})]})})}},7241:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(8698).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}},e=>{e.O(0,[157,939,103,441,794,358],()=>e(e.s=4891)),_N_E=e.O()}]);
|