@miravo/cli-linux-arm64-musl 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console-dist/assets/{api-DPmCeS_C.js → api-CrYvIV3A.js} +1 -1
- package/console-dist/assets/catalog-CMdsHJtX.js +1 -0
- package/console-dist/assets/catalog-DCLloXKb.js +1 -0
- package/console-dist/assets/catalog-source-B3vWR4vX.js +1 -0
- package/console-dist/assets/control-6TWF0ywx.js +1 -0
- package/console-dist/assets/{control-Doh5s9U2.js → control-C_0G31vu.js} +1 -1
- package/console-dist/assets/{events-DAKmlfl3.js → events--facGImw.js} +1 -1
- package/console-dist/assets/events-D7PCqbvy.js +1 -0
- package/console-dist/assets/fleet-DmMO3ebD.js +1 -0
- package/console-dist/assets/{fleet-jLriF31S.js → fleet-anqPXBbM.js} +1 -1
- package/console-dist/assets/{get-error-message-Btp63MTs.js → get-error-message-BgE2BpPG.js} +1 -1
- package/console-dist/assets/index-BNGYKshE.css +2 -0
- package/console-dist/assets/{index-0cZ4jnjm.js → index-Dmyw65xM.js} +3 -3
- package/console-dist/assets/{instance-detail-CDT9PHVw.js → instance-detail-CDK2JYdW.js} +1 -1
- package/console-dist/assets/{login-Cs-sBvVA.js → login-H82N0S2O.js} +1 -1
- package/console-dist/assets/models-B7FNHSvb.js +1 -0
- package/console-dist/assets/models-Bmif9sIG.js +1 -0
- package/console-dist/assets/platforms-DGpl5tPh.js +1 -0
- package/console-dist/assets/platforms-Djfu2pyM.js +1 -0
- package/console-dist/assets/{query-fetch-error-C-7x_NhM.js → query-fetch-error-BWenDoLQ.js} +1 -1
- package/console-dist/assets/{route-preload-cBwnl6Y_.js → route-preload-CLRbqehb.js} +2 -2
- package/console-dist/assets/tags-dBHY56Fz.js +1 -0
- package/console-dist/assets/{tags-KxhNEiLb.js → tags-zenGXuzO.js} +1 -1
- package/console-dist/assets/{transition-nav-link-DVwZxiEL.js → transition-nav-link-BWSxzHUf.js} +1 -1
- package/console-dist/assets/{use-engine-command-mutation-iPA57YyA.js → use-engine-command-mutation-CT_3rCP3.js} +1 -1
- package/console-dist/assets/use-platform-stream-QBU2PAD2.js +2 -0
- package/console-dist/assets/{use-transition-navigate-CUOoK-a_.js → use-transition-navigate-Br9xwrqi.js} +1 -1
- package/console-dist/assets/{validation-XGNj2nVO.js → validation-pFKbjwNg.js} +1 -1
- package/console-dist/index.html +19 -19
- package/miravo +0 -0
- package/package.json +1 -1
- package/console-dist/assets/catalog-CFU1TdO9.js +0 -1
- package/console-dist/assets/catalog-DSNME88V.js +0 -1
- package/console-dist/assets/catalog-source-ChUAD0NL.js +0 -1
- package/console-dist/assets/control-Cl3BCzup.js +0 -1
- package/console-dist/assets/events-9ouwtfN4.js +0 -1
- package/console-dist/assets/fleet-C5IPKrdf.js +0 -1
- package/console-dist/assets/index-D1lU9Fg9.css +0 -2
- package/console-dist/assets/models-D_OCpWPE.js +0 -1
- package/console-dist/assets/models-NVvJNhiz.js +0 -1
- package/console-dist/assets/platforms-BNTV1g6K.js +0 -1
- package/console-dist/assets/platforms-D024zTxj.js +0 -1
- package/console-dist/assets/tags-BTciN0-X.js +0 -1
- package/console-dist/assets/use-platform-stream-8tr6SVec.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{S as r,b as i,o as a,x as o}from"./api-DPmCeS_C.js";import{i as s,n as c}from"./dist-xY0pK9Wy.js";import{c as l,n as u}from"./chunk-OE4NN4TA-DBWZidbW.js";import{t as d}from"./shallow-Cin0mLuv.js";import{c as f,d as p,g as m,l as h,p as ee,s as g,u as _,v as te,w as ne,x as re,y as v}from"./format-CshN6yEB.js";import{t as y}from"./utils-XFKvwlFT.js";import{t as b}from"./arrow-right-BjBb4z7g.js";import{t as x}from"./arrow-up-down-C1oJAmrw.js";import{c as S,i as C,n as w,s as T,t as E}from"./select-CmlY1M1a.js";import{t as ie}from"./circle-question-mark-CJvcT6V6.js";import{i as D,n as O,t as k}from"./tooltip-D1ydB4g3.js";import{r as A}from"./engine-store-DMULdR_V.js";import{t as j}from"./route-preload-cBwnl6Y_.js";import{t as ae}from"./badge-eIn_7YrK.js";import{n as oe}from"./transition-types-2i1blGlR.js";import{a as se,i as ce,n as le,o as ue,r as de,s as fe,t as pe}from"./combobox-BCaV1Wbo.js";import{a as M,c as N,i as me,n as he,o as P,r as ge,s as _e}from"./select-display-items-Bqb6Sbg6.js";var F=e(t(),1);function I(e){return o.prefetchQuery({queryKey:i.instances.detail(e),queryFn:()=>a(`/instances/${e}`,r.instanceDetail),staleTime:2e3})}var L=n(),R={success:`bg-success`,warning:`bg-warning`,destructive:`bg-destructive`,foreground:`bg-foreground/60`,primary:`bg-primary`},z={success:`text-success`,warning:`text-warning`,destructive:`text-destructive`,foreground:`text-foreground`,primary:`text-primary`},B={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus`};function V({label:e,pip:t,pulse:n}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t&&(n?(0,L.jsxs)(`span`,{"aria-hidden":!0,className:`relative flex size-1.5 shrink-0 items-center justify-center`,children:[(0,L.jsx)(`span`,{className:y(`absolute inline-flex h-full w-full animate-ping rounded-full opacity-75`,R[t])}),(0,L.jsx)(`span`,{className:y(`relative inline-flex size-1.5 rounded-full`,R[t])})]}):(0,L.jsx)(`span`,{"aria-hidden":!0,className:y(`size-1.5 shrink-0 rounded-full`,R[t])})),(0,L.jsx)(`span`,{className:`truncate text-[10px] font-medium uppercase tracking-(--miravo-tracking-eyebrow) text-muted-foreground`,children:e})]})}function H({children:e,tone:t=`foreground`,live:n}){return(0,L.jsx)(`span`,{...n?{role:`status`,"aria-live":`polite`}:{},className:y(`mt-1 block min-w-0 truncate font-mono text-2xl font-semibold tabular-nums leading-none transition-colors duration-300`,z[t]),children:e})}function U({children:e}){return(0,L.jsx)(`span`,{className:`mt-1 min-w-0 truncate text-[10px] text-muted-foreground`,children:e})}function W(e,t){return e===t?``:t}function ve({statusFilter:e,onStatusFilter:t}){let{instances:n,tps:r,memberValueCount:i,availableAdapters:a,adapterMetrics:o}=A(d(e=>({instances:e.instances,tps:e.tps,memberValueCount:e.memberValueCount,availableAdapters:e.availableAdapters,adapterMetrics:e.adapterMetrics}))),s=(0,F.useMemo)(()=>{let e=n.filter(e=>!e.isQuarantined&&e.activeFaults.length===0).length,t=n.filter(e=>!e.isQuarantined&&e.activeFaults.length>0).length,r=n.filter(e=>e.isQuarantined).length,i=n.length;return{healthy:e,faulted:t,quarantined:r,total:i,pct:i>0?Math.round(e/i*100):100,activeFaultCount:n.reduce((e,t)=>e+t.activeFaults.length,0),modelCount:new Set(n.map(e=>e.model)).size,affectedCount:new Set(n.filter(e=>e.activeFaults.length>0).map(e=>e.id)).size}},[n]),c=(0,F.useMemo)(()=>{let e=a.filter(e=>e.enabled);return{enabled:e,totalMessages:e.reduce((e,t)=>e+(o.find(e=>e.name===t.name)?.metrics?.messagesPublished??0),0),totalErrors:e.reduce((e,t)=>e+(o.find(e=>e.name===t.name)?.metrics?.errorsCount??0),0),labels:e.map(e=>B[e.name]??e.name)}},[a,o]),l=s.activeFaultCount>0,f=l?`destructive`:s.quarantined>0?`warning`:`success`,m=l?`faulted`:`healthy`;return(0,L.jsxs)(`section`,{"aria-label":`Fleet status`,className:`flex w-full min-w-0 max-w-full flex-col divide-y divide-border/40 overflow-hidden rounded-(--miravo-radius-stadium-sm) border sm:flex-row sm:divide-x sm:divide-y-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(W(e,m)),"aria-pressed":e===`healthy`||e===`faulted`,"aria-label":l?`Filter to faulted instances`:`Filter to healthy instances`,className:y(`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 text-left outline-none transition-colors duration-150`,`hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,(e===`healthy`||e===`faulted`)&&`bg-muted/50`),children:[(0,L.jsx)(V,{label:`Health`,pip:f}),(0,L.jsxs)(H,{tone:l?`destructive`:`success`,children:[s.pct,`%`]}),(0,L.jsx)(U,{children:s.total===0?`No instances`:[`${s.total} instance${s.total===1?``:`s`}`,s.faulted>0&&`${s.faulted} faulted`,s.quarantined>0&&`${s.quarantined} quarantined`,`${s.modelCount} model${s.modelCount===1?``:`s`}`].filter(Boolean).join(` · `)})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e===`faulted`?``:`faulted`),"aria-pressed":e===`faulted`,"aria-label":`Filter to faulted instances`,className:y(`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 text-left outline-none transition-colors duration-150`,`hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,e===`faulted`&&`bg-muted/50`),children:[(0,L.jsx)(V,{label:`Faults`,pip:l?`destructive`:`success`}),(0,L.jsx)(H,{tone:l?`destructive`:`foreground`,live:!0,children:s.activeFaultCount}),(0,L.jsx)(U,{children:l?`${s.affectedCount} instance${s.affectedCount===1?``:`s`} affected`:`all clear`})]}),(0,L.jsxs)(k,{children:[(0,L.jsxs)(D,{render:(0,L.jsx)(u,{to:`/tags`,"aria-label":`Open tag stream`,className:`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 outline-none transition-colors duration-150 hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`}),children:[(0,L.jsx)(V,{label:`Tags`,pip:`primary`,pulse:!0}),(0,L.jsx)(H,{children:p(i)}),(0,L.jsxs)(U,{children:[(0,L.jsx)(`span`,{className:`font-mono tabular-nums`,children:r.toFixed(1)}),` tps · live`]})]}),(0,L.jsx)(O,{side:`bottom`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-[11px]`,children:[(0,L.jsx)(`span`,{children:`Live tags tracked across the fleet.`}),i>=1e6&&(0,L.jsxs)(`span`,{className:`font-mono tabular-nums text-muted-foreground`,children:[h(i),` tags`]}),(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Updating at `,(0,L.jsx)(`span`,{className:`font-mono tabular-nums`,children:r.toFixed(1)}),` per second.`]})]})})]}),c.enabled.length>0&&(0,L.jsx)(G,{labels:c.labels,totalMessages:c.totalMessages,totalErrors:c.totalErrors,perAdapter:c.enabled.map(e=>({name:B[e.name]??e.name,metrics:o.find(t=>t.name===e.name)?.metrics}))})]})}function G({labels:e,totalMessages:t,totalErrors:n,perAdapter:r}){return(0,L.jsxs)(k,{children:[(0,L.jsxs)(D,{render:(0,L.jsx)(u,{to:`/control`,"aria-label":`Open control — protocol adapters`,className:`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 outline-none transition-colors duration-150 hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`}),children:[(0,L.jsx)(V,{label:`Protocol`,pip:`primary`,pulse:!0}),(0,L.jsx)(H,{tone:n>0?`warning`:`foreground`,live:!0,children:p(t)}),(0,L.jsxs)(U,{children:[e.join(` · `),n>0&&` · ${n} error${n===1?``:`s`}`]})]}),(0,L.jsx)(O,{side:`bottom`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 text-[11px]`,children:[(0,L.jsx)(`span`,{children:`Messages published since session start.`}),t>=1e6&&(0,L.jsxs)(`span`,{className:`font-mono tabular-nums text-muted-foreground`,children:[h(t),` total`]}),(0,L.jsx)(`div`,{className:`flex flex-col gap-0.5 border-t border-tooltip-border/60 pt-1`,children:r.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,L.jsxs)(`span`,{className:`font-mono tabular-nums`,children:[h(e.metrics?.messagesPublished??0),` msg`]}),e.metrics&&e.metrics.errorsCount>0&&(0,L.jsxs)(`span`,{className:`font-mono tabular-nums text-destructive`,children:[`· `,e.metrics.errorsCount,` err`]})]},e.name))})]})})]})}var K=`Commissioning → instance is running startup diagnostics. Operating → running normally. Decommissioning → winding down.`;function ye(e,t,n){let r=n===`asc`?1:-1;return[...e].sort((e,n)=>{switch(t){case`id`:return e.id.localeCompare(n.id)*r;case`model`:return e.model.localeCompare(n.model)*r;case`lifecycle`:return e.lifecycleStage.localeCompare(n.lifecycleStage)*r;case`hours`:return(e.operatingHours-n.operatingHours)*r;case`faults`:return(e.activeFaults.length-n.activeFaults.length)*r;case`status`:{let t=e=>e.isQuarantined?2:+(e.activeFaults.length>0);return(t(e)-t(n))*r}default:return 0}})}function be(e){return e===``||e===`healthy`||e===`faulted`||e===`quarantined`}function xe(e){return e.isQuarantined?`quarantined`:e.activeFaults.length>0?`faulted`:`healthy`}var q={healthy:{pip:`bg-success`,ring:`border-success/40 text-success`,label:`healthy`,help:`No active faults, not quarantined.`},faulted:{pip:`bg-warning`,ring:`border-warning/40 text-warning`,label:`faulted`,help:`One or more active faults; instance is still running.`},quarantined:{pip:`bg-destructive`,ring:`border-destructive/40 text-destructive`,label:`quarantined`,help:`Instance isolated from production flows pending review.`}};function Se({state:e}){let t=q[e];return(0,L.jsxs)(k,{children:[(0,L.jsxs)(D,{render:(0,L.jsx)(`span`,{className:y(`inline-flex h-5 items-center gap-1.5 rounded-(--miravo-radius-pill) border bg-background/30 px-2 text-[11px] font-medium`,t.ring)}),children:[(0,L.jsx)(`span`,{"aria-hidden":!0,className:y(`size-1.5 shrink-0 rounded-full`,t.pip)}),(0,L.jsx)(`span`,{children:g(t.label)})]}),(0,L.jsx)(O,{side:`top`,children:t.help})]})}function J({label:e,sortKey:t,subtitle:n,tooltip:r,current:i,direction:a,onSort:o,className:s}){let c=i===t,l=c?a===`asc`?`ascending`:`descending`:`none`,u=(0,L.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 whitespace-nowrap rounded-(--miravo-radius-tight) text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,onClick:()=>o(t),children:[(0,L.jsxs)(`span`,{className:`inline-flex items-baseline gap-1`,children:[(0,L.jsx)(`span`,{children:e}),n&&(0,L.jsx)(`span`,{className:`text-[10px] font-normal text-muted-foreground`,children:n})]}),(0,L.jsx)(x,{className:y(`size-3`,c?`text-foreground`:`text-muted-foreground`),"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`sr-only`,children:c?`, sorted ${a===`asc`?`ascending`:`descending`}. Click to toggle.`:`, click to sort`})]});return(0,L.jsx)(P,{className:s,"aria-sort":l,children:r?(0,L.jsxs)(k,{children:[(0,L.jsx)(D,{render:u}),(0,L.jsx)(O,{side:`top`,children:r})]}):u})}function Y({title:e,body:t,action:n}){return(0,L.jsx)(N,{children:(0,L.jsx)(M,{colSpan:7,className:`py-10`,children:(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-sm flex-col items-center gap-2 text-center`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),n&&(0,L.jsxs)(u,{to:n.href,className:`mt-1 inline-flex items-center gap-1 rounded-(--miravo-radius-tight) text-xs font-medium text-primary outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,children:[n.label,(0,L.jsx)(b,{className:`size-3`,"aria-hidden":!0})]})]})})})}function X(){let{instances:e,connectionState:t}=A(d(e=>({instances:e.instances,connectionState:e.connectionState}))),[n,r]=s(`q`,c.withDefault(``)),[i,a]=s(`model`,c.withDefault(``)),[o,u]=s(`lifecycle`,c.withDefault(``)),[p,h]=s(`status`,c.withDefault(``)),g=be(p)?p:``,[x,R]=(0,F.useState)(`id`),[z,B]=(0,F.useState)(`asc`),V=(0,F.useRef)(null),H=l(),[U,W]=(0,F.useState)(``);(0,F.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),V.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let G=(0,F.useCallback)(e=>{e===x?B(e=>e===`asc`?`desc`:`asc`):(R(e),B(`asc`))},[x]),q=(0,F.useCallback)(e=>{h(e===``?``:e)},[h]),X=(0,F.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.model,(t.get(n.model)??0)+1);return[...t.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[e]),Z=(0,F.useMemo)(()=>[...new Set(e.map(e=>e.lifecycleStage))].sort(),[e]),Ce=(0,F.useMemo)(()=>[{value:`all`,label:`All stages`},...Z.map(e=>({value:e,label:m(e)}))],[Z]),Q=(0,F.useMemo)(()=>U?X.filter(([e])=>v(e,U)):X,[X,U]),we=(0,F.useMemo)(()=>i?{value:i,label:_(i)}:null,[i]),$=(0,F.useMemo)(()=>{let t=e;return i&&(t=t.filter(e=>e.model===i)),o&&(t=t.filter(e=>e.lifecycleStage===o)),n&&(t=t.filter(e=>te(e.id,n)||v(e.model,n))),g===`faulted`&&(t=t.filter(e=>e.activeFaults.length>0)),g===`quarantined`&&(t=t.filter(e=>e.isQuarantined)),g===`healthy`&&(t=t.filter(e=>e.activeFaults.length===0&&!e.isQuarantined)),ye(t,x,z)},[e,n,g,i,o,x,z]),Te=g!==``||i!==``||o!==``||n!==``,Ee=(0,F.useCallback)(()=>{r(``),h(``),a(``),u(``)},[r,h,a,u]),De=(0,F.useCallback)(e=>{(0,F.startTransition)(()=>{(0,F.addTransitionType)(oe),H(`/instance/${e}`)})},[H]),Oe=e.length===0&&t!==`live`,ke=e.length===0&&t===`live`;return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,L.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Fleet Overview`}),(0,L.jsx)(ve,{statusFilter:g,onStatusFilter:q}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(pe,{value:we,onValueChange:e=>void a(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:W,children:[(0,L.jsx)(de,{placeholder:`All models`,className:`h-8 w-48`,showClear:!!i}),(0,L.jsx)(le,{children:(0,L.jsxs)(se,{children:[Q.map(([e,t])=>(0,L.jsxs)(ce,{value:{value:e,label:_(e)},children:[(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:_(e)}),(0,L.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),Q.length===0&&(0,L.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]}),Z.length>1&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsxs)(E,{value:o||`all`,onValueChange:e=>void u(!e||e===`all`?``:e),items:Ce,children:[(0,L.jsx)(T,{className:`h-8 w-36`,"aria-label":`Lifecycle stage`,children:(0,L.jsx)(S,{placeholder:`All stages`})}),(0,L.jsxs)(w,{alignItemWithTrigger:!1,align:`start`,children:[(0,L.jsx)(C,{value:`all`,children:`All stages`}),Z.map(e=>(0,L.jsx)(C,{value:e,children:m(e)},e))]})]}),(0,L.jsxs)(k,{children:[(0,L.jsx)(D,{render:(0,L.jsx)(`button`,{type:`button`,"aria-label":`About lifecycle stages`,className:`flex size-6 items-center justify-center rounded-(--miravo-radius-tight) text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`}),children:(0,L.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0})}),(0,L.jsx)(O,{side:`top`,children:K})]})]}),(0,L.jsxs)(E,{value:g||`all`,onValueChange:e=>void h(!e||e===`all`?``:e),items:he,children:[(0,L.jsx)(T,{className:`h-8 w-32`,"aria-label":`Status filter`,children:(0,L.jsx)(S,{placeholder:`All status`})}),(0,L.jsxs)(w,{alignItemWithTrigger:!1,align:`start`,children:[(0,L.jsx)(C,{value:`all`,children:`All status`}),(0,L.jsx)(C,{value:`healthy`,children:`Healthy`}),(0,L.jsx)(C,{value:`faulted`,children:`Faulted`}),(0,L.jsx)(C,{value:`quarantined`,children:`Quarantined`})]})]}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(re,{ref:V,placeholder:`Search...`,value:n,onChange:e=>void r(e.target.value),"aria-label":`Search instances by id or model`,className:`h-8 w-40 pr-7 text-xs`}),!n&&(0,L.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-(--miravo-radius-tight) border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),Te&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,onClick:Ee,className:`flex items-center gap-1 rounded-(--miravo-radius-tight) px-1 text-xs text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,L.jsx)(ne,{className:`size-3`,"aria-hidden":!0}),`Clear`]}),(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,"aria-live":`polite`,children:[$.length,` of `,e.length]})]})]}),(0,L.jsx)(ue,{className:`py-0`,children:(0,L.jsx)(fe,{className:`p-0 [&_thead_tr_th:last-child]:w-6 [&_thead_tr_th:last-child]:px-1 sm:[&_thead_tr_th:last-child]:w-8 sm:[&_thead_tr_th:last-child]:px-2 [&_tbody_tr_td:last-child]:px-1 sm:[&_tbody_tr_td:last-child]:px-2`,children:(0,L.jsxs)(ge,{children:[(0,L.jsx)(_e,{children:(0,L.jsxs)(N,{children:[(0,L.jsx)(J,{label:`Instance`,sortKey:`id`,current:x,direction:z,onSort:G}),(0,L.jsx)(J,{label:`Model`,sortKey:`model`,current:x,direction:z,onSort:G,className:`hidden sm:table-cell`}),(0,L.jsx)(J,{label:`Lifecycle`,sortKey:`lifecycle`,current:x,direction:z,onSort:G,tooltip:K}),(0,L.jsx)(J,{label:`Operating age`,sortKey:`hours`,current:x,direction:z,onSort:G,tooltip:`Cumulative operating hours since the instance started running.`,className:`hidden text-right md:table-cell`}),(0,L.jsx)(J,{label:`Faults`,sortKey:`faults`,current:x,direction:z,onSort:G,tooltip:`Count of active (uncleared) faults on this instance.`}),(0,L.jsx)(J,{label:`Status`,sortKey:`status`,current:x,direction:z,onSort:G}),(0,L.jsx)(P,{children:(0,L.jsx)(`span`,{className:`sr-only`,children:`Navigate to instance`})})]})}),(0,L.jsx)(me,{children:Oe?(0,L.jsx)(Y,{title:`Connecting to runtime`,body:`Live fleet data will appear once the connection is up.`}):ke?(0,L.jsx)(Y,{title:`No running instances`,body:`Start an environment from the Catalog to see instances.`,action:{label:`Open Catalog`,href:`/catalog`}}):$.length===0?(0,L.jsx)(Y,{title:`No matches`,body:`Adjust filters or clear them to see the full fleet.`}):$.map(e=>{let t=xe(e),n=f(e.id);return(0,L.jsxs)(N,{tabIndex:0,"aria-label":`Open instance ${n}`,className:y(`group cursor-pointer outline-none transition-colors`,`focus-visible:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-inset`),onClick:()=>De(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),De(e.id))},onMouseEnter:()=>{j(`/instance/${e.id}`),I(e.id)},onFocus:()=>{j(`/instance/${e.id}`),I(e.id)},children:[(0,L.jsx)(M,{className:`text-sm`,children:(0,L.jsx)(F.ViewTransition,{name:`instance-${e.id}`,default:`none`,children:(0,L.jsx)(`span`,{className:`inline-flex max-w-full rounded-(--miravo-radius-tight) text-left`,children:n})})}),(0,L.jsx)(M,{className:`hidden text-sm sm:table-cell`,children:_(e.model)}),(0,L.jsx)(M,{children:(0,L.jsx)(ae,{variant:`secondary`,className:`text-xs`,children:m(e.lifecycleStage)})}),(0,L.jsx)(M,{className:`hidden font-mono text-sm md:table-cell`,children:ee(e.operatingHours)}),(0,L.jsx)(M,{children:e.activeFaults.length>0?(0,L.jsxs)(k,{children:[(0,L.jsx)(D,{render:(0,L.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-(--miravo-radius-pill) bg-destructive/15 px-1.5 font-mono text-[11px] font-semibold tabular-nums text-destructive`}),children:e.activeFaults.length}),(0,L.jsxs)(O,{side:`top`,children:[e.activeFaults.slice(0,4).join(`, `),e.activeFaults.length>4&&` + ${e.activeFaults.length-4} more`]})]}):(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`no faults`}),(0,L.jsx)(`span`,{"aria-hidden":!0,children:`—`})]})}),(0,L.jsx)(M,{children:(0,L.jsx)(Se,{state:t})}),(0,L.jsx)(M,{children:(0,L.jsx)(b,{className:`size-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`,"aria-hidden":!0})})]},e.id)})})]})})})]})}export{X as t};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{S as r,b as i,o as a,x as o}from"./api-CrYvIV3A.js";import{i as s,n as c}from"./dist-xY0pK9Wy.js";import{c as l,n as u}from"./chunk-OE4NN4TA-DBWZidbW.js";import{t as d}from"./shallow-Cin0mLuv.js";import{c as f,d as p,g as m,l as h,p as ee,s as g,u as _,v as te,w as ne,x as re,y as v}from"./format-CshN6yEB.js";import{t as y}from"./utils-XFKvwlFT.js";import{t as b}from"./arrow-right-BjBb4z7g.js";import{t as x}from"./arrow-up-down-C1oJAmrw.js";import{c as S,i as C,n as w,s as T,t as E}from"./select-CmlY1M1a.js";import{t as ie}from"./circle-question-mark-CJvcT6V6.js";import{i as D,n as O,t as k}from"./tooltip-D1ydB4g3.js";import{r as A}from"./engine-store-DMULdR_V.js";import{t as j}from"./route-preload-CLRbqehb.js";import{t as ae}from"./badge-eIn_7YrK.js";import{n as oe}from"./transition-types-2i1blGlR.js";import{a as se,i as ce,n as le,o as ue,r as de,s as fe,t as pe}from"./combobox-BCaV1Wbo.js";import{a as M,c as N,i as me,n as he,o as P,r as ge,s as _e}from"./select-display-items-Bqb6Sbg6.js";var F=e(t(),1);function I(e){return o.prefetchQuery({queryKey:i.instances.detail(e),queryFn:()=>a(`/instances/${e}`,r.instanceDetail),staleTime:2e3})}var L=n(),R={success:`bg-success`,warning:`bg-warning`,destructive:`bg-destructive`,foreground:`bg-foreground/60`,primary:`bg-primary`},z={success:`text-success`,warning:`text-warning`,destructive:`text-destructive`,foreground:`text-foreground`,primary:`text-primary`},B={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus`};function V({label:e,pip:t,pulse:n}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t&&(n?(0,L.jsxs)(`span`,{"aria-hidden":!0,className:`relative flex size-1.5 shrink-0 items-center justify-center`,children:[(0,L.jsx)(`span`,{className:y(`absolute inline-flex h-full w-full animate-ping rounded-full opacity-75`,R[t])}),(0,L.jsx)(`span`,{className:y(`relative inline-flex size-1.5 rounded-full`,R[t])})]}):(0,L.jsx)(`span`,{"aria-hidden":!0,className:y(`size-1.5 shrink-0 rounded-full`,R[t])})),(0,L.jsx)(`span`,{className:`truncate text-[10px] font-medium uppercase tracking-(--miravo-tracking-eyebrow) text-muted-foreground`,children:e})]})}function H({children:e,tone:t=`foreground`,live:n}){return(0,L.jsx)(`span`,{...n?{role:`status`,"aria-live":`polite`}:{},className:y(`mt-1 block min-w-0 truncate font-mono text-2xl font-semibold tabular-nums leading-none transition-colors duration-300`,z[t]),children:e})}function U({children:e}){return(0,L.jsx)(`span`,{className:`mt-1 min-w-0 truncate text-[10px] text-muted-foreground`,children:e})}function W(e,t){return e===t?``:t}function ve({statusFilter:e,onStatusFilter:t}){let{instances:n,tps:r,memberValueCount:i,availableAdapters:a,adapterMetrics:o}=A(d(e=>({instances:e.instances,tps:e.tps,memberValueCount:e.memberValueCount,availableAdapters:e.availableAdapters,adapterMetrics:e.adapterMetrics}))),s=(0,F.useMemo)(()=>{let e=n.filter(e=>!e.isQuarantined&&e.activeFaults.length===0).length,t=n.filter(e=>!e.isQuarantined&&e.activeFaults.length>0).length,r=n.filter(e=>e.isQuarantined).length,i=n.length;return{healthy:e,faulted:t,quarantined:r,total:i,pct:i>0?Math.round(e/i*100):100,activeFaultCount:n.reduce((e,t)=>e+t.activeFaults.length,0),modelCount:new Set(n.map(e=>e.model)).size,affectedCount:new Set(n.filter(e=>e.activeFaults.length>0).map(e=>e.id)).size}},[n]),c=(0,F.useMemo)(()=>{let e=a.filter(e=>e.enabled);return{enabled:e,totalMessages:e.reduce((e,t)=>e+(o.find(e=>e.name===t.name)?.metrics?.messagesPublished??0),0),totalErrors:e.reduce((e,t)=>e+(o.find(e=>e.name===t.name)?.metrics?.errorsCount??0),0),labels:e.map(e=>B[e.name]??e.name)}},[a,o]),l=s.activeFaultCount>0,f=l?`destructive`:s.quarantined>0?`warning`:`success`,m=l?`faulted`:`healthy`;return(0,L.jsxs)(`section`,{"aria-label":`Fleet status`,className:`flex w-full min-w-0 max-w-full flex-col divide-y divide-border/40 overflow-hidden rounded-(--miravo-radius-stadium-sm) border sm:flex-row sm:divide-x sm:divide-y-0`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(W(e,m)),"aria-pressed":e===`healthy`||e===`faulted`,"aria-label":l?`Filter to faulted instances`:`Filter to healthy instances`,className:y(`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 text-left outline-none transition-colors duration-150`,`hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,(e===`healthy`||e===`faulted`)&&`bg-muted/50`),children:[(0,L.jsx)(V,{label:`Health`,pip:f}),(0,L.jsxs)(H,{tone:l?`destructive`:`success`,children:[s.pct,`%`]}),(0,L.jsx)(U,{children:s.total===0?`No instances`:[`${s.total} instance${s.total===1?``:`s`}`,s.faulted>0&&`${s.faulted} faulted`,s.quarantined>0&&`${s.quarantined} quarantined`,`${s.modelCount} model${s.modelCount===1?``:`s`}`].filter(Boolean).join(` · `)})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e===`faulted`?``:`faulted`),"aria-pressed":e===`faulted`,"aria-label":`Filter to faulted instances`,className:y(`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 text-left outline-none transition-colors duration-150`,`hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,e===`faulted`&&`bg-muted/50`),children:[(0,L.jsx)(V,{label:`Faults`,pip:l?`destructive`:`success`}),(0,L.jsx)(H,{tone:l?`destructive`:`foreground`,live:!0,children:s.activeFaultCount}),(0,L.jsx)(U,{children:l?`${s.affectedCount} instance${s.affectedCount===1?``:`s`} affected`:`all clear`})]}),(0,L.jsxs)(k,{children:[(0,L.jsxs)(D,{render:(0,L.jsx)(u,{to:`/tags`,"aria-label":`Open tag stream`,className:`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 outline-none transition-colors duration-150 hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`}),children:[(0,L.jsx)(V,{label:`Tags`,pip:`primary`,pulse:!0}),(0,L.jsx)(H,{children:p(i)}),(0,L.jsxs)(U,{children:[(0,L.jsx)(`span`,{className:`font-mono tabular-nums`,children:r.toFixed(1)}),` tps · live`]})]}),(0,L.jsx)(O,{side:`bottom`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-[11px]`,children:[(0,L.jsx)(`span`,{children:`Live tags tracked across the fleet.`}),i>=1e6&&(0,L.jsxs)(`span`,{className:`font-mono tabular-nums text-muted-foreground`,children:[h(i),` tags`]}),(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Updating at `,(0,L.jsx)(`span`,{className:`font-mono tabular-nums`,children:r.toFixed(1)}),` per second.`]})]})})]}),c.enabled.length>0&&(0,L.jsx)(G,{labels:c.labels,totalMessages:c.totalMessages,totalErrors:c.totalErrors,perAdapter:c.enabled.map(e=>({name:B[e.name]??e.name,metrics:o.find(t=>t.name===e.name)?.metrics}))})]})}function G({labels:e,totalMessages:t,totalErrors:n,perAdapter:r}){return(0,L.jsxs)(k,{children:[(0,L.jsxs)(D,{render:(0,L.jsx)(u,{to:`/control`,"aria-label":`Open control — protocol adapters`,className:`flex min-w-0 flex-1 flex-col overflow-hidden px-4 py-3 outline-none transition-colors duration-150 hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`}),children:[(0,L.jsx)(V,{label:`Protocol`,pip:`primary`,pulse:!0}),(0,L.jsx)(H,{tone:n>0?`warning`:`foreground`,live:!0,children:p(t)}),(0,L.jsxs)(U,{children:[e.join(` · `),n>0&&` · ${n} error${n===1?``:`s`}`]})]}),(0,L.jsx)(O,{side:`bottom`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 text-[11px]`,children:[(0,L.jsx)(`span`,{children:`Messages published since session start.`}),t>=1e6&&(0,L.jsxs)(`span`,{className:`font-mono tabular-nums text-muted-foreground`,children:[h(t),` total`]}),(0,L.jsx)(`div`,{className:`flex flex-col gap-0.5 border-t border-tooltip-border/60 pt-1`,children:r.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,L.jsxs)(`span`,{className:`font-mono tabular-nums`,children:[h(e.metrics?.messagesPublished??0),` msg`]}),e.metrics&&e.metrics.errorsCount>0&&(0,L.jsxs)(`span`,{className:`font-mono tabular-nums text-destructive`,children:[`· `,e.metrics.errorsCount,` err`]})]},e.name))})]})})]})}var K=`Commissioning → instance is running startup diagnostics. Operating → running normally. Decommissioning → winding down.`;function ye(e,t,n){let r=n===`asc`?1:-1;return[...e].sort((e,n)=>{switch(t){case`id`:return e.id.localeCompare(n.id)*r;case`model`:return e.model.localeCompare(n.model)*r;case`lifecycle`:return e.lifecycleStage.localeCompare(n.lifecycleStage)*r;case`hours`:return(e.operatingHours-n.operatingHours)*r;case`faults`:return(e.activeFaults.length-n.activeFaults.length)*r;case`status`:{let t=e=>e.isQuarantined?2:+(e.activeFaults.length>0);return(t(e)-t(n))*r}default:return 0}})}function be(e){return e===``||e===`healthy`||e===`faulted`||e===`quarantined`}function xe(e){return e.isQuarantined?`quarantined`:e.activeFaults.length>0?`faulted`:`healthy`}var q={healthy:{pip:`bg-success`,ring:`border-success/40 text-success`,label:`healthy`,help:`No active faults, not quarantined.`},faulted:{pip:`bg-warning`,ring:`border-warning/40 text-warning`,label:`faulted`,help:`One or more active faults; instance is still running.`},quarantined:{pip:`bg-destructive`,ring:`border-destructive/40 text-destructive`,label:`quarantined`,help:`Instance isolated from production flows pending review.`}};function Se({state:e}){let t=q[e];return(0,L.jsxs)(k,{children:[(0,L.jsxs)(D,{render:(0,L.jsx)(`span`,{className:y(`inline-flex h-5 items-center gap-1.5 rounded-(--miravo-radius-pill) border bg-background/30 px-2 text-[11px] font-medium`,t.ring)}),children:[(0,L.jsx)(`span`,{"aria-hidden":!0,className:y(`size-1.5 shrink-0 rounded-full`,t.pip)}),(0,L.jsx)(`span`,{children:g(t.label)})]}),(0,L.jsx)(O,{side:`top`,children:t.help})]})}function J({label:e,sortKey:t,subtitle:n,tooltip:r,current:i,direction:a,onSort:o,className:s}){let c=i===t,l=c?a===`asc`?`ascending`:`descending`:`none`,u=(0,L.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 whitespace-nowrap rounded-(--miravo-radius-tight) text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,onClick:()=>o(t),children:[(0,L.jsxs)(`span`,{className:`inline-flex items-baseline gap-1`,children:[(0,L.jsx)(`span`,{children:e}),n&&(0,L.jsx)(`span`,{className:`text-[10px] font-normal text-muted-foreground`,children:n})]}),(0,L.jsx)(x,{className:y(`size-3`,c?`text-foreground`:`text-muted-foreground`),"aria-hidden":!0}),(0,L.jsx)(`span`,{className:`sr-only`,children:c?`, sorted ${a===`asc`?`ascending`:`descending`}. Click to toggle.`:`, click to sort`})]});return(0,L.jsx)(P,{className:s,"aria-sort":l,children:r?(0,L.jsxs)(k,{children:[(0,L.jsx)(D,{render:u}),(0,L.jsx)(O,{side:`top`,children:r})]}):u})}function Y({title:e,body:t,action:n}){return(0,L.jsx)(N,{children:(0,L.jsx)(M,{colSpan:7,className:`py-10`,children:(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-sm flex-col items-center gap-2 text-center`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),n&&(0,L.jsxs)(u,{to:n.href,className:`mt-1 inline-flex items-center gap-1 rounded-(--miravo-radius-tight) text-xs font-medium text-primary outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,children:[n.label,(0,L.jsx)(b,{className:`size-3`,"aria-hidden":!0})]})]})})})}function X(){let{instances:e,connectionState:t}=A(d(e=>({instances:e.instances,connectionState:e.connectionState}))),[n,r]=s(`q`,c.withDefault(``)),[i,a]=s(`model`,c.withDefault(``)),[o,u]=s(`lifecycle`,c.withDefault(``)),[p,h]=s(`status`,c.withDefault(``)),g=be(p)?p:``,[x,R]=(0,F.useState)(`id`),[z,B]=(0,F.useState)(`asc`),V=(0,F.useRef)(null),H=l(),[U,W]=(0,F.useState)(``);(0,F.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),V.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let G=(0,F.useCallback)(e=>{e===x?B(e=>e===`asc`?`desc`:`asc`):(R(e),B(`asc`))},[x]),q=(0,F.useCallback)(e=>{h(e===``?``:e)},[h]),X=(0,F.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.model,(t.get(n.model)??0)+1);return[...t.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[e]),Z=(0,F.useMemo)(()=>[...new Set(e.map(e=>e.lifecycleStage))].sort(),[e]),Ce=(0,F.useMemo)(()=>[{value:`all`,label:`All stages`},...Z.map(e=>({value:e,label:m(e)}))],[Z]),Q=(0,F.useMemo)(()=>U?X.filter(([e])=>v(e,U)):X,[X,U]),we=(0,F.useMemo)(()=>i?{value:i,label:_(i)}:null,[i]),$=(0,F.useMemo)(()=>{let t=e;return i&&(t=t.filter(e=>e.model===i)),o&&(t=t.filter(e=>e.lifecycleStage===o)),n&&(t=t.filter(e=>te(e.id,n)||v(e.model,n))),g===`faulted`&&(t=t.filter(e=>e.activeFaults.length>0)),g===`quarantined`&&(t=t.filter(e=>e.isQuarantined)),g===`healthy`&&(t=t.filter(e=>e.activeFaults.length===0&&!e.isQuarantined)),ye(t,x,z)},[e,n,g,i,o,x,z]),Te=g!==``||i!==``||o!==``||n!==``,Ee=(0,F.useCallback)(()=>{r(``),h(``),a(``),u(``)},[r,h,a,u]),De=(0,F.useCallback)(e=>{(0,F.startTransition)(()=>{(0,F.addTransitionType)(oe),H(`/instance/${e}`)})},[H]),Oe=e.length===0&&t!==`live`,ke=e.length===0&&t===`live`;return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,L.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Fleet Overview`}),(0,L.jsx)(ve,{statusFilter:g,onStatusFilter:q}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(pe,{value:we,onValueChange:e=>void a(e?.value??``),isItemEqualToValue:(e,t)=>e?.value===t?.value,onInputValueChange:W,children:[(0,L.jsx)(de,{placeholder:`All models`,className:`h-8 w-48`,showClear:!!i}),(0,L.jsx)(le,{children:(0,L.jsxs)(se,{children:[Q.map(([e,t])=>(0,L.jsxs)(ce,{value:{value:e,label:_(e)},children:[(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:_(e)}),(0,L.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[`(`,t,`)`]})]},e)),Q.length===0&&(0,L.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]}),Z.length>1&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsxs)(E,{value:o||`all`,onValueChange:e=>void u(!e||e===`all`?``:e),items:Ce,children:[(0,L.jsx)(T,{className:`h-8 w-36`,"aria-label":`Lifecycle stage`,children:(0,L.jsx)(S,{placeholder:`All stages`})}),(0,L.jsxs)(w,{alignItemWithTrigger:!1,align:`start`,children:[(0,L.jsx)(C,{value:`all`,children:`All stages`}),Z.map(e=>(0,L.jsx)(C,{value:e,children:m(e)},e))]})]}),(0,L.jsxs)(k,{children:[(0,L.jsx)(D,{render:(0,L.jsx)(`button`,{type:`button`,"aria-label":`About lifecycle stages`,className:`flex size-6 items-center justify-center rounded-(--miravo-radius-tight) text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`}),children:(0,L.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0})}),(0,L.jsx)(O,{side:`top`,children:K})]})]}),(0,L.jsxs)(E,{value:g||`all`,onValueChange:e=>void h(!e||e===`all`?``:e),items:he,children:[(0,L.jsx)(T,{className:`h-8 w-32`,"aria-label":`Status filter`,children:(0,L.jsx)(S,{placeholder:`All status`})}),(0,L.jsxs)(w,{alignItemWithTrigger:!1,align:`start`,children:[(0,L.jsx)(C,{value:`all`,children:`All status`}),(0,L.jsx)(C,{value:`healthy`,children:`Healthy`}),(0,L.jsx)(C,{value:`faulted`,children:`Faulted`}),(0,L.jsx)(C,{value:`quarantined`,children:`Quarantined`})]})]}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(re,{ref:V,placeholder:`Search...`,value:n,onChange:e=>void r(e.target.value),"aria-label":`Search instances by id or model`,className:`h-8 w-40 pr-7 text-xs`}),!n&&(0,L.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-(--miravo-radius-tight) border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),Te&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,onClick:Ee,className:`flex items-center gap-1 rounded-(--miravo-radius-tight) px-1 text-xs text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,L.jsx)(ne,{className:`size-3`,"aria-hidden":!0}),`Clear`]}),(0,L.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,"aria-live":`polite`,children:[$.length,` of `,e.length]})]})]}),(0,L.jsx)(ue,{className:`py-0`,children:(0,L.jsx)(fe,{className:`p-0 [&_thead_tr_th:last-child]:w-6 [&_thead_tr_th:last-child]:px-1 sm:[&_thead_tr_th:last-child]:w-8 sm:[&_thead_tr_th:last-child]:px-2 [&_tbody_tr_td:last-child]:px-1 sm:[&_tbody_tr_td:last-child]:px-2`,children:(0,L.jsxs)(ge,{children:[(0,L.jsx)(_e,{children:(0,L.jsxs)(N,{children:[(0,L.jsx)(J,{label:`Instance`,sortKey:`id`,current:x,direction:z,onSort:G}),(0,L.jsx)(J,{label:`Model`,sortKey:`model`,current:x,direction:z,onSort:G,className:`hidden sm:table-cell`}),(0,L.jsx)(J,{label:`Lifecycle`,sortKey:`lifecycle`,current:x,direction:z,onSort:G,tooltip:K}),(0,L.jsx)(J,{label:`Operating age`,sortKey:`hours`,current:x,direction:z,onSort:G,tooltip:`Cumulative operating hours since the instance started running.`,className:`hidden text-right md:table-cell`}),(0,L.jsx)(J,{label:`Faults`,sortKey:`faults`,current:x,direction:z,onSort:G,tooltip:`Count of active (uncleared) faults on this instance.`}),(0,L.jsx)(J,{label:`Status`,sortKey:`status`,current:x,direction:z,onSort:G}),(0,L.jsx)(P,{children:(0,L.jsx)(`span`,{className:`sr-only`,children:`Navigate to instance`})})]})}),(0,L.jsx)(me,{children:Oe?(0,L.jsx)(Y,{title:`Connecting to runtime`,body:`Live fleet data will appear once the connection is up.`}):ke?(0,L.jsx)(Y,{title:`No running instances`,body:`Start an environment from the Catalog to see instances.`,action:{label:`Open Catalog`,href:`/catalog`}}):$.length===0?(0,L.jsx)(Y,{title:`No matches`,body:`Adjust filters or clear them to see the full fleet.`}):$.map(e=>{let t=xe(e),n=f(e.id);return(0,L.jsxs)(N,{tabIndex:0,"aria-label":`Open instance ${n}`,className:y(`group cursor-pointer outline-none transition-colors`,`focus-visible:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-inset`),onClick:()=>De(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),De(e.id))},onMouseEnter:()=>{j(`/instance/${e.id}`),I(e.id)},onFocus:()=>{j(`/instance/${e.id}`),I(e.id)},children:[(0,L.jsx)(M,{className:`text-sm`,children:(0,L.jsx)(F.ViewTransition,{name:`instance-${e.id}`,default:`none`,children:(0,L.jsx)(`span`,{className:`inline-flex max-w-full rounded-(--miravo-radius-tight) text-left`,children:n})})}),(0,L.jsx)(M,{className:`hidden text-sm sm:table-cell`,children:_(e.model)}),(0,L.jsx)(M,{children:(0,L.jsx)(ae,{variant:`secondary`,className:`text-xs`,children:m(e.lifecycleStage)})}),(0,L.jsx)(M,{className:`hidden font-mono text-sm md:table-cell`,children:ee(e.operatingHours)}),(0,L.jsx)(M,{children:e.activeFaults.length>0?(0,L.jsxs)(k,{children:[(0,L.jsx)(D,{render:(0,L.jsx)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-(--miravo-radius-pill) bg-destructive/15 px-1.5 font-mono text-[11px] font-semibold tabular-nums text-destructive`}),children:e.activeFaults.length}),(0,L.jsxs)(O,{side:`top`,children:[e.activeFaults.slice(0,4).join(`, `),e.activeFaults.length>4&&` + ${e.activeFaults.length-4} more`]})]}):(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`no faults`}),(0,L.jsx)(`span`,{"aria-hidden":!0,children:`—`})]})}),(0,L.jsx)(M,{children:(0,L.jsx)(Se,{state:t})}),(0,L.jsx)(M,{children:(0,L.jsx)(b,{className:`size-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`,"aria-hidden":!0})})]},e.id)})})]})})})]})}export{X as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e}from"./api-
|
|
1
|
+
import{C as e}from"./api-CrYvIV3A.js";function t(e,t){return e instanceof Error&&e.message.trim().length>0?e.message:typeof e==`string`&&e.trim().length>0?e:t}function n(t){if(e.is(t)&&t.hint?.trim())return t.hint}export{t as n,n as t};
|