rigscope 0.1.3 → 0.1.5

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.
Files changed (118) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +3 -3
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +6 -6
  5. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +2 -2
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  17. package/.next/server/app/administration/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/administration.html +1 -1
  19. package/.next/server/app/administration.rsc +3 -3
  20. package/.next/server/app/administration.segments/_full.segment.rsc +3 -3
  21. package/.next/server/app/administration.segments/_tree.segment.rsc +2 -2
  22. package/.next/server/app/administration.segments/administration/__PAGE__.segment.rsc +3 -3
  23. package/.next/server/app/alerts/page.js +1 -1
  24. package/.next/server/app/alerts/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/alerts.html +1 -1
  26. package/.next/server/app/alerts.rsc +4 -4
  27. package/.next/server/app/alerts.segments/_full.segment.rsc +4 -4
  28. package/.next/server/app/alerts.segments/_tree.segment.rsc +2 -2
  29. package/.next/server/app/alerts.segments/alerts/__PAGE__.segment.rsc +4 -4
  30. package/.next/server/app/connections/page.js +1 -1
  31. package/.next/server/app/connections/page.js.nft.json +1 -1
  32. package/.next/server/app/connections/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app/connections.html +1 -1
  34. package/.next/server/app/connections.rsc +6 -6
  35. package/.next/server/app/connections.segments/_full.segment.rsc +6 -6
  36. package/.next/server/app/connections.segments/_tree.segment.rsc +2 -2
  37. package/.next/server/app/connections.segments/connections/__PAGE__.segment.rsc +6 -6
  38. package/.next/server/app/history/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/history.html +1 -1
  40. package/.next/server/app/history.rsc +4 -4
  41. package/.next/server/app/history.segments/_full.segment.rsc +4 -4
  42. package/.next/server/app/history.segments/_tree.segment.rsc +2 -2
  43. package/.next/server/app/history.segments/history/__PAGE__.segment.rsc +4 -4
  44. package/.next/server/app/index.html +1 -1
  45. package/.next/server/app/index.rsc +6 -6
  46. package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -6
  47. package/.next/server/app/index.segments/_full.segment.rsc +6 -6
  48. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  49. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  50. package/.next/server/app/login.html +1 -1
  51. package/.next/server/app/login.rsc +2 -2
  52. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  53. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  55. package/.next/server/app/machines/[machineId]/page.js +1 -1
  56. package/.next/server/app/machines/[machineId]/page.js.nft.json +1 -1
  57. package/.next/server/app/machines/[machineId]/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/page.js +1 -1
  59. package/.next/server/app/page.js.nft.json +1 -1
  60. package/.next/server/app/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/processes/page.js +1 -1
  62. package/.next/server/app/processes/page_client-reference-manifest.js +1 -1
  63. package/.next/server/app/processes.html +1 -1
  64. package/.next/server/app/processes.rsc +4 -4
  65. package/.next/server/app/processes.segments/_full.segment.rsc +4 -4
  66. package/.next/server/app/processes.segments/_tree.segment.rsc +2 -2
  67. package/.next/server/app/processes.segments/processes/__PAGE__.segment.rsc +4 -4
  68. package/.next/server/app-paths-manifest.json +3 -3
  69. package/.next/server/chunks/168.js +1 -1
  70. package/.next/server/chunks/364.js +1 -0
  71. package/.next/server/chunks/751.js +1 -1
  72. package/.next/server/middleware-build-manifest.js +1 -1
  73. package/.next/server/pages/404.html +1 -1
  74. package/.next/server/pages/500.html +1 -1
  75. package/.next/static/chunks/103-13ec30dcc059b9d3.js +1 -0
  76. package/.next/static/chunks/{227-417939c480f50747.js → 130-e940915010276f88.js} +1 -1
  77. package/.next/static/chunks/408-29f55984738967db.js +1 -0
  78. package/.next/static/chunks/app/alerts/{page-fe0e877778c60af8.js → page-2548b2ab0c057953.js} +1 -1
  79. package/.next/static/chunks/app/connections/{page-99cd54d6929b3f1f.js → page-07113bf16cb352e7.js} +1 -1
  80. package/.next/static/chunks/app/machines/[machineId]/page-0b89e4393a137c4d.js +1 -0
  81. package/.next/static/chunks/app/{page-1ae9fc94c897785b.js → page-c68554c93016dd13.js} +1 -1
  82. package/.next/static/chunks/app/processes/{page-0e98a4a64e829c5f.js → page-b6d97d119f10e2a1.js} +3 -3
  83. package/.next/static/css/fb3ad9534f4681e6.css +1 -0
  84. package/CHANGELOG.md +35 -0
  85. package/DESIGN.md +27 -16
  86. package/README.md +2 -0
  87. package/dist/cli.cjs +2366 -1930
  88. package/dist/collector.cjs +18 -7
  89. package/dist/hub.cjs +1 -1
  90. package/docs/installation.md +77 -25
  91. package/docs/operations.md +13 -7
  92. package/docs/releasing.md +12 -12
  93. package/package.json +1 -1
  94. package/.next/server/chunks/877.js +0 -1
  95. package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.html +0 -1
  96. package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.meta +0 -1
  97. package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.rsc +0 -26
  98. package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.segments/_full.segment.rsc +0 -26
  99. package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.segments/_tree.segment.rsc +0 -4
  100. package/.next/server/route-cache/APP_PAGE/16d1ab46157a868f438fa01e04bf53e805c71cddec593ea1535905c59625cd42/$/login.segments/login/__PAGE__.segment.rsc +0 -32
  101. package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.html +0 -1
  102. package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.meta +0 -1
  103. package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.rsc +0 -24
  104. package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.segments/_full.segment.rsc +0 -24
  105. package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -30
  106. package/.next/server/route-cache/APP_PAGE/41da0ef926a63354a29f601d8e8d0a5951196c45ebcd28b7d4708fb7f56f3bf1/$/_not-found.segments/_tree.segment.rsc +0 -4
  107. package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.html +0 -1
  108. package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.meta +0 -1
  109. package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.rsc +0 -26
  110. package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.segments/__PAGE__.segment.rsc +0 -31
  111. package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.segments/_full.segment.rsc +0 -26
  112. package/.next/server/route-cache/APP_PAGE/c6377dd9ce6a1c2cd100eb4344e843eb4639b9ed26f84643f77680e9eb454c4b/$/index.segments/_tree.segment.rsc +0 -3
  113. package/.next/static/chunks/103-c47318242b24e9ac.js +0 -1
  114. package/.next/static/chunks/408-4fe7147e38981ee1.js +0 -1
  115. package/.next/static/chunks/app/machines/[machineId]/page-916ee73de5eb067d.js +0 -1
  116. package/.next/static/css/3fbf75e4c471c6a8.css +0 -1
  117. /package/.next/static/{xjSDCOO8Gpm5iPO9tyRG5 → oxwySrJXqXq8O6_7AzZGe}/_buildManifest.js +0 -0
  118. /package/.next/static/{xjSDCOO8Gpm5iPO9tyRG5 → oxwySrJXqXq8O6_7AzZGe}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=484,a.ids=[484],a.modules={3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4155:(a,b,c)=>{"use strict";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]})}},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10223:(a,b,c)=>{Promise.resolve().then(c.bind(c,29953))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12023:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>q,handler:()=>s,routeModule:()=>r});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,76537))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),o={children:["",{children:["alerts",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,65902))),"/home/triet/Project/rigscope/src/app/alerts/page.tsx"]}]},{"global-error":[n,"next/dist/client/components/builtin/global-error.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]},{layout:[i,"/home/triet/Project/rigscope/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]}.children,p=(0,e.H)({tree:o,page:"/alerts/page",pathname:"/alerts",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),q=p.__next_app__,r=p.routeModule,s=p.handler},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},22685:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(65366).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"}]])},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29356:(a,b,c)=>{"use strict";c.d(b,{c:()=>e});var d=c(67484);function e(a=1e3){let[b,c]=(0,d.useState)(()=>Date.now());return b}},29953:(a,b,c)=>{"use strict";c.d(b,{AlertsView:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AlertsView() from the server but AlertsView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/alerts/alerts-view.tsx","AlertsView")},33873:a=>{"use strict";a.exports=require("path")},33947:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(65366).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"}]])},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65902:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g,metadata:()=>f});var d=c(5735),e=c(29953);let f={title:"Alerts"};function g(){return(0,d.jsx)(e.AlertsView,{})}},86673:(a,b,c)=>{"use strict";c.d(b,{AlertsView:()=>R});var d=c(48249),e=c(67484),f=c(33947),g=c(22685),h=c(31742),i=c(93484);let j=(0,c(65366).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var k=c(78607),l=c(22091),m=c(22338),n=c(81232),o=c(75006),p=c(4155),q=c(93224),r=c(58910),s=c(29356);let t=[{value:"above",label:"At or above threshold",needsThreshold:!0},{value:"below",label:"At or below threshold",needsThreshold:!0},{value:"stale",label:"No receipt within cadence threshold",needsThreshold:!1},{value:"unavailable",label:"Reading unavailable",needsThreshold:!1}],u={"cpu.usage":{label:"CPU usage",unit:"percent",resource:"none"},"cpu.core":{label:"CPU core usage",unit:"percent",resource:"required"},"cpu.temperature":{label:"CPU temperature",unit:"celsius",resource:"none"},"cpu.power":{label:"CPU package power",unit:"watts",resource:"none"},"cpu.iowait":{label:"CPU I/O wait",unit:"percent",resource:"none"},"cpu.pressure":{label:"CPU pressure",unit:"percent",resource:"none"},"memory.used":{label:"Memory used",unit:"bytes",resource:"none"},"memory.total":{label:"Memory total",unit:"bytes",resource:"none"},"memory.usage":{label:"Memory usage",unit:"percent",resource:"none"},"memory.pressure.some":{label:"Memory pressure (some)",unit:"percent",resource:"none"},"memory.pressure.full":{label:"Memory pressure (full)",unit:"percent",resource:"none"},"swap.used":{label:"Swap used",unit:"bytes",resource:"none"},"swap.total":{label:"Swap total",unit:"bytes",resource:"none"},"gpu.utilization":{label:"GPU utilization",unit:"percent",resource:"required"},"gpu.memory.used":{label:"GPU memory used",unit:"bytes",resource:"required"},"gpu.memory.total":{label:"GPU memory total",unit:"bytes",resource:"required"},"gpu.temperature":{label:"GPU temperature",unit:"celsius",resource:"required"},"gpu.power":{label:"GPU power",unit:"watts",resource:"required"},"io.pressure.some":{label:"I/O pressure (some)",unit:"percent",resource:"none"},"io.pressure.full":{label:"I/O pressure (full)",unit:"percent",resource:"none"},"fs.used":{label:"Filesystem used",unit:"bytes",resource:"required"},"fs.total":{label:"Filesystem total",unit:"bytes",resource:"required"},"fs.usage":{label:"Filesystem usage",unit:"percent",resource:"required"},"fs.inodes.usage":{label:"Filesystem inode usage",unit:"percent",resource:"required"},"disk.read":{label:"Disk read",unit:"bytes_per_second",resource:"required"},"disk.write":{label:"Disk write",unit:"bytes_per_second",resource:"required"},"disk.read.latency":{label:"Disk read latency",unit:"milliseconds",resource:"required"},"disk.write.latency":{label:"Disk write latency",unit:"milliseconds",resource:"required"},"disk.utilization":{label:"Disk utilization",unit:"percent",resource:"required"},"net.rx":{label:"Network receive",unit:"bytes_per_second",resource:"required"},"net.tx":{label:"Network transmit",unit:"bytes_per_second",resource:"required"}};function v(a){return"required"===u[a].resource}function w(a){let b=["B","KiB","MiB","GiB","TiB"],c=Math.max(0,a),d=0;for(;c>=1024&&d<b.length-1;)c/=1024,d+=1;return 0===d?`${Math.round(c)} ${b[d]}`:`${c.toFixed(1)} ${b[d]}`}function x(a,b){if(null===b||!Number.isFinite(b))return"—";switch(u[a].unit){case"percent":return`${Math.round(100*b)/100}%`;case"bytes":return w(b);case"bytes_per_second":return`${w(b)}/s`;case"celsius":return`${Math.round(b)} \xb0C`;case"watts":return`${Math.round(b)} W`;case"milliseconds":return`${Math.round(10*b)/10} ms`}}function y(a){return t.find(b=>b.value===a)?.label??a}function z(a,b){return`${u[a].label}${b?` (${b})`:""}`}let A=[{id:"sustained-high-cpu",label:"Sustained high CPU",ruleName:"Sustained high CPU",metric:"cpu.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"none",description:"Suggests CPU at or above 90% for 5 minutes."},{id:"memory-nearly-full",label:"Memory nearly full",ruleName:"Memory nearly full",metric:"memory.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"none",description:"Suggests memory usage at or above 90% for 5 minutes."},{id:"disk-nearly-full",label:"Disk nearly full",ruleName:"Disk nearly full",metric:"fs.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"filesystem",description:"Suggests filesystem usage at or above 90% for 5 minutes."},{id:"inode-capacity-low",label:"Inode capacity low",ruleName:"Inode capacity low",metric:"fs.inodes.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"filesystem",description:"Suggests inode usage at or above 90% for 5 minutes."},{id:"gpu-hot",label:"GPU hot",ruleName:"GPU hot",metric:"gpu.temperature",condition:"above",threshold:85,durationMs:6e4,resourceKind:"gpu",description:"Suggests GPU temperature at or above 85 \xb0C for 1 minute."},{id:"cpu-hot",label:"CPU hot",ruleName:"CPU hot",metric:"cpu.temperature",condition:"above",threshold:90,durationMs:6e4,resourceKind:"none",description:"Suggests CPU temperature at or above 90 \xb0C for 1 minute."},{id:"collector-offline",label:"Collector offline",ruleName:"Collector offline",metric:"cpu.usage",condition:"stale",threshold:null,durationMs:0,resourceKind:"none",description:"Uses the existing stale condition and the collector's advertised cadence."},{id:"memory-pressure",label:"Memory pressure",ruleName:"Memory pressure",metric:"memory.pressure.some",condition:"above",threshold:10,durationMs:6e4,resourceKind:"none",description:"Suggests memory pressure at or above 10% for 1 minute."},{id:"io-pressure",label:"I/O pressure",ruleName:"I/O pressure",metric:"io.pressure.some",condition:"above",threshold:10,durationMs:6e4,resourceKind:"none",description:"Suggests I/O pressure at or above 10% for 1 minute."},{id:"cpu-pressure",label:"CPU pressure",ruleName:"CPU pressure",metric:"cpu.pressure",condition:"above",threshold:10,durationMs:6e4,resourceKind:"none",description:"Suggests CPU pressure at or above 10% for 1 minute."},{id:"high-io-wait",label:"High I/O wait",ruleName:"High I/O wait",metric:"cpu.iowait",condition:"above",threshold:20,durationMs:3e5,resourceKind:"none",description:"Suggests CPU I/O wait at or above 20% for 5 minutes."},{id:"disk-busy",label:"Disk busy",ruleName:"Disk busy",metric:"disk.utilization",condition:"above",threshold:90,durationMs:3e5,resourceKind:"disk",description:"Suggests disk utilization at or above 90% for 5 minutes."},{id:"slow-disk-reads",label:"Slow disk reads",ruleName:"Slow disk reads",metric:"disk.read.latency",condition:"above",threshold:100,durationMs:3e5,resourceKind:"disk",description:"Suggests read latency at or above 100 ms for 5 minutes."}],B={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPU",disks:"Disk",network:"Network"};function C(a){return{kind:"unavailable",reason:a}}function D(){return{kind:"waiting",reason:"Waiting for the first metrics sample."}}function E(a,b){if(null===a||"object"!=typeof a)return null;let c=a[b];return"number"==typeof c&&Number.isFinite(c)?c:null}function F(a,b){return"ok"===a.disks.status?a.disks.filesystems.find(a=>a.id===b):void 0}function G(a,b){return"ok"===a.disks.status?a.disks.devices.find(a=>a.id===b):void 0}function H(a,b,c){return null===E(a,b)?C(`${c} is not reported by this collector.`):{kind:"ready"}}function I(a,b,c,d,e){let f="ready"===c.kind&&void 0!==b?{name:a.ruleName,machineId:b.machineId,metric:a.metric,resourceId:e,condition:a.condition,threshold:a.threshold,durationMs:a.durationMs,enabled:!0}:null;return{preset:a,status:c,resourceId:e,resources:d,input:f}}function J(a,b){if(!b||!v(a))return[];let c=b.inventory;return void 0===c?[]:"cpu.core"===a?Array.from({length:Math.min(c.cpu.logicalCores,256)},(a,b)=>({value:`core:${b}`,label:`Core ${b}`})):a.startsWith("gpu.")?c.gpus.filter(a=>"supported"===a.telemetry).map(a=>({value:a.id,label:a.name})):a.startsWith("fs.")?c.filesystems.map(a=>({value:a.id,label:`${a.mountPoint} (${a.fsType})`})):a.startsWith("disk.")?c.disks.map(a=>({value:a.id,label:a.name})):a.startsWith("net.")?c.network.map(a=>({value:a.id,label:a.name})):[]}function K({machines:a,rule:b,busy:c,onSave:f,onCancel:g}){let h=a[0]?.machineId??"",[i,j]=(0,e.useState)(""),[k,l]=(0,e.useState)(h),[m,n]=(0,e.useState)("cpu.usage"),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)("above"),[s,w]=(0,e.useState)("80"),[x,y]=(0,e.useState)("0"),[z,L]=(0,e.useState)(!0),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(""),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(!1),U=a.find(a=>a.machineId===k),V=void 0!==U&&void 0===U.metrics,W=null===b?A.map(a=>(function(a,b){let{resources:c,resourceId:d}=function(a,b){if("none"===a||void 0===b)return{resources:[],resourceId:""};if("filesystem"===a){let a=b.filesystems.map(a=>({value:a.id,label:`${a.mountPoint} (${a.fsType})`})),c=b.filesystems.find(a=>"/"===a.mountPoint)??b.filesystems[0];return{resources:a,resourceId:c?.id??""}}if("gpu"===a){let a=b.gpus.filter(a=>"supported"===a.telemetry);return{resources:a.map(a=>({value:a.id,label:a.name})),resourceId:a[0]?.id??""}}return{resources:b.disks.map(a=>({value:a.id,label:a.name})),resourceId:b.disks[0]?.id??""}}(a.resourceKind,b?.inventory);return void 0===b?I(a,b,C("Choose a machine."),c,d):"none"!==a.resourceKind&&""===d?I(a,b,C(function(a){switch(a){case"filesystem":return"No filesystems are reported by this machine.";case"gpu":return"No telemetry-capable GPU is reported by this machine.";case"disk":return"No disks are reported by this machine.";case"none":return"No resource is available."}}(a.resourceKind)),c,d):I(a,b,function(a,b,c){var d;if("stale"===a.condition)return{kind:"ready"};let e=function(a,b){let c=a.inventory?.capabilities[b];if(c?.status==="unsupported"||c?.status==="withheld")return C(`${B[b]} metrics are not shared with this hub.`);let d=a.metrics?.payload;return void 0===d?D():"unavailable"===function(a,b){switch(b){case"cpu":return a.cpu;case"memory":return a.memory;case"swap":return a.swap;case"gpus":return a.gpus;case"disks":return a.disks;case"network":return a.network}}(d,b).status?C(`${B[b]} readings are unavailable on this machine.`):null}(b,(d=a.metric).startsWith("cpu.")?"cpu":d.startsWith("memory.")?"memory":d.startsWith("swap.")?"swap":d.startsWith("gpu.")?"gpus":d.startsWith("io.")||d.startsWith("fs.")||d.startsWith("disk.")?"disks":"network");if(null!==e)return e;let f=b.metrics?.payload;if(void 0===f)return D();switch(a.metric){case"cpu.usage":default:return{kind:"ready"};case"cpu.temperature":return H(f.cpu,"temperatureC","CPU temperature");case"cpu.power":return H(f.cpu,"powerWatts","CPU package power");case"cpu.iowait":return H(f.cpu,"iowaitPercent","CPU I/O wait");case"cpu.pressure":return H(f.cpu,"pressureSomePercent","CPU pressure");case"memory.usage":{let a=f.memory;if("ok"!==a.status||!(a.totalBytes>0))return C("Memory total is not reported by this machine.");return{kind:"ready"}}case"memory.pressure.some":return H(f.memory,"pressureSomePercent","Memory pressure");case"memory.pressure.full":return H(f.memory,"pressureFullPercent","Memory full pressure");case"io.pressure.some":return H(f.disks,"pressureSomePercent","I/O pressure");case"io.pressure.full":return H(f.disks,"pressureFullPercent","I/O full pressure");case"fs.usage":{let a=F(f,c);if(void 0===a)return C("The latest sample does not include this filesystem.");if("ok"!==a.status||!(a.totalBytes>0))return C("Filesystem size is not reported for this filesystem.");return{kind:"ready"}}case"fs.inodes.usage":{let a=F(f,c);if(void 0===a)return C("The latest sample does not include this filesystem.");if("ok"!==a.status)return C("This filesystem is unavailable in the latest sample.");let b=E(a,"inodesUsed"),d=E(a,"inodesTotal");if(null===b||null===d||d<=0)return C("Inode usage is not reported for this filesystem.");return{kind:"ready"}}case"gpu.temperature":{let a="ok"===f.gpus.status?f.gpus.devices.find(a=>a.id===c):void 0;if(void 0===a)return C("The latest sample does not include this GPU.");if("ok"!==a.status)return C("This GPU is unavailable in the latest sample.");return H(a,"temperatureC","GPU temperature")}case"disk.utilization":{let a=G(f,c);if(void 0===a)return C("The latest sample does not include this disk.");if("ok"!==a.status)return C("This disk is unavailable in the latest sample.");return H(a,"ioUtilizationPercent","Disk utilization")}case"disk.read.latency":{let a=G(f,c);if(void 0===a)return C("The latest sample does not include this disk.");if("ok"!==a.status)return C("This disk is unavailable in the latest sample.");return H(a,"readLatencyMs","Disk read latency")}case"disk.write.latency":{let a=G(f,c);if(void 0===a)return C("The latest sample does not include this disk.");if("ok"!==a.status)return C("This disk is unavailable in the latest sample.");return H(a,"writeLatencyMs","Disk write latency")}}}(a,b,d),c,d)})(a,U)):[],X=""===O?null:W.find(a=>a.preset.id===O)??null,Y=J(m,U),Z="above"===q||"below"===q,$=v(m),_=c||S||0===a.length,aa=async a=>{if(a.preventDefault(),R(null),""===i.trim())return void R("Give the rule a name.");if(""===k)return void R("Choose a machine.");if(V&&"stale"!==q)return void R("No metrics have been received from this machine yet, so value and unavailable rules cannot be evaluated against it. Use a stale rule, or wait until the machine reports metrics.");if($&&""===o.trim())return void R("Choose or enter the metric's resource.");let c=Number(x);if(""===x.trim()||!Number.isInteger(c)||c<0||1e3*c>864e5)return void R("Duration must be a whole number of seconds from 0 to 86400.");let d=null;if(Z&&(""===s.trim()||!Number.isFinite(d=Number(s))))return void R("Enter a numeric threshold.");let e=function(a){if(""===a.trim())return null;let b=new Date(a);return Number.isFinite(b.getTime())?b.toISOString():null}(M);T(!0);try{await f({...null===b?{}:{id:b.id},name:i.trim(),machineId:k,metric:m,resourceId:$?o.trim():"",condition:q,threshold:Z?d:null,durationMs:1e3*c,enabled:z,maintenanceUntil:e})}catch(a){R(a instanceof Error?a.message:"Could not save the rule.")}finally{T(!1)}};return(0,d.jsxs)("form",{onSubmit:a=>void aa(a),"aria-busy":S,className:"flex flex-col gap-4",children:[0===a.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"No machines available."}):null,null===b?(0,d.jsxs)("div",{className:"border-b border-border pb-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("label",{htmlFor:"alert-rule-preset",className:"text-xs text-muted-foreground",children:"Warning preset"}),(0,d.jsxs)("select",{id:"alert-rule-preset",value:O,onChange:a=>P(a.target.value),disabled:_,"aria-describedby":"alert-rule-preset-note",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:[(0,d.jsx)("option",{value:"",children:"Choose a preset…"}),W.map(a=>(0,d.jsxs)("option",{value:a.preset.id,children:[a.preset.label,"ready"===a.status.kind?"":"waiting"===a.status.kind?" — waiting for metrics":" — unavailable"]},a.preset.id))]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{if(null===X||null===X.input)return;let a=X.input;j(a.name),l(a.machineId),n(a.metric),p(a.resourceId??""),r(a.condition),w(null===a.threshold||void 0===a.threshold?"":String(a.threshold)),y(String(a.durationMs/1e3)),R(null)},disabled:_||X?.status.kind!=="ready",className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Use preset"})]}),(0,d.jsx)("p",{id:"alert-rule-preset-note","aria-live":"polite",className:"mt-1.5 text-xs text-muted-foreground",children:null!==X&&"ready"!==X.status.kind?X.status.reason:""})]}):null,(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("div",{className:"sm:col-span-2",children:[(0,d.jsx)("label",{htmlFor:"alert-rule-name",className:"text-xs text-muted-foreground",children:"Rule name"}),(0,d.jsx)("input",{id:"alert-rule-name",value:i,onChange:a=>j(a.target.value),maxLength:128,disabled:_,placeholder:"CPU sustained high",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground placeholder:text-muted-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-machine",className:"text-xs text-muted-foreground",children:"Machine"}),(0,d.jsxs)("select",{id:"alert-rule-machine",value:k,onChange:c=>{var d;let e,f;return d=c.target.value,P(""),l(d),void 0!==(e=a.find(a=>a.machineId===d))&&void 0===e.metrics&&null===b&&r("stale"),f=J(m,e),void(v(m)&&p(f[0]?.value??""))},disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:[""===k||a.some(a=>a.machineId===k)?null:(0,d.jsxs)("option",{value:k,children:[k," (current)"]}),a.map(a=>(0,d.jsx)("option",{value:a.machineId,children:a.displayName?.trim()||a.hostname||a.machineId},a.machineId))]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-metric",className:"text-xs text-muted-foreground",children:"Metric"}),(0,d.jsx)("select",{id:"alert-rule-metric",value:m,onChange:a=>{var b;let c;return n(b=a.target.value),c=J(b,U),void p(v(b)?c[0]?.value??"":"")},disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:Object.keys(u).map(a=>({value:a,label:u[a].label})).map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))})]}),$?(0,d.jsxs)("div",{className:"sm:col-span-2",children:[(0,d.jsx)("label",{htmlFor:"alert-rule-resource",className:"text-xs text-muted-foreground",children:"Resource"}),Y.length>0?(0,d.jsxs)("select",{id:"alert-rule-resource",value:o,onChange:a=>p(a.target.value),disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:[""===o||Y.some(a=>a.value===o)?null:(0,d.jsxs)("option",{value:o,children:[o," (current)"]}),Y.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))]}):(0,d.jsx)("input",{id:"alert-rule-resource",value:o,onChange:a=>p(a.target.value),maxLength:256,disabled:_,placeholder:"cpu.core"===m?"core:0":m.startsWith("gpu.")?"gpu:GPU-…":m.startsWith("fs.")?"fs:/":m.startsWith("disk.")?"disk:sda":m.startsWith("net.")?"net:eno1":"Resource id",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground placeholder:text-muted-foreground"})]}):null,(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-condition",className:"text-xs text-muted-foreground",children:"Condition"}),(0,d.jsx)("select",{id:"alert-rule-condition",value:q,onChange:a=>r(a.target.value),disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:t.map(a=>(0,d.jsx)("option",{value:a.value,disabled:V&&"stale"!==a.value,children:a.label},a.value))}),V?(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Waiting for metrics."}):null]}),Z?(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{htmlFor:"alert-rule-threshold",className:"text-xs text-muted-foreground",children:["Threshold (",function(a){switch(u[a].unit){case"percent":return"percent (0–100)";case"bytes":return"bytes";case"bytes_per_second":return"bytes per second";case"celsius":return"degrees Celsius";case"watts":return"watts";case"milliseconds":return"milliseconds"}}(m),")"]}),(0,d.jsx)("input",{id:"alert-rule-threshold",type:"number",step:"any",value:s,onChange:a=>w(a.target.value),disabled:_,className:"tnum mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}):null,(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-duration",className:"text-xs text-muted-foreground",children:"Must hold for (seconds)"}),(0,d.jsx)("input",{id:"alert-rule-duration",type:"number",min:0,max:86400,step:1,value:x,onChange:a=>y(a.target.value),disabled:_,className:"tnum mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-maintenance",className:"text-xs text-muted-foreground",children:"Maintenance until (optional)"}),(0,d.jsx)("input",{id:"alert-rule-maintenance",type:"datetime-local",value:M,onChange:a=>N(a.target.value),disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground sm:col-span-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:z,onChange:a=>L(a.target.checked),disabled:_,className:"h-4 w-4 rounded border-border accent-[var(--accent)]"}),"Rule enabled"]})]}),Q?(0,d.jsx)("p",{role:"alert",className:"rounded-md bg-crit-soft px-3 py-2 text-xs text-foreground",children:Q}):null,(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{type:"submit",disabled:_,className:"rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90 disabled:opacity-50",children:S?"Saving…":null===b?"Create rule":"Save rule"}),null!==b?(0,d.jsx)("button",{type:"button",onClick:g,disabled:S,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Cancel"}):null]})]})}function L({status:a,busy:b,onConfigure:c,onClear:f,onTest:g}){let[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(null),z=(0,e.useRef)(null),A=(0,e.useRef)(null),B=(0,e.useRef)(null),C=async a=>{u(!0),q(null),w(null),y(null);try{await c(a),i(""),k(""),m(""),o(!0)}catch(a){q(a instanceof Error?a.message:"Could not configure the webhook.")}finally{u(!1)}},D=async b=>{b.preventDefault();let c=(()=>{let a;q(null),s(null);let b=h.trim();if(""===b)return q("Enter the webhook URL."),null;if(""!==j.trim())try{let b=JSON.parse(j);if(null===b||"object"!=typeof b||Array.isArray(b))throw Error("not an object");for(let[c,d]of(a={},Object.entries(b))){if("string"!=typeof d)throw Error("header values must be strings");a[c]=d}}catch{return q("Headers must be a JSON object with string values."),null}return{url:b,...void 0===a?{}:{headers:a},secret:""===l.trim()?null:l,enabled:n}})();if(null!==c){if(a.configured){y(c),w("replace");return}await C(c)}},E=async()=>{u(!0),q(null),s(null),w(null);try{await f(),i(""),k(""),m("")}catch(a){q(a instanceof Error?a.message:"Could not clear the webhook.")}finally{u(!1)}},F=async()=>{"clear"===v?await E():"replace"===v&&null!==x&&await C(x)},G=async()=>{q(null),u(!0);try{s(await g())}catch(a){q(a instanceof Error?a.message:"Could not test the webhook.")}finally{u(!1)}},H=b||t||null!==v,I=a.configured&&"loopback-http"===a.transport;return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-xs",children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Configured"}),(0,d.jsx)("dd",{className:"text-foreground",children:a.configured?a.enabled?"Enabled":"Disabled":"Not configured"}),(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Transport"}),(0,d.jsx)("dd",{className:"text-foreground",children:"https"===a.transport?"HTTPS":"loopback-http"===a.transport?"Loopback HTTP test sink":"—"}),(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Last test"}),(0,d.jsx)("dd",{className:"text-foreground",children:null===a.lastTestAt?"Never":`${!0===a.lastTestOk?"Passed":"Failed"} \xb7 ${new Date(a.lastTestAt).toLocaleString()}`}),a.lastError?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Last error"}),(0,d.jsx)("dd",{className:"text-warn",children:a.lastError})]}):null]}),(0,d.jsxs)("form",{onSubmit:a=>void D(a),className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-webhook-url",className:"text-xs text-muted-foreground",children:a.configured?"Replace webhook URL":"Webhook URL"}),(0,d.jsx)("input",{id:"alert-webhook-url",type:"url",required:!0,value:h,onChange:a=>i(a.target.value),maxLength:2048,disabled:H,placeholder:"https://receiver.example/alerts",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground placeholder:text-muted-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-webhook-headers",className:"text-xs text-muted-foreground",children:"Headers (JSON, optional)"}),(0,d.jsx)("textarea",{id:"alert-webhook-headers",value:j,onChange:a=>k(a.target.value),rows:2,disabled:H,placeholder:'{"x-channel": "monitoring"}',className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-webhook-secret",className:"text-xs text-muted-foreground",children:"Signing secret (optional)"}),(0,d.jsx)("input",{id:"alert-webhook-secret",type:"password",value:l,onChange:a=>m(a.target.value),maxLength:256,disabled:H,placeholder:"Blank clears the signature",autoComplete:"new-password",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:n,onChange:a=>o(a.target.checked),disabled:H,className:"h-4 w-4 rounded border-border accent-[var(--accent)]"}),"Webhook enabled"]}),p?(0,d.jsx)("p",{role:"alert",className:"rounded-md bg-crit-soft px-3 py-2 text-xs text-foreground",children:p}):null,(0,d.jsx)("p",{role:"status",className:r?`rounded-md px-3 py-2 text-xs ${r.ok?"bg-ok-soft text-foreground":"bg-warn-soft text-foreground"}`:"sr-only",children:r?`Test ${r.ok?"delivered":"failed"}${null!==r.status?` (HTTP ${r.status})`:""}${r.error?` — ${r.error}`:""}.`:""}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{ref:A,type:"submit",disabled:H||""===h.trim(),className:"rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90 disabled:opacity-50",children:a.configured?"Replace webhook":"Configure webhook"}),(0,d.jsx)("button",{ref:B,type:"button",onClick:()=>{q(null),w("clear")},disabled:H||!a.configured,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Clear webhook"}),(0,d.jsx)("button",{type:"button",onClick:()=>void G(),disabled:H||!I,title:I?"Send one explicit test message to the configured loopback sink":"Test delivery is available only for a configured loopback HTTP sink",className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Send test"})]}),null!==v?(0,d.jsxs)("div",{role:"group","aria-label":"Confirm webhook change",className:"rounded-md bg-warn-soft px-3 py-3",children:[(0,d.jsx)("p",{className:"text-xs text-foreground",children:"clear"===v?"Clear the configured webhook? Future incidents will not be delivered until a webhook is configured again.":"Replace the configured webhook? The stored URL, headers and secret will be overwritten."}),(0,d.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{ref:z,type:"button",onClick:()=>void F(),disabled:t,className:`rounded-md px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors disabled:opacity-50 ${"clear"===v?"bg-crit":"bg-accent hover:bg-accent/90"}`,children:"clear"===v?"Confirm clear":"Confirm replace"}),(0,d.jsx)("button",{type:"button",onClick:()=>{let a="clear"===v?B.current:A.current;w(null),y(null),a?.focus()},disabled:t,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Cancel"})]})]}):null]})]})}function M(a){if(null===a)return"—";let b=new Date(a);return Number.isFinite(b.getTime())?b.toLocaleString():a}function N({tone:a,children:b}){return(0,d.jsx)("span",{className:`tnum inline-flex items-center rounded-full px-2 py-0.5 text-xs ${"ok"===a?"bg-ok-soft text-ok":"warn"===a?"bg-warn-soft text-warn":"crit"===a?"bg-crit-soft text-crit":"border border-border text-muted-foreground"}`,children:b})}function O({incident:a,now:b}){let c="open"===a.status;return(0,d.jsx)("li",{className:"border-b border-border py-3 last:border-b-0",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(N,{tone:c?"crit":"ok",children:c?"Open":"Recovered"}),(0,d.jsx)("span",{className:"truncate text-sm font-medium",children:a.ruleName}),(0,d.jsx)("span",{className:"tnum text-xs text-muted-foreground",children:a.machineId})]}),(0,d.jsx)("p",{className:"mt-1 max-w-2xl text-sm",children:a.message}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[z(a.metric,a.resourceId)," \xb7 started"," ",(0,q.nV)((0,q.A4)(a.startedAt,b)),null!==a.resolvedAt?` \xb7 recovered ${(0,q.nV)((0,q.A4)(a.resolvedAt,b))}`:""]})]}),(0,d.jsxs)("dl",{className:"tnum grid shrink-0 grid-cols-2 gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[(0,d.jsx)("dt",{children:"Started value"}),(0,d.jsx)("dd",{className:"text-right text-foreground",children:x(a.metric,a.startedValue)}),(0,d.jsx)("dt",{children:"Recovered value"}),(0,d.jsx)("dd",{className:"text-right text-foreground",children:x(a.metric,a.resolvedValue)})]})]})})}function P({rule:a,admin:b,busy:c,confirmingDelete:e,onEdit:h,onRequestDelete:i,onCancelDelete:j,onConfirmDelete:k}){var l,m;let n=(l=a.condition,t.find(a=>a.value===l)?.needsThreshold)?`${y(a.condition)} ${x(a.metric,a.threshold)}`:y(a.condition),o=a.enabled?"firing"===a.state?"crit":"pending"===a.state?"warn":"ok":"muted",p=a.enabled?"firing"===a.state?"Firing":"pending"===a.state?"Pending":"OK":"Disabled";return(0,d.jsxs)("li",{className:"border-b border-border py-3 last:border-b-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"truncate text-sm font-medium",children:a.name}),(0,d.jsx)(N,{tone:o,children:p})]}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[a.machineId," \xb7 ",z(a.metric,a.resourceId)]}),(0,d.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[n," \xb7 holds ",!Number.isFinite(m=a.durationMs)||m<=0?"Immediately":m<6e4?`${Math.round(m/1e3)} s`:m<36e5?`${Math.round(m/6e4)} min`:`${Math.round(m/36e5)} h`,a.pendingSince?` \xb7 pending since ${M(a.pendingSince)}`:""]}),a.maintenanceUntil?(0,d.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Maintenance until ",M(a.maintenanceUntil)]}):null]}),b?(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,d.jsxs)("button",{type:"button",onClick:h,disabled:c||e,className:"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:[(0,d.jsx)(f.A,{className:"h-3 w-3","aria-hidden":!0}),"Edit"]}),(0,d.jsxs)("button",{type:"button",onClick:i,disabled:c||e,className:"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-crit transition-colors hover:bg-crit-soft disabled:opacity-50",children:[(0,d.jsx)(g.A,{className:"h-3 w-3","aria-hidden":!0}),"Delete"]})]}):null]}),e?(0,d.jsxs)("div",{role:"group","aria-label":"Confirm rule deletion",className:"mt-3 rounded-md bg-warn-soft px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs text-foreground",children:["Delete “",a.name,"”? Its incident history stays, but the rule stops evaluating."]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,d.jsx)("button",{type:"button",autoFocus:!0,onClick:()=>void k(),disabled:c,className:"rounded-md bg-crit px-2.5 py-1 text-xs font-medium text-accent-foreground transition-colors disabled:opacity-50",children:"Confirm delete"}),(0,d.jsx)("button",{type:"button",onClick:j,disabled:c,className:"rounded-md border border-border px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Cancel"})]})]}):null]})}function Q({notification:a}){let b="failed"===a.status?"crit":"delivered"===a.status?"ok":"warn";return(0,d.jsxs)("li",{className:"border-b border-border py-2 last:border-b-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 text-xs",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(N,{tone:b,children:a.status}),(0,d.jsx)("span",{className:"text-foreground",children:a.event}),(0,d.jsxs)("span",{className:"tnum text-muted-foreground",children:["attempt ",a.attempts,"/",a.maxAttempts]})]}),(0,d.jsx)("span",{className:"tnum text-muted-foreground",children:M(a.createdAt)})]}),a.lastError?(0,d.jsx)("p",{className:"mt-1 text-xs text-warn",children:a.lastError}):null,(0,d.jsx)("p",{className:"tnum mt-0.5 truncate font-mono text-xs text-muted-foreground",children:a.id})]})}function R(){let{session:a,machines:b}=(0,r.M)(),c=(0,p.x)(),f=(0,s.c)(),g="signed-in"===a.kind?a.user.csrfToken:null,q="signed-in"===a.kind&&!0===a.user.admin,[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(!0),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),H=q&&(null===t||t.canAdmin),I=(0,e.useCallback)(async()=>{if(null!==g){w(!0),y(null);try{let a=await fetch("/api/alerts",{headers:{Accept:"application/json"},cache:"no-store",credentials:"same-origin"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error??`Could not load alerts (${a.status}).`);u(b)}catch(a){y(a instanceof Error?a.message:"Could not load alerts.")}finally{w(!1)}}},[g]),J=(0,e.useCallback)(async(a,b)=>{if(null===g)throw Error("Sign in required.");G(!0),y(null);try{let c=await fetch(a,{...b,cache:"no-store",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json","x-csrf-token":g,...b.headers??{}}}),d=await c.json().catch(()=>({}));if(!c.ok)throw Error(d.error??`Request failed (${c.status}).`);return d}finally{G(!1)}},[g]),M=async a=>{await J("/api/alerts/rules",{method:"POST",body:JSON.stringify(a)}),C(null),A(a.id?"Rule saved.":"Rule created."),await I()},N=async a=>{try{await J(`/api/alerts/rules?id=${encodeURIComponent(a.id)}`,{method:"DELETE"}),B?.id===a.id&&C(null),E(null),A("Rule deleted."),await I()}catch(a){y(a instanceof Error?a.message:"Could not delete the rule.")}},R=async a=>{await J("/api/alerts/webhook",{method:"POST",body:JSON.stringify({action:"configure",...a})}),A("Webhook configured."),await I()},S=async()=>{await J("/api/alerts/webhook",{method:"POST",body:JSON.stringify({action:"clear"})}),A("Webhook cleared."),await I()},T=async()=>{let a=await J("/api/alerts/webhook",{method:"POST",body:JSON.stringify({action:"test"})});return u(b=>null===b?b:{...b,webhook:a.status}),A(a.result.ok?"Webhook test delivered.":"Webhook test failed."),a.result},U=t?.incidents??[],V=U.filter(a=>"open"===a.status).length,W=t?.rules??[],X=t?.notifications,Y=v&&null===t;return(0,d.jsx)(l.G,{title:"Alerts",headerRight:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.$E,{}),(0,d.jsx)(o.B,{})]}),children:c||(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(p.E,{}),(0,d.jsx)("div",{className:"mb-4 flex flex-wrap items-center justify-end gap-3",children:(0,d.jsxs)("button",{type:"button",onClick:()=>void I(),disabled:v,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:[(0,d.jsx)(h.A,{className:`h-3.5 w-3.5 ${v?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]})}),(0,d.jsx)("p",{role:"status",className:z?"mb-4 text-xs text-muted-foreground":"sr-only",children:z??""}),x?(0,d.jsx)("p",{role:"alert",className:"mb-4 rounded-lg bg-crit-soft px-4 py-2.5 text-xs text-foreground",children:x}):null,Y?(0,d.jsx)(m.Z,{title:"Alerts",className:"mt-8",children:(0,d.jsx)(m.p,{icon:h.A,note:"Loading alert rules and incidents…"})}):null===t?(0,d.jsx)(m.Z,{title:"Alerts unavailable",className:"mt-8",children:(0,d.jsx)(m.p,{icon:i.A,note:"Alert state could not be loaded."})}):(0,d.jsxs)("div",{className:H?"grid gap-5 xl:grid-cols-[minmax(0,1fr)_24rem]":"flex flex-col gap-5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,d.jsx)(m.Z,{title:"Incidents and recoveries",action:(0,d.jsxs)("span",{children:[V," open \xb7 ",U.length," recent"]}),children:0===U.length?(0,d.jsx)(m.p,{icon:j,note:"No incidents."}):(0,d.jsx)("ul",{className:"flex flex-col",children:U.map(a=>(0,d.jsx)(O,{incident:a,now:f},a.id))})}),(0,d.jsx)(m.Z,{title:"Rules",action:(0,d.jsxs)("span",{children:[W.length," configured"]}),children:0===W.length?(0,d.jsx)(m.p,{icon:k.A,note:"No rules."}):(0,d.jsx)("ul",{className:"flex flex-col",children:W.map(a=>(0,d.jsx)(P,{rule:a,admin:H,busy:F,confirmingDelete:D===a.id,onEdit:()=>{E(null),C(a)},onRequestDelete:()=>E(a.id),onCancelDelete:()=>E(null),onConfirmDelete:()=>N(a)},a.id))})}),(0,d.jsx)(m.Z,{title:"Notifications",action:(0,d.jsxs)("span",{children:[X?.pending??0," pending \xb7 ",X?.failed??0," failed"]}),children:void 0===X||0===X.recent.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"No notifications."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("dl",{className:"grid grid-cols-3 gap-3 border-b border-border pb-3 text-xs",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Pending"}),(0,d.jsx)("dd",{className:"tnum text-foreground",children:X.pending})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Delivered"}),(0,d.jsx)("dd",{className:"tnum text-foreground",children:X.delivered})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Failed"}),(0,d.jsx)("dd",{className:"tnum text-foreground",children:X.failed})]})]}),(0,d.jsx)("ul",{className:"mt-1 flex flex-col",children:X.recent.slice(0,10).map(a=>(0,d.jsx)(Q,{notification:a},a.id))})]})})]}),H?(0,d.jsxs)("aside",{className:"flex min-w-0 flex-col gap-5",children:[(0,d.jsx)(m.Z,{title:null===B?"New rule":"Edit rule",action:null===B?null:(0,d.jsx)("button",{type:"button",onClick:()=>C(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"New instead"}),children:(0,d.jsx)(K,{machines:b,rule:B,busy:F,onSave:M,onCancel:()=>C(null)})}),(0,d.jsx)(m.Z,{title:"Webhook",children:(0,d.jsx)(L,{status:t.webhook,busy:F,onConfigure:R,onClear:S,onTest:T})})]}):null]})]})})}},90606:(a,b,c)=>{"use strict";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"}]])},93351:(a,b,c)=>{Promise.resolve().then(c.bind(c,86673))}};var b=require("../../webpack-runtime.js");b.C(a);var c=b.X(0,[266,430,721,161,751],()=>b(b.s=12023));module.exports=c})();
1
+ (()=>{var a={};a.id=484,a.ids=[484],a.modules={3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4155:(a,b,c)=>{"use strict";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]})}},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10223:(a,b,c)=>{Promise.resolve().then(c.bind(c,29953))},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12023:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>q,handler:()=>s,routeModule:()=>r});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,76537))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),o={children:["",{children:["alerts",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,65902))),"/home/triet/Project/rigscope/src/app/alerts/page.tsx"]}]},{"global-error":[n,"next/dist/client/components/builtin/global-error.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]},{layout:[i,"/home/triet/Project/rigscope/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]}.children,p=(0,e.H)({tree:o,page:"/alerts/page",pathname:"/alerts",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),q=p.__next_app__,r=p.routeModule,s=p.handler},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},22685:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(65366).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"}]])},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29953:(a,b,c)=>{"use strict";c.d(b,{AlertsView:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AlertsView() from the server but AlertsView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/triet/Project/rigscope/src/components/alerts/alerts-view.tsx","AlertsView")},33873:a=>{"use strict";a.exports=require("path")},33947:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(65366).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"}]])},38522:a=>{"use strict";a.exports=require("node:zlib")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65902:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g,metadata:()=>f});var d=c(5735),e=c(29953);let f={title:"Alerts"};function g(){return(0,d.jsx)(e.AlertsView,{})}},86673:(a,b,c)=>{"use strict";c.d(b,{AlertsView:()=>R});var d=c(48249),e=c(67484),f=c(33947),g=c(22685),h=c(31742),i=c(93484);let j=(0,c(65366).A)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var k=c(78607),l=c(22091),m=c(22338),n=c(81232),o=c(75006),p=c(4155),q=c(93224),r=c(58910),s=c(29356);let t=[{value:"above",label:"At or above threshold",needsThreshold:!0},{value:"below",label:"At or below threshold",needsThreshold:!0},{value:"stale",label:"No receipt within cadence threshold",needsThreshold:!1},{value:"unavailable",label:"Reading unavailable",needsThreshold:!1}],u={"cpu.usage":{label:"CPU usage",unit:"percent",resource:"none"},"cpu.core":{label:"CPU core usage",unit:"percent",resource:"required"},"cpu.temperature":{label:"CPU temperature",unit:"celsius",resource:"none"},"cpu.power":{label:"CPU package power",unit:"watts",resource:"none"},"cpu.iowait":{label:"CPU I/O wait",unit:"percent",resource:"none"},"cpu.pressure":{label:"CPU pressure",unit:"percent",resource:"none"},"memory.used":{label:"Memory used",unit:"bytes",resource:"none"},"memory.total":{label:"Memory total",unit:"bytes",resource:"none"},"memory.usage":{label:"Memory usage",unit:"percent",resource:"none"},"memory.pressure.some":{label:"Memory pressure (some)",unit:"percent",resource:"none"},"memory.pressure.full":{label:"Memory pressure (full)",unit:"percent",resource:"none"},"swap.used":{label:"Swap used",unit:"bytes",resource:"none"},"swap.total":{label:"Swap total",unit:"bytes",resource:"none"},"gpu.utilization":{label:"GPU utilization",unit:"percent",resource:"required"},"gpu.memory.used":{label:"GPU memory used",unit:"bytes",resource:"required"},"gpu.memory.total":{label:"GPU memory total",unit:"bytes",resource:"required"},"gpu.temperature":{label:"GPU temperature",unit:"celsius",resource:"required"},"gpu.power":{label:"GPU power",unit:"watts",resource:"required"},"io.pressure.some":{label:"I/O pressure (some)",unit:"percent",resource:"none"},"io.pressure.full":{label:"I/O pressure (full)",unit:"percent",resource:"none"},"fs.used":{label:"Filesystem used",unit:"bytes",resource:"required"},"fs.total":{label:"Filesystem total",unit:"bytes",resource:"required"},"fs.usage":{label:"Filesystem usage",unit:"percent",resource:"required"},"fs.inodes.usage":{label:"Filesystem inode usage",unit:"percent",resource:"required"},"disk.read":{label:"Disk read",unit:"bytes_per_second",resource:"required"},"disk.write":{label:"Disk write",unit:"bytes_per_second",resource:"required"},"disk.read.latency":{label:"Disk read latency",unit:"milliseconds",resource:"required"},"disk.write.latency":{label:"Disk write latency",unit:"milliseconds",resource:"required"},"disk.utilization":{label:"Disk utilization",unit:"percent",resource:"required"},"net.rx":{label:"Network receive",unit:"bytes_per_second",resource:"required"},"net.tx":{label:"Network transmit",unit:"bytes_per_second",resource:"required"}};function v(a){return"required"===u[a].resource}function w(a){let b=["B","KiB","MiB","GiB","TiB"],c=Math.max(0,a),d=0;for(;c>=1024&&d<b.length-1;)c/=1024,d+=1;return 0===d?`${Math.round(c)} ${b[d]}`:`${c.toFixed(1)} ${b[d]}`}function x(a,b){if(null===b||!Number.isFinite(b))return"—";switch(u[a].unit){case"percent":return`${Math.round(100*b)/100}%`;case"bytes":return w(b);case"bytes_per_second":return`${w(b)}/s`;case"celsius":return`${Math.round(b)} \xb0C`;case"watts":return`${Math.round(b)} W`;case"milliseconds":return`${Math.round(10*b)/10} ms`}}function y(a){return t.find(b=>b.value===a)?.label??a}function z(a,b){return`${u[a].label}${b?` (${b})`:""}`}let A=[{id:"sustained-high-cpu",label:"Sustained high CPU",ruleName:"Sustained high CPU",metric:"cpu.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"none",description:"Suggests CPU at or above 90% for 5 minutes."},{id:"memory-nearly-full",label:"Memory nearly full",ruleName:"Memory nearly full",metric:"memory.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"none",description:"Suggests memory usage at or above 90% for 5 minutes."},{id:"disk-nearly-full",label:"Disk nearly full",ruleName:"Disk nearly full",metric:"fs.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"filesystem",description:"Suggests filesystem usage at or above 90% for 5 minutes."},{id:"inode-capacity-low",label:"Inode capacity low",ruleName:"Inode capacity low",metric:"fs.inodes.usage",condition:"above",threshold:90,durationMs:3e5,resourceKind:"filesystem",description:"Suggests inode usage at or above 90% for 5 minutes."},{id:"gpu-hot",label:"GPU hot",ruleName:"GPU hot",metric:"gpu.temperature",condition:"above",threshold:85,durationMs:6e4,resourceKind:"gpu",description:"Suggests GPU temperature at or above 85 \xb0C for 1 minute."},{id:"cpu-hot",label:"CPU hot",ruleName:"CPU hot",metric:"cpu.temperature",condition:"above",threshold:90,durationMs:6e4,resourceKind:"none",description:"Suggests CPU temperature at or above 90 \xb0C for 1 minute."},{id:"collector-offline",label:"Collector offline",ruleName:"Collector offline",metric:"cpu.usage",condition:"stale",threshold:null,durationMs:0,resourceKind:"none",description:"Uses the existing stale condition and the collector's advertised cadence."},{id:"memory-pressure",label:"Memory pressure",ruleName:"Memory pressure",metric:"memory.pressure.some",condition:"above",threshold:10,durationMs:6e4,resourceKind:"none",description:"Suggests memory pressure at or above 10% for 1 minute."},{id:"io-pressure",label:"I/O pressure",ruleName:"I/O pressure",metric:"io.pressure.some",condition:"above",threshold:10,durationMs:6e4,resourceKind:"none",description:"Suggests I/O pressure at or above 10% for 1 minute."},{id:"cpu-pressure",label:"CPU pressure",ruleName:"CPU pressure",metric:"cpu.pressure",condition:"above",threshold:10,durationMs:6e4,resourceKind:"none",description:"Suggests CPU pressure at or above 10% for 1 minute."},{id:"high-io-wait",label:"High I/O wait",ruleName:"High I/O wait",metric:"cpu.iowait",condition:"above",threshold:20,durationMs:3e5,resourceKind:"none",description:"Suggests CPU I/O wait at or above 20% for 5 minutes."},{id:"disk-busy",label:"Disk busy",ruleName:"Disk busy",metric:"disk.utilization",condition:"above",threshold:90,durationMs:3e5,resourceKind:"disk",description:"Suggests disk utilization at or above 90% for 5 minutes."},{id:"slow-disk-reads",label:"Slow disk reads",ruleName:"Slow disk reads",metric:"disk.read.latency",condition:"above",threshold:100,durationMs:3e5,resourceKind:"disk",description:"Suggests read latency at or above 100 ms for 5 minutes."}],B={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPU",disks:"Disk",network:"Network"};function C(a){return{kind:"unavailable",reason:a}}function D(){return{kind:"waiting",reason:"Waiting for the first metrics sample."}}function E(a,b){if(null===a||"object"!=typeof a)return null;let c=a[b];return"number"==typeof c&&Number.isFinite(c)?c:null}function F(a,b){return"ok"===a.disks.status?a.disks.filesystems.find(a=>a.id===b):void 0}function G(a,b){return"ok"===a.disks.status?a.disks.devices.find(a=>a.id===b):void 0}function H(a,b,c){return null===E(a,b)?C(`${c} is not reported by this collector.`):{kind:"ready"}}function I(a,b,c,d,e){let f="ready"===c.kind&&void 0!==b?{name:a.ruleName,machineId:b.machineId,metric:a.metric,resourceId:e,condition:a.condition,threshold:a.threshold,durationMs:a.durationMs,enabled:!0}:null;return{preset:a,status:c,resourceId:e,resources:d,input:f}}function J(a,b){if(!b||!v(a))return[];let c=b.inventory;return void 0===c?[]:"cpu.core"===a?Array.from({length:Math.min(c.cpu.logicalCores,256)},(a,b)=>({value:`core:${b}`,label:`Core ${b}`})):a.startsWith("gpu.")?c.gpus.filter(a=>"supported"===a.telemetry).map(a=>({value:a.id,label:a.name})):a.startsWith("fs.")?c.filesystems.map(a=>({value:a.id,label:`${a.mountPoint} (${a.fsType})`})):a.startsWith("disk.")?c.disks.map(a=>({value:a.id,label:a.name})):a.startsWith("net.")?c.network.map(a=>({value:a.id,label:a.name})):[]}function K({machines:a,rule:b,busy:c,onSave:f,onCancel:g}){let h=a[0]?.machineId??"",[i,j]=(0,e.useState)(""),[k,l]=(0,e.useState)(h),[m,n]=(0,e.useState)("cpu.usage"),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)("above"),[s,w]=(0,e.useState)("80"),[x,y]=(0,e.useState)("0"),[z,L]=(0,e.useState)(!0),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(""),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(!1),U=a.find(a=>a.machineId===k),V=void 0!==U&&void 0===U.metrics,W=null===b?A.map(a=>(function(a,b){let{resources:c,resourceId:d}=function(a,b){if("none"===a||void 0===b)return{resources:[],resourceId:""};if("filesystem"===a){let a=b.filesystems.map(a=>({value:a.id,label:`${a.mountPoint} (${a.fsType})`})),c=b.filesystems.find(a=>"/"===a.mountPoint)??b.filesystems[0];return{resources:a,resourceId:c?.id??""}}if("gpu"===a){let a=b.gpus.filter(a=>"supported"===a.telemetry);return{resources:a.map(a=>({value:a.id,label:a.name})),resourceId:a[0]?.id??""}}return{resources:b.disks.map(a=>({value:a.id,label:a.name})),resourceId:b.disks[0]?.id??""}}(a.resourceKind,b?.inventory);return void 0===b?I(a,b,C("Choose a machine."),c,d):"none"!==a.resourceKind&&""===d?I(a,b,C(function(a){switch(a){case"filesystem":return"No filesystems are reported by this machine.";case"gpu":return"No telemetry-capable GPU is reported by this machine.";case"disk":return"No disks are reported by this machine.";case"none":return"No resource is available."}}(a.resourceKind)),c,d):I(a,b,function(a,b,c){var d;if("stale"===a.condition)return{kind:"ready"};let e=function(a,b){let c=a.inventory?.capabilities[b];if(c?.status==="unsupported"||c?.status==="withheld")return C(`${B[b]} metrics are not shared with this hub.`);let d=a.metrics?.payload;return void 0===d?D():"unavailable"===function(a,b){switch(b){case"cpu":return a.cpu;case"memory":return a.memory;case"swap":return a.swap;case"gpus":return a.gpus;case"disks":return a.disks;case"network":return a.network}}(d,b).status?C(`${B[b]} readings are unavailable on this machine.`):null}(b,(d=a.metric).startsWith("cpu.")?"cpu":d.startsWith("memory.")?"memory":d.startsWith("swap.")?"swap":d.startsWith("gpu.")?"gpus":d.startsWith("io.")||d.startsWith("fs.")||d.startsWith("disk.")?"disks":"network");if(null!==e)return e;let f=b.metrics?.payload;if(void 0===f)return D();switch(a.metric){case"cpu.usage":default:return{kind:"ready"};case"cpu.temperature":return H(f.cpu,"temperatureC","CPU temperature");case"cpu.power":return H(f.cpu,"powerWatts","CPU package power");case"cpu.iowait":return H(f.cpu,"iowaitPercent","CPU I/O wait");case"cpu.pressure":return H(f.cpu,"pressureSomePercent","CPU pressure");case"memory.usage":{let a=f.memory;if("ok"!==a.status||!(a.totalBytes>0))return C("Memory total is not reported by this machine.");return{kind:"ready"}}case"memory.pressure.some":return H(f.memory,"pressureSomePercent","Memory pressure");case"memory.pressure.full":return H(f.memory,"pressureFullPercent","Memory full pressure");case"io.pressure.some":return H(f.disks,"pressureSomePercent","I/O pressure");case"io.pressure.full":return H(f.disks,"pressureFullPercent","I/O full pressure");case"fs.usage":{let a=F(f,c);if(void 0===a)return C("The latest sample does not include this filesystem.");if("ok"!==a.status||!(a.totalBytes>0))return C("Filesystem size is not reported for this filesystem.");return{kind:"ready"}}case"fs.inodes.usage":{let a=F(f,c);if(void 0===a)return C("The latest sample does not include this filesystem.");if("ok"!==a.status)return C("This filesystem is unavailable in the latest sample.");let b=E(a,"inodesUsed"),d=E(a,"inodesTotal");if(null===b||null===d||d<=0)return C("Inode usage is not reported for this filesystem.");return{kind:"ready"}}case"gpu.temperature":{let a="ok"===f.gpus.status?f.gpus.devices.find(a=>a.id===c):void 0;if(void 0===a)return C("The latest sample does not include this GPU.");if("ok"!==a.status)return C("This GPU is unavailable in the latest sample.");return H(a,"temperatureC","GPU temperature")}case"disk.utilization":{let a=G(f,c);if(void 0===a)return C("The latest sample does not include this disk.");if("ok"!==a.status)return C("This disk is unavailable in the latest sample.");return H(a,"ioUtilizationPercent","Disk utilization")}case"disk.read.latency":{let a=G(f,c);if(void 0===a)return C("The latest sample does not include this disk.");if("ok"!==a.status)return C("This disk is unavailable in the latest sample.");return H(a,"readLatencyMs","Disk read latency")}case"disk.write.latency":{let a=G(f,c);if(void 0===a)return C("The latest sample does not include this disk.");if("ok"!==a.status)return C("This disk is unavailable in the latest sample.");return H(a,"writeLatencyMs","Disk write latency")}}}(a,b,d),c,d)})(a,U)):[],X=""===O?null:W.find(a=>a.preset.id===O)??null,Y=J(m,U),Z="above"===q||"below"===q,$=v(m),_=c||S||0===a.length,aa=async a=>{if(a.preventDefault(),R(null),""===i.trim())return void R("Give the rule a name.");if(""===k)return void R("Choose a machine.");if(V&&"stale"!==q)return void R("No metrics have been received from this machine yet, so value and unavailable rules cannot be evaluated against it. Use a stale rule, or wait until the machine reports metrics.");if($&&""===o.trim())return void R("Choose or enter the metric's resource.");let c=Number(x);if(""===x.trim()||!Number.isInteger(c)||c<0||1e3*c>864e5)return void R("Duration must be a whole number of seconds from 0 to 86400.");let d=null;if(Z&&(""===s.trim()||!Number.isFinite(d=Number(s))))return void R("Enter a numeric threshold.");let e=function(a){if(""===a.trim())return null;let b=new Date(a);return Number.isFinite(b.getTime())?b.toISOString():null}(M);T(!0);try{await f({...null===b?{}:{id:b.id},name:i.trim(),machineId:k,metric:m,resourceId:$?o.trim():"",condition:q,threshold:Z?d:null,durationMs:1e3*c,enabled:z,maintenanceUntil:e})}catch(a){R(a instanceof Error?a.message:"Could not save the rule.")}finally{T(!1)}};return(0,d.jsxs)("form",{onSubmit:a=>void aa(a),"aria-busy":S,className:"flex flex-col gap-4",children:[0===a.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"No machines available."}):null,null===b?(0,d.jsxs)("div",{className:"border-b border-border pb-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("label",{htmlFor:"alert-rule-preset",className:"text-xs text-muted-foreground",children:"Warning preset"}),(0,d.jsxs)("select",{id:"alert-rule-preset",value:O,onChange:a=>P(a.target.value),disabled:_,"aria-describedby":"alert-rule-preset-note",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:[(0,d.jsx)("option",{value:"",children:"Choose a preset…"}),W.map(a=>(0,d.jsxs)("option",{value:a.preset.id,children:[a.preset.label,"ready"===a.status.kind?"":"waiting"===a.status.kind?" — waiting for metrics":" — unavailable"]},a.preset.id))]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{if(null===X||null===X.input)return;let a=X.input;j(a.name),l(a.machineId),n(a.metric),p(a.resourceId??""),r(a.condition),w(null===a.threshold||void 0===a.threshold?"":String(a.threshold)),y(String(a.durationMs/1e3)),R(null)},disabled:_||X?.status.kind!=="ready",className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Use preset"})]}),(0,d.jsx)("p",{id:"alert-rule-preset-note","aria-live":"polite",className:"mt-1.5 text-xs text-muted-foreground",children:null!==X&&"ready"!==X.status.kind?X.status.reason:""})]}):null,(0,d.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,d.jsxs)("div",{className:"sm:col-span-2",children:[(0,d.jsx)("label",{htmlFor:"alert-rule-name",className:"text-xs text-muted-foreground",children:"Rule name"}),(0,d.jsx)("input",{id:"alert-rule-name",value:i,onChange:a=>j(a.target.value),maxLength:128,disabled:_,placeholder:"CPU sustained high",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground placeholder:text-muted-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-machine",className:"text-xs text-muted-foreground",children:"Machine"}),(0,d.jsxs)("select",{id:"alert-rule-machine",value:k,onChange:c=>{var d;let e,f;return d=c.target.value,P(""),l(d),void 0!==(e=a.find(a=>a.machineId===d))&&void 0===e.metrics&&null===b&&r("stale"),f=J(m,e),void(v(m)&&p(f[0]?.value??""))},disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:[""===k||a.some(a=>a.machineId===k)?null:(0,d.jsxs)("option",{value:k,children:[k," (current)"]}),a.map(a=>(0,d.jsx)("option",{value:a.machineId,children:a.displayName?.trim()||a.hostname||a.machineId},a.machineId))]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-metric",className:"text-xs text-muted-foreground",children:"Metric"}),(0,d.jsx)("select",{id:"alert-rule-metric",value:m,onChange:a=>{var b;let c;return n(b=a.target.value),c=J(b,U),void p(v(b)?c[0]?.value??"":"")},disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:Object.keys(u).map(a=>({value:a,label:u[a].label})).map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))})]}),$?(0,d.jsxs)("div",{className:"sm:col-span-2",children:[(0,d.jsx)("label",{htmlFor:"alert-rule-resource",className:"text-xs text-muted-foreground",children:"Resource"}),Y.length>0?(0,d.jsxs)("select",{id:"alert-rule-resource",value:o,onChange:a=>p(a.target.value),disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:[""===o||Y.some(a=>a.value===o)?null:(0,d.jsxs)("option",{value:o,children:[o," (current)"]}),Y.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value))]}):(0,d.jsx)("input",{id:"alert-rule-resource",value:o,onChange:a=>p(a.target.value),maxLength:256,disabled:_,placeholder:"cpu.core"===m?"core:0":m.startsWith("gpu.")?"gpu:GPU-…":m.startsWith("fs.")?"fs:/":m.startsWith("disk.")?"disk:sda":m.startsWith("net.")?"net:eno1":"Resource id",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground placeholder:text-muted-foreground"})]}):null,(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-condition",className:"text-xs text-muted-foreground",children:"Condition"}),(0,d.jsx)("select",{id:"alert-rule-condition",value:q,onChange:a=>r(a.target.value),disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground",children:t.map(a=>(0,d.jsx)("option",{value:a.value,disabled:V&&"stale"!==a.value,children:a.label},a.value))}),V?(0,d.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Waiting for metrics."}):null]}),Z?(0,d.jsxs)("div",{children:[(0,d.jsxs)("label",{htmlFor:"alert-rule-threshold",className:"text-xs text-muted-foreground",children:["Threshold (",function(a){switch(u[a].unit){case"percent":return"percent (0–100)";case"bytes":return"bytes";case"bytes_per_second":return"bytes per second";case"celsius":return"degrees Celsius";case"watts":return"watts";case"milliseconds":return"milliseconds"}}(m),")"]}),(0,d.jsx)("input",{id:"alert-rule-threshold",type:"number",step:"any",value:s,onChange:a=>w(a.target.value),disabled:_,className:"tnum mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}):null,(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-duration",className:"text-xs text-muted-foreground",children:"Must hold for (seconds)"}),(0,d.jsx)("input",{id:"alert-rule-duration",type:"number",min:0,max:86400,step:1,value:x,onChange:a=>y(a.target.value),disabled:_,className:"tnum mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-rule-maintenance",className:"text-xs text-muted-foreground",children:"Maintenance until (optional)"}),(0,d.jsx)("input",{id:"alert-rule-maintenance",type:"datetime-local",value:M,onChange:a=>N(a.target.value),disabled:_,className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground sm:col-span-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:z,onChange:a=>L(a.target.checked),disabled:_,className:"h-4 w-4 rounded border-border accent-[var(--accent)]"}),"Rule enabled"]})]}),Q?(0,d.jsx)("p",{role:"alert",className:"rounded-md bg-crit-soft px-3 py-2 text-xs text-foreground",children:Q}):null,(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{type:"submit",disabled:_,className:"rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90 disabled:opacity-50",children:S?"Saving…":null===b?"Create rule":"Save rule"}),null!==b?(0,d.jsx)("button",{type:"button",onClick:g,disabled:S,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Cancel"}):null]})]})}function L({status:a,busy:b,onConfigure:c,onClear:f,onTest:g}){let[h,i]=(0,e.useState)(""),[j,k]=(0,e.useState)(""),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(!0),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(null),z=(0,e.useRef)(null),A=(0,e.useRef)(null),B=(0,e.useRef)(null),C=async a=>{u(!0),q(null),w(null),y(null);try{await c(a),i(""),k(""),m(""),o(!0)}catch(a){q(a instanceof Error?a.message:"Could not configure the webhook.")}finally{u(!1)}},D=async b=>{b.preventDefault();let c=(()=>{let a;q(null),s(null);let b=h.trim();if(""===b)return q("Enter the webhook URL."),null;if(""!==j.trim())try{let b=JSON.parse(j);if(null===b||"object"!=typeof b||Array.isArray(b))throw Error("not an object");for(let[c,d]of(a={},Object.entries(b))){if("string"!=typeof d)throw Error("header values must be strings");a[c]=d}}catch{return q("Headers must be a JSON object with string values."),null}return{url:b,...void 0===a?{}:{headers:a},secret:""===l.trim()?null:l,enabled:n}})();if(null!==c){if(a.configured){y(c),w("replace");return}await C(c)}},E=async()=>{u(!0),q(null),s(null),w(null);try{await f(),i(""),k(""),m("")}catch(a){q(a instanceof Error?a.message:"Could not clear the webhook.")}finally{u(!1)}},F=async()=>{"clear"===v?await E():"replace"===v&&null!==x&&await C(x)},G=async()=>{q(null),u(!0);try{s(await g())}catch(a){q(a instanceof Error?a.message:"Could not test the webhook.")}finally{u(!1)}},H=b||t||null!==v,I=a.configured&&"loopback-http"===a.transport;return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-xs",children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Configured"}),(0,d.jsx)("dd",{className:"text-foreground",children:a.configured?a.enabled?"Enabled":"Disabled":"Not configured"}),(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Transport"}),(0,d.jsx)("dd",{className:"text-foreground",children:"https"===a.transport?"HTTPS":"loopback-http"===a.transport?"Loopback HTTP test sink":"—"}),(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Last test"}),(0,d.jsx)("dd",{className:"text-foreground",children:null===a.lastTestAt?"Never":`${!0===a.lastTestOk?"Passed":"Failed"} \xb7 ${new Date(a.lastTestAt).toLocaleString()}`}),a.lastError?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Last error"}),(0,d.jsx)("dd",{className:"text-warn",children:a.lastError})]}):null]}),(0,d.jsxs)("form",{onSubmit:a=>void D(a),className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-webhook-url",className:"text-xs text-muted-foreground",children:a.configured?"Replace webhook URL":"Webhook URL"}),(0,d.jsx)("input",{id:"alert-webhook-url",type:"url",required:!0,value:h,onChange:a=>i(a.target.value),maxLength:2048,disabled:H,placeholder:"https://receiver.example/alerts",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground placeholder:text-muted-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-webhook-headers",className:"text-xs text-muted-foreground",children:"Headers (JSON, optional)"}),(0,d.jsx)("textarea",{id:"alert-webhook-headers",value:j,onChange:a=>k(a.target.value),rows:2,disabled:H,placeholder:'{"x-channel": "monitoring"}',className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"alert-webhook-secret",className:"text-xs text-muted-foreground",children:"Signing secret (optional)"}),(0,d.jsx)("input",{id:"alert-webhook-secret",type:"password",value:l,onChange:a=>m(a.target.value),maxLength:256,disabled:H,placeholder:"Blank clears the signature",autoComplete:"new-password",className:"mt-1 w-full rounded-md border border-border bg-card px-2.5 py-1.5 text-sm text-foreground"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs text-foreground",children:[(0,d.jsx)("input",{type:"checkbox",checked:n,onChange:a=>o(a.target.checked),disabled:H,className:"h-4 w-4 rounded border-border accent-[var(--accent)]"}),"Webhook enabled"]}),p?(0,d.jsx)("p",{role:"alert",className:"rounded-md bg-crit-soft px-3 py-2 text-xs text-foreground",children:p}):null,(0,d.jsx)("p",{role:"status",className:r?`rounded-md px-3 py-2 text-xs ${r.ok?"bg-ok-soft text-foreground":"bg-warn-soft text-foreground"}`:"sr-only",children:r?`Test ${r.ok?"delivered":"failed"}${null!==r.status?` (HTTP ${r.status})`:""}${r.error?` — ${r.error}`:""}.`:""}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{ref:A,type:"submit",disabled:H||""===h.trim(),className:"rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors hover:bg-accent/90 disabled:opacity-50",children:a.configured?"Replace webhook":"Configure webhook"}),(0,d.jsx)("button",{ref:B,type:"button",onClick:()=>{q(null),w("clear")},disabled:H||!a.configured,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Clear webhook"}),(0,d.jsx)("button",{type:"button",onClick:()=>void G(),disabled:H||!I,title:I?"Send one explicit test message to the configured loopback sink":"Test delivery is available only for a configured loopback HTTP sink",className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Send test"})]}),null!==v?(0,d.jsxs)("div",{role:"group","aria-label":"Confirm webhook change",className:"rounded-md bg-warn-soft px-3 py-3",children:[(0,d.jsx)("p",{className:"text-xs text-foreground",children:"clear"===v?"Clear the configured webhook? Future incidents will not be delivered until a webhook is configured again.":"Replace the configured webhook? The stored URL, headers and secret will be overwritten."}),(0,d.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,d.jsx)("button",{ref:z,type:"button",onClick:()=>void F(),disabled:t,className:`rounded-md px-3 py-1.5 text-xs font-medium text-accent-foreground transition-colors disabled:opacity-50 ${"clear"===v?"bg-crit":"bg-accent hover:bg-accent/90"}`,children:"clear"===v?"Confirm clear":"Confirm replace"}),(0,d.jsx)("button",{type:"button",onClick:()=>{let a="clear"===v?B.current:A.current;w(null),y(null),a?.focus()},disabled:t,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Cancel"})]})]}):null]})]})}function M(a){if(null===a)return"—";let b=new Date(a);return Number.isFinite(b.getTime())?b.toLocaleString():a}function N({tone:a,children:b}){return(0,d.jsx)("span",{className:`tnum inline-flex items-center rounded-full px-2 py-0.5 text-xs ${"ok"===a?"bg-ok-soft text-ok":"warn"===a?"bg-warn-soft text-warn":"crit"===a?"bg-crit-soft text-crit":"border border-border text-muted-foreground"}`,children:b})}function O({incident:a,now:b}){let c="open"===a.status;return(0,d.jsx)("li",{className:"border-b border-border py-3 last:border-b-0",children:(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)(N,{tone:c?"crit":"ok",children:c?"Open":"Recovered"}),(0,d.jsx)("span",{className:"truncate text-sm font-medium",children:a.ruleName}),(0,d.jsx)("span",{className:"tnum text-xs text-muted-foreground",children:a.machineId})]}),(0,d.jsx)("p",{className:"mt-1 max-w-2xl text-sm",children:a.message}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[z(a.metric,a.resourceId)," \xb7 started"," ",(0,q.nV)((0,q.A4)(a.startedAt,b)),null!==a.resolvedAt?` \xb7 recovered ${(0,q.nV)((0,q.A4)(a.resolvedAt,b))}`:""]})]}),(0,d.jsxs)("dl",{className:"tnum grid shrink-0 grid-cols-2 gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[(0,d.jsx)("dt",{children:"Started value"}),(0,d.jsx)("dd",{className:"text-right text-foreground",children:x(a.metric,a.startedValue)}),(0,d.jsx)("dt",{children:"Recovered value"}),(0,d.jsx)("dd",{className:"text-right text-foreground",children:x(a.metric,a.resolvedValue)})]})]})})}function P({rule:a,admin:b,busy:c,confirmingDelete:e,onEdit:h,onRequestDelete:i,onCancelDelete:j,onConfirmDelete:k}){var l,m;let n=(l=a.condition,t.find(a=>a.value===l)?.needsThreshold)?`${y(a.condition)} ${x(a.metric,a.threshold)}`:y(a.condition),o=a.enabled?"firing"===a.state?"crit":"pending"===a.state?"warn":"ok":"muted",p=a.enabled?"firing"===a.state?"Firing":"pending"===a.state?"Pending":"OK":"Disabled";return(0,d.jsxs)("li",{className:"border-b border-border py-3 last:border-b-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"truncate text-sm font-medium",children:a.name}),(0,d.jsx)(N,{tone:o,children:p})]}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[a.machineId," \xb7 ",z(a.metric,a.resourceId)]}),(0,d.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[n," \xb7 holds ",!Number.isFinite(m=a.durationMs)||m<=0?"Immediately":m<6e4?`${Math.round(m/1e3)} s`:m<36e5?`${Math.round(m/6e4)} min`:`${Math.round(m/36e5)} h`,a.pendingSince?` \xb7 pending since ${M(a.pendingSince)}`:""]}),a.maintenanceUntil?(0,d.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Maintenance until ",M(a.maintenanceUntil)]}):null]}),b?(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,d.jsxs)("button",{type:"button",onClick:h,disabled:c||e,className:"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:[(0,d.jsx)(f.A,{className:"h-3 w-3","aria-hidden":!0}),"Edit"]}),(0,d.jsxs)("button",{type:"button",onClick:i,disabled:c||e,className:"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs text-crit transition-colors hover:bg-crit-soft disabled:opacity-50",children:[(0,d.jsx)(g.A,{className:"h-3 w-3","aria-hidden":!0}),"Delete"]})]}):null]}),e?(0,d.jsxs)("div",{role:"group","aria-label":"Confirm rule deletion",className:"mt-3 rounded-md bg-warn-soft px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs text-foreground",children:["Delete “",a.name,"”? Its incident history stays, but the rule stops evaluating."]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,d.jsx)("button",{type:"button",autoFocus:!0,onClick:()=>void k(),disabled:c,className:"rounded-md bg-crit px-2.5 py-1 text-xs font-medium text-accent-foreground transition-colors disabled:opacity-50",children:"Confirm delete"}),(0,d.jsx)("button",{type:"button",onClick:j,disabled:c,className:"rounded-md border border-border px-2.5 py-1 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:"Cancel"})]})]}):null]})}function Q({notification:a}){let b="failed"===a.status?"crit":"delivered"===a.status?"ok":"warn";return(0,d.jsxs)("li",{className:"border-b border-border py-2 last:border-b-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 text-xs",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(N,{tone:b,children:a.status}),(0,d.jsx)("span",{className:"text-foreground",children:a.event}),(0,d.jsxs)("span",{className:"tnum text-muted-foreground",children:["attempt ",a.attempts,"/",a.maxAttempts]})]}),(0,d.jsx)("span",{className:"tnum text-muted-foreground",children:M(a.createdAt)})]}),a.lastError?(0,d.jsx)("p",{className:"mt-1 text-xs text-warn",children:a.lastError}):null,(0,d.jsx)("p",{className:"tnum mt-0.5 truncate font-mono text-xs text-muted-foreground",children:a.id})]})}function R(){let{session:a,machines:b}=(0,r.M)(),c=(0,p.x)(),f=(0,s.c)(),g="signed-in"===a.kind?a.user.csrfToken:null,q="signed-in"===a.kind&&!0===a.user.admin,[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(!0),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(!1),H=q&&(null===t||t.canAdmin),I=(0,e.useCallback)(async()=>{if(null!==g){w(!0),y(null);try{let a=await fetch("/api/alerts",{headers:{Accept:"application/json"},cache:"no-store",credentials:"same-origin"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error??`Could not load alerts (${a.status}).`);u(b)}catch(a){y(a instanceof Error?a.message:"Could not load alerts.")}finally{w(!1)}}},[g]),J=(0,e.useCallback)(async(a,b)=>{if(null===g)throw Error("Sign in required.");G(!0),y(null);try{let c=await fetch(a,{...b,cache:"no-store",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json","x-csrf-token":g,...b.headers??{}}}),d=await c.json().catch(()=>({}));if(!c.ok)throw Error(d.error??`Request failed (${c.status}).`);return d}finally{G(!1)}},[g]),M=async a=>{await J("/api/alerts/rules",{method:"POST",body:JSON.stringify(a)}),C(null),A(a.id?"Rule saved.":"Rule created."),await I()},N=async a=>{try{await J(`/api/alerts/rules?id=${encodeURIComponent(a.id)}`,{method:"DELETE"}),B?.id===a.id&&C(null),E(null),A("Rule deleted."),await I()}catch(a){y(a instanceof Error?a.message:"Could not delete the rule.")}},R=async a=>{await J("/api/alerts/webhook",{method:"POST",body:JSON.stringify({action:"configure",...a})}),A("Webhook configured."),await I()},S=async()=>{await J("/api/alerts/webhook",{method:"POST",body:JSON.stringify({action:"clear"})}),A("Webhook cleared."),await I()},T=async()=>{let a=await J("/api/alerts/webhook",{method:"POST",body:JSON.stringify({action:"test"})});return u(b=>null===b?b:{...b,webhook:a.status}),A(a.result.ok?"Webhook test delivered.":"Webhook test failed."),a.result},U=t?.incidents??[],V=U.filter(a=>"open"===a.status).length,W=t?.rules??[],X=t?.notifications,Y=v&&null===t;return(0,d.jsx)(l.G,{title:"Alerts",headerRight:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.$E,{}),(0,d.jsx)(o.B,{})]}),children:c||(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(p.E,{}),(0,d.jsx)("div",{className:"mb-4 flex flex-wrap items-center justify-end gap-3",children:(0,d.jsxs)("button",{type:"button",onClick:()=>void I(),disabled:v,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong disabled:opacity-50",children:[(0,d.jsx)(h.A,{className:`h-3.5 w-3.5 ${v?"animate-spin":""}`,"aria-hidden":!0}),"Refresh"]})}),(0,d.jsx)("p",{role:"status",className:z?"mb-4 text-xs text-muted-foreground":"sr-only",children:z??""}),x?(0,d.jsx)("p",{role:"alert",className:"mb-4 rounded-lg bg-crit-soft px-4 py-2.5 text-xs text-foreground",children:x}):null,Y?(0,d.jsx)(m.Z,{title:"Alerts",className:"mt-8",children:(0,d.jsx)(m.p,{icon:h.A,note:"Loading alert rules and incidents…"})}):null===t?(0,d.jsx)(m.Z,{title:"Alerts unavailable",className:"mt-8",children:(0,d.jsx)(m.p,{icon:i.A,note:"Alert state could not be loaded."})}):(0,d.jsxs)("div",{className:H?"grid gap-5 xl:grid-cols-[minmax(0,1fr)_24rem]":"flex flex-col gap-5",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[(0,d.jsx)(m.Z,{title:"Incidents and recoveries",action:(0,d.jsxs)("span",{children:[V," open \xb7 ",U.length," recent"]}),children:0===U.length?(0,d.jsx)(m.p,{icon:j,note:"No incidents."}):(0,d.jsx)("ul",{className:"flex flex-col",children:U.map(a=>(0,d.jsx)(O,{incident:a,now:f},a.id))})}),(0,d.jsx)(m.Z,{title:"Rules",action:(0,d.jsxs)("span",{children:[W.length," configured"]}),children:0===W.length?(0,d.jsx)(m.p,{icon:k.A,note:"No rules."}):(0,d.jsx)("ul",{className:"flex flex-col",children:W.map(a=>(0,d.jsx)(P,{rule:a,admin:H,busy:F,confirmingDelete:D===a.id,onEdit:()=>{E(null),C(a)},onRequestDelete:()=>E(a.id),onCancelDelete:()=>E(null),onConfirmDelete:()=>N(a)},a.id))})}),(0,d.jsx)(m.Z,{title:"Notifications",action:(0,d.jsxs)("span",{children:[X?.pending??0," pending \xb7 ",X?.failed??0," failed"]}),children:void 0===X||0===X.recent.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"No notifications."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("dl",{className:"grid grid-cols-3 gap-3 border-b border-border pb-3 text-xs",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Pending"}),(0,d.jsx)("dd",{className:"tnum text-foreground",children:X.pending})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Delivered"}),(0,d.jsx)("dd",{className:"tnum text-foreground",children:X.delivered})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-muted-foreground",children:"Failed"}),(0,d.jsx)("dd",{className:"tnum text-foreground",children:X.failed})]})]}),(0,d.jsx)("ul",{className:"mt-1 flex flex-col",children:X.recent.slice(0,10).map(a=>(0,d.jsx)(Q,{notification:a},a.id))})]})})]}),H?(0,d.jsxs)("aside",{className:"flex min-w-0 flex-col gap-5",children:[(0,d.jsx)(m.Z,{title:null===B?"New rule":"Edit rule",action:null===B?null:(0,d.jsx)("button",{type:"button",onClick:()=>C(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"New instead"}),children:(0,d.jsx)(K,{machines:b,rule:B,busy:F,onSave:M,onCancel:()=>C(null)})}),(0,d.jsx)(m.Z,{title:"Webhook",children:(0,d.jsx)(L,{status:t.webhook,busy:F,onConfigure:R,onClear:S,onTest:T})})]}):null]})]})})}},90606:(a,b,c)=>{"use strict";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"}]])},93351:(a,b,c)=>{Promise.resolve().then(c.bind(c,86673))}};var b=require("../../webpack-runtime.js");b.C(a);var c=b.X(0,[266,430,721,161,751],()=>b(b.s=12023));module.exports=c})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/alerts/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"1461":{"*":{"id":"86673","name":"*","chunks":[],"async":false}},"1721":{"*":{"id":"40015","name":"*","chunks":[],"async":false}},"2394":{"*":{"id":"76670","name":"*","chunks":[],"async":false}},"2701":{"*":{"id":"7867","name":"*","chunks":[],"async":false}},"2737":{"*":{"id":"4833","name":"*","chunks":[],"async":false}},"2939":{"*":{"id":"81328","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"5000":{"*":{"id":"93022","name":"*","chunks":[],"async":false}},"5773":{"*":{"id":"71793","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"7044":{"*":{"id":"9479","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"7281":{"*":{"id":"81931","name":"*","chunks":[],"async":false}},"7339":{"*":{"id":"30847","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"8887":{"*":{"id":"85909","name":"*","chunks":[],"async":false}},"9939":{"*":{"id":"58910","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/triet/Project/rigscope/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/app/globals.css":{"id":1743,"name":"*","chunks":["939","static/chunks/939-514e554087419c71.js","177","static/chunks/app/layout-4feff677c4071745.js"],"async":false},"/home/triet/Project/rigscope/src/components/theme-provider.tsx":{"id":2737,"name":"*","chunks":["939","static/chunks/939-514e554087419c71.js","177","static/chunks/app/layout-4feff677c4071745.js"],"async":false},"/home/triet/Project/rigscope/src/live/live-provider.tsx":{"id":9939,"name":"*","chunks":["939","static/chunks/939-514e554087419c71.js","177","static/chunks/app/layout-4feff677c4071745.js"],"async":false},"/home/triet/Project/rigscope/src/components/admin/administration-view.tsx":{"id":7044,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/alerts/alerts-view.tsx":{"id":1461,"name":"*","chunks":["157","static/chunks/157-0d36ebf66af048ac.js","939","static/chunks/939-514e554087419c71.js","103","static/chunks/103-c47318242b24e9ac.js","484","static/chunks/app/alerts/page-fe0e877778c60af8.js"],"async":false},"/home/triet/Project/rigscope/src/components/resources/connections-panels.tsx":{"id":5773,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/login-view.tsx":{"id":5000,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/history/history-view.tsx":{"id":2939,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/machine-navigation.tsx":{"id":1721,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/shell/sidebar.tsx":{"id":2701,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/theme-toggle.tsx":{"id":2394,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/fleet-view.tsx":{"id":7281,"name":"*","chunks":["157","static/chunks/157-0d36ebf66af048ac.js","939","static/chunks/939-514e554087419c71.js","103","static/chunks/103-c47318242b24e9ac.js","227","static/chunks/227-417939c480f50747.js","974","static/chunks/app/page-1ae9fc94c897785b.js"],"async":false},"/home/triet/Project/rigscope/src/components/processes/processes-view.tsx":{"id":7339,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/machine-view.tsx":{"id":8887,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/triet/Project/rigscope/src/":[],"/home/triet/Project/rigscope/src/app/layout":[{"inlined":false,"path":"static/css/3fbf75e4c471c6a8.css"}],"/home/triet/Project/rigscope/src/app/page":[],"/home/triet/Project/rigscope/src/app/alerts/page":[]},"rscModuleMapping":{"484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"1461":{"*":{"id":"29953","name":"*","chunks":[],"async":false}},"1721":{"*":{"id":"28565","name":"*","chunks":[],"async":false}},"1743":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"2394":{"*":{"id":"46568","name":"*","chunks":[],"async":false}},"2701":{"*":{"id":"50369","name":"*","chunks":[],"async":false}},"2737":{"*":{"id":"65223","name":"*","chunks":[],"async":false}},"2939":{"*":{"id":"79173","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"5000":{"*":{"id":"52604","name":"*","chunks":[],"async":false}},"5773":{"*":{"id":"37147","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"7044":{"*":{"id":"2902","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"7281":{"*":{"id":"22993","name":"*","chunks":[],"async":false}},"7339":{"*":{"id":"89893","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"8887":{"*":{"id":"73132","name":"*","chunks":[],"async":false}},"9939":{"*":{"id":"89604","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/alerts/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"1461":{"*":{"id":"86673","name":"*","chunks":[],"async":false}},"1721":{"*":{"id":"40015","name":"*","chunks":[],"async":false}},"2394":{"*":{"id":"76670","name":"*","chunks":[],"async":false}},"2701":{"*":{"id":"7867","name":"*","chunks":[],"async":false}},"2737":{"*":{"id":"4833","name":"*","chunks":[],"async":false}},"2939":{"*":{"id":"81328","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"5000":{"*":{"id":"93022","name":"*","chunks":[],"async":false}},"5773":{"*":{"id":"71793","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"7044":{"*":{"id":"9479","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"7281":{"*":{"id":"81931","name":"*","chunks":[],"async":false}},"7339":{"*":{"id":"30847","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"8887":{"*":{"id":"85909","name":"*","chunks":[],"async":false}},"9939":{"*":{"id":"58910","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/home/triet/Project/rigscope/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7123,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/client-page.js":{"id":1304,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/client-segment.js":{"id":8616,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":4777,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/layout-router.js":{"id":7121,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":4581,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":484,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":6869,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/app/globals.css":{"id":1743,"name":"*","chunks":["939","static/chunks/939-514e554087419c71.js","177","static/chunks/app/layout-4feff677c4071745.js"],"async":false},"/home/triet/Project/rigscope/src/components/theme-provider.tsx":{"id":2737,"name":"*","chunks":["939","static/chunks/939-514e554087419c71.js","177","static/chunks/app/layout-4feff677c4071745.js"],"async":false},"/home/triet/Project/rigscope/src/live/live-provider.tsx":{"id":9939,"name":"*","chunks":["939","static/chunks/939-514e554087419c71.js","177","static/chunks/app/layout-4feff677c4071745.js"],"async":false},"/home/triet/Project/rigscope/src/components/admin/administration-view.tsx":{"id":7044,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/alerts/alerts-view.tsx":{"id":1461,"name":"*","chunks":["157","static/chunks/157-0d36ebf66af048ac.js","939","static/chunks/939-514e554087419c71.js","103","static/chunks/103-13ec30dcc059b9d3.js","484","static/chunks/app/alerts/page-2548b2ab0c057953.js"],"async":false},"/home/triet/Project/rigscope/src/components/resources/connections-panels.tsx":{"id":5773,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/history/history-view.tsx":{"id":2939,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/machine-navigation.tsx":{"id":1721,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/shell/sidebar.tsx":{"id":2701,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/theme-toggle.tsx":{"id":2394,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/login-view.tsx":{"id":5000,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/machine-view.tsx":{"id":8887,"name":"*","chunks":[],"async":false},"/home/triet/Project/rigscope/src/components/live/fleet-view.tsx":{"id":7281,"name":"*","chunks":["157","static/chunks/157-0d36ebf66af048ac.js","939","static/chunks/939-514e554087419c71.js","103","static/chunks/103-13ec30dcc059b9d3.js","130","static/chunks/130-e940915010276f88.js","974","static/chunks/app/page-c68554c93016dd13.js"],"async":false},"/home/triet/Project/rigscope/src/components/processes/processes-view.tsx":{"id":7339,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/home/triet/Project/rigscope/src/":[],"/home/triet/Project/rigscope/src/app/layout":[{"inlined":false,"path":"static/css/fb3ad9534f4681e6.css"}],"/home/triet/Project/rigscope/src/app/page":[],"/home/triet/Project/rigscope/src/app/alerts/page":[]},"rscModuleMapping":{"484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"1304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"1461":{"*":{"id":"29953","name":"*","chunks":[],"async":false}},"1721":{"*":{"id":"28565","name":"*","chunks":[],"async":false}},"1743":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"2394":{"*":{"id":"46568","name":"*","chunks":[],"async":false}},"2701":{"*":{"id":"50369","name":"*","chunks":[],"async":false}},"2737":{"*":{"id":"65223","name":"*","chunks":[],"async":false}},"2939":{"*":{"id":"79173","name":"*","chunks":[],"async":false}},"4581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"4777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"5000":{"*":{"id":"52604","name":"*","chunks":[],"async":false}},"5773":{"*":{"id":"37147","name":"*","chunks":[],"async":false}},"6869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"7044":{"*":{"id":"2902","name":"*","chunks":[],"async":false}},"7121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"7123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"7281":{"*":{"id":"22993","name":"*","chunks":[],"async":false}},"7339":{"*":{"id":"89893","name":"*","chunks":[],"async":false}},"8616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"8887":{"*":{"id":"73132","name":"*","chunks":[],"async":false}},"9939":{"*":{"id":"89604","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/3fbf75e4c471c6a8.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js"/><script src="/_next/static/chunks/4bd1b696-c7408084347438ae.js" async=""></script><script src="/_next/static/chunks/794-ceeb732a1a81bc27.js" async=""></script><script src="/_next/static/chunks/main-app-f92328c8950d2e53.js" async=""></script><script src="/_next/static/chunks/939-514e554087419c71.js" async=""></script><script src="/_next/static/chunks/app/layout-4feff677c4071745.js" async=""></script><script src="/_next/static/chunks/157-0d36ebf66af048ac.js" async=""></script><script src="/_next/static/chunks/103-c47318242b24e9ac.js" async=""></script><script src="/_next/static/chunks/app/alerts/page-fe0e877778c60af8.js" async=""></script><title>Alerts — Rigscope</title><meta name="description" content="Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub."/><link rel="icon" href="/icon.svg?3b3fa3229e2d0d7a" type="image/svg+xml" sizes="any"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","dark",null,["light","dark"],null,true,true)</script><div class="relative flex h-dvh overflow-hidden bg-background text-foreground"><a href="#main-content" class="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">Skip to content</a><aside class="flex w-14 shrink-0 flex-col border-r border-border bg-card md:w-56"><a aria-label="Rigscope" class="flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-3 md:px-5" href="/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="h-5 w-5 shrink-0 text-accent"><path d="M8 3H4v18h4M16 3h4v18h-4"></path><path d="m8 15 4-6 4 3M8 8h.01M16 17h.01"></path></svg><span class="hidden text-sm font-semibold tracking-tight text-foreground md:inline">Rigscope</span></a><nav aria-label="Primary" class="flex min-h-0 flex-1 flex-col overflow-y-auto p-2 md:p-3"><a title="Fleet" class="flex min-h-9 min-w-0 items-center gap-3 rounded-md px-2 text-sm transition-colors md:px-3 text-muted-foreground hover:bg-card-strong hover:text-foreground" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server h-4 w-4 shrink-0" aria-hidden="true"><rect width="20" height="8" x="2" y="2" rx="2" ry="2"></rect><rect width="20" height="8" x="2" y="14" rx="2" ry="2"></rect><line x1="6" x2="6.01" y1="6" y2="6"></line><line x1="6" x2="6.01" y1="18" y2="18"></line></svg><span class="hidden md:inline">Fleet</span></a><div class="flex flex-col gap-1 border-t border-border pt-3"><a aria-current="page" title="Alerts" class="flex min-h-9 min-w-0 items-center gap-3 rounded-md px-2 text-sm transition-colors md:px-3 bg-selected font-medium text-foreground" href="/alerts"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bell h-4 w-4 shrink-0" aria-hidden="true"><path d="M10.268 21a2 2 0 0 0 3.464 0"></path><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"></path></svg><span class="hidden md:inline">Alerts</span></a><a title="Connections" class="flex min-h-9 min-w-0 items-center gap-3 rounded-md px-2 text-sm transition-colors md:px-3 text-muted-foreground hover:bg-card-strong hover:text-foreground" href="/connections"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cable h-4 w-4 shrink-0" aria-hidden="true"><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"></path><path d="M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9"></path><path d="M21 21v-2h-4"></path><path d="M3 5h4V3"></path><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"></path></svg><span class="hidden md:inline">Connections</span></a></div></nav><footer class="hidden shrink-0 border-t border-border p-3 md:block"><div class="flex items-center gap-2 px-3 text-xs"><span class="inline-block h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50" aria-hidden="true"></span><span class="truncate" role="status" aria-label="Live feed status: Checking session…">Checking session…</span></div></footer></aside><div class="flex min-w-0 flex-1 flex-col"><header class="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"><h1 class="truncate text-lg font-semibold tracking-tight">Alerts</h1><div class="flex items-center gap-3"><div class="flex min-w-0 items-center gap-3"><div role="status" aria-label="Live feed status: Checking session…" class="flex min-w-0 items-center gap-2"><span class="inline-block h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50" aria-hidden="true"></span><span class="tnum truncate text-xs text-muted-foreground">Checking session…</span></div></div><button type="button" aria-label="Toggle theme" class="flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-selected hover:text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun h-4.5 w-4.5 dark:hidden"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2"></path><path d="M12 20v2"></path><path d="m4.93 4.93 1.41 1.41"></path><path d="m17.66 17.66 1.41 1.41"></path><path d="M2 12h2"></path><path d="M20 12h2"></path><path d="m6.34 17.66-1.41 1.41"></path><path d="m19.07 4.93-1.41 1.41"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon hidden h-4.5 w-4.5 dark:block"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></button></div></header><main id="main-content" tabindex="-1" class="relative min-h-0 min-w-0 flex-1 overflow-x-hidden overscroll-contain p-4 outline-offset-[-2px] md:p-6 overflow-y-auto"><div class="mx-auto flex w-full min-w-0 max-w-[1500px] flex-col"><section class="flex min-w-0 flex-col rounded-xl border border-border bg-card p-5 mx-auto my-12 max-w-md"><div class="flex shrink-0 items-center justify-between gap-4"><h2 class="text-sm font-medium tracking-tight">Checking session</h2></div><div class="mt-4 flex min-h-0 flex-1 flex-col"><div class="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"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user-round h-5 w-5 text-muted-foreground" aria-hidden="true"><circle cx="12" cy="8" r="5"></circle><path d="M20 21a8 8 0 0 0-16 0"></path></svg><p class="text-sm text-muted-foreground">Checking your session…</p></div></div></section></div></main></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:\"static/chunks/939-514e554087419c71.js\"\n3:\"static/chunks/app/layout-4feff677c4071745.js\"\n4:I[2737,[\"939\",\"$2\",\"177\",\"$3\"],\"ThemeProvider\"]\n5:I[9939,[\"939\",\"$2\",\"177\",\"$3\"],\"LiveProvider\"]\n6:I[7121,[],\"\"]\n7:I[4581,[],\"\"]\nb:\"static/chunks/157-0d36ebf66af048ac.js\"\nc:\"static/chunks/103-c47318242b24e9ac.js\"\nd:\"static/chunks/app/alerts/page-fe0e877778c60af8.js\"\ne:I[1461,[\"157\",\"$b\",\"939\",\"$2\",\"103\",\"$c\",\"484\",\"$d\"],\"AlertsView\"]\nf:I[484,[],\"OutletBoundary\"]\n10:\"$Sreact.suspense\"\n12:\"ViewportBoundary\"\n13:I[484,[],\"$12\"]\n15:\"MetadataBoundary\"\n16:I[484,[],\"$15\"]\n18:I[7123,[],\"default\",1]\n:HL[\"/_next/static/css/3fbf75e4c471c6a8.css\",\"style\"]\n9:X\na:[[\"children\",{\"s\":\"__PAGE__\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Le\",null,{}],null,[\"$\",\"$Lf\",null,{\"children\":[\"$\",\"$10\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@11\"}]}]]}],\"p\":false,\"v\":null}}]]\n8:[[\"children\",{\"s\":\"alerts\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$9\"},\"c\":\"$Qa\"}]]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"alerts\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/3fbf75e4c471c6a8.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L4\",null,{\"attribute\":\"class\",\"defaultTheme\":\"dark\",\"enableSystem\":true,\"children\":[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]}]]}],\"p\":false,\"v\":null},\"c\":\"$Q8\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L13\",null,{\"children\":\"$L14\"}],[\"$\",\"$L16\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$10\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L17\"}]}],null]}],null]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$18\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"xjSDCOO8Gpm5iPO9tyRG5\"}\n"])</script><script>self.__next_f.push([1,"9:C\n14:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"19:I[6869,[],\"IconMark\"]\n11:null\n17:[[\"$\",\"title\",\"0\",{\"children\":\"Alerts — Rigscope\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?3b3fa3229e2d0d7a\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$L19\",\"3\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/fb3ad9534f4681e6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js"/><script src="/_next/static/chunks/4bd1b696-c7408084347438ae.js" async=""></script><script src="/_next/static/chunks/794-ceeb732a1a81bc27.js" async=""></script><script src="/_next/static/chunks/main-app-f92328c8950d2e53.js" async=""></script><script src="/_next/static/chunks/939-514e554087419c71.js" async=""></script><script src="/_next/static/chunks/app/layout-4feff677c4071745.js" async=""></script><script src="/_next/static/chunks/157-0d36ebf66af048ac.js" async=""></script><script src="/_next/static/chunks/103-13ec30dcc059b9d3.js" async=""></script><script src="/_next/static/chunks/app/alerts/page-2548b2ab0c057953.js" async=""></script><title>Alerts — Rigscope</title><meta name="description" content="Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub."/><link rel="icon" href="/icon.svg?3b3fa3229e2d0d7a" type="image/svg+xml" sizes="any"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","dark",null,["light","dark"],null,true,true)</script><div class="relative flex h-dvh overflow-hidden bg-background text-foreground"><a href="#main-content" class="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">Skip to content</a><aside class="flex w-14 shrink-0 flex-col border-r border-border bg-background md:w-56"><a aria-label="Rigscope" class="flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-3 md:px-5" href="/"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="h-5 w-5 shrink-0 text-accent"><path d="M8 3H4v18h4M16 3h4v18h-4"></path><path d="m8 15 4-6 4 3M8 8h.01M16 17h.01"></path></svg><span class="hidden text-sm font-semibold tracking-tight text-foreground md:inline">Rigscope</span></a><nav aria-label="Primary" class="flex min-h-0 flex-1 flex-col overflow-y-auto p-2 md:p-3"><a title="Fleet" aria-label="Fleet" class="flex min-h-9 min-w-0 items-center gap-3 rounded-md border px-2 text-sm transition-colors md:px-3 border-transparent text-muted-foreground hover:bg-card-strong hover:text-foreground" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server h-4 w-4 shrink-0" aria-hidden="true"><rect width="20" height="8" x="2" y="2" rx="2" ry="2"></rect><rect width="20" height="8" x="2" y="14" rx="2" ry="2"></rect><line x1="6" x2="6.01" y1="6" y2="6"></line><line x1="6" x2="6.01" y1="18" y2="18"></line></svg><span class="hidden md:inline">Fleet</span></a><div class="flex shrink-0 flex-col gap-1 border-t border-border pt-3"><a aria-current="page" title="Alerts" aria-label="Alerts" class="flex min-h-9 min-w-0 items-center gap-3 rounded-md border px-2 text-sm transition-colors md:px-3 border-accent/60 bg-selected font-medium text-foreground" href="/alerts"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bell h-4 w-4 shrink-0" aria-hidden="true"><path d="M10.268 21a2 2 0 0 0 3.464 0"></path><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"></path></svg><span class="hidden md:inline">Alerts</span></a><a title="Connections" aria-label="Connections" class="flex min-h-9 min-w-0 items-center gap-3 rounded-md border px-2 text-sm transition-colors md:px-3 border-transparent text-muted-foreground hover:bg-card-strong hover:text-foreground" href="/connections"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cable h-4 w-4 shrink-0" aria-hidden="true"><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"></path><path d="M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9"></path><path d="M21 21v-2h-4"></path><path d="M3 5h4V3"></path><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"></path></svg><span class="hidden md:inline">Connections</span></a></div></nav><footer class="hidden shrink-0 border-t border-border p-3 md:block"><div class="flex items-center gap-2 px-3 text-xs"><span class="inline-block h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50" aria-hidden="true"></span><span class="truncate" role="status" aria-label="Live feed status: Checking session…">Checking session…</span></div></footer></aside><div class="flex min-w-0 flex-1 flex-col"><header class="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"><h1 class="truncate text-lg font-semibold tracking-tight">Alerts</h1><div class="flex items-center gap-3"><div class="flex min-w-0 items-center gap-3"><div role="status" aria-label="Live feed status: Checking session…" class="flex min-w-0 items-center gap-2"><span class="inline-block h-2 w-2 shrink-0 rounded-full bg-muted-foreground/50" aria-hidden="true"></span><span class="tnum truncate text-xs text-muted-foreground">Checking session…</span></div></div><button type="button" aria-label="Toggle theme" class="flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-selected hover:text-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun h-4.5 w-4.5 dark:hidden"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2"></path><path d="M12 20v2"></path><path d="m4.93 4.93 1.41 1.41"></path><path d="m17.66 17.66 1.41 1.41"></path><path d="M2 12h2"></path><path d="M20 12h2"></path><path d="m6.34 17.66-1.41 1.41"></path><path d="m19.07 4.93-1.41 1.41"></path></svg><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon hidden h-4.5 w-4.5 dark:block"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></button></div></header><main id="main-content" tabindex="-1" class="relative min-h-0 min-w-0 flex-1 overflow-x-hidden overscroll-contain p-4 outline-offset-[-2px] md:p-6 overflow-y-auto"><div class="mx-auto flex w-full min-w-0 max-w-[1500px] flex-col"><section class="flex min-w-0 flex-col rounded-xl border border-border bg-card p-5 mx-auto my-12 max-w-md"><div class="flex shrink-0 items-center justify-between gap-4"><h2 class="text-sm font-medium tracking-tight">Checking session</h2></div><div class="mt-4 flex min-h-0 flex-1 flex-col"><div class="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"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user-round h-5 w-5 text-muted-foreground" aria-hidden="true"><circle cx="12" cy="8" r="5"></circle><path d="M20 21a8 8 0 0 0-16 0"></path></svg><p class="text-sm text-muted-foreground">Checking your session…</p></div></div></section></div></main></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-9ca43f4ce1bb8938.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:\"static/chunks/939-514e554087419c71.js\"\n3:\"static/chunks/app/layout-4feff677c4071745.js\"\n4:I[2737,[\"939\",\"$2\",\"177\",\"$3\"],\"ThemeProvider\"]\n5:I[9939,[\"939\",\"$2\",\"177\",\"$3\"],\"LiveProvider\"]\n6:I[7121,[],\"\"]\n7:I[4581,[],\"\"]\nb:\"static/chunks/157-0d36ebf66af048ac.js\"\nc:\"static/chunks/103-13ec30dcc059b9d3.js\"\nd:\"static/chunks/app/alerts/page-2548b2ab0c057953.js\"\ne:I[1461,[\"157\",\"$b\",\"939\",\"$2\",\"103\",\"$c\",\"484\",\"$d\"],\"AlertsView\"]\nf:I[484,[],\"OutletBoundary\"]\n10:\"$Sreact.suspense\"\n12:\"ViewportBoundary\"\n13:I[484,[],\"$12\"]\n15:\"MetadataBoundary\"\n16:I[484,[],\"$15\"]\n18:I[7123,[],\"default\",1]\n:HL[\"/_next/static/css/fb3ad9534f4681e6.css\",\"style\"]\n9:X\na:[[\"children\",{\"s\":\"__PAGE__\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Le\",null,{}],null,[\"$\",\"$Lf\",null,{\"children\":[\"$\",\"$10\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@11\"}]}]]}],\"p\":false,\"v\":null}}]]\n8:[[\"children\",{\"s\":\"alerts\",\"h\":512,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$9\"},\"c\":\"$Qa\"}]]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"alerts\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/fb3ad9534f4681e6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L4\",null,{\"attribute\":\"class\",\"defaultTheme\":\"dark\",\"enableSystem\":true,\"children\":[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]}]]}],\"p\":false,\"v\":null},\"c\":\"$Q8\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L13\",null,{\"children\":\"$L14\"}],[\"$\",\"$L16\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$10\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L17\"}]}],null]}],null]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$18\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"oxwySrJXqXq8O6_7AzZGe\"}\n"])</script><script>self.__next_f.push([1,"9:C\n14:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"19:I[6869,[],\"IconMark\"]\n11:null\n17:[[\"$\",\"title\",\"0\",{\"children\":\"Alerts — Rigscope\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Self-hosted remote system monitor — a live fleet of collectors behind one authenticated hub.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?3b3fa3229e2d0d7a\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$L19\",\"3\",{}]]\n"])</script></body></html>
@@ -6,8 +6,8 @@
6
6
  6:I[7121,[],""]
7
7
  7:I[4581,[],""]
8
8
  b:"static/chunks/157-0d36ebf66af048ac.js"
9
- c:"static/chunks/103-c47318242b24e9ac.js"
10
- d:"static/chunks/app/alerts/page-fe0e877778c60af8.js"
9
+ c:"static/chunks/103-13ec30dcc059b9d3.js"
10
+ d:"static/chunks/app/alerts/page-2548b2ab0c057953.js"
11
11
  e:I[1461,["157","$b","939","$2","103","$c","484","$d"],"AlertsView"]
12
12
  f:I[484,[],"OutletBoundary"]
13
13
  10:"$Sreact.suspense"
@@ -16,11 +16,11 @@ f:I[484,[],"OutletBoundary"]
16
16
  15:"MetadataBoundary"
17
17
  16:I[484,[],"$15"]
18
18
  18:I[7123,[],"default",1]
19
- :HL["/_next/static/css/3fbf75e4c471c6a8.css","style"]
19
+ :HL["/_next/static/css/fb3ad9534f4681e6.css","style"]
20
20
  9:X
21
21
  a:[["children",{"s":"__PAGE__","h":512,"d":{"r":["$","$1","c",{"children":[["$","$Le",null,{}],null,["$","$Lf",null,{"children":["$","$10",null,{"name":"Next.MetadataOutlet","children":"$@11"}]}]]}],"p":false,"v":null}}]]
22
22
  8:[["children",{"s":"alerts","h":512,"d":{"r":["$","$1","c",{"children":[null,["$","$L6",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],"p":false,"v":"$9"},"c":"$Qa"}]]
23
- 0:{"P":null,"c":["","alerts"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/3fbf75e4c471c6a8.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"children":["$","$L4",null,{"attribute":"class","defaultTheme":"dark","enableSystem":true,"children":["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L13",null,{"children":"$L14"}],["$","$L16",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$10",null,{"name":"Next.Metadata","children":"$L17"}]}],null]}],null]}],"p":false,"v":null}},"m":"$undefined","G":["$18",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"xjSDCOO8Gpm5iPO9tyRG5"}
23
+ 0:{"P":null,"c":["","alerts"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/fb3ad9534f4681e6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"children":["$","$L4",null,{"attribute":"class","defaultTheme":"dark","enableSystem":true,"children":["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L13",null,{"children":"$L14"}],["$","$L16",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$10",null,{"name":"Next.Metadata","children":"$L17"}]}],null]}],null]}],"p":false,"v":null}},"m":"$undefined","G":["$18",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"oxwySrJXqXq8O6_7AzZGe"}
24
24
  9:C
25
25
  14:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
26
26
  19:I[6869,[],"IconMark"]
@@ -6,8 +6,8 @@
6
6
  6:I[7121,[],""]
7
7
  7:I[4581,[],""]
8
8
  b:"static/chunks/157-0d36ebf66af048ac.js"
9
- c:"static/chunks/103-c47318242b24e9ac.js"
10
- d:"static/chunks/app/alerts/page-fe0e877778c60af8.js"
9
+ c:"static/chunks/103-13ec30dcc059b9d3.js"
10
+ d:"static/chunks/app/alerts/page-2548b2ab0c057953.js"
11
11
  e:I[1461,["157","$b","939","$2","103","$c","484","$d"],"AlertsView"]
12
12
  f:I[484,[],"OutletBoundary"]
13
13
  10:"$Sreact.suspense"
@@ -16,11 +16,11 @@ f:I[484,[],"OutletBoundary"]
16
16
  15:"MetadataBoundary"
17
17
  16:I[484,[],"$15"]
18
18
  18:I[7123,[],"default",1]
19
- :HL["/_next/static/css/3fbf75e4c471c6a8.css","style"]
19
+ :HL["/_next/static/css/fb3ad9534f4681e6.css","style"]
20
20
  9:X
21
21
  a:[["children",{"s":"__PAGE__","h":512,"d":{"r":["$","$1","c",{"children":[["$","$Le",null,{}],null,["$","$Lf",null,{"children":["$","$10",null,{"name":"Next.MetadataOutlet","children":"$@11"}]}]]}],"p":false,"v":null}}]]
22
22
  8:[["children",{"s":"alerts","h":512,"d":{"r":["$","$1","c",{"children":[null,["$","$L6",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],"p":false,"v":"$9"},"c":"$Qa"}]]
23
- 0:{"P":null,"c":["","alerts"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/3fbf75e4c471c6a8.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"children":["$","$L4",null,{"attribute":"class","defaultTheme":"dark","enableSystem":true,"children":["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L13",null,{"children":"$L14"}],["$","$L16",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$10",null,{"name":"Next.Metadata","children":"$L17"}]}],null]}],null]}],"p":false,"v":null}},"m":"$undefined","G":["$18",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"xjSDCOO8Gpm5iPO9tyRG5"}
23
+ 0:{"P":null,"c":["","alerts"],"q":"","i":false,"t":{"t":{"s":"","h":528,"d":{"r":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/fb3ad9534f4681e6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":["$","body",null,{"children":["$","$L4",null,{"attribute":"class","defaultTheme":"dark","enableSystem":true,"children":["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]}]]}],"p":false,"v":null},"c":"$Q8"},"h":{"r":["$","$1","h",{"children":[null,["$","$L13",null,{"children":"$L14"}],["$","$L16",null,{"children":[["$","div",null,{"hidden":true,"children":["$","$10",null,{"name":"Next.Metadata","children":"$L17"}]}],null]}],null]}],"p":false,"v":null}},"m":"$undefined","G":["$18",[]],"S":true,"r":"$undefined","s":"$undefined","a":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"oxwySrJXqXq8O6_7AzZGe"}
24
24
  9:C
25
25
  14:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
26
26
  19:I[6869,[],"IconMark"]
@@ -1,4 +1,4 @@
1
- :HL["/_next/static/css/3fbf75e4c471c6a8.css","style"]
1
+ :HL["/_next/static/css/fb3ad9534f4681e6.css","style"]
2
2
  2:[["children",{"s":"__PAGE__","h":160}]]
3
3
  1:[["children",{"s":"alerts","h":96,"c":"$Q2"}]]
4
- 0:{"b":"xjSDCOO8Gpm5iPO9tyRG5","t":{"t":{"s":"","h":80,"c":"$Q1"}}}
4
+ 0:{"b":"oxwySrJXqXq8O6_7AzZGe","t":{"t":{"s":"","h":80,"c":"$Q1"}}}