@camstack/addon-admin-ui 1.2.309 → 1.2.312
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/dist/assets/{AddonCollectionPage-DfDB2mq9.js → AddonCollectionPage-D_jT_fKd.js} +1 -1
- package/dist/assets/Addons-Dm22iIFC.js +1 -0
- package/dist/assets/{AdminTabs-DxmhnOA4.js → AdminTabs-BLa2Yu61.js} +1 -1
- package/dist/assets/AiProfiles-C1FiOjIi.js +3 -0
- package/dist/assets/{BrokerForm-CwkfwR8i.js → BrokerForm-W3yjLc5F.js} +1 -1
- package/dist/assets/Build-D42X2om2.js +32 -0
- package/dist/assets/{Capabilities-BXH0dd9S.js → Capabilities-DgQeevtK.js} +1 -1
- package/dist/assets/{CapabilityBadges-Dn7AXuW_.js → CapabilityBadges-PxEJ-G8M.js} +1 -1
- package/dist/assets/Cluster-CYJRjTNq.js +11 -0
- package/dist/assets/CompositionEditor-BR4ITRMC.js +1 -0
- package/dist/assets/{CompositionEditorPage-C7XC86xi.js → CompositionEditorPage-B9FazR7t.js} +1 -1
- package/dist/assets/Data-BZ997zDU.js +1 -0
- package/dist/assets/DetectionIntelligence-CoZLbnyz.js +1 -0
- package/dist/assets/{DeviceAggregateSection-DaWUMVM_.js → DeviceAggregateSection-DGRRUhpU.js} +1 -1
- package/dist/assets/DeviceDetail-X4_H5AEU.js +2 -0
- package/dist/assets/{Devices-B910dZmw.js → Devices-D2avtpSh.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-BZT10fAL.js → EmbedPlayerPage-DndXvLAf.js} +1 -1
- package/dist/assets/Events-DcBl0VuS.js +1 -0
- package/dist/assets/FormBuilder-DcvB5DXc.js +1 -0
- package/dist/assets/Identity-BFps8fGD.js +1 -0
- package/dist/assets/IntegrationDetail-cLLqyAlF.js +1 -0
- package/dist/assets/Integrations--caPrwcY.js +1 -0
- package/dist/assets/Integrations-CKkdQ5eX.js +1 -0
- package/dist/assets/Locations-DCOaDC4m.js +3 -0
- package/dist/assets/{Logs-DHU8ME8r.js → Logs-CVsufO3f.js} +1 -1
- package/dist/assets/{ModelLicenses-wNL-QqNC.js → ModelLicenses-C53LveOk.js} +1 -1
- package/dist/assets/{MotionZonesSettings-BOo01f0b.js → MotionZonesSettings-BP6JgzDx.js} +1 -1
- package/dist/assets/{MyAccess-CnAKwSSc.js → MyAccess-BPy91g8M.js} +1 -1
- package/dist/assets/Network-BH8GF1jj.js +1 -0
- package/dist/assets/{NodeAddonsSettingsPanel-B7GDs7Q9.js → NodeAddonsSettingsPanel-DaUaDmgN.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-CAH77n84.js → NodeInferenceDevices-CV8hPlUN.js} +1 -1
- package/dist/assets/Notifications-B2HuQQif.js +1 -0
- package/dist/assets/Pipeline-VFKCmqnk.js +1 -0
- package/dist/assets/Plates-CwmrYBy1.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-DvrlDBhA.js → PrivacyMaskSettings-DrGP3agd.js} +1 -1
- package/dist/assets/{ProviderIcon-BeS1q8Rf.js → ProviderIcon-DpDrKQg9.js} +1 -1
- package/dist/assets/Recordings-wBHDYR-a.js +1 -0
- package/dist/assets/{ScanNetworkModal-BjBfm97i.js → ScanNetworkModal-Bs0BPCl_.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-Cd9vKq8k.js → SceneMonitorEditor-BKRn3LUw.js} +1 -1
- package/dist/assets/{Scenes-TxX32cBu.js → Scenes-AZ844W8Q.js} +1 -1
- package/dist/assets/{Settings-C3794LJM.js → Settings-C3eJAyF_.js} +1 -1
- package/dist/assets/{Showroom-CnFb5-UE.js → Showroom-CrjPa3nO.js} +1 -1
- package/dist/assets/{StorageLocationsPanel-CAC8Rq6D.js → StorageLocationsPanel-DZBpj1S8.js} +1 -1
- package/dist/assets/{Terminal-BDjPoF0A.js → Terminal-DP9Z-4oI.js} +3 -3
- package/dist/assets/{Viewer-CreAyV1k.js → Viewer-BdSLJVFV.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-oI6UR7Sc.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BzFC5oNH.js} +1 -1
- package/dist/assets/{archive-CPBvgIqJ.js → archive--Adx9xt7.js} +1 -1
- package/dist/assets/{authed-media-2_-kYrP3.js → authed-media-BjiwUfzl.js} +1 -1
- package/dist/assets/{boxes-CW5AuMy7.js → boxes-C9etGa7E.js} +1 -1
- package/dist/assets/circle-slash-cB0daX9J.js +1 -0
- package/dist/assets/{debounced-invalidate-DE5pKSOE.js → debounced-invalidate-D_ADe-pO.js} +1 -1
- package/dist/assets/{device-integration-icon-BSLLy94_.js → device-integration-icon-CDQck2H0.js} +1 -1
- package/dist/assets/{dist-zmoGT7Gu.js → dist-CLDbTq6j.js} +3 -3
- package/dist/assets/{dist-CSp3gDPo.js → dist-Dhc7r6s3.js} +1 -1
- package/dist/assets/{face-bbox-D5H5wJEP.js → face-bbox-BMJUn0ul.js} +1 -1
- package/dist/assets/{hard-drive-download-D75f3X09.js → hard-drive-download-_iraTBzr.js} +1 -1
- package/dist/assets/{hostInit-BGs5TZwj.js → hostInit-BUbZdY_9.js} +1 -1
- package/dist/assets/index-ToaOKO9V.js +4 -0
- package/dist/assets/{layers-DGrwhNHF.js → layers-DiVzoqI9.js} +1 -1
- package/dist/assets/{location-owned-usage-DmVfd_sN.js → location-owned-usage-BYFxxj5I.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-1d0a7067.js → mf-entry-bootstrap-0-eaedec53.js} +2 -2
- package/dist/assets/{player-overlays-BQsHwEhF.js → player-overlays-CW14DMpN.js} +1 -1
- package/dist/assets/remoteEntry-Cor8-DvN.js +1 -0
- package/dist/assets/{send-C9Ra25bz.js → send-CPgogH5c.js} +1 -1
- package/dist/assets/{settings-2-BpUmiqRR.js → settings-2-Ch5_hcKD.js} +1 -1
- package/dist/assets/{square-check-big-C7grRhDO.js → square-check-big-znl8trUW.js} +1 -1
- package/dist/assets/src-DIrDyFmq.js +67 -0
- package/dist/assets/src-JqpYwj-l.js +349 -0
- package/dist/assets/{use-scenes-feed-Dr06_e3L.js → use-scenes-feed-YEEHIE1o.js} +1 -1
- package/dist/assets/{use-stationary-objects-pBTdGYcS.js → use-stationary-objects-DOl51SBk.js} +1 -1
- package/dist/assets/{useDevice-B9iEONPT.js → useDevice-C8SXb13_.js} +1 -1
- package/dist/assets/useEventInvalidation-B86vUgTW.js +1 -0
- package/dist/assets/{useNodeUrlSelection-zcbHXTK_.js → useNodeUrlSelection-BGtbjkMI.js} +1 -1
- package/dist/assets/user-round-D9U1WJod.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DfqZUgL6.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BaoDsuWl.js} +2 -2
- package/dist/index.html +5 -5
- package/dist/server/addon.js +79 -24
- package/package.json +1 -1
- package/dist/assets/Addons-BmF6QJjq.js +0 -1
- package/dist/assets/AiProfiles-WyKxGEnm.js +0 -3
- package/dist/assets/Build-CpSrckHu.js +0 -32
- package/dist/assets/Cluster-DNC6op-4.js +0 -11
- package/dist/assets/CompositionEditor-BaeVNz7c.js +0 -1
- package/dist/assets/Data-DPv4QjP_.js +0 -1
- package/dist/assets/DetectionIntelligence-B1ufxTut.js +0 -1
- package/dist/assets/DeviceDetail-CyKo2o-W.js +0 -2
- package/dist/assets/Events-CiXQRykv.js +0 -1
- package/dist/assets/FormBuilder-alW8XL-9.js +0 -1
- package/dist/assets/Identity-C-QYUex9.js +0 -1
- package/dist/assets/IntegrationDetail-CTNmCNSj.js +0 -1
- package/dist/assets/Integrations-DIESuQ9O.js +0 -1
- package/dist/assets/Integrations-IV9f6F-m.js +0 -1
- package/dist/assets/Locations-hlNJgk-2.js +0 -3
- package/dist/assets/Network-DtKUhXlu.js +0 -1
- package/dist/assets/Notifications-DkxqJ__w.js +0 -1
- package/dist/assets/Pipeline-DkOxZ075.js +0 -1
- package/dist/assets/Plates-B8aiSB7g.js +0 -1
- package/dist/assets/Recordings-D7_5bDg0.js +0 -1
- package/dist/assets/circle-slash-CWusOAgX.js +0 -1
- package/dist/assets/device-picker-model-qVKFWw6-.js +0 -1
- package/dist/assets/index-DRfmHS9g.js +0 -4
- package/dist/assets/remoteEntry-hicAutTF.js +0 -1
- package/dist/assets/src-AIYVh4G3.js +0 -67
- package/dist/assets/src-BUUu3NWL.js +0 -349
- package/dist/assets/useEventInvalidation-DUUiiikb.js +0 -1
- package/dist/assets/user-round-D6wAMHCi.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as e,S as t,W as n,q as r,x as i}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{vt as a,yt as o}from"./player-overlays-BQsHwEhF.js";import{Gn as s,Hu as c,Kn as l,ic as u,jl as d,nc as f,nt as p,ru as m,ud as h,zc as g}from"./src-AIYVh4G3.js";import{t as _}from"./layers-DGrwhNHF.js";import{h as v,l as y}from"./index-DRfmHS9g.js";import{t as b}from"./AdminPage-CiKtOLQm.js";import{t as x}from"./AdminTabs-DxmhnOA4.js";import{t as S}from"./AddonCollectionPage-DfDB2mq9.js";import{t as C}from"./addon-display-names-DvSEQty-.js";var w=o(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),T=o(`timer-reset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]);e();var E=5e3,D={"winston-logging":`Rotated log files on this node’s disk.`,"console-logging":`stdout / stderr of the node process.`,"loki-logging":`Pushes to a Grafana Loki instance. Off until enabled with a URL.`,"hub-forwarder":`Agent-only — forwards this node’s entries to the hub.`};function O(){let e=l({capName:`log-destination`},{refetchInterval:E}),t=s(void 0,{refetchInterval:E}),r=n(()=>C(t.data??[]),[t.data]),a=n(()=>{let e=new Map;for(let n of t.data??[]){let t=n.description,r=n.id;typeof r==`string`&&typeof t==`string`&&t.length>0&&e.set(r,t)}return e},[t.data]);return i(S,{title:`Logging`,subtitle:`Every registered log destination. Entries are fanned to all enabled destinations at once — enabling one does not disable another. Each destination's own configuration is docked under it.`,pageIcon:d,itemIcon:w,capability:`log-destination`,installButtonLabel:`Add destination`,items:n(()=>(e.data??[]).map(e=>({addonId:e.addonId,displayName:r.get(e.addonId)??e.addonId,isActive:e.isActive,caption:a.get(e.addonId)??D[e.addonId]??``})),[e.data,r,a]),isLoading:e.isLoading,emptyTitle:`No log destinations registered`,emptyDescription:`This should not happen — the console and rotated-file destinations are builtins. If the list is empty, the node is still booting.`,renderStatusBadges:e=>e.caption.length>0?i(`span`,{className:`text-[10px] text-foreground-subtle`,children:e.caption}):null})}e();var k=[12e4,3e5,6e5,18e5],A={"request-census":`Counts every tRPC call by TRANSPORT PLANE — http, ws, mesh — and by procedure, caller, address and user-agent. Subscriptions are counted apart from calls, so a long-lived stream cannot pass for a storm. Arm it, then restart: the deadline is persisted, so the window is still running when clients reconnect.`};function j(){let{t:e}=y(),n=f({},{refetchInterval:5e3}),a=u(),[o,s]=r(null),c=(e,t)=>{s(e),a.mutate({patch:{diagnostics:[{id:e,armMs:t}]}},{onSettled:()=>{s(null),n.refetch()}})},l=n.data?.activeWindows??[],d=n.data?.channels??[],p=n.data?.activeChannels??[],g=(e,t,r)=>{s(e),a.mutate({patch:{channels:[{channel:e,armMs:t,deviceIds:r}]}},{onSettled:()=>{s(null),n.refetch()}})};return t(b,{icon:h,title:e(`logging.diagnostics.title`,`Diagnostics`),subtitle:e(`logging.diagnostics.subtitle`,`Diagnostics are armed for a window, never switched on. Each carries a deadline and expires by itself — one left running is an incident of its own.`),children:[n.isLoading?t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[i(m,{className:`h-3.5 w-3.5 animate-spin`}),e(`common.loading`,`Loading…`)]}):i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:l.map(e=>i(N,{window:e,busy:o===e.id,onArm:t=>c(e.id,t)},e.id))}),i(`h3`,{className:`mt-6 text-sm font-medium text-foreground`,children:e(`logging.diagnostics.channels`,`Component channels`)}),i(`p`,{className:`mb-2 max-w-3xl text-[11px] text-foreground-subtle`,children:e(`logging.diagnostics.channelsSubtitle`,`Declared by the addons that own them — this list is not maintained by hand. Arming a channel opens a window with a deadline; it closes by itself.`)}),d.length===0?i(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`logging.diagnostics.noChannels`,`No addon on this cluster declares a log channel, or none could be reached right now.`)}):i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:d.map(e=>i(M,{channel:e,state:p.find(t=>t.channel===e.name),busy:o===e.name,onArm:(t,n)=>g(e.name,t,n)},e.name))})]})}function M({channel:e,state:n,busy:o,onArm:s}){let{t:c}=y(),[l,u]=r(``),d=n?.armed===!0,f=()=>{let e=l.split(/[\s,+]+/).filter(e=>/^\d+$/.test(e)).map(e=>Number(e));return e.length>0?e:null};return t(`div`,{className:`flex flex-col gap-2 p-3 lg:flex-row lg:items-center lg:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.name}),d?t(`span`,{className:`inline-flex items-center gap-1 rounded bg-warning/10 px-1.5 py-0.5 text-[10px] font-semibold text-warning`,children:[i(T,{className:`h-3 w-3`}),c(`logging.diagnostics.expiresIn`,`expires in {{left}}`,{left:P(n?.remainingMs??0)})]}):i(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle`,children:c(`logging.diagnostics.disarmed`,`disarmed`)}),d&&n?.deviceIds!==null&&n?.deviceIds!==void 0&&t(`span`,{className:`inline-flex items-center gap-1 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary`,children:[i(a,{className:`h-3 w-3`}),n.deviceIds.join(`, `)]}),!e.perDevice&&i(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle`,children:c(`logging.diagnostics.notPerCamera`,`not filterable per camera`)})]}),i(`p`,{className:`mt-0.5 max-w-2xl text-[11px] text-foreground-subtle`,children:e.description})]}),t(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1`,children:[e.perDevice&&i(`input`,{type:`text`,inputMode:`numeric`,value:l,disabled:o,onChange:e=>u(e.target.value),placeholder:c(`logging.diagnostics.camerasPlaceholder`,`all cameras`),className:`w-28 rounded border border-border bg-surface px-2 py-1 text-[11px] text-foreground`}),k.map(e=>i(`button`,{type:`button`,disabled:o,onClick:()=>s(e,f()),className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-50`,children:P(e)},e)),i(`button`,{type:`button`,disabled:o||!d,onClick:()=>s(0,null),className:`rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-40`,children:c(`logging.diagnostics.disarm`,`Disarm`)})]})]})}function N({window:e,busy:n,onArm:r}){let{t:a}=y();return t(`div`,{className:`flex flex-col gap-2 p-3 lg:flex-row lg:items-center lg:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.id}),e.armed?t(`span`,{className:`inline-flex items-center gap-1 rounded bg-warning/10 px-1.5 py-0.5 text-[10px] font-semibold text-warning`,children:[i(T,{className:`h-3 w-3`}),a(`logging.diagnostics.expiresIn`,`expires in {{left}}`,{left:P(e.remainingMs)})]}):i(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle`,children:a(`logging.diagnostics.disarmed`,`disarmed`)}),e.armed&&!e.persisted&&i(`span`,{className:`text-[10px] text-warning`,children:a(`logging.diagnostics.notPersisted`,`not persisted — will not survive a restart`)})]}),i(`p`,{className:`mt-0.5 max-w-2xl text-[11px] text-foreground-subtle`,children:A[e.id]??``})]}),t(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1`,children:[k.map(e=>i(`button`,{type:`button`,disabled:n,onClick:()=>r(e),className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-50`,children:P(e)},e)),i(`button`,{type:`button`,disabled:n||!e.armed,onClick:()=>r(0),className:`rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-40`,children:a(`logging.diagnostics.disarm`,`Disarm`)})]})]})}function P(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/60),r=t%60;return n===0?`${r}s`:r===0?`${n}m`:`${n}m ${r}s`}e();var F=[`debug`,`info`,`warn`,`error`],I=``,L=``;function R(){let{t:e}=y(),[a,o]=r(I),[s,c]=r(L),{nodes:l}=g(),d=n(()=>l.map(e=>({id:e.id,label:e.name||e.id})),[l]),p=f({...a===I?{}:{scopeNodeId:a},...s===L?{}:{scopeComponent:s}},{refetchInterval:15e3}),h=u(),v=p.data,x=h.isPending||p.isFetching,S=v?.channels??[],C=(e,t)=>{h.mutate({...e.nodeId===null?{}:{scopeNodeId:e.nodeId},...e.component===null?{}:{scopeComponent:e.component},patch:{level:t}},{onSuccess:()=>void p.refetch()})};return i(b,{icon:_,title:e(`logging.levels.title`,`Levels`),subtitle:e(`logging.levels.subtitle`,`Cluster → node, most specific wins. The floor gates what reaches the log destinations; the in-memory viewer keeps every line either way.`),actions:t(`div`,{className:`flex flex-wrap items-center gap-3`,children:[t(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[e(`logging.levels.scope`,`Scope`),t(`select`,{className:`rounded border border-border bg-surface px-2 py-1 text-xs text-foreground disabled:opacity-50`,value:a,disabled:s!==L,onChange:e=>o(e.target.value),children:[i(`option`,{value:I,children:e(`logging.levels.cluster`,`Cluster`)}),d.map(e=>i(`option`,{value:e.id,children:e.label},e.id))]})]}),t(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[e(`logging.levels.component`,`Component`),t(`select`,{className:`rounded border border-border bg-surface px-2 py-1 text-xs text-foreground`,value:s,onChange:e=>c(e.target.value),children:[i(`option`,{value:L,children:e(`logging.levels.noComponent`,`None`)}),S.map(e=>i(`option`,{value:e.name,children:e.name},e.name))]})]})]}),children:p.isLoading||v===void 0?t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[i(m,{className:`h-3.5 w-3.5 animate-spin`}),e(`common.loading`,`Loading…`)]}):t(`div`,{className:`space-y-3`,children:[i(B,{level:v.effective.level,source:v.effective.levelSource,persisted:v.persisted}),i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:v.explicit.layers.map(e=>i(V,{layer:e,inForce:e.scope===v.effective.levelSource,busy:x,onSet:t=>C(e,t),onClear:()=>C(e,null)},`${e.scope}:${e.nodeId??e.component??`cluster`}`))}),s!==L&&i(`p`,{className:`text-[11px] text-foreground-subtle`,children:S.find(e=>e.name===s)?.description??``}),i(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`logging.levels.componentNote`,`A component is a log channel an addon declared. Its level is cluster-wide and beats both the node and the cluster layer.`)}),i(z,{days:v.opsLogRetentionDays,busy:x,onSet:e=>h.mutate({patch:{opsLogRetentionDays:e}},{onSuccess:()=>void p.refetch()})})]})})}function z({days:e,busy:n,onSet:r}){let{t:a}=y();return t(`div`,{className:`rounded-lg border border-border bg-surface p-3 space-y-1`,children:[t(`label`,{className:`flex items-center justify-between gap-3`,children:[i(`span`,{className:`text-xs font-medium`,children:a(`logging.levels.opsLogRetention`,`Retention audit trail`)}),t(`span`,{className:`flex items-center gap-1.5`,children:[i(`input`,{type:`number`,min:0,max:3650,step:1,defaultValue:e,disabled:n,onBlur:t=>{let n=Number.parseInt(t.target.value,10);Number.isFinite(n)&&n!==e&&r(n)},className:`w-20 rounded border border-border bg-surface px-2 py-1 text-xs`}),i(`span`,{className:`text-[11px] text-foreground-subtle`,children:a(`common.days`,`days`)})]})]}),i(`p`,{className:`text-[11px] text-foreground-subtle`,children:a(`logging.levels.opsLogRetentionNote`,`How long the record of what retention deleted is kept. Cluster-wide, and deliberately longer than any camera window — it is the history of the sweep, not of the camera, and it is what makes a storage leak explainable after the fact. 0 keeps it forever.`)})]})}function B({level:e,source:n,persisted:r}){let{t:a}=y();return t(`div`,{className:`rounded-lg border border-border bg-surface p-3`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-xs text-foreground-subtle`,children:a(`logging.levels.effective`,`In force here`)}),i(`span`,{className:`rounded bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary`,children:e}),i(`span`,{className:`text-[11px] text-foreground-subtle`,children:n==="default"?a(`logging.levels.fromDefault`,`nothing is set anywhere — this is the default`):a(`logging.levels.fromLayer`,`decided by the {{source}} layer`,{source:n})})]}),!r&&i(`p`,{className:`mt-1 text-[11px] text-warning`,children:a(`logging.levels.notPersisted`,`The settings store could not be read or written — what you see is live, but it would not survive a restart.`)})]})}function V({layer:e,inForce:n,busy:r,onSet:a,onClear:o}){let{t:s}=y();return t(`div`,{className:`flex flex-col gap-2 p-3 sm:flex-row sm:items-center sm:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.scope===`cluster`?s(`logging.levels.cluster`,`Cluster`):e.scope===`component`?e.component??``:e.nodeId??``}),n&&t(`span`,{className:`inline-flex items-center gap-1 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary`,children:[i(c,{className:`h-3 w-3`}),s(`logging.levels.inForce`,`in force`)]})]}),i(`p`,{className:`mt-0.5 text-[11px] text-foreground-subtle`,children:e.level===null?s(`logging.levels.inherits`,`inherits — nothing set at this layer`):s(`logging.levels.setHere`,`set here: {{level}}`,{level:e.level})})]}),t(`div`,{className:`flex shrink-0 items-center gap-1`,children:[F.map(t=>i(`button`,{type:`button`,disabled:r,onClick:()=>a(t),className:`rounded px-2 py-1 text-[11px] font-medium transition-colors disabled:opacity-50 ${e.level===t?`bg-primary text-primary-foreground`:`border border-border text-foreground-subtle hover:text-foreground`}`,children:t},t)),i(`button`,{type:`button`,disabled:r||e.level===null,onClick:o,className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-40`,children:s(`logging.levels.clear`,`Clear`)})]})]})}function H(){return i(b,{children:i(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:i(p,{limit:500,maxHeight:`max-h-[calc(100vh-310px)]`,showScope:!0,showFilters:!0})})})}function U(){return i(`div`,{className:`flex flex-col p-4`,children:i(x,{tabs:[{id:`viewer`,label:`Viewer`,icon:v,content:i(H,{})},{id:`destinations`,label:`Destinations`,icon:d,content:i(O,{})},{id:`levels`,label:`Levels`,icon:_,content:i(R,{})},{id:`diagnostics`,label:`Diagnostics`,icon:h,content:i(j,{})}]})})}export{U as LogsPage};
|
|
1
|
+
import{Q as e,S as t,W as n,q as r,x as i}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{vt as a,yt as o}from"./player-overlays-CW14DMpN.js";import{Sd as s,Ul as c,Zc as l,ed as u,gc as d,hu as f,ir as p,mc as m,mt as h,rr as g}from"./src-DIrDyFmq.js";import{t as _}from"./layers-DiVzoqI9.js";import{h as v,l as y}from"./index-ToaOKO9V.js";import{t as b}from"./AdminPage-CiKtOLQm.js";import{t as x}from"./AdminTabs-BLa2Yu61.js";import{t as S}from"./AddonCollectionPage-D_jT_fKd.js";import{t as C}from"./addon-display-names-DvSEQty-.js";var w=o(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),T=o(`timer-reset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]);e();var E=5e3,D={"winston-logging":`Rotated log files on this node’s disk.`,"console-logging":`stdout / stderr of the node process.`,"loki-logging":`Pushes to a Grafana Loki instance. Off until enabled with a URL.`,"hub-forwarder":`Agent-only — forwards this node’s entries to the hub.`};function O(){let e=p({capName:`log-destination`},{refetchInterval:E}),t=g(void 0,{refetchInterval:E}),r=n(()=>C(t.data??[]),[t.data]),a=n(()=>{let e=new Map;for(let n of t.data??[]){let t=n.description,r=n.id;typeof r==`string`&&typeof t==`string`&&t.length>0&&e.set(r,t)}return e},[t.data]);return i(S,{title:`Logging`,subtitle:`Every registered log destination. Entries are fanned to all enabled destinations at once — enabling one does not disable another. Each destination's own configuration is docked under it.`,pageIcon:c,itemIcon:w,capability:`log-destination`,installButtonLabel:`Add destination`,items:n(()=>(e.data??[]).map(e=>({addonId:e.addonId,displayName:r.get(e.addonId)??e.addonId,isActive:e.isActive,caption:a.get(e.addonId)??D[e.addonId]??``})),[e.data,r,a]),isLoading:e.isLoading,emptyTitle:`No log destinations registered`,emptyDescription:`This should not happen — the console and rotated-file destinations are builtins. If the list is empty, the node is still booting.`,renderStatusBadges:e=>e.caption.length>0?i(`span`,{className:`text-[10px] text-foreground-subtle`,children:e.caption}):null})}e();var k=[12e4,3e5,6e5,18e5],A={"request-census":`Counts every tRPC call by TRANSPORT PLANE — http, ws, mesh — and by procedure, caller, address and user-agent. Subscriptions are counted apart from calls, so a long-lived stream cannot pass for a storm. Arm it, then restart: the deadline is persisted, so the window is still running when clients reconnect.`};function j(){let{t:e}=y(),n=m({},{refetchInterval:5e3}),a=d(),[o,c]=r(null),l=(e,t)=>{c(e),a.mutate({patch:{diagnostics:[{id:e,armMs:t}]}},{onSettled:()=>{c(null),n.refetch()}})},u=n.data?.activeWindows??[],p=n.data?.channels??[],h=n.data?.activeChannels??[],g=(e,t,r)=>{c(e),a.mutate({patch:{channels:[{channel:e,armMs:t,deviceIds:r}]}},{onSettled:()=>{c(null),n.refetch()}})};return t(b,{icon:s,title:e(`logging.diagnostics.title`,`Diagnostics`),subtitle:e(`logging.diagnostics.subtitle`,`Diagnostics are armed for a window, never switched on. Each carries a deadline and expires by itself — one left running is an incident of its own.`),children:[n.isLoading?t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[i(f,{className:`h-3.5 w-3.5 animate-spin`}),e(`common.loading`,`Loading…`)]}):i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:u.map(e=>i(N,{window:e,busy:o===e.id,onArm:t=>l(e.id,t)},e.id))}),i(`h3`,{className:`mt-6 text-sm font-medium text-foreground`,children:e(`logging.diagnostics.channels`,`Component channels`)}),i(`p`,{className:`mb-2 max-w-3xl text-[11px] text-foreground-subtle`,children:e(`logging.diagnostics.channelsSubtitle`,`Declared by the addons that own them — this list is not maintained by hand. Arming a channel opens a window with a deadline; it closes by itself.`)}),p.length===0?i(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`logging.diagnostics.noChannels`,`No addon on this cluster declares a log channel, or none could be reached right now.`)}):i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:p.map(e=>i(M,{channel:e,state:h.find(t=>t.channel===e.name),busy:o===e.name,onArm:(t,n)=>g(e.name,t,n)},e.name))})]})}function M({channel:e,state:n,busy:o,onArm:s}){let{t:c}=y(),[l,u]=r(``),d=n?.armed===!0,f=()=>{let e=l.split(/[\s,+]+/).filter(e=>/^\d+$/.test(e)).map(e=>Number(e));return e.length>0?e:null};return t(`div`,{className:`flex flex-col gap-2 p-3 lg:flex-row lg:items-center lg:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.name}),d?t(`span`,{className:`inline-flex items-center gap-1 rounded bg-warning/10 px-1.5 py-0.5 text-[10px] font-semibold text-warning`,children:[i(T,{className:`h-3 w-3`}),c(`logging.diagnostics.expiresIn`,`expires in {{left}}`,{left:P(n?.remainingMs??0)})]}):i(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle`,children:c(`logging.diagnostics.disarmed`,`disarmed`)}),d&&n?.deviceIds!==null&&n?.deviceIds!==void 0&&t(`span`,{className:`inline-flex items-center gap-1 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary`,children:[i(a,{className:`h-3 w-3`}),n.deviceIds.join(`, `)]}),!e.perDevice&&i(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle`,children:c(`logging.diagnostics.notPerCamera`,`not filterable per camera`)})]}),i(`p`,{className:`mt-0.5 max-w-2xl text-[11px] text-foreground-subtle`,children:e.description})]}),t(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1`,children:[e.perDevice&&i(`input`,{type:`text`,inputMode:`numeric`,value:l,disabled:o,onChange:e=>u(e.target.value),placeholder:c(`logging.diagnostics.camerasPlaceholder`,`all cameras`),className:`w-28 rounded border border-border bg-surface px-2 py-1 text-[11px] text-foreground`}),k.map(e=>i(`button`,{type:`button`,disabled:o,onClick:()=>s(e,f()),className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-50`,children:P(e)},e)),i(`button`,{type:`button`,disabled:o||!d,onClick:()=>s(0,null),className:`rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-40`,children:c(`logging.diagnostics.disarm`,`Disarm`)})]})]})}function N({window:e,busy:n,onArm:r}){let{t:a}=y();return t(`div`,{className:`flex flex-col gap-2 p-3 lg:flex-row lg:items-center lg:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.id}),e.armed?t(`span`,{className:`inline-flex items-center gap-1 rounded bg-warning/10 px-1.5 py-0.5 text-[10px] font-semibold text-warning`,children:[i(T,{className:`h-3 w-3`}),a(`logging.diagnostics.expiresIn`,`expires in {{left}}`,{left:P(e.remainingMs)})]}):i(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-foreground-subtle`,children:a(`logging.diagnostics.disarmed`,`disarmed`)}),e.armed&&!e.persisted&&i(`span`,{className:`text-[10px] text-warning`,children:a(`logging.diagnostics.notPersisted`,`not persisted — will not survive a restart`)})]}),i(`p`,{className:`mt-0.5 max-w-2xl text-[11px] text-foreground-subtle`,children:A[e.id]??``})]}),t(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1`,children:[k.map(e=>i(`button`,{type:`button`,disabled:n,onClick:()=>r(e),className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-50`,children:P(e)},e)),i(`button`,{type:`button`,disabled:n||!e.armed,onClick:()=>r(0),className:`rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground disabled:opacity-40`,children:a(`logging.diagnostics.disarm`,`Disarm`)})]})]})}function P(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/60),r=t%60;return n===0?`${r}s`:r===0?`${n}m`:`${n}m ${r}s`}e();var F=[`debug`,`info`,`warn`,`error`],I=``,L=``;function R(){let{t:e}=y(),[a,o]=r(I),[s,c]=r(L),{nodes:u}=l(),p=n(()=>u.map(e=>({id:e.id,label:e.name||e.id})),[u]),h=m({...a===I?{}:{scopeNodeId:a},...s===L?{}:{scopeComponent:s}},{refetchInterval:15e3}),g=d(),v=h.data,x=g.isPending||h.isFetching,S=v?.channels??[],C=(e,t)=>{g.mutate({...e.nodeId===null?{}:{scopeNodeId:e.nodeId},...e.component===null?{}:{scopeComponent:e.component},patch:{level:t}},{onSuccess:()=>void h.refetch()})};return i(b,{icon:_,title:e(`logging.levels.title`,`Levels`),subtitle:e(`logging.levels.subtitle`,`Cluster → node, most specific wins. The floor gates what reaches the log destinations; the in-memory viewer keeps every line either way.`),actions:t(`div`,{className:`flex flex-wrap items-center gap-3`,children:[t(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[e(`logging.levels.scope`,`Scope`),t(`select`,{className:`rounded border border-border bg-surface px-2 py-1 text-xs text-foreground disabled:opacity-50`,value:a,disabled:s!==L,onChange:e=>o(e.target.value),children:[i(`option`,{value:I,children:e(`logging.levels.cluster`,`Cluster`)}),p.map(e=>i(`option`,{value:e.id,children:e.label},e.id))]})]}),t(`label`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[e(`logging.levels.component`,`Component`),t(`select`,{className:`rounded border border-border bg-surface px-2 py-1 text-xs text-foreground`,value:s,onChange:e=>c(e.target.value),children:[i(`option`,{value:L,children:e(`logging.levels.noComponent`,`None`)}),S.map(e=>i(`option`,{value:e.name,children:e.name},e.name))]})]})]}),children:h.isLoading||v===void 0?t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[i(f,{className:`h-3.5 w-3.5 animate-spin`}),e(`common.loading`,`Loading…`)]}):t(`div`,{className:`space-y-3`,children:[i(B,{level:v.effective.level,source:v.effective.levelSource,persisted:v.persisted}),i(`div`,{className:`rounded-lg border border-border bg-surface divide-y divide-border`,children:v.explicit.layers.map(e=>i(V,{layer:e,inForce:e.scope===v.effective.levelSource,busy:x,onSet:t=>C(e,t),onClear:()=>C(e,null)},`${e.scope}:${e.nodeId??e.component??`cluster`}`))}),s!==L&&i(`p`,{className:`text-[11px] text-foreground-subtle`,children:S.find(e=>e.name===s)?.description??``}),i(`p`,{className:`text-[11px] text-foreground-subtle`,children:e(`logging.levels.componentNote`,`A component is a log channel an addon declared. Its level is cluster-wide and beats both the node and the cluster layer.`)}),i(z,{days:v.opsLogRetentionDays,busy:x,onSet:e=>g.mutate({patch:{opsLogRetentionDays:e}},{onSuccess:()=>void h.refetch()})})]})})}function z({days:e,busy:n,onSet:r}){let{t:a}=y();return t(`div`,{className:`rounded-lg border border-border bg-surface p-3 space-y-1`,children:[t(`label`,{className:`flex items-center justify-between gap-3`,children:[i(`span`,{className:`text-xs font-medium`,children:a(`logging.levels.opsLogRetention`,`Retention audit trail`)}),t(`span`,{className:`flex items-center gap-1.5`,children:[i(`input`,{type:`number`,min:0,max:3650,step:1,defaultValue:e,disabled:n,onBlur:t=>{let n=Number.parseInt(t.target.value,10);Number.isFinite(n)&&n!==e&&r(n)},className:`w-20 rounded border border-border bg-surface px-2 py-1 text-xs`}),i(`span`,{className:`text-[11px] text-foreground-subtle`,children:a(`common.days`,`days`)})]})]}),i(`p`,{className:`text-[11px] text-foreground-subtle`,children:a(`logging.levels.opsLogRetentionNote`,`How long the record of what retention deleted is kept. Cluster-wide, and deliberately longer than any camera window — it is the history of the sweep, not of the camera, and it is what makes a storage leak explainable after the fact. 0 keeps it forever.`)})]})}function B({level:e,source:n,persisted:r}){let{t:a}=y();return t(`div`,{className:`rounded-lg border border-border bg-surface p-3`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-xs text-foreground-subtle`,children:a(`logging.levels.effective`,`In force here`)}),i(`span`,{className:`rounded bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary`,children:e}),i(`span`,{className:`text-[11px] text-foreground-subtle`,children:n==="default"?a(`logging.levels.fromDefault`,`nothing is set anywhere — this is the default`):a(`logging.levels.fromLayer`,`decided by the {{source}} layer`,{source:n})})]}),!r&&i(`p`,{className:`mt-1 text-[11px] text-warning`,children:a(`logging.levels.notPersisted`,`The settings store could not be read or written — what you see is live, but it would not survive a restart.`)})]})}function V({layer:e,inForce:n,busy:r,onSet:a,onClear:o}){let{t:s}=y();return t(`div`,{className:`flex flex-col gap-2 p-3 sm:flex-row sm:items-center sm:justify-between`,children:[t(`div`,{className:`min-w-0`,children:[t(`div`,{className:`flex items-center gap-2`,children:[i(`span`,{className:`text-sm font-medium text-foreground`,children:e.scope===`cluster`?s(`logging.levels.cluster`,`Cluster`):e.scope===`component`?e.component??``:e.nodeId??``}),n&&t(`span`,{className:`inline-flex items-center gap-1 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-semibold text-primary`,children:[i(u,{className:`h-3 w-3`}),s(`logging.levels.inForce`,`in force`)]})]}),i(`p`,{className:`mt-0.5 text-[11px] text-foreground-subtle`,children:e.level===null?s(`logging.levels.inherits`,`inherits — nothing set at this layer`):s(`logging.levels.setHere`,`set here: {{level}}`,{level:e.level})})]}),t(`div`,{className:`flex shrink-0 items-center gap-1`,children:[F.map(t=>i(`button`,{type:`button`,disabled:r,onClick:()=>a(t),className:`rounded px-2 py-1 text-[11px] font-medium transition-colors disabled:opacity-50 ${e.level===t?`bg-primary text-primary-foreground`:`border border-border text-foreground-subtle hover:text-foreground`}`,children:t},t)),i(`button`,{type:`button`,disabled:r||e.level===null,onClick:o,className:`rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground disabled:opacity-40`,children:s(`logging.levels.clear`,`Clear`)})]})]})}function H(){return i(b,{children:i(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:i(h,{limit:500,maxHeight:`max-h-[calc(100vh-310px)]`,showScope:!0,showFilters:!0})})})}function U(){return i(`div`,{className:`flex flex-col p-4`,children:i(x,{tabs:[{id:`viewer`,label:`Viewer`,icon:v,content:i(H,{})},{id:`destinations`,label:`Destinations`,icon:c,content:i(O,{})},{id:`levels`,label:`Levels`,icon:_,content:i(R,{})},{id:`diagnostics`,label:`Diagnostics`,icon:s,content:i(j,{})}]})})}export{U as LogsPage};
|