@camstack/addon-admin-ui 1.2.80 → 1.2.82
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/{AddLocationWizard-BplATOR7.js → AddLocationWizard-BwgLlZv7.js} +1 -1
- package/dist/assets/{AddonCollectionPage-CdNsoMWo.js → AddonCollectionPage-Cj4wS8-x.js} +1 -1
- package/dist/assets/{Addons-DxiNBg7q.js → Addons-Bez0j4jh.js} +1 -1
- package/dist/assets/{AdminTabs-o7ydWGf3.js → AdminTabs-BsOfmLas.js} +1 -1
- package/dist/assets/AiProfiles-CCqpaNjG.js +3 -0
- package/dist/assets/{BrokerForm-BTW5XOei.js → BrokerForm-Drb3n-di.js} +1 -1
- package/dist/assets/{Build-DlKOwH9F.js → Build-BSu-hlCH.js} +5 -5
- package/dist/assets/{Capabilities-DjmSs_7z.js → Capabilities-B9tN-DdS.js} +1 -1
- package/dist/assets/{CapabilityBadges-Vmt1jUay.js → CapabilityBadges-BNXFPTSR.js} +1 -1
- package/dist/assets/{Cluster-BeImZiRl.js → Cluster-LnvP_-DT.js} +1 -1
- package/dist/assets/{Data-4-wW7xvW.js → Data-DQoZzIZB.js} +1 -1
- package/dist/assets/{DetectionIntelligence-CWbr8tbP.js → DetectionIntelligence-CFoMsLZW.js} +1 -1
- package/dist/assets/{DeviceAggregateSection-C4r0oKj-.js → DeviceAggregateSection-D7sNSnRE.js} +1 -1
- package/dist/assets/{DeviceDetail-6WuuADci.js → DeviceDetail-COpbvbHy.js} +2 -2
- package/dist/assets/{Devices-Cdo9T7Hl.js → Devices-BXT6J0za.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-DpyEXMIj.js → EmbedPlayerPage-DQFmWgyi.js} +1 -1
- package/dist/assets/{Events-db2XpiCE.js → Events-Cepqohr3.js} +1 -1
- package/dist/assets/{FormBuilder-DghVmYdW.js → FormBuilder-yxzbuGp1.js} +1 -1
- package/dist/assets/{Identity-ClINn19j.js → Identity-4UbH5joN.js} +1 -1
- package/dist/assets/{IntegrationDetail-huq1COpc.js → IntegrationDetail-FBpSiNiq.js} +1 -1
- package/dist/assets/Integrations-Bg2x55D6.js +1 -0
- package/dist/assets/{Integrations-BPmUFGaE.js → Integrations-BlwdDz0G.js} +1 -1
- package/dist/assets/{Logs-5x7BN70E.js → Logs-BCcd7cRS.js} +1 -1
- package/dist/assets/{MotionZonesSettings-CXmze-u_.js → MotionZonesSettings-CrtWFnAG.js} +1 -1
- package/dist/assets/{MyAccess-BhJ894bJ.js → MyAccess-D5kgvplj.js} +1 -1
- package/dist/assets/Network-B0MvXDa9.js +1 -0
- package/dist/assets/{NodeAddonsSettingsPanel-CGlq91_1.js → NodeAddonsSettingsPanel-D-zNagxQ.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-BbDP_6p1.js → NodeInferenceDevices-DBUXozHP.js} +1 -1
- package/dist/assets/Notifications-CblnDXBf.js +1 -0
- package/dist/assets/{Pipeline-CRHBUJLp.js → Pipeline-DpNEvH7k.js} +1 -1
- package/dist/assets/{Plates-CEqBb-FM.js → Plates-CceWOulf.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-U7is4jPg.js → PrivacyMaskSettings-1sJg0nCf.js} +1 -1
- package/dist/assets/{ProviderIcon-givAANxO.js → ProviderIcon-D6droj6v.js} +1 -1
- package/dist/assets/Recordings-ZhiDhtnW.js +1 -0
- package/dist/assets/{ScanNetworkModal-CaQ94SG1.js → ScanNetworkModal-DB571PA-.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-eQIpVebT.js → SceneMonitorEditor-B_qhxMl3.js} +1 -1
- package/dist/assets/{Scenes-CLwcW9a8.js → Scenes-CPSr7A8e.js} +1 -1
- package/dist/assets/{Settings-DJQz_Bo7.js → Settings-DWSXbJID.js} +1 -1
- package/dist/assets/{Showroom-BGbYDTbE.js → Showroom-Cm3xY6GG.js} +1 -1
- package/dist/assets/{Terminal-Y0gaj8at.js → Terminal-7ZPYC_zr.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-oPoXa9Oo.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CwufIJ7b.js} +1 -1
- package/dist/assets/{bell-ring-DRfEO3L-.js → bell-ring-Bzv8dm-v.js} +1 -1
- package/dist/assets/{boxes-CY6P6ESy.js → boxes-DyONyMfj.js} +1 -1
- package/dist/assets/{build-cluster-graph-BxwbxzWM.js → build-cluster-graph-BvbjCtkO.js} +1 -1
- package/dist/assets/circle-check-big-abMS-_w1.js +1 -0
- package/dist/assets/{circle-x-vKF_48Fk.js → circle-x-BagyAbVd.js} +1 -1
- package/dist/assets/clock-cR19SlFN.js +1 -0
- package/dist/assets/{copy-CxvRrzFo.js → copy-Cg682Ob5.js} +1 -1
- package/dist/assets/{debounced-invalidate-I_3fI5zr.js → debounced-invalidate-CcW_auXQ.js} +1 -1
- package/dist/assets/{dist-CZ2cb_5L.js → dist-B7jD-S4H.js} +1 -1
- package/dist/assets/dist-Cpz6pXi5.js +345 -0
- package/dist/assets/{download-CTN_vvVN.js → download--fExXTTV.js} +1 -1
- package/dist/assets/{face-bbox-Bnh3onDU.js → face-bbox-Cz1g9sBR.js} +1 -1
- package/dist/assets/{hard-drive-sN0JoQ5e.js → hard-drive-CeO72W4c.js} +1 -1
- package/dist/assets/{hostInit-CMvK8ug_.js → hostInit-CxhESPfk.js} +1 -1
- package/dist/assets/{index-BPmtCsWe.js → index-C4gpE4dh.js} +3 -3
- package/dist/assets/{key-round-DeJeMZoU.js → key-round-Di2VNu4U.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-998f9e18.js → mf-entry-bootstrap-0-99898c10.js} +2 -2
- package/dist/assets/{pencil-dn6J_3O1.js → pencil-DLvxk9x1.js} +1 -1
- package/dist/assets/play-UOl727Zq.js +1 -0
- package/dist/assets/{player-overlays-vzvf47qo.js → player-overlays-UTlrOH4s.js} +1 -1
- package/dist/assets/plus-CLrUKG39.js +1 -0
- package/dist/assets/power-CozRqx8K.js +1 -0
- package/dist/assets/{radio-jngo5rsf.js → radio-RZ7CZVIj.js} +1 -1
- package/dist/assets/{refresh-cw-BmW2aBNL.js → refresh-cw-6kHXys54.js} +1 -1
- package/dist/assets/remoteEntry-D-9G_Rwp.js +1 -0
- package/dist/assets/rotate-ccw-DV-a5MvB.js +1 -0
- package/dist/assets/rotate-cw-B4c6V4Ez.js +1 -0
- package/dist/assets/search-Diuzp1ZB.js +1 -0
- package/dist/assets/{send-B8-V6Q5N.js → send-DKjSQk9v.js} +1 -1
- package/dist/assets/{server-DMGjCytV.js → server-cirmHxYC.js} +1 -1
- package/dist/assets/square-DHyM8h05.js +1 -0
- package/dist/assets/{square-check-big-BUkZndXA.js → square-check-big-ZW9Cb-30.js} +1 -1
- package/dist/assets/src-C9CFJqET.js +345 -0
- package/dist/assets/{src-B_5K5Nhw.js → src-CEchIfpK.js} +7 -7
- package/dist/assets/{star-07cYs3kE.js → star-DYsm4pCY.js} +1 -1
- package/dist/assets/{undo-2-CGo4ph-C.js → undo-2-B4nFfmbK.js} +1 -1
- package/dist/assets/{upload-Cs19I6eI.js → upload-CAXNjiO6.js} +1 -1
- package/dist/assets/{use-scenes-feed-D9vEiyCy.js → use-scenes-feed-CCncPGkQ.js} +1 -1
- package/dist/assets/{useEventInvalidation-D43dbHb5.js → useEventInvalidation-V6uvnrrN.js} +1 -1
- package/dist/assets/{video-CtTYTFm3.js → video-BJrMHLZ5.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-Dk8z8-Lg.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DtSdTes5.js} +2 -2
- package/dist/assets/{wifi-B-4lveV3.js → wifi-CusedooP.js} +1 -1
- package/dist/assets/{zap-C-XrexOK.js → zap-DUeFTNxj.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/server/addon.js +30 -4
- package/package.json +1 -1
- package/dist/assets/AiProfiles-BWpPEg7i.js +0 -3
- package/dist/assets/Integrations-q0JQHORH.js +0 -1
- package/dist/assets/Network-Bm9LniKC.js +0 -1
- package/dist/assets/Notifications-Cs2Llu4a.js +0 -1
- package/dist/assets/Recordings-BaHXqEXn.js +0 -1
- package/dist/assets/circle-check-big-DEt-jG8h.js +0 -1
- package/dist/assets/clock-BaBVy3Lm.js +0 -1
- package/dist/assets/dist-LvoQmQKy.js +0 -345
- package/dist/assets/play-BWAbFUvA.js +0 -1
- package/dist/assets/plus-CN7JZeR9.js +0 -1
- package/dist/assets/power-CaWCTJS2.js +0 -1
- package/dist/assets/remoteEntry-D-vWNjbB.js +0 -1
- package/dist/assets/rotate-ccw-DNLmlufh.js +0 -1
- package/dist/assets/rotate-cw-X0iW9Gr9.js +0 -1
- package/dist/assets/search-CoCX98St.js +0 -1
- package/dist/assets/square-BS6-4_m-.js +0 -1
- package/dist/assets/src-CQYt_2Ec.js +0 -345
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as e,Q as t,S as n,W as r,o as i,q as a,x as o,z as s}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{Z as c,q as l}from"./player-overlays-vzvf47qo.js";import{Ba as u,Bo as d,Co as f,Do as p,Fo as m,Ho as h,Io as g,Lo as _,Oo as v,Os as y,Rr as b,So as x,To as S,Uo as C,Vo as w,Wa as T,Yi as E,Zt as D,ea as O,gn as k,ia as A,ko as ee,la as te,ma as ne,mn as j,on as re,tt as M,un as N,wo as ie,xo as ae,zo as oe}from"./src-B_5K5Nhw.js";import{Tt as P,tt as F}from"./src-CQYt_2Ec.js";import{t as se}from"./circle-x-vKF_48Fk.js";import{t as ce}from"./download-CTN_vvVN.js";import{t as I}from"./hard-drive-sN0JoQ5e.js";import{C as L,G as R,K as z,M as B,O as V,V as H,i as U,s as W}from"./index-BPmtCsWe.js";import{t as le}from"./AdminPage-CCD07UMs.js";import{r as ue}from"./authed-media-BPd_L9jr.js";import{t as de}from"./DeviceAggregateSection-C4r0oKj-.js";import{t as fe}from"./AdminTabs-o7ydWGf3.js";import{t as G}from"./format-size-CO9d3C3-.js";import{i as K,n as pe,r as me,t as he}from"./AddLocationWizard-BplATOR7.js";var q=z(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),J=z(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),ge=z(`settings-2`,[[`path`,{d:`M20 7h-9`,key:`3s1dr2`}],[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]);t();function _e(){let e=b({}),t=r(()=>(e.data??[]).filter(e=>e.type===F.Camera).sort((e,t)=>e.name.localeCompare(t.name)),[e.data]),[i,s]=a(null),c=i??t[0]?.id??null;return!e.isLoading&&t.length===0?o(D,{icon:H,title:`No cameras`,description:`Add a camera first.`}):n(`div`,{className:`space-y-3`,children:[n(`div`,{className:`flex items-center gap-2`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),o(`select`,{value:c??``,onChange:e=>s(Number(e.target.value)),className:`rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:t.map(e=>o(`option`,{value:e.id,children:e.name},e.id))})]}),c!==null&&o(re,{deviceId:c,children:o(de,{deviceId:c,sectionFilter:e=>e.location===`top-tab`&&e.tab===`recording`})},c)]})}t();var ve=[`high`,`mid`,`low`],ye=[{value:1,label:`Real time (1×)`},{value:2,label:`2×`},{value:4,label:`4×`},{value:8,label:`8×`},{value:16,label:`16×`}],be=10080*60*1e3;function Y(e){let t=new Date(Date.now()-e*6e4),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function xe({onClose:e,onCreated:t}){let i=b({}),s=r(()=>(i.data??[]).filter(e=>e.type===F.Camera).sort((e,t)=>e.name.localeCompare(t.name)),[i.data]),[c,l]=a(``),[u,d]=a(`high`),[p,m]=a(Y(60)),[h,g]=a(Y(0)),[_,v]=a(1),[y,x]=a(!0),[S,C]=a(``),[w,T]=a(null),E=c===``?s[0]?.id??null:c,D=new Date(p).getTime(),O=new Date(h).getTime(),k=Number.isFinite(D)&&Number.isFinite(O)&&D<O,A=f({onSuccess:()=>{t(),e()},onError:e=>T(e instanceof Error?e.message:String(e))});return o(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:e,children:n(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[n(`h2`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[o(V,{className:`h-3.5 w-3.5`}),`New export`]}),o(`button`,{onClick:e,className:`text-foreground-subtle hover:text-foreground`,children:o(U,{className:`h-4 w-4`})})]}),n(`div`,{className:`p-4 space-y-3`,children:[n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),o(`select`,{value:E??``,onChange:e=>l(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:s.map(e=>o(`option`,{value:e.id,children:e.name},e.id))})]}),n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Profile`}),o(`select`,{value:u,onChange:e=>d(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:ve.map(e=>o(`option`,{value:e,children:e},e))})]})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`From`}),o(`input`,{type:`datetime-local`,value:p,onChange:e=>m(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]}),n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`To`}),o(`input`,{type:`datetime-local`,value:h,onChange:e=>g(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`})]})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Speed`}),o(`select`,{value:_,onChange:e=>v(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:ye.map(e=>o(`option`,{value:e.value,children:e.label},e.value))})]}),n(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Title (optional)`}),o(`input`,{type:`text`,value:S,onChange:e=>C(e.target.value),placeholder:`e.g. courier at the gate`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle`})]})]}),n(`label`,{className:`flex items-center gap-2 text-xs text-foreground cursor-pointer`,children:[o(`input`,{type:`checkbox`,checked:y,disabled:_!==1,onChange:e=>x(e.target.checked),className:`accent-primary`}),`Include audio`,_===1?``:` (real-time only)`]}),!k&&o(`p`,{className:`text-[11px] text-danger`,children:`"From" must be before "To".`}),w&&o(`p`,{className:`text-[11px] text-danger`,children:w})]}),n(`div`,{className:`flex justify-end gap-2 border-t border-border px-4 py-3`,children:[o(`button`,{onClick:e,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground`,children:`Cancel`}),o(`button`,{onClick:()=>{if(E===null||!k)return;T(null);let e=S.trim();A.mutate({deviceId:E,profile:u,fromMs:D,toMs:O,options:{includeAudio:y,maxLifeMs:be,deleteAfterDownload:!1,..._===1?{}:{speed:_},...e.length>0?{title:e}:{}}})},disabled:E===null||!k||A.isPending,className:`rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:A.isPending?`Queuing…`:`Create export`})]})]})})}function Se(e){let t=[];return e.timelapse?t.push(`timelapse ${String(e.timelapse.everyMs/1e3)}s`):(t.push(`${String(e.speed??1)}×`),e.includeAudio&&t.push(`+ audio`)),t.join(` `)}function Ce(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function we(e,t){let n=Math.max(0,Math.round((t-e)/1e3)),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=r>0?`${String(r)}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`:`${String(i)}:${String(a).padStart(2,`0`)}`;return`${Ce(e)} · ${o}`}function Te(e,t){let n=e-t;if(n<=0)return`expired`;let r=Math.floor(n/6e4);if(r<60)return`in ${String(r)}m`;let i=Math.floor(r/60);return i<24?`in ${String(i)}h`:`in ${String(Math.floor(i/24))}d`}function Ee(e,t,n,r){return e.map(e=>{if(e.state===`expired`||e.state===`deleted`)return e;let i=r.get(e.id);if(i)return{...e,state:`failed`,error:i.error,progressPct:null};let a=n.get(e.id);if(a)return{...e,state:`ready`,fileBytes:a.fileBytes,progressPct:100};let o=t.get(e.id);return o&&(e.state===`queued`||e.state===`rendering`)?{...e,state:`rendering`,progressPct:o.progressPct}:e})}t();var De=[[`recordingExport`]],Oe={queued:{cls:`bg-muted text-foreground-subtle`,label:`queued`},rendering:{cls:`bg-primary/10 text-primary`,label:`rendering`,spin:!0},ready:{cls:`bg-success/10 text-success`,label:`ready`},failed:{cls:`bg-danger/10 text-danger`,label:`failed`},expired:{cls:`bg-muted text-foreground-subtle`,label:`expired`},deleted:{cls:`bg-muted text-foreground-subtle`,label:`deleted`}};function ke(){let{data:e,isLoading:t}=S({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:n}=y(P.RecordingExportProgress,e=>e.exportId),{map:i}=y(P.RecordingExportCompleted,e=>e.exportId),{map:a}=y(P.RecordingExportFailed,e=>e.exportId);return{rows:r(()=>Ee(e??[],n,i,a),[e,n,i,a]),isLoading:t}}function Ae(e){let[t,n]=a(()=>Date.now());return s(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function je(){let t=i(),[s,l]=a(!1),u=()=>{t.invalidateQueries({queryKey:[[`recordingExport`,`listExports`]]})},d=N(),f=c().trpcClient,p=Ae(6e4),{rows:m,isLoading:h}=ke(),{data:g}=b({}),_=r(()=>{let e=new Map;for(let t of g??[])e.set(t.id,t.name);return e},[g]),v=e(()=>{t.invalidateQueries({queryKey:De})},[t]),y=x({onSuccess:v}),S=ie({onSuccess:v}),[C,w]=a(null),T=e(async e=>{w(e.id);try{let{url:t}=await f.recordingExport.getDownloadUrl.query({exportId:e.id}),n=await ue(t),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e.options.title??e.id}.mp4`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r),v()}finally{w(null)}},[f,v]),E=e(async e=>{await d({title:`Cancel this export?`,message:`Stops the render. The partial file is discarded.`,confirmLabel:`Cancel export`,variant:`danger`})&&y.mutate({exportId:e.id})},[d,y]),O=e(async e=>{await d({title:`Delete this export?`,message:`Permanently removes the rendered file and its history row.`,confirmLabel:`Delete`,variant:`danger`})&&S.mutate({exportId:e.id})},[d,S]),k=r(()=>[{key:`camera`,header:`Camera`,render:e=>o(`span`,{className:`text-foreground`,children:_.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:`Range`,nowrap:!0,render:e=>o(`span`,{className:`tabular-nums`,children:we(e.fromMs,e.toMs)})},{key:`variant`,header:`Variant`,render:e=>o(`span`,{className:`text-foreground-subtle`,children:Se(e.options)})},{key:`state`,header:`State`,render:e=>{let t=Oe[e.state];return n(`span`,{className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium ${t.cls}`,children:[t.spin&&o(L,{className:`h-2.5 w-2.5 animate-spin`}),t.label,e.state===`rendering`&&e.progressPct!==null&&n(`span`,{className:`tabular-nums`,children:[e.progressPct,`%`]})]})}},{key:`expiry`,header:`Expires`,nowrap:!0,render:e=>e.state===`deleted`?o(`span`,{className:`text-foreground-subtle`,children:`—`}):o(`span`,{className:`text-foreground-subtle tabular-nums`,children:Te(e.expiresAt,p)})},{key:`size`,header:`Size`,align:`right`,nowrap:!0,render:e=>o(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:G(e.fileBytes)})},{key:`actions`,header:``,align:`right`,render:e=>{let t=e.state===`ready`,r=e.state===`queued`||e.state===`rendering`,i=e.state!==`deleted`;return n(`div`,{className:`flex items-center justify-end gap-1`,children:[t&&n(`button`,{onClick:()=>{T(e)},disabled:C===e.id,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-primary/10 hover:text-foreground disabled:opacity-50`,title:`Download MP4`,children:[C===e.id?o(L,{className:`h-3 w-3 animate-spin`}):o(ce,{className:`h-3 w-3`}),`Download`]}),r&&n(`button`,{onClick:()=>{E(e)},disabled:y.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50`,title:`Cancel render`,children:[o(se,{className:`h-3 w-3`}),`Cancel`]}),i&&o(`button`,{onClick:()=>{O(e)},disabled:S.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:`Delete export`,children:o(W,{className:`h-3 w-3`})})]})}}],[_,p,C,y.isPending,S.isPending,T,E,O]);return h&&m.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[o(L,{className:`h-4 w-4 animate-spin`}),`Loading exports…`]}):n(`div`,{className:`space-y-3`,children:[o(`div`,{className:`flex justify-end`,children:n(`button`,{onClick:()=>l(!0),className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground`,children:[o(V,{className:`h-3.5 w-3.5`}),`New export`]})}),m.length===0?o(D,{icon:V,title:`No exports yet`,description:`Create one here (New export) or from a camera's timeline in the viewer. Rendered clips show up here to download or manage.`}):o(M,{columns:k,rows:m,rowKey:e=>e.id,minWidthPx:720}),s&&o(xe,{onClose:()=>l(!1),onCreated:u})]})}function X(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function Z(e,t){let n=X(e);return n.length===0?`default root`:n.map(e=>t.get(e)??e).join(` + `)}function Me(e,t,n){if(e.length===0)return null;let r=e[0];if(e.length===1&&r!==void 0)return{label:Z(r,t),exact:!0};if(n===null)return null;let i=e.find(e=>X(e).includes(n));return i===void 0?null:{label:Z(i,t),exact:!1}}t();var Ne=[[`recording`]],Q=[{value:`retention`,label:`Retention policy`},{value:`quota`,label:`Quota / disk pressure`},{value:`operator`,label:`Operator`}];function Pe(e){return e.totalBytes===null||e.totalBytes<=0?null:Math.min(1,Math.max(0,e.usedBytes/e.totalBytes))}function Fe(){let t=i(),s=N(),[c,u]=a(`retention`),{data:d,isLoading:f}=p({},{refetchOnWindowFocus:!1}),{data:m}=b({}),{data:h}=_({}),g=r(()=>{let e=new Map;for(let t of m??[])e.set(t.id,t.name);return e},[m]),v=r(()=>{let e=new Map;for(let t of h??[])e.set(t.id,t.displayName);return e},[h]),y=r(()=>(h??[]).find(e=>e.type===`recordings`&&e.isDefault)?.id??null,[h]),x=r(()=>Me(d?.locations??[],v,y),[d?.locations,v,y]),S=e(()=>{t.invalidateQueries({queryKey:Ne})},[t]),C=ee({onSuccess:S}),w=ae({onSuccess:S}),T=e(async e=>{await s({title:`Prune ${g.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Applies the retention policy now (reason: ${c}). Footage beyond the policy is permanently deleted.`,confirmLabel:`Prune now`,variant:`danger`})&&C.mutate({deviceId:e.deviceId,reason:c})},[s,C,c,g]),E=e(async e=>{await s({title:`Delete all footage for ${g.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${G(e.usedBytes)} of recorded footage for this camera. This cannot be undone.`,confirmLabel:`Delete ${G(e.usedBytes)}`,variant:`danger`})&&w.mutate({deviceId:e.deviceId})},[s,w,g]),O=r(()=>[{key:`camera`,header:`Camera`,render:e=>o(`span`,{className:`text-foreground`,children:g.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`disk`,header:`Disk`,nowrap:!0,render:()=>x===null?o(`span`,{className:`text-foreground-subtle`,children:`—`}):n(`span`,{className:x.exact?`text-foreground`:`text-foreground-subtle`,title:x.exact?`The only recordings volume on this node — this camera can only be here.`:`The recordings DEFAULT. This node has several recordings volumes and the per-camera placement is not reported by recording.getStorageUsage, so this is where footage lands by default rather than a per-camera fact.`,children:[x.label,!x.exact&&o(`span`,{className:`ml-1 text-foreground-subtle`,children:`(default)`})]})},{key:`used`,header:`Used`,align:`right`,nowrap:!0,render:e=>o(`span`,{className:`tabular-nums`,children:G(e.usedBytes)})},{key:`actions`,header:``,align:`right`,render:e=>n(`div`,{className:`flex items-center justify-end gap-1`,children:[n(`button`,{onClick:()=>{T(e)},disabled:C.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50`,title:`Apply retention policy now`,children:[o(J,{className:`h-3 w-3`}),`Prune`]}),n(`button`,{onClick:()=>{E(e)},disabled:w.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:`Delete all footage`,children:[o(W,{className:`h-3 w-3`}),`Delete`]})]})}],[g,x,T,E,C.isPending,w.isPending]);if(f&&!d)return n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[o(L,{className:`h-4 w-4 animate-spin`}),`Loading storage usage…`]});if(!d)return o(D,{icon:I,title:`No storage data`,description:`The recording node has not reported any storage usage yet.`});let k=d.devices.length;return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[o(l,{label:`Total used`,icon:o(I,{className:`h-3 w-3`}),footer:`${String(k)} camera${k===1?``:`s`} on ${d.nodeId}`,children:G(d.totalUsedBytes)}),d.locations.map(e=>{let t=Pe(e),r=e.locationId??`default`;return o(l,{label:`Disk: ${(e.locationIds??[r]).join(` + `)}`,footer:e.availableBytes===null?`${G(e.usedBytes)} used (capacity unknown)`:`${G(e.availableBytes)} free${e.totalBytes===null?``:` of ${G(e.totalBytes)}`}`,children:t===null?o(`span`,{className:`tabular-nums`,children:G(e.usedBytes)}):n(`div`,{className:`flex items-center gap-2`,children:[o(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:o(`div`,{className:`h-full rounded ${t>.9?`bg-danger`:t>.75?`bg-amber-500`:`bg-primary`}`,style:{width:`${String(Math.round(t*100))}%`}})}),n(`span`,{className:`tabular-nums text-xs`,children:[Math.round(t*100),`%`]})]})},r)})]}),n(`section`,{className:`flex items-center gap-2 text-xs`,children:[o(`label`,{htmlFor:`prune-reason`,className:`text-foreground-subtle`,children:`Prune reason`}),o(`select`,{id:`prune-reason`,value:c,onChange:e=>{let t=Q.find(t=>t.value===e.target.value);t&&u(t.value)},className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:Q.map(e=>o(`option`,{value:e.value,children:e.label},e.value))})]}),k===0?o(D,{icon:I,title:`No recorded footage`,description:`No camera has recorded footage on this node yet.`}):o(M,{columns:O,rows:[...d.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}t();var Ie=[{value:`all`,label:`All`},{value:`recording`,label:`Recordings`},{value:`events`,label:`Events`}],Le={recording:`bg-primary/10 text-primary`,events:`bg-violet-500/10 text-violet-400`};function Re(e){return new Date(e).toLocaleString()}function ze(){let[e,t]=a(`all`),{data:i,isLoading:s}=v({},{refetchOnWindowFocus:!1}),{data:c,isLoading:l}=te({},{refetchOnWindowFocus:!1}),{data:u}=b({}),d=r(()=>{let e=new Map;for(let t of u??[])e.set(t.id,t.name);return e},[u]),f=r(()=>{let t=[...i??[],...c??[]];return(e===`all`?t:t.filter(t=>t.domain===e)).toSorted((e,t)=>t.at-e.at)},[i,c,e]),p=r(()=>[{key:`at`,header:`When`,nowrap:!0,render:e=>o(`span`,{className:`text-foreground-subtle tabular-nums`,children:Re(e.at)})},{key:`domain`,header:`Domain`,render:e=>o(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${Le[e.domain]}`,children:e.domain})},{key:`op`,header:`Operation`,render:e=>o(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:`Reason`,render:e=>o(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:`Camera`,render:e=>e.deviceId===null?o(`span`,{className:`text-foreground-subtle`,children:`cluster`}):o(`span`,{className:`text-foreground`,children:d.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`items`,header:`Items`,align:`right`,nowrap:!0,render:e=>o(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:`Reclaimed`,align:`right`,nowrap:!0,render:e=>o(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?G(e.bytesReclaimed):`—`})}],[d]),m=s||l;return n(`div`,{className:`flex flex-col gap-4`,children:[o(`div`,{className:`flex items-center gap-1`,children:Ie.map(n=>o(`button`,{onClick:()=>t(n.value),className:`rounded px-2 py-1 text-xs font-medium ${e===n.value?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-muted`}`,children:n.label},n.value))}),m&&f.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[o(L,{className:`h-4 w-4 animate-spin`}),`Loading activity…`]}):f.length===0?o(D,{icon:R,title:`No activity yet`,description:`Prune, delete and rescan operations across recordings and events show up here.`}):o(M,{columns:p,rows:f,rowKey:e=>e.id,minWidthPx:720})]})}t();function $({types:e}){let t=i(),s=N(),{data:c}=_({}),l=g(),u=r(()=>l.data??[],[l.data]),[d,f]=a(null),[p,h]=a(null),v=()=>{t.invalidateQueries({queryKey:[[`storage`,`listLocations`]]})},y=C({onSuccess:v}),b=m({onSuccess:v}),x=r(()=>{let e=new Map;for(let t of c??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[c]),S=e=>{e.isDefault||y.mutate(K(e,{isDefault:!0}))},w=(e,t)=>{y.mutate(K(e,{enabled:t}))},T=async e=>{if(e.isDefault){await s({title:`Cannot delete default location`,message:`"${e.displayName}" is the default for type "${e.type}". Mark another as default first.`,confirmLabel:`OK`,variant:`warning`});return}await s({title:`Delete location "${e.displayName}"?`,message:`Removes the record; files on disk are untouched.`,confirmLabel:`Delete`,variant:`danger`})&&b.mutate({id:e.id})},E=e.map(e=>u.find(t=>t.id===e)).filter(e=>e!==void 0);return n(`div`,{className:`space-y-3`,children:[E.length===0?o(`p`,{className:`text-[11px] text-foreground-subtle italic`,children:`No storage locations declared for this purpose.`}):E.map(e=>o(me,{type:e.id,displayName:e.displayName,description:e.description,cardinality:e.cardinality,locations:x.get(e.id)??[],onAdd:e=>f(e),onEdit:e=>h(e),onDelete:e=>{T(e)},onSetDefault:e=>S(e),onToggleEnabled:(e,t)=>w(e,t)},e.id)),d!==null&&o(he,{initialType:d,onClose:()=>f(null),onCreated:()=>{v(),f(null)}}),p!==null&&o(pe,{location:p,onClose:()=>h(null),onSaved:()=>{v(),h(null)}})]})}t();var Be=`pipeline-analytics`;function Ve(e){for(let t of e?.sections??[])for(let e of t.fields??[])if(e.key===`postProcessingNodeId`&&typeof e.value==`string`)return e.value;return`hub`}function He(){let e=i(),{data:t}=E(void 0),{data:a,isLoading:s}=j({addonId:Be}),c=Ve(a),l=k({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),u=r(()=>{let e=(t??[]).filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,c,...e])].filter(Boolean)},[t,c]);return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[o(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node`}),o(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that runs detection post-processing (events, media, audio & motion). Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[s?o(L,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):o(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:Be,patch:{postProcessingNodeId:e.target.value}})},disabled:l.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:u.map(e=>o(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&o(L,{className:`h-4 w-4 animate-spin text-primary`})]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[o(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Events folder`}),o(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`Where event crops / full frames are stored. A single folder — no collection / equal-splitting.`}),o($,{types:[`eventMedia`]})]})]})}t();var Ue=`recorder`;function We(e,t,n){for(let n of e?.sections??[])for(let e of n.fields??[])if(e.key===t&&typeof e.value==`string`)return e.value;return n}function Ge(){let e=i(),{data:t}=E(void 0),{data:a,isLoading:s}=j({addonId:Ue}),c=We(a,`recordingNodeId`,`hub`),l=k({onSuccess:()=>{e.invalidateQueries({queryKey:[[`addonSettings`,`getGlobalSettings`]]})}}),u=r(()=>{let e=(t??[]).filter(e=>e.isOnline).map(e=>e.id);return[...new Set([`hub`,c,...e])].filter(Boolean)},[t,c]);return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[o(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Recording node`}),o(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that records (continuous & events) and serves playback. Every other node stays inert — no multi-node balancing. Takes effect on addon restart.`}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[s?o(L,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):o(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:Ue,patch:{recordingNodeId:e.target.value}})},disabled:l.isPending,className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:u.map(e=>o(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&o(L,{className:`h-4 w-4 animate-spin text-primary`})]}),c!==`hub`&&n(`p`,{className:`mt-2 text-[11px] text-amber-500`,children:[`The stream-broker is hub-only — an agent recorder pulls streams from the hub over the network. The hub's RTSP restream port must be reachable from`,` `,o(`span`,{className:`font-medium`,children:c}),`. If the auto-derived host doesn't work, set the recorder's`,o(`span`,{className:`font-medium`,children:` recordingHubHostname`}),` global setting.`]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[o(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Recordings folders`}),o(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`Where recordings are stored. Multi-location collections — segments are split across the locations of a type. Add a location to grow capacity; mark one default per type.`}),o($,{types:[`recordings`,`recordingsLow`]})]})]})}t();var Ke=2e3;function qe(){let e=N(),t=i(),r=T(),a=u(void 0,{refetchInterval:e=>e.state.data?.state===`running`?Ke:!1}),c=a.data,l=c?.state===`running`,d=l||r.isPending;s(()=>{c?.state!==`done`||c.finishedAtMs===null||(t.invalidateQueries({queryKey:[[`recording`]]}),t.invalidateQueries({queryKey:[[`pipelineAnalytics`]]}))},[c?.state,c?.finishedAtMs,t]);let f=async()=>{await e({title:`Reconcile storage from disk?`,message:`Makes the database match the filesystem: recordings index, tracks, events and media whose files are gone. Favourited tracks without files are deleted. Snapshot-less motion/audio events are deleted. Enrolled identities stay. This cannot be undone.`,confirmLabel:`Reconcile`,variant:`warning`})&&(await r.mutateAsync(),await a.refetch())},p=l?c.total>0?`Reconciling ${String(c.completed)}/${String(c.total)}…`:`Reconciling…`:r.isPending?`Reconciling…`:`Reconcile from disk`;return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[o(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Disk reconcile`}),o(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Makes the database match the filesystem for recordings, tracks, events and media. Rows whose files are gone are deleted, including snapshot-less motion events. Enrolled identities stay. The walk runs on the hub; you can leave this page.`}),n(`div`,{className:`mt-3 flex flex-col gap-2`,children:[n(`button`,{type:`button`,onClick:()=>void f(),disabled:d,className:`inline-flex w-fit items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-[11px] font-medium border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50`,children:[d?o(L,{className:`h-3.5 w-3.5 animate-spin`}):o(I,{className:`h-3.5 w-3.5`}),p]}),c?.state===`done`?n(`p`,{className:`text-[11px] text-foreground-subtle`,children:[`Last run: `,String(c.completed),` camera(s) — dropped `,String(c.tracks),` tracks,`,` `,String(c.events),` events, `,String(c.mediaDropped),` media`,c.failed.length>0?`, ${String(c.failed.length)} failed (${c.failed.join(`, `)})`:``,`.`]}):null,c?.state===`error`&&c.error!==null?n(`p`,{className:`text-[11px] text-destructive`,children:[`Reconcile failed: `,c.error]}):null]})]})}t();var Je=[[`pipelineAnalytics`]],Ye=1440*60*1e3,Xe=[{days:1,label:`1 day`},{days:7,label:`7 days`},{days:30,label:`30 days`},{days:90,label:`90 days`}];function Ze(){let t=i(),s=N(),[c,u]=a(30),{data:d,isLoading:f}=A({},{refetchOnWindowFocus:!1}),{data:p}=b({}),m=r(()=>{let e=new Map;for(let t of p??[])e.set(t.id,t.name);return e},[p]),h=e(()=>{t.invalidateQueries({queryKey:Je})},[t]),g=ne({onSuccess:h}),_=O({onSuccess:h}),v=e(async()=>{await s({title:`Prune events older than ${String(c)} day${c===1?``:`s`}?`,message:`Permanently deletes every event (motion / object / audio) older than the cutoff across all cameras, and their media. This cannot be undone.`,confirmLabel:`Prune events`,variant:`danger`})&&g.mutate({olderThanMs:Date.now()-c*Ye,reason:`retention`})},[s,g,c]),y=e(async e=>{await s({title:`Delete all events for ${m.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${String(e.rows)} event${e.rows===1?``:`s`} (${G(e.bytes)} of media) for this camera. This cannot be undone.`,confirmLabel:`Delete events`,variant:`danger`})&&_.mutate({deviceId:e.deviceId})},[s,_,m]),x=r(()=>[{key:`camera`,header:`Camera`,render:e=>o(`span`,{className:`text-foreground`,children:m.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`rows`,header:`Events`,align:`right`,nowrap:!0,render:e=>o(`span`,{className:`tabular-nums`,children:e.rows.toLocaleString()})},{key:`bytes`,header:`Media`,align:`right`,nowrap:!0,render:e=>o(`span`,{className:`tabular-nums`,children:G(e.bytes)})},{key:`actions`,header:``,align:`right`,render:e=>n(`button`,{onClick:()=>{y(e)},disabled:_.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:`Delete all events for this camera`,children:[o(W,{className:`h-3 w-3`}),`Delete`]})}],[m,y,_.isPending]);return f&&!d?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[o(L,{className:`h-4 w-4 animate-spin`}),`Loading event-store footprint…`]}):d?n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[o(l,{label:`Total events`,icon:o(B,{className:`h-3 w-3`}),footer:`across ${String(d.devices.length)} camera${d.devices.length===1?``:`s`}`,children:d.totalRows.toLocaleString()}),o(l,{label:`Event media on disk`,children:G(d.totalBytes)})]}),n(`section`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[o(`span`,{className:`text-foreground-subtle`,children:`Prune events older than`}),o(`select`,{value:c,onChange:e=>u(Number(e.target.value)),className:`rounded-md border border-border bg-surface px-2 py-1 text-xs text-foreground`,children:Xe.map(e=>o(`option`,{value:e.days,children:e.label},e.days))}),n(`button`,{onClick:()=>{v()},disabled:g.isPending,className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs font-medium text-foreground-subtle hover:bg-amber-500/10 hover:text-amber-500 disabled:opacity-50`,children:[g.isPending?o(L,{className:`h-3 w-3 animate-spin`}):o(J,{className:`h-3 w-3`}),`Prune now`]})]}),d.devices.length===0?o(D,{icon:B,title:`No stored events`,description:`No camera has persisted events yet.`}):o(M,{columns:x,rows:[...d.devices],rowKey:e=>e.deviceId,minWidthPx:480})]}):o(D,{icon:B,title:`No event data`,description:`Pipeline analytics has not reported any event-store footprint yet.`})}t();var Qe=`storage-migration`;function $e(){let{data:e}=E(void 0);return(e??[]).some(e=>e.addons.some(e=>e.capabilities.includes(Qe)))}var et=[{id:`recordings`,label:`Recordings`,locationType:`recordings`},{id:`recordingsLow`,label:`Low-res recordings`,locationType:`recordingsLow`},{id:`eventMedia`,label:`Event media`,locationType:`eventMedia`}],tt=new Set([`planning`,`pausing`,`moving`,`verifying`,`repointing`,`refreshing`,`resuming`]);function nt(){return $e()?o(rt,{}):o(D,{icon:q,title:`Storage migration not installed`,description:`This system doesn't advertise the storage-migration capability yet. Once it's deployed, this panel moves recordings, low-res recordings and event media to new storage locations in one coordinated, verified operation.`})}function rt(){let e=N(),{data:t}=_({}),[i,s]=a({}),[c,l]=a(null),[u,f]=a(null),p=r(()=>{let e=new Map;for(let n of t??[]){let t=e.get(n.type);t?t.push(n):e.set(n.type,[n])}return e},[t]),m=h({},{refetchInterval:2e3}),g=m.data??null,v=g!==null&&tt.has(g.phase),y=r(()=>{let e={};for(let t of et){let n=i[t.id];n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[i]),b=d({destinations:y??{}},{enabled:!1,retry:!1}),x=w(),S=oe(),C=async()=>{if(!y)return;f(null);let e=await b.refetch();if(e.error){f(e.error instanceof Error?e.error.message:String(e.error));return}l(e.data??null)},T=async()=>{if(y&&await e({title:`Start storage migration?`,message:`Pauses the affected writers, copies the data to the new locations, verifies it, then repoints the defaults. Safe to re-run if interrupted.`,confirmLabel:`Start migration`,variant:`danger`})){f(null);try{await x.mutateAsync({destinations:y}),l(null),await m.refetch()}catch(e){f(e instanceof Error?e.message:String(e))}}},E=async()=>{if(g&&await e({title:`Cancel migration?`,message:`Stops the in-progress migration. Data already moved and verified stays at the destination; anything already repointed is not reverted.`,confirmLabel:`Cancel migration`,variant:`danger`}))try{await S.mutateAsync({jobId:g.jobId}),await m.refetch()}catch{}};return n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[n(`h3`,{className:`flex items-center gap-1.5 text-sm font-semibold text-foreground`,children:[o(q,{className:`h-3.5 w-3.5`}),`Storage migration`]}),o(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Move recordings, low-res recordings and/or event media to new storage locations in one coordinated operation: pauses the writers, copies via the recorder / pipeline-analytics movers, verifies, then repoints the defaults. Always applies to every camera — destinations are global defaults per storage class, so migration can't be scoped to a subset of cameras. This is the only supported way to move a storage location's data — the Storage tab no longer offers a per-location "Relocate" action.`}),o(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3`,children:et.map(e=>{let t=p.get(e.locationType)??[];return n(`div`,{className:`space-y-1`,children:[o(`label`,{htmlFor:`migration-dest-${e.id}`,className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e.label}),n(`select`,{id:`migration-dest-${e.id}`,value:i[e.id]??``,onChange:t=>{let n=t.target.value;s(t=>({...t,[e.id]:n}))},disabled:v,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:[o(`option`,{value:``,children:`— unchanged —`}),t.map(e=>o(`option`,{value:e.id,children:e.displayName},e.id))]})]},e.id)})}),u&&o(`p`,{className:`mt-2 text-[11px] text-danger`,children:u}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[n(`button`,{type:`button`,onClick:()=>{C()},disabled:!y||b.isFetching||v,className:`inline-flex items-center gap-1.5 rounded border border-border px-2.5 py-1.5 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover disabled:opacity-50`,children:[b.isFetching&&o(L,{className:`h-3 w-3 animate-spin`}),`Plan`]}),n(`button`,{type:`button`,onClick:()=>{T()},disabled:!y||x.isPending||v,className:`inline-flex items-center gap-1.5 rounded bg-primary px-2.5 py-1.5 text-xs font-medium text-primary-foreground disabled:opacity-50`,children:[x.isPending&&o(L,{className:`h-3 w-3 animate-spin`}),`Start migration`]})]}),c&&o(`div`,{className:`mt-3 divide-y divide-border rounded-md border border-border`,children:c.moves.length===0?o(`p`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:`Nothing to move — selected destinations match the current defaults.`}):c.moves.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]},`${e.storageClass}-${e.toLocationId}`))})]}),g&&n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[n(`div`,{className:`flex items-center justify-between`,children:[o(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Migration status`}),v&&n(`button`,{type:`button`,onClick:()=>{E()},className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,children:[o(U,{className:`h-3 w-3`}),`Cancel`]})]}),n(`p`,{className:`mt-1 text-xs text-foreground`,children:[`Phase: `,o(`span`,{className:`font-medium`,children:g.phase}),v&&o(L,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),g.error&&o(`p`,{className:`mt-1 text-[11px] text-danger`,children:g.error}),g.pausedParticipants.length>0&&n(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:[`Paused: `,g.pausedParticipants.join(`, `)]}),o(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:g.moves.map(e=>n(`div`,{className:`flex items-center justify-between px-2.5 py-1.5 text-[11px]`,children:[n(`span`,{className:`text-foreground`,children:[e.storageClass,`: `,e.fromLocationId,` → `,e.toLocationId]}),n(`span`,{className:`text-foreground-subtle`,children:[e.state??`pending`,e.error?` (${e.error})`:``]})]},e.storageClass))})]})]})}function it(){return n(`div`,{className:`flex flex-col gap-8`,children:[n(`div`,{children:[o(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Recording`}),o(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The cluster recording node and recordings folders.`}),n(`div`,{className:`mt-3 flex flex-col gap-6`,children:[o(Ge,{}),o(qe,{})]})]}),n(`div`,{children:[o(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Events`}),o(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The cluster post-processing node, the events folder, and the durable event-store footprint with retention and per-camera deletion.`}),n(`div`,{className:`mt-3 flex flex-col gap-6`,children:[o(He,{}),o(Ze,{})]})]}),n(`div`,{children:[o(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Migration`}),o(`div`,{className:`mt-3`,children:o(nt,{})})]})]})}function at(){return o(le,{icon:V,title:`Recordings`,subtitle:`Recording node & storage, event-store management, exported clips, and an activity log.`,children:o(fe,{tabs:[{id:`storage`,label:`Storage`,icon:I,content:o(Fe,{})},{id:`cameras`,label:`Cameras`,icon:H,content:o(_e,{})},{id:`exports`,label:`Export`,icon:V,content:o(je,{})},{id:`activity`,label:`Activity`,icon:R,content:o(ze,{})},{id:`management`,label:`Management`,icon:ge,content:o(it,{})}]})})}export{at as RecordingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as e}from"./index-BPmtCsWe.js";var t=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as e}from"./index-BPmtCsWe.js";var t=e(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]);export{t};
|