@camstack/addon-admin-ui 1.2.174 → 1.2.177
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-CQNcxLmB.js → AddonCollectionPage-CuPOmV8p.js} +1 -1
- package/dist/assets/{Addons-C8Pvwd2G.js → Addons-B76FmiVE.js} +1 -1
- package/dist/assets/{AdminTabs-BU25jHQX.js → AdminTabs-hW4DuL0P.js} +1 -1
- package/dist/assets/{AiProfiles-CkSyanZS.js → AiProfiles-DJAd7PwD.js} +1 -1
- package/dist/assets/{BrokerForm-DQ_zgMoD.js → BrokerForm-D3ftUi9d.js} +1 -1
- package/dist/assets/{Build-CH4impMX.js → Build-oXsKNeIm.js} +1 -1
- package/dist/assets/{Capabilities-D_1B-859.js → Capabilities-DqFRY3cs.js} +1 -1
- package/dist/assets/{CapabilityBadges-D2wnwjTn.js → CapabilityBadges-vcssFmTu.js} +1 -1
- package/dist/assets/{Cluster-C416Pq34.js → Cluster-BNLii1Ff.js} +1 -1
- package/dist/assets/{Data-DO8PCdGK.js → Data-D7EuBohC.js} +1 -1
- package/dist/assets/{DetectionIntelligence-Dn4_o8_u.js → DetectionIntelligence-DAU7Jc5D.js} +1 -1
- package/dist/assets/{DeviceAggregateSection-Cef4_S8_.js → DeviceAggregateSection-8YHejIHg.js} +1 -1
- package/dist/assets/{DeviceDetail-BdcLhwCL.js → DeviceDetail-DQVPxbhk.js} +1 -1
- package/dist/assets/{Devices-tdKjbipS.js → Devices-B51FFd3E.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-w3QUHM5y.js → EmbedPlayerPage-CJvJYwe0.js} +1 -1
- package/dist/assets/{Events-EnhT2bML.js → Events-DKRbEqD7.js} +1 -1
- package/dist/assets/{FormBuilder-DtoH-H2q.js → FormBuilder-_v3InSTC.js} +1 -1
- package/dist/assets/{Identity--mhpip1U.js → Identity-BnCGYxYI.js} +1 -1
- package/dist/assets/{IntegrationDetail-Dicdhnhj.js → IntegrationDetail-Cs4x6zFM.js} +1 -1
- package/dist/assets/{Integrations-f05Ywaok.js → Integrations-DNtj-OSF.js} +1 -1
- package/dist/assets/{Integrations-tKj-0ho4.js → Integrations-JSkzNyl_.js} +1 -1
- package/dist/assets/{Locations-DG4IFTEM.js → Locations-CDwp_pJl.js} +1 -1
- package/dist/assets/{Logs-B0E3Uq18.js → Logs-CLaj1xr9.js} +1 -1
- package/dist/assets/{MotionZonesSettings-BQWMwZ4h.js → MotionZonesSettings-N8Tg-9BL.js} +1 -1
- package/dist/assets/{MyAccess-7mdOj2Hm.js → MyAccess-DsCbwOxS.js} +1 -1
- package/dist/assets/{Network-5LGn-Mws.js → Network-V7FxLrKE.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-BsF8np-K.js → NodeAddonsSettingsPanel-LrcFJy8T.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-vvLMQhQR.js → NodeInferenceDevices-BOs74ffT.js} +1 -1
- package/dist/assets/{Notifications-NMmc9efE.js → Notifications-aXhj3AaY.js} +1 -1
- package/dist/assets/{Pipeline-BLe7j74H.js → Pipeline-D_l3PBfy.js} +1 -1
- package/dist/assets/{Plates-Bw5aXCmG.js → Plates-L3yWKFtB.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-Duw3xEf9.js → PrivacyMaskSettings-BS60o54h.js} +1 -1
- package/dist/assets/ProviderIcon-Bq4ngehg.js +1 -0
- package/dist/assets/Recordings-BDulkwLG.js +1 -0
- package/dist/assets/{ScanNetworkModal-CH41-Hpm.js → ScanNetworkModal-BbEifU2T.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-Bs4MoK32.js → SceneMonitorEditor-CoigeSka.js} +1 -1
- package/dist/assets/{Scenes-fkABvsPY.js → Scenes-Cw7Da5Lz.js} +1 -1
- package/dist/assets/{Settings-CaxGo2l5.js → Settings-D7A7Gh7G.js} +1 -1
- package/dist/assets/Showroom-D9C3nH04.js +1 -0
- package/dist/assets/{StorageLocationsPanel-BH60gcVP.js → StorageLocationsPanel-CCto7mK1.js} +1 -1
- package/dist/assets/{Terminal-C2vt7rLI.js → Terminal-CBsrmqyU.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BYcJT7VZ.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Sux0y9zg.js} +1 -1
- package/dist/assets/{authed-media-ssdh9WZa.js → authed-media-CVmIX_4o.js} +1 -1
- package/dist/assets/{bell-off-DZeGZskH.js → bell-off-QTQPIbPU.js} +1 -1
- package/dist/assets/{bell-ring-CHheQ59j.js → bell-ring-BTf8k-H3.js} +1 -1
- package/dist/assets/{boxes-DE0Kg_Zt.js → boxes-BVv4tC_P.js} +1 -1
- package/dist/assets/circle-check-big-Cdk8vuxd.js +1 -0
- package/dist/assets/circle-dot-C1k5g9wf.js +1 -0
- package/dist/assets/circle-slash-BX3B05me.js +1 -0
- package/dist/assets/{circle-x-D24E0STu.js → circle-x-yof6q2ik.js} +1 -1
- package/dist/assets/clock-DbU3Id-L.js +1 -0
- package/dist/assets/{copy-DlB7UsEQ.js → copy-gmLqLBGz.js} +1 -1
- package/dist/assets/{debounced-invalidate-D0BJH3x_.js → debounced-invalidate-BawHUCGb.js} +1 -1
- package/dist/assets/dist-BXqg_XXo.js +349 -0
- package/dist/assets/dist-c3rGzk_T.js +1 -0
- package/dist/assets/{download-urufn8GN.js → download-Dretq0sG.js} +1 -1
- package/dist/assets/{face-bbox-D137htBM.js → face-bbox-ClBA9Q7h.js} +1 -1
- package/dist/assets/{flame-DLh70ShH.js → flame-CX4XQUE7.js} +1 -1
- package/dist/assets/{format-size-CvsfU8ov.js → format-size-Ffnu36kT.js} +1 -1
- package/dist/assets/{hard-drive-C_qCvW3c.js → hard-drive-B0IB8cDj.js} +1 -1
- package/dist/assets/{hostInit-tuSuQCp6.js → hostInit-DNxprgXM.js} +1 -1
- package/dist/assets/index-C8cofuIo.css +2 -0
- package/dist/assets/{index-D5stGBcP.js → index-DHLoM-LC.js} +3 -3
- package/dist/assets/{key-round-Bjn44TZ0.js → key-round-CkoLOzNo.js} +1 -1
- package/dist/assets/{layers-BaODe1wE.js → layers-D_IXNRGH.js} +1 -1
- package/dist/assets/{location-owned-usage-B_pajTer.js → location-owned-usage-C6mfOUvv.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-44b835d3.js → mf-entry-bootstrap-0-da3dfd4f.js} +2 -2
- package/dist/assets/{pencil-B3XBvIHk.js → pencil-BmChM4HE.js} +1 -1
- package/dist/assets/play-CrDT1wRJ.js +1 -0
- package/dist/assets/{player-overlays-BnnhEMD9.js → player-overlays-B1tg0R3a.js} +1 -1
- package/dist/assets/plus-CqwAbQmD.js +1 -0
- package/dist/assets/power-CnHDBZh0.js +1 -0
- package/dist/assets/{radio-CS_D2GUp.js → radio-BoEwIYh0.js} +1 -1
- package/dist/assets/{refresh-cw-D6Pp_K4H.js → refresh-cw-DpKpZbb-.js} +1 -1
- package/dist/assets/remoteEntry-Cgi2-deT.js +1 -0
- package/dist/assets/rotate-ccw-C4yZJcgC.js +1 -0
- package/dist/assets/rotate-cw-C1-k2nNI.js +1 -0
- package/dist/assets/{send-Btm01NIQ.js → send-CDheBMb9.js} +1 -1
- package/dist/assets/{server-DK9fq9fz.js → server-ClvLeHRJ.js} +1 -1
- package/dist/assets/{shield-DsgTgXWx.js → shield-BnwKEUhb.js} +1 -1
- package/dist/assets/{shield-alert-DuEwzYkR.js → shield-alert-BNKq7sgY.js} +1 -1
- package/dist/assets/square-EwXfbNwZ.js +1 -0
- package/dist/assets/{square-check-big-BE8480BV.js → square-check-big-BYGndaGe.js} +1 -1
- package/dist/assets/src-BrDwcwAj.js +349 -0
- package/dist/assets/{src-X2J9M4WA.js → src-wG6W3iRS.js} +17 -17
- package/dist/assets/{undo-2-DWIvegW6.js → undo-2-BvHbsETj.js} +1 -1
- package/dist/assets/{use-scenes-feed-DQ-I5yVy.js → use-scenes-feed-DzkSpI3B.js} +1 -1
- package/dist/assets/useEventInvalidation-ZV0cIKJg.js +1 -0
- package/dist/assets/{useNodeUrlSelection-B-4cP9vB.js → useNodeUrlSelection-CnHEt-oK.js} +1 -1
- package/dist/assets/user-round-C-Y8HKja.js +1 -0
- package/dist/assets/{video-Bgrw0TdF.js → video-CzYVeCU6.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-iYb0kdkK.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-C_6Viu7m.js} +2 -2
- package/dist/assets/{wifi-BSKeoysm.js → wifi-BgqRvXkO.js} +1 -1
- package/dist/assets/{zap-tGxAXsxr.js → zap-Bm7fmlGT.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/server/addon.js +202 -15
- package/package.json +1 -1
- package/dist/assets/ProviderIcon-ChlkicsQ.js +0 -1
- package/dist/assets/Recordings-BZba1sr-.js +0 -1
- package/dist/assets/Showroom-DbEt4xRz.js +0 -1
- package/dist/assets/circle-check-big-HZUNph0o.js +0 -1
- package/dist/assets/circle-dot-syL662Th.js +0 -1
- package/dist/assets/circle-slash-TNV27Tll.js +0 -1
- package/dist/assets/clock-Bxx_wT8K.js +0 -1
- package/dist/assets/dist-B_HDQzh9.js +0 -349
- package/dist/assets/dist-DcHHEsE_.js +0 -1
- package/dist/assets/index-BWPGA7Gb.css +0 -2
- package/dist/assets/play-BFk94v8S.js +0 -1
- package/dist/assets/plus-BmAxciic.js +0 -1
- package/dist/assets/power-BDmDy3h3.js +0 -1
- package/dist/assets/remoteEntry-BrBtEx_a.js +0 -1
- package/dist/assets/rotate-ccw-BzxSI7mV.js +0 -1
- package/dist/assets/rotate-cw-BeFA4xbH.js +0 -1
- package/dist/assets/square-CI62DSjh.js +0 -1
- package/dist/assets/src-CCqCq7P6.js +0 -349
- package/dist/assets/useEventInvalidation-DQ60wJ7e.js +0 -1
- package/dist/assets/user-round-BFKcOTbp.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-DAXzJeTX.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -592,7 +592,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
592
592
|
* issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
|
|
593
593
|
*/
|
|
594
594
|
EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
|
|
595
|
-
EventCategory["FrigateLiveEvent"] = "frigate.live-event";
|
|
596
595
|
EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
|
|
597
596
|
/**
|
|
598
597
|
* Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
|
|
@@ -12526,7 +12525,7 @@ DeviceType.Camera;
|
|
|
12526
12525
|
var SourceInfoSchema = object({
|
|
12527
12526
|
/** Live dispatch key — mutable when the source system allows rename. */
|
|
12528
12527
|
id: string(),
|
|
12529
|
-
/** Source system tag — e.g. 'homeassistant' | 'reolink' | '
|
|
12528
|
+
/** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
|
|
12530
12529
|
system: string(),
|
|
12531
12530
|
/** Immutable upstream identifier when available (HA `unique_id`, … ).
|
|
12532
12531
|
* Used to detect rename when `id` changes. */
|
|
@@ -13013,7 +13012,7 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
|
|
|
13013
13012
|
* - `device-management.router.ts` (deleted in Phase 2)
|
|
13014
13013
|
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
13015
13014
|
*
|
|
13016
|
-
* All device provider addons (rtsp, onvif,
|
|
13015
|
+
* All device provider addons (rtsp, onvif, …) are hub-local: they may
|
|
13017
13016
|
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
13018
13017
|
* - No nodeId routing needed — this is a pure hub singleton.
|
|
13019
13018
|
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
@@ -17023,7 +17022,7 @@ var NcRuleInputSchema = object({
|
|
|
17023
17022
|
* The measured seven-person arrival on device 590 spans 110 s with every
|
|
17024
17023
|
* internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
|
|
17025
17024
|
* idle cutoff holds it as one and ends it when the arrival actually ends.
|
|
17026
|
-
* 30 is
|
|
17025
|
+
* 30 s is a widely shipped value for the same decision.
|
|
17027
17026
|
*
|
|
17028
17027
|
* ### What it replaces
|
|
17029
17028
|
*
|
|
@@ -19065,6 +19064,13 @@ var ZoneCrossingSchema = object({
|
|
|
19065
19064
|
/** Zone display name at crossing time (falls back to the id). */
|
|
19066
19065
|
zoneName: string().optional()
|
|
19067
19066
|
});
|
|
19067
|
+
/** One zone a box was stamped with, and how much of the BOX fell inside it. */
|
|
19068
|
+
var ZoneOverlapSchema = object({
|
|
19069
|
+
zoneId: string(),
|
|
19070
|
+
zoneName: string().optional(),
|
|
19071
|
+
/** Percentage of the BOX area inside the zone, 0–100. */
|
|
19072
|
+
overlapPct: number()
|
|
19073
|
+
});
|
|
19068
19074
|
var ObjectEventSchema = object({
|
|
19069
19075
|
...BaseEventFields,
|
|
19070
19076
|
kind: literal("object"),
|
|
@@ -19089,6 +19095,35 @@ var ObjectEventSchema = object({
|
|
|
19089
19095
|
bbox: BoundingBoxSchema.optional(),
|
|
19090
19096
|
/** Heavy JSON — omitted in slim projection. */
|
|
19091
19097
|
zones: array(string()).readonly().optional(),
|
|
19098
|
+
/**
|
|
19099
|
+
* How far inside each stamped zone the box actually was, as a percentage of
|
|
19100
|
+
* the BOX area.
|
|
19101
|
+
*
|
|
19102
|
+
* Membership alone cannot express "at least a third of it inside", which is
|
|
19103
|
+
* the bar an operator argues with — and the number already existed: the
|
|
19104
|
+
* engine computed it, the pipeline logged it, and then discarded it. It
|
|
19105
|
+
* matters most on the events that carry no track, where a rule has nothing
|
|
19106
|
+
* else to judge by.
|
|
19107
|
+
*/
|
|
19108
|
+
zoneOverlaps: array(ZoneOverlapSchema).readonly().optional(),
|
|
19109
|
+
/**
|
|
19110
|
+
* Present when this event describes a detection the TRACKER refused, so it
|
|
19111
|
+
* has no track and never will.
|
|
19112
|
+
*
|
|
19113
|
+
* A zone-scoped immediate rule asks "is there an animal in the flowerbed
|
|
19114
|
+
* NOW?"; tracking answers a different question ("is this the same subject as
|
|
19115
|
+
* before?") whose confirmation threshold presumes continuity. On 2026-09-09 a
|
|
19116
|
+
* dog at 0.7729, 100% inside a watched zone, was refused three times in six
|
|
19117
|
+
* seconds with three different candidate ids — seven analysed frames in the
|
|
19118
|
+
* window, the subject in a handful of them, metres apart — and produced no
|
|
19119
|
+
* event at all.
|
|
19120
|
+
*
|
|
19121
|
+
* It is NAMED rather than merely implied by a missing `trackId`: an event
|
|
19122
|
+
* with no track and no reason is indistinguishable from a track whose media
|
|
19123
|
+
* went missing, and a consumer that asks this one for a best shot or a
|
|
19124
|
+
* history is asking for something that never existed.
|
|
19125
|
+
*/
|
|
19126
|
+
spawnRefused: string().optional(),
|
|
19092
19127
|
/** Omitted in slim projection. */
|
|
19093
19128
|
state: TrackStateSchema.optional(),
|
|
19094
19129
|
/**
|
|
@@ -20162,6 +20197,60 @@ var NativeCropResultSchema = object({
|
|
|
20162
20197
|
*/
|
|
20163
20198
|
tier: _enum(["native", "ram-fullframe"]).optional()
|
|
20164
20199
|
});
|
|
20200
|
+
/**
|
|
20201
|
+
* What a PARKED frame is for — the `kind` half of the `(deviceId, trackId,
|
|
20202
|
+
* kind)` key ([D422](../../../docs/decisions/adr-0422-a-relevant-frame-is-parked-when-it-becomes-relevant.md)).
|
|
20203
|
+
*
|
|
20204
|
+
* - `keyFrame` — the track's clean best FULL frame at native width (capped by
|
|
20205
|
+
* the caller's `maxWidth`). What `keyFrame` + `keyFrameSmall` are written
|
|
20206
|
+
* from, and what the detail plane's full-frame rung cuts from.
|
|
20207
|
+
* - `thumbnail` — the best-shot subject slab: the caller's 16:9 central-square
|
|
20208
|
+
* window, cut by the runner at uncapped native resolution.
|
|
20209
|
+
*
|
|
20210
|
+
* The runner never interprets `trackId`; it is an opaque key the hub owns.
|
|
20211
|
+
*/
|
|
20212
|
+
var ParkedFrameKindSchema = _enum(["keyFrame", "thumbnail"]);
|
|
20213
|
+
/**
|
|
20214
|
+
* Why a park did NOT happen. Every one is logged on the runner with
|
|
20215
|
+
* `tags: { deviceId }` and the handle's measured age, because a handle already
|
|
20216
|
+
* gone at park time IS the defect the 150–500 ms window exists to prevent —
|
|
20217
|
+
* never a reason to retry in a loop.
|
|
20218
|
+
*
|
|
20219
|
+
* - `handle-gone` — the native surface no longer resolves this handle (never
|
|
20220
|
+
* registered, past the lease bound, or the worker released it). `detail`
|
|
20221
|
+
* carries the runner's own miss reason.
|
|
20222
|
+
* - `encode-failed` — pixels resolved and the JPEG encode threw.
|
|
20223
|
+
*/
|
|
20224
|
+
var ParkRefusalSchema = _enum(["handle-gone", "encode-failed"]);
|
|
20225
|
+
/** Answer to `parkTrackFrame` — a discriminated union, so "not parked" always names why. */
|
|
20226
|
+
var ParkTrackFrameResultSchema = discriminatedUnion("parked", [object({
|
|
20227
|
+
parked: literal(true),
|
|
20228
|
+
/** The node holding the parcel — what a later retrieval must be pinned to. */
|
|
20229
|
+
nodeId: string(),
|
|
20230
|
+
width: number().int().positive(),
|
|
20231
|
+
height: number().int().positive(),
|
|
20232
|
+
/** JPEG bytes the parcel costs on the node. */
|
|
20233
|
+
bytes: number().int().nonnegative(),
|
|
20234
|
+
/** Whether this park replaced a parcel already held for the key. */
|
|
20235
|
+
replaced: boolean()
|
|
20236
|
+
}), object({
|
|
20237
|
+
parked: literal(false),
|
|
20238
|
+
nodeId: string(),
|
|
20239
|
+
reason: ParkRefusalSchema,
|
|
20240
|
+
/** Age of the handle at the park, on the runner's clock; null if unknown. */
|
|
20241
|
+
handleAgeMs: number().nullable(),
|
|
20242
|
+
detail: string().optional()
|
|
20243
|
+
})]);
|
|
20244
|
+
/** A retrieved parcel — the runner's own JPEG, base64 for the wire. */
|
|
20245
|
+
var ParkedTrackFrameSchema = object({
|
|
20246
|
+
jpeg: string(),
|
|
20247
|
+
width: number().int().positive(),
|
|
20248
|
+
height: number().int().positive(),
|
|
20249
|
+
/** The frame instant the parcel shows (the caller's clock, echoed back). */
|
|
20250
|
+
timestamp: number(),
|
|
20251
|
+
/** When the node stored it (the node's clock). */
|
|
20252
|
+
parkedAt: number()
|
|
20253
|
+
});
|
|
20165
20254
|
/** Parent detection context passed to `runDetailSubtree` — the crop's
|
|
20166
20255
|
* originating detection, in FRAME-space coordinates. Reuses
|
|
20167
20256
|
* `NativeCropBboxSchema`'s `{x,y,w,h}` shape (same numeric fields; here
|
|
@@ -20551,7 +20640,7 @@ var RunnerCameraConfigSchema = object({
|
|
|
20551
20640
|
* - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
|
|
20552
20641
|
* analyzer providers) running on decoded frames in this runner.
|
|
20553
20642
|
* - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
|
|
20554
|
-
* analytics
|
|
20643
|
+
* analytics). The provider emits ProviderMotion
|
|
20555
20644
|
* events; the orchestrator forwards to `reportMotion`.
|
|
20556
20645
|
*/
|
|
20557
20646
|
motionSources: MotionSourcesSchema.default(["analyzer"]),
|
|
@@ -20793,7 +20882,26 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
20793
20882
|
className: string(),
|
|
20794
20883
|
/** Camera the pixels came from. Diagnostics + log tags ONLY — never routing. */
|
|
20795
20884
|
sourceDeviceId: number()
|
|
20796
|
-
}), RunStatelessStepResultSchema, { kind: "mutation" })
|
|
20885
|
+
}), RunStatelessStepResultSchema, { kind: "mutation" }), method(object({
|
|
20886
|
+
deviceId: number(),
|
|
20887
|
+
/** Opaque to the runner — the hub's track id. */
|
|
20888
|
+
trackId: string(),
|
|
20889
|
+
kind: ParkedFrameKindSchema,
|
|
20890
|
+
handle: FrameHandleSchema,
|
|
20891
|
+
/** Normalized [0,1] window to cut. `{0,0,1,1}` for a full frame. */
|
|
20892
|
+
bbox: NativeCropBboxSchema,
|
|
20893
|
+
/** Width cap for a full-frame park (the `keyFrame` native cap). */
|
|
20894
|
+
maxWidth: number().int().positive().optional(),
|
|
20895
|
+
/** The frame instant (caller's clock) — orders parks for one key. */
|
|
20896
|
+
timestamp: number()
|
|
20897
|
+
}), ParkTrackFrameResultSchema, { kind: "mutation" }), method(object({
|
|
20898
|
+
deviceId: number(),
|
|
20899
|
+
trackId: string(),
|
|
20900
|
+
kind: ParkedFrameKindSchema
|
|
20901
|
+
}), ParkedTrackFrameSchema.nullable()), method(object({
|
|
20902
|
+
deviceId: number(),
|
|
20903
|
+
trackId: string()
|
|
20904
|
+
}), object({ released: number().int().nonnegative() }), { kind: "mutation" });
|
|
20797
20905
|
var CameraPipelineConfigSchema = object({
|
|
20798
20906
|
engine: PipelineEngineChoiceSchema.optional(),
|
|
20799
20907
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
@@ -23722,7 +23830,7 @@ DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _v
|
|
|
23722
23830
|
*
|
|
23723
23831
|
* Implementations:
|
|
23724
23832
|
* - Each camera-providing addon registers this cap natively per
|
|
23725
|
-
* device (Reolink, Hikvision, RTSP,
|
|
23833
|
+
* device (Reolink, Hikvision, RTSP, ONVIF self).
|
|
23726
23834
|
* - Returns a snapshot from the persisted device config blob — no
|
|
23727
23835
|
* extra round-trip to the camera, no probing.
|
|
23728
23836
|
* - The cap is admin-only (`auth: 'admin'`) — credentials must not
|
|
@@ -25108,7 +25216,7 @@ var AvailableIntegrationTypeSchema = object({
|
|
|
25108
25216
|
* Which integration-marker cap the addon declared, so the wizard can
|
|
25109
25217
|
* branch on CAP — never on addon name. `device-adoption` integrations
|
|
25110
25218
|
* (Home Assistant, …) route through the broker step (Approach A);
|
|
25111
|
-
* `device-provider` integrations (Reolink/
|
|
25219
|
+
* `device-provider` integrations (Reolink/ONVIF) keep the
|
|
25112
25220
|
* legacy config → discovery flow.
|
|
25113
25221
|
*/
|
|
25114
25222
|
kind: _enum(["device-adoption", "device-provider"]),
|
|
@@ -27665,13 +27773,31 @@ var RecordingManifestSchema = object({
|
|
|
27665
27773
|
*/
|
|
27666
27774
|
playbackEndpoints: array(string())
|
|
27667
27775
|
});
|
|
27668
|
-
/**
|
|
27669
|
-
*
|
|
27776
|
+
/**
|
|
27777
|
+
* Recording storage usage for one camera — what the ARCHIVE holds for it,
|
|
27778
|
+
* across every profile and every resolvable location on this node.
|
|
27779
|
+
*
|
|
27780
|
+
* ## Archive vs residency, which is the whole point of this shape (D418)
|
|
27781
|
+
*
|
|
27782
|
+
* `usedBytes` / `oldestMs` / `segments` are the durable hour ledger's numbers:
|
|
27783
|
+
* the same quantity `RecordingLocationUsage.usedBytes` reports for the volume
|
|
27784
|
+
* this camera writes to, so the two can be added up and compared.
|
|
27785
|
+
*
|
|
27786
|
+
* They were not always. Until D418 this row came from the recorder's in-RAM
|
|
27787
|
+
* `RecordingIndex`, which since D287 holds only the live tail plus the hours
|
|
27788
|
+
* somebody hydrated — so a hub with 1.9 TB and 3.3 days of footage reported
|
|
27789
|
+
* 60.5 GB and "oldest: three hours ago" on the same page as the volume row
|
|
27790
|
+
* that said otherwise, and two people read it as retention eating recent
|
|
27791
|
+
* footage. Residency is still reported, under `residentBytes` /
|
|
27792
|
+
* `residentOldestMs`, which answer a different question and say so.
|
|
27793
|
+
*/
|
|
27670
27794
|
var RecordingDeviceUsageSchema = object({
|
|
27671
27795
|
deviceId: number(),
|
|
27796
|
+
/** Bytes the ARCHIVE holds for this camera on this node's resolvable
|
|
27797
|
+
* recordings locations. */
|
|
27672
27798
|
usedBytes: number(),
|
|
27673
27799
|
/**
|
|
27674
|
-
* Start of this camera's OLDEST
|
|
27800
|
+
* Start of this camera's OLDEST ARCHIVED segment, across every profile and
|
|
27675
27801
|
* location — the "Oldest footage" column in Recordings → Storage, and the
|
|
27676
27802
|
* only honest answer to "is retention actually holding?" per camera.
|
|
27677
27803
|
*
|
|
@@ -27681,7 +27807,24 @@ var RecordingDeviceUsageSchema = object({
|
|
|
27681
27807
|
* (types) and the addon ship on different trains, and the addon is usually
|
|
27682
27808
|
* the later of the two.
|
|
27683
27809
|
*/
|
|
27684
|
-
oldestMs: number().nullable().optional()
|
|
27810
|
+
oldestMs: number().nullable().optional(),
|
|
27811
|
+
/** Segments the archive holds for this camera — the "M" beside `usedBytes`.
|
|
27812
|
+
* OPTIONAL for the same train-skew reason as `oldestMs`. */
|
|
27813
|
+
segments: number().optional(),
|
|
27814
|
+
/**
|
|
27815
|
+
* RESIDENCY, not the archive: bytes the recorder process currently holds in
|
|
27816
|
+
* its RAM index — the live tail plus the hours a reader hydrated.
|
|
27817
|
+
*
|
|
27818
|
+
* It answers "what can be served without touching the disk", never "how much
|
|
27819
|
+
* footage this camera has". A UI that renders it must label it as such, and
|
|
27820
|
+
* must never total it as storage. OPTIONAL: a recorder predating D418 omits
|
|
27821
|
+
* it, and so does a node whose ledger could not answer.
|
|
27822
|
+
*/
|
|
27823
|
+
residentBytes: number().optional(),
|
|
27824
|
+
/** The residency counterpart of `oldestMs` — the oldest segment currently in
|
|
27825
|
+
* RAM, which on a healthy recorder is minutes ago and means nothing about
|
|
27826
|
+
* retention. `null` = nothing resident. */
|
|
27827
|
+
residentOldestMs: number().nullable().optional()
|
|
27685
27828
|
});
|
|
27686
27829
|
/** Recording storage usage + capacity for one storage location. */
|
|
27687
27830
|
var RecordingLocationUsageSchema = object({
|
|
@@ -27719,6 +27862,17 @@ var RecordingStorageUsageSchema = object({
|
|
|
27719
27862
|
totalUsedBytes: number(),
|
|
27720
27863
|
devices: array(RecordingDeviceUsageSchema),
|
|
27721
27864
|
/**
|
|
27865
|
+
* WHERE `devices[]` came from, so an empty table is never mistaken for empty
|
|
27866
|
+
* disks (D418).
|
|
27867
|
+
*
|
|
27868
|
+
* `archive` = the durable hour ledger answered. `unavailable` = this node
|
|
27869
|
+
* declared no ledger and the recorder REFUSED rather than answering the
|
|
27870
|
+
* question with the resident index (D295 rule 3) — the rows are UNKNOWN, not
|
|
27871
|
+
* zero, and a UI must say so. OPTIONAL: a recorder predating D418 omits it,
|
|
27872
|
+
* and its rows are residency.
|
|
27873
|
+
*/
|
|
27874
|
+
devicesRead: _enum(["archive", "unavailable"]).optional(),
|
|
27875
|
+
/**
|
|
27722
27876
|
* Per-physical-volume capacity. OPTIONAL, and consumers must render the rest
|
|
27723
27877
|
* of the payload without it: the hub serves this method through a BAKED
|
|
27724
27878
|
* router, so a hub whose framework train predates a change to this array
|
|
@@ -34106,6 +34260,24 @@ Object.freeze({
|
|
|
34106
34260
|
addonId: null,
|
|
34107
34261
|
access: "view"
|
|
34108
34262
|
},
|
|
34263
|
+
"pipelineRunner.getParkedTrackFrame": {
|
|
34264
|
+
capName: "pipeline-runner",
|
|
34265
|
+
capScope: "system",
|
|
34266
|
+
addonId: null,
|
|
34267
|
+
access: "view"
|
|
34268
|
+
},
|
|
34269
|
+
"pipelineRunner.parkTrackFrame": {
|
|
34270
|
+
capName: "pipeline-runner",
|
|
34271
|
+
capScope: "system",
|
|
34272
|
+
addonId: null,
|
|
34273
|
+
access: "create"
|
|
34274
|
+
},
|
|
34275
|
+
"pipelineRunner.releaseParkedTrackFrames": {
|
|
34276
|
+
capName: "pipeline-runner",
|
|
34277
|
+
capScope: "system",
|
|
34278
|
+
addonId: null,
|
|
34279
|
+
access: "create"
|
|
34280
|
+
},
|
|
34109
34281
|
"pipelineRunner.reportMotion": {
|
|
34110
34282
|
capName: "pipeline-runner",
|
|
34111
34283
|
capScope: "system",
|
|
@@ -37383,6 +37555,21 @@ Object.freeze({
|
|
|
37383
37555
|
form: "single",
|
|
37384
37556
|
optional: false
|
|
37385
37557
|
}],
|
|
37558
|
+
"pipelineRunner.getParkedTrackFrame": [{
|
|
37559
|
+
name: "deviceId",
|
|
37560
|
+
form: "single",
|
|
37561
|
+
optional: false
|
|
37562
|
+
}],
|
|
37563
|
+
"pipelineRunner.parkTrackFrame": [{
|
|
37564
|
+
name: "deviceId",
|
|
37565
|
+
form: "single",
|
|
37566
|
+
optional: false
|
|
37567
|
+
}],
|
|
37568
|
+
"pipelineRunner.releaseParkedTrackFrames": [{
|
|
37569
|
+
name: "deviceId",
|
|
37570
|
+
form: "single",
|
|
37571
|
+
optional: false
|
|
37572
|
+
}],
|
|
37386
37573
|
"pipelineRunner.reportMotion": [{
|
|
37387
37574
|
name: "deviceId",
|
|
37388
37575
|
form: "single",
|
|
@@ -38074,7 +38261,7 @@ var PreviewTextField = string().max(200);
|
|
|
38074
38261
|
* Whether the notification's preview is a STILL or a short animation.
|
|
38075
38262
|
*
|
|
38076
38263
|
* The operator's ask, verbatim: *"inviato come gif o video (come per le altre
|
|
38077
|
-
* rule)"* —
|
|
38264
|
+
* rule)"* — the other rules already offer an animated preview, and a ten-hour
|
|
38078
38265
|
* night reads better as three seconds of motion than as one frame of it. Both
|
|
38079
38266
|
* modes get the SAME treatment (blurred frame, large centred title); `'gif'`
|
|
38080
38267
|
* simply applies it to a dozen frames sampled across the render and assembles
|
|
@@ -38475,7 +38662,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
38475
38662
|
capability: adminUiCapability,
|
|
38476
38663
|
provider: {
|
|
38477
38664
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
38478
|
-
getVersion: async () => ({ version: "1.2.
|
|
38665
|
+
getVersion: async () => ({ version: "1.2.177" })
|
|
38479
38666
|
}
|
|
38480
38667
|
}];
|
|
38481
38668
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as e,S as t,q as n,x as r}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 i}from"./player-overlays-BnnhEMD9.js";import{t as a}from"./radio-CS_D2GUp.js";import{t as o}from"./server-DK9fq9fz.js";import{t as s}from"./wifi-BSKeoysm.js";import{J as c}from"./index-D5stGBcP.js";var l=c(`cctv`,[[`path`,{d:`M16.75 12h3.632a1 1 0 0 1 .894 1.447l-2.034 4.069a1 1 0 0 1-1.708.134l-2.124-2.97`,key:`ir91b5`}],[`path`,{d:`M17.106 9.053a1 1 0 0 1 .447 1.341l-3.106 6.211a1 1 0 0 1-1.342.447L3.61 12.3a2.92 2.92 0 0 1-1.3-3.91L3.69 5.6a2.92 2.92 0 0 1 3.92-1.3z`,key:`jlp8i1`}],[`path`,{d:`M2 19h3.76a2 2 0 0 0 1.8-1.1L9 15`,key:`19bib8`}],[`path`,{d:`M2 21v-4`,key:`l40lih`}],[`path`,{d:`M7 9h.01`,key:`19b3jx`}]]),u=c(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]);e();var d={frigate:{icon:l,color:`#3b82f6`,label:`Frigate`},scrypted:{icon:o,color:`#a855f7`,label:`Scrypted`},reolink:{icon:a,color:`#06b6d4`,label:`Reolink`},homeassistant:{icon:u,color:`#22d3ee`,label:`Home Assistant`},rtsp:{icon:s,color:`#78716c`,label:`RTSP`},onvif:{icon:s,color:`#78716c`,label:`ONVIF`}},f={sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`},p={sm:`h-7 w-7`,md:`h-8 w-8`,lg:`h-10 w-10`};function m(e){let t=e.toLowerCase();return t.startsWith(`provider-`)?t.slice(9):t}function h(e){return d[m(e)]??{icon:l,color:`#78716c`,label:e}}function g(e){let t=m(e);return i(`/api/addon-assets/${e.toLowerCase().startsWith(`provider-`)?e:`provider-${t}`}/assets/icon.svg`)}function _({type:e,size:i=`md`,showLabel:a}){let o=h(e),s=o.icon,[c,l]=n(!1),u=g(e);return t(`div`,{className:`flex items-center gap-2`,children:[r(`div`,{className:`flex items-center justify-center rounded-lg ${p[i]}`,style:{backgroundColor:`${o.color}15`},children:c?r(s,{className:f[i],style:{color:o.color}}):r(`img`,{src:u,alt:o.label,className:f[i],onError:()=>l(!0)})}),a&&r(`span`,{className:`text-xs font-medium text-foreground-subtle`,children:o.label})]})}export{_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as e,Q as t,S as n,W as r,b as i,o as a,q as o,x as s,z as c}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{J as l,at as u}from"./player-overlays-BnnhEMD9.js";import{$a as d,Aa as f,Fo as p,Ho as m,Io as h,Jr as g,Lo as _,Qo as v,Qs as y,Ro as b,Sn as x,Uo as S,Vo as C,Yt as w,as as T,cs as E,es as D,ga as O,is as k,ls as A,ns as j,nt as M,os as ee,rc as N,rn as te,ro as ne,rs as re,rt as ie,sn as P,ss as ae,tc as F,ts as oe,us as se,wa as ce,ya as le,yn as ue,zo as de}from"./src-X2J9M4WA.js";import{Kt as I}from"./src-CCqCq7P6.js";import{i as fe,r as pe}from"./location-owned-usage-B_pajTer.js";import{t as me}from"./circle-x-D24E0STu.js";import{t as he}from"./download-urufn8GN.js";import{t as L}from"./format-size-CvsfU8ov.js";import{t as R}from"./hard-drive-C_qCvW3c.js";import{H as z,J as B,N as V,a as H,k as U,o as W,q as ge,r as _e,w as G}from"./index-D5stGBcP.js";import{t as ve}from"./AdminPage-CCD07UMs.js";import{i as ye}from"./authed-media-ssdh9WZa.js";import{t as be}from"./DeviceAggregateSection-Cef4_S8_.js";import{t as xe}from"./AdminTabs-BU25jHQX.js";import{t as Se}from"./StorageLocationsPanel-BH60gcVP.js";var Ce=B(`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`}]]),we=B(`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`}]]),Te=B(`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();var Ee=[{value:`all`,label:`All`},{value:`recording`,label:`Recordings`},{value:`events`,label:`Events`}],De={recording:`bg-primary/10 text-primary`,events:`bg-violet-500/10 text-violet-400`},Oe={columnKey:`at`,dir:`desc`};function ke(e){return new Date(e).toLocaleString()}function Ae(){let[e,t]=o(`all`),{data:a,isLoading:c,isError:l}=m({},{refetchOnWindowFocus:!1}),{data:u,isLoading:d,isError:f}=ce({},{refetchOnWindowFocus:!1}),{data:p}=g({isCamera:!0,projection:`slim`}),h=r(()=>{let e=new Map;for(let t of p??[])e.set(t.id,t.name);return e},[p]),_=r(()=>{let t=[...a??[],...u??[]];return(e===`all`?t:t.filter(t=>t.domain===e)).toSorted((e,t)=>t.at-e.at)},[a,u,e]),v=r(()=>{let t=[];return l&&e!==`events`&&t.push(`Recordings`),f&&e!==`recording`&&t.push(`Events`),t},[l,f,e]),y=r(()=>[{key:`at`,header:`When`,nowrap:!0,sortValue:e=>e.at,render:e=>s(`span`,{className:`text-foreground-subtle tabular-nums`,children:ke(e.at)})},{key:`domain`,header:`Domain`,sortValue:e=>e.domain,render:e=>s(`span`,{className:`inline-flex rounded px-1.5 py-0.5 text-[10px] font-medium ${De[e.domain]}`,children:e.domain})},{key:`op`,header:`Operation`,sortValue:e=>e.op,render:e=>s(`span`,{className:`text-foreground`,children:e.op})},{key:`reason`,header:`Reason`,sortValue:e=>e.reason,render:e=>s(`span`,{className:`text-foreground-subtle`,children:e.reason})},{key:`device`,header:`Camera`,sortValue:e=>e.deviceId===null?`cluster`:h.get(e.deviceId)??`#${String(e.deviceId)}`,render:e=>e.deviceId===null?s(`span`,{className:`text-foreground-subtle`,children:`cluster`}):s(`span`,{className:`text-foreground`,children:h.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`items`,header:`Items`,align:`right`,nowrap:!0,sortValue:e=>e.itemsAffected,render:e=>s(`span`,{className:`tabular-nums`,children:e.itemsAffected.toLocaleString()})},{key:`bytes`,header:`Reclaimed`,align:`right`,nowrap:!0,sortValue:e=>e.bytesReclaimed,render:e=>s(`span`,{className:`tabular-nums`,children:e.bytesReclaimed>0?L(e.bytesReclaimed):`—`})}],[h]),b=c||d;return n(`div`,{className:`flex flex-col gap-4`,children:[s(`div`,{className:`flex items-center gap-1`,children:Ee.map(n=>s(`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))}),b&&_.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(G,{className:`h-4 w-4 animate-spin`}),`Loading activity…`]}):_.length===0?v.length>0?s(w,{icon:H,title:`Activity could not be read`,description:`The ${v.join(` and `)} ops log did not answer. This is not "nothing happened" — retry, or check the node that owns it.`}):s(w,{icon:ge,title:`No activity yet`,description:`Prune, delete and rescan operations across recordings and events show up here.`}):n(i,{children:[v.length>0&&n(`p`,{className:`flex items-center gap-1.5 text-[11px] text-amber-500`,children:[s(H,{className:`h-3 w-3 shrink-0`}),v.join(` and `),` did not answer — rows from`,` `,v.length===1?`that domain`:`those domains`,` are missing below.`]}),s(M,{columns:y,rows:_,rowKey:e=>e.id,minWidthPx:720,mobileMode:`scroll`,maxBodyHeight:ie,defaultSort:Oe})]})]})}t();function je(){let e=g({isCamera:!0,projection:`slim`}),t=r(()=>(e.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[e.data]),[i,a]=o(null),c=i??t[0]?.id??null;return!e.isLoading&&t.length===0?s(w,{icon:z,title:`No cameras`,description:`Add a camera first.`}):n(`div`,{className:`space-y-3`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Per-camera recording & retention`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Recording mode, schedule bands and the retention policy for one camera — the same controls as the camera's own Recording tab. Retention is one policy over footage and analytics; per-camera event deletion lives on the Events tab.`})]}),n(`div`,{className:`flex items-center gap-2`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),s(`select`,{value:c??``,onChange:e=>a(Number(e.target.value)),className:`rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:t.map(e=>s(`option`,{value:e.id,children:e.name},e.id))})]}),c!==null&&s(te,{deviceId:c,children:s(be,{deviceId:c,sectionFilter:e=>e.location===`top-tab`&&e.tab===`recording`})},c)]})}t();var Me=`pipeline-analytics`;function Ne(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 Pe(){let e=a(),{nodes:t}=y(),{data:i,isLoading:o}=ue({addonId:Me}),c=Ne(i),l=x({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:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node`}),s(`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:[o?s(G,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):s(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:Me,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=>s(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&s(G,{className:`h-4 w-4 animate-spin text-primary`})]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Events folder`}),s(`p`,{className:`mb-3 text-[11px] text-foreground-subtle`,children:`Where event crops / full frames are stored. A single folder — no collection / equal-splitting.`}),s(Se,{types:[`eventMedia`]})]})]})}t();var Fe=[[`pipelineAnalytics`]],Ie=1440*60*1e3;function Le(e,t){return t.get(e)??`Removed camera #${String(e)}`}var Re=[{days:1,label:`1 day`},{days:7,label:`7 days`},{days:30,label:`30 days`},{days:90,label:`90 days`}];function ze(){let t=a(),i=P(),[c,u]=o(30),[d,p]=o(null),{data:m,isLoading:h}=le({},{refetchOnWindowFocus:!1}),{data:_}=g({isCamera:!0,projection:`slim`}),v=r(()=>{let e=new Map;for(let t of _??[])e.set(t.id,t.name);return e},[_]),y=e(()=>{t.invalidateQueries({queryKey:Fe})},[t]),b=f({onSuccess:y}),x=O(),S=e(async()=>{await i({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`})&&b.mutate({olderThanMs:Date.now()-c*Ie,reason:`retention`})},[i,b,c]),C=e(async e=>{let t=Le(e.deviceId,v);if(await i({title:`Delete all events for ${t}?`,message:`Permanently deletes ${String(e.rows)} event${e.rows===1?``:`s`} (${L(e.bytes)} of media) for this camera. This cannot be undone.`,confirmLabel:`Delete events`,variant:`danger`})){p(null);try{let n=await x.mutateAsync({deviceId:e.deviceId});y();let r=n.motion+n.object+n.audio;if(r===0&&e.bytes>0){p(`0 events deleted for ${t}. Media still listed (${L(e.bytes)}) — those blobs are not event rows; use Management → Count leftovers or Disk reconcile.`);return}p(`Deleted ${String(r)} event${r===1?``:`s`} for ${t}.`)}catch(e){p(e instanceof Error?e.message:String(e))}}},[i,x,v,y]),T=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:Le(e.deviceId,v)})},{key:`rows`,header:`Events`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:e.rows.toLocaleString()})},{key:`bytes`,header:`Media`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:L(e.bytes)})},{key:`actions`,header:``,align:`right`,render:e=>n(`button`,{onClick:()=>{C(e)},disabled:x.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:[s(W,{className:`h-3 w-3`}),`Delete`]})}],[v,C,x.isPending]);return h&&!m?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(G,{className:`h-4 w-4 animate-spin`}),`Loading event-store footprint…`]}):m?n(`div`,{className:`flex flex-col gap-6`,children:[n(`section`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[s(l,{label:`Total events`,icon:s(V,{className:`h-3 w-3`}),footer:`across ${String(m.devices.length)} camera${m.devices.length===1?``:`s`}`,children:m.totalRows.toLocaleString()}),s(l,{label:`Event media on disk`,children:L(m.totalBytes)})]}),n(`section`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[s(`span`,{className:`text-foreground-subtle`,children:`Prune events older than`}),s(`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:Re.map(e=>s(`option`,{value:e.days,children:e.label},e.days))}),n(`button`,{onClick:()=>{S()},disabled:b.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:[b.isPending?s(G,{className:`h-3 w-3 animate-spin`}):s(we,{className:`h-3 w-3`}),`Prune now`]})]}),m.devices.length===0?s(w,{icon:V,title:`No stored events`,description:`No camera has persisted events yet.`}):s(M,{columns:T,rows:[...m.devices],rowKey:e=>e.deviceId,minWidthPx:480}),d===null?null:s(`p`,{className:d.startsWith(`Deleted `)?`text-[11px] text-foreground-subtle`:`text-[11px] text-destructive`,children:d})]}):s(w,{icon:V,title:`No event data`,description:`Pipeline analytics has not reported any event-store footprint yet.`})}function Be(){return n(`div`,{className:`flex flex-col gap-8`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Event store`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`What the durable event store occupies, per camera, with fleet-wide prune-by-age and delete-all-events.`}),s(`div`,{className:`mt-3`,children:s(ze,{})})]}),n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Post-processing node & folders`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that writes event crops, and the storage location they land in.`}),s(`div`,{className:`mt-3`,children:s(Pe,{})})]})]})}function Ve(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 He(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function Ue(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`${He(e)} · ${o}`}function We(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 Ge(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 Ke=[`high`,`mid`,`low`],qe=[{value:1,label:`Real time (1×)`},{value:2,label:`2×`},{value:4,label:`4×`},{value:8,label:`8×`},{value:16,label:`16×`}],Je=10080*60*1e3;function Ye(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=g({isCamera:!0,projection:`slim`}),a=r(()=>(i.data??[]).toSorted((e,t)=>e.name.localeCompare(t.name)),[i.data]),[c,l]=o(``),[u,d]=o(`high`),[f,p]=o(Ye(60)),[m,h]=o(Ye(0)),[v,y]=o(1),[b,x]=o(!0),[S,C]=o(``),[w,T]=o(null),E=c===``?a[0]?.id??null:c,D=new Date(f).getTime(),O=new Date(m).getTime(),k=Number.isFinite(D)&&Number.isFinite(O)&&D<O,A=_({onSuccess:()=>{t(),e()},onError:e=>T(e instanceof Error?e.message:String(e))});return s(`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:[s(U,{className:`h-3.5 w-3.5`}),`New export`]}),s(`button`,{onClick:e,className:`text-foreground-subtle hover:text-foreground`,children:s(_e,{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:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Camera`}),s(`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:a.map(e=>s(`option`,{value:e.id,children:e.name},e.id))})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Profile`}),s(`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:Ke.map(e=>s(`option`,{value:e,children:e},e))})]})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`From`}),s(`input`,{type:`datetime-local`,value:f,onChange:e=>p(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:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`To`}),s(`input`,{type:`datetime-local`,value:m,onChange:e=>h(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:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Speed`}),s(`select`,{value:v,onChange:e=>y(Number(e.target.value)),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground`,children:qe.map(e=>s(`option`,{value:e.value,children:e.label},e.value))})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Title (optional)`}),s(`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:[s(`input`,{type:`checkbox`,checked:b,disabled:v!==1,onChange:e=>x(e.target.checked),className:`accent-primary`}),`Include audio`,v===1?``:` (real-time only)`]}),!k&&s(`p`,{className:`text-[11px] text-danger`,children:`"From" must be before "To".`}),w&&s(`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:[s(`button`,{onClick:e,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground`,children:`Cancel`}),s(`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:b,maxLifeMs:Je,deleteAfterDownload:!1,...v===1?{}:{speed:v},...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`})]})]})})}t();var Ze=[[`recordingExport`]],Qe={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 $e(){let{data:e,isLoading:t}=de({},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data??[]).some(e=>e.state===`queued`||e.state===`rendering`)?3e3:!1}),{map:n}=F(I.RecordingExportProgress,e=>e.exportId),{map:i}=F(I.RecordingExportCompleted,e=>e.exportId),{map:a}=F(I.RecordingExportFailed,e=>e.exportId);return{rows:r(()=>Ge(e??[],n,i,a),[e,n,i,a]),isLoading:t}}function et(e){let[t,n]=o(()=>Date.now());return c(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function tt(){let t=a(),[i,c]=o(!1),l=()=>{t.invalidateQueries({queryKey:[[`recordingExport`,`listExports`]]})},d=P(),f=u().trpcClient,p=et(6e4),{rows:m,isLoading:_}=$e(),{data:v}=g({isCamera:!0,projection:`slim`}),y=r(()=>{let e=new Map;for(let t of v??[])e.set(t.id,t.name);return e},[v]),x=e(()=>{t.invalidateQueries({queryKey:Ze})},[t]),S=h({onSuccess:x}),C=b({onSuccess:x}),[T,E]=o(null),D=e(async e=>{E(e.id);try{let{url:t}=await f.recordingExport.getDownloadUrl.query({exportId:e.id}),n=await ye(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),x()}finally{E(null)}},[f,x]),O=e(async e=>{await d({title:`Cancel this export?`,message:`Stops the render. The partial file is discarded.`,confirmLabel:`Cancel export`,variant:`danger`})&&S.mutate({exportId:e.id})},[d,S]),k=e(async e=>{await d({title:`Delete this export?`,message:`Permanently removes the rendered file and its history row.`,confirmLabel:`Delete`,variant:`danger`})&&C.mutate({exportId:e.id})},[d,C]),A=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:y.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`range`,header:`Range`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:Ue(e.fromMs,e.toMs)})},{key:`variant`,header:`Variant`,render:e=>s(`span`,{className:`text-foreground-subtle`,children:Ve(e.options)})},{key:`state`,header:`State`,render:e=>{let t=Qe[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&&s(G,{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`?s(`span`,{className:`text-foreground-subtle`,children:`—`}):s(`span`,{className:`text-foreground-subtle tabular-nums`,children:We(e.expiresAt,p)})},{key:`size`,header:`Size`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:e.fileBytes===null?`—`:L(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:()=>{D(e)},disabled:T===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:[T===e.id?s(G,{className:`h-3 w-3 animate-spin`}):s(he,{className:`h-3 w-3`}),`Download`]}),r&&n(`button`,{onClick:()=>{O(e)},disabled:S.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:[s(me,{className:`h-3 w-3`}),`Cancel`]}),i&&s(`button`,{onClick:()=>{k(e)},disabled:C.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:s(W,{className:`h-3 w-3`})})]})}}],[y,p,T,S.isPending,C.isPending,D,O,k]);return _&&m.length===0?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(G,{className:`h-4 w-4 animate-spin`}),`Loading exports…`]}):n(`div`,{className:`space-y-3`,children:[s(`div`,{className:`flex justify-end`,children:n(`button`,{onClick:()=>c(!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:[s(U,{className:`h-3.5 w-3.5`}),`New export`]})}),m.length===0?s(w,{icon:U,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.`}):s(M,{columns:A,rows:m,rowKey:e=>e.id,minWidthPx:720}),i&&s(Xe,{onClose:()=>c(!1),onCreated:l})]})}function nt(e){return e===null?`absent`:e.providers.length>0?`present`:`absent`}function rt(e){let t=N.capabilities.getCapability.useQuery({name:e});return t.status===`pending`?`pending`:t.status===`error`?`unknown`:nt(t.data)}var it=`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`;t();var at=`storage-migration`,ot=new Set([`orphans`,`debug-media`,`ghost-ledger`]);function st(e){return[`${e.orphansReclaimed} orphan rows (${L(e.orphanBytesReclaimed)})`,e.includeDebugMedia?`${e.debugMediaReclaimed} debug files (${L(e.debugMediaBytesReclaimed)})`:null,`${e.ghostsForgotten} ghost rows (${L(e.ghostBytesForgotten)})`].filter(e=>e!==null).join(` · `)}function ct(){return rt(at)===`present`?s(lt,{}):null}function lt(){let e=P(),[t,r]=o(!1),[i,a]=o(null),c=re({},{refetchInterval:2e3}),l=c.data??null,u=l!==null&&ot.has(l.phase),d=j(),f=oe(),p=async()=>{if(await e({title:`Run storage cleanup?`,message:t?`Reclaims leftover analytics rows and files, debug stills/filmstrips, and ghost footage rows on frozen locations. Safe to re-run.`:`Reclaims leftover analytics rows and files, and ghost footage rows on frozen locations. Debug stills are left alone. Safe to re-run.`,confirmLabel:`Run cleanup`,variant:`danger`})){a(null);try{await d.mutateAsync({includeDebugMedia:t}),await c.refetch()}catch(e){a(e instanceof Error?e.message:String(e))}}},m=async()=>{if(l&&await e({title:`Cancel cleanup?`,message:`Stops after the current step. Work already done stays done.`,confirmLabel:`Cancel cleanup`,variant:`danger`}))try{await f.mutateAsync({jobId:l.jobId}),await c.refetch()}catch{}};return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Cleanup`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`One pass over leftover analytics (database + files) and ghost footage rows on frozen locations. Does not time out — progress updates here until it finishes.`}),n(`label`,{className:`mt-3 flex items-start gap-2 text-[11px] text-foreground`,children:[s(`input`,{type:`checkbox`,checked:t,disabled:u,onChange:e=>{r(e.target.checked)},className:`mt-0.5 h-3.5 w-3.5 accent-primary`}),s(`span`,{children:`Also remove debug media (motion stills and track filmstrips)`})]}),n(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[n(`button`,{type:`button`,disabled:u||d.isPending,onClick:()=>{p()},className:it,children:[(u||d.isPending)&&s(G,{className:`h-3 w-3 animate-spin`}),s(W,{className:`h-3 w-3`}),`Run cleanup`]}),u&&s(`button`,{type:`button`,onClick:()=>{m()},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:`Cancel`})]}),i&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:i}),l&&n(`div`,{className:`mt-3 space-y-1 rounded-md border border-border px-2.5 py-2`,children:[n(`p`,{className:`text-xs text-foreground`,children:[`Phase: `,s(`span`,{className:`font-medium`,children:l.phase}),u&&s(G,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),l.detail&&s(`p`,{className:`text-[11px] text-foreground-subtle`,children:l.detail}),s(`p`,{className:`text-[11px] text-foreground-subtle`,children:st(l)}),l.error&&s(`p`,{className:`text-[11px] text-danger`,children:l.error})]})]})}t();var ut=2e3;function dt(){let e=P(),t=a(),r=ne(),i=d(void 0,{refetchInterval:e=>e.state.data?.state===`running`?ut:!1}),o=i.data,l=o?.state===`running`,u=l||r.isPending;c(()=>{o?.state!==`done`||o.finishedAtMs===null||(t.invalidateQueries({queryKey:[[`recording`]]}),t.invalidateQueries({queryKey:[[`pipelineAnalytics`]]}))},[o?.state,o?.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 i.refetch())},p=l?o.total>0?`Reconciling ${String(o.completed)}/${String(o.total)}…`:`Reconciling…`:r.isPending?`Reconciling…`:`Reconcile from disk`;return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Disk reconcile`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Deletes database rows whose files are gone. Enrolled identities stay.`}),n(`div`,{className:`mt-3 flex flex-col gap-2`,children:[n(`button`,{type:`button`,onClick:()=>void f(),disabled:u,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:[u?s(G,{className:`h-3.5 w-3.5 animate-spin`}):s(R,{className:`h-3.5 w-3.5`}),p]}),o?.state===`done`?n(`p`,{className:`text-[11px] text-foreground-subtle`,children:[`Last run: `,String(o.completed),` camera(s) — dropped `,String(o.tracks),` tracks,`,` `,String(o.events),` events, `,String(o.mediaDropped),` media`,o.failed.length>0?`, ${String(o.failed.length)} failed (${o.failed.join(`, `)})`:``,`.`]}):null,o?.state===`error`&&o.error!==null?n(`p`,{className:`text-[11px] text-destructive`,children:[`Reconcile failed: `,o.error]}):null]})]})}var K=1e3,q=60*K,J=60*q;function Y(e){return e.toLocaleString(`en-US`)}function ft(e){if(!Number.isFinite(e)||e<0)return`—`;if(e>=J){let t=Math.floor(e/J),n=Math.round(e%J/q);return`${t.toString()}h ${n.toString()}m`}if(e>=q){let t=Math.floor(e/q),n=Math.round(e%q/K);return`${t.toString()}m ${n.toString()}s`}return`${Math.max(0,Math.round(e/K)).toString()}s`}function pt(e){let t=Math.max(0,e.observedAt-e.startedAt),n=e.filesTotal===null?`${Y(e.filesMoved)} files`:`${Y(e.filesMoved)} / ${Y(e.filesTotal)} files`,r=e.filesTotal===null||e.filesTotal===0?null:Math.min(1,e.filesMoved/e.filesTotal),i=t>0&&e.filesMoved>0,a=i?`${L(e.bytesMoved/t*K)}/s`:null,o=e.filesTotal===null?null:e.filesTotal-e.filesMoved,s=!i||o===null||o<=0?null:`~${ft(o*t/e.filesMoved)} left`;return{counted:n,fraction:r,moved:`${L(e.bytesMoved)} moved`,rate:a,eta:s}}function mt(e){let t=pt(e);return[t.counted,t.moved,t.rate,t.eta].filter(e=>e!==null).join(` · `)}t();var ht=`storage-migration`,X=[{id:`recordings`,label:`Recordings`,locationType:`recordings`},{id:`recordingsLow`,label:`Low-res recordings`,locationType:`recordingsLow`},{id:`eventMedia`,label:`Event media`,locationType:`eventMedia`}],gt=new Set([`planning`,`sealing`,`pausing`,`moving`,`draining`,`verifying`,`repointing`,`refreshing`,`resuming`]);function _t(){let e=rt(ht);return e===`pending`?n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(G,{className:`h-4 w-4 animate-spin`}),`Checking whether storage migration is installed…`]}):e===`unknown`?s(w,{icon:H,title:`Couldn't check whether storage migration is installed`,description:`The capability registry did not answer, so this panel has nothing to report either way — it is not a statement that the capability is missing. Reload to ask again.`}):e===`absent`?s(w,{icon:Ce,title:`Storage migration not installed`,description:`The capability registry answered: no addon in this cluster provides storage-migration. Once one is deployed, this panel moves recordings, low-res recordings and event media to new storage locations in one coordinated, verified operation.`}):s(vt,{})}function vt(){let e=P(),{data:t}=v({}),[i,a]=o({}),[c,l]=o({}),[u,d]=o(null),[f,p]=o(null),m=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]),h=r(()=>{let e=new Map;for(let n of t??[]){if(n.enabled===!1)continue;let t=e.get(n.type);t?t.push(n.id):e.set(n.type,[n.id])}let n=new Map;for(let[t,r]of e)r.length===1&&n.set(t,r[0]);return n},[t]),g=se({},{refetchInterval:2e3}),_=g.data??null,y=_!==null&>.has(_.phase),b=r(()=>{let e={};for(let t of X){let n=i[t.id];n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[i]),x=r(()=>{let e={};for(let t of X){if(!i[t.id])continue;let n=c[t.id]??h.get(t.locationType);n&&(e[t.id]=n)}return Object.keys(e).length>0?e:void 0},[i,c,h]),S=r(()=>({destinations:b??{},...x?{sources:x}:{}}),[b,x]),C=ae(S,{enabled:!1,retry:!1}),w=A(),T=D(),E=async()=>{if(!b)return;p(null);let e=await C.refetch();if(e.error){p(e.error instanceof Error?e.error.message:String(e.error));return}d(e.data??null)},O=async()=>{if(b&&await e({title:`Start storage migration?`,message:`Copies the selected classes from the chosen source to the destination, verifies, then either makes the destination the default (if the source was) or disables the source. Safe to re-run if interrupted.`,confirmLabel:`Start migration`,variant:`danger`})){p(null);try{await w.mutateAsync(S),d(null),await g.refetch()}catch(e){p(e instanceof Error?e.message:String(e))}}},k=async()=>{if(_&&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 T.mutateAsync({jobId:_.jobId}),await g.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:[s(Ce,{className:`h-3.5 w-3.5`}),`Storage migration`]}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Move recordings, low-res recordings and/or event media from one location to another: copies via the recorder / pipeline-analytics movers, verifies, then either repoints the default (when the source was the default) or disables the source (when it was not). Skip a class with an empty destination.`}),s(`div`,{className:`mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3`,children:X.map(e=>{let t=m.get(e.locationType)??[],r=h.get(e.locationType)??``;return n(`div`,{className:`space-y-2`,children:[s(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:e.label}),n(`div`,{className:`space-y-1`,children:[n(`label`,{htmlFor:`migration-from-${e.id}`,className:`text-[10px] text-foreground-subtle`,children:[e.label,` from`]}),s(`select`,{id:`migration-from-${e.id}`,value:c[e.id]??r,onChange:t=>{let n=t.target.value;l(t=>({...t,[e.id]:n}))},disabled:y,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:t.map(e=>n(`option`,{value:e.id,children:[e.displayName,e.enabled===!1?` (read-only)`:``]},e.id))})]}),n(`div`,{className:`space-y-1`,children:[n(`label`,{htmlFor:`migration-dest-${e.id}`,className:`text-[10px] text-foreground-subtle`,children:[e.label,` to`]}),n(`select`,{id:`migration-dest-${e.id}`,value:i[e.id]??``,onChange:t=>{let n=t.target.value;a(t=>({...t,[e.id]:n}))},disabled:y,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground disabled:opacity-50`,children:[s(`option`,{value:``,children:`— skip —`}),t.map(e=>s(`option`,{value:e.id,children:e.displayName},e.id))]})]})]},e.id)})}),f&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:f}),n(`div`,{className:`mt-3 flex items-center gap-2`,children:[n(`button`,{type:`button`,onClick:()=>{E()},disabled:!b||C.isFetching||y,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:[C.isFetching&&s(G,{className:`h-3 w-3 animate-spin`}),`Plan`]}),n(`button`,{type:`button`,onClick:()=>{O()},disabled:!b||w.isPending||y,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:[w.isPending&&s(G,{className:`h-3 w-3 animate-spin`}),`Start migration`]})]}),u&&s(`div`,{className:`mt-3 divide-y divide-border rounded-md border border-border`,children:u.moves.length===0?s(`p`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:`Nothing to move — selected destinations match the current defaults.`}):u.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}`))}),_&&n(`div`,{className:`mt-4 border-t border-border pt-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[s(`h4`,{className:`text-xs font-semibold text-foreground`,children:`Migration status`}),y&&n(`button`,{type:`button`,onClick:()=>{k()},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:[s(_e,{className:`h-3 w-3`}),`Cancel`]})]}),n(`p`,{className:`mt-1 text-xs text-foreground`,children:[`Phase: `,s(`span`,{className:`font-medium`,children:_.phase}),y&&s(G,{className:`ml-2 inline h-3 w-3 animate-spin text-primary`})]}),_.error&&s(`p`,{className:`mt-1 text-[11px] text-danger`,children:_.error}),_.pausedParticipants.length>0&&n(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:[`Paused: `,_.pausedParticipants.join(`, `)]}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:_.moves.map(e=>s(yt,{move:e},`${e.storageClass}-${e.fromLocationId}`))})]}),s(bt,{})]}),s(xt,{running:y}),s(Ct,{})]})}function yt({move:e}){let t=e.progress===null?null:pt(e.progress);return n(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[n(`div`,{className:`flex items-center justify-between`,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.progress!==null&&n(`div`,{className:`mt-1 space-y-1`,children:[t!==null&&t.fraction!==null&&s(`div`,{className:`h-1 w-full overflow-hidden rounded bg-border`,children:s(`div`,{className:`h-full bg-primary`,style:{width:`${(t.fraction*100).toFixed(1)}%`}})}),s(`p`,{className:`text-[10px] text-foreground-subtle`,children:mt(e.progress)})]})]})}function bt(){let{data:e}=T({});return!e||e.length===0?null:n(`div`,{className:`mt-4 border-t border-border pt-3`,children:[s(`h4`,{className:`text-xs font-semibold text-foreground`,children:`Migration history`}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:e.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px] text-foreground-subtle`,children:[s(`span`,{className:`font-medium text-foreground`,children:e.phase}),` · `,Object.entries(e.destinations).filter(e=>typeof e[1]==`string`).map(([e,t])=>`${e} → ${t}`).join(`, `),` · `,new Date(e.startedAt).toLocaleString()]},e.jobId))})]})}function xt({running:e}){let t=P(),r=E({},{staleTime:1/0,refetchOnWindowFocus:!1}),i=k(),[a,c]=o(null),l=r.data??[];if(l.length===0)return null;let u=async e=>{if(await t({title:`Drain remaining ${e.storageClass}?`,message:`Moves what is still on ${e.fromLocationId} to ${e.toLocationId}. Nothing is paused and no default is changed — this is the second half of a migration, run on its own. It is resumable: cancelling leaves everything readable from both locations.`,confirmLabel:`Drain remaining`,variant:`danger`})){c(null);try{await i.mutateAsync({classes:[e.storageClass]}),await r.refetch()}catch(e){c(e instanceof Error?e.message:String(e))}}};return n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[n(`div`,{className:`flex items-start justify-between gap-2`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Left on the old location`}),n(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s(`span`,{className:`text-[10px] text-foreground-subtle`,children:r.dataUpdatedAt>0?`Measured ${new Date(r.dataUpdatedAt).toLocaleTimeString()}`:`Measured — never`}),s(`button`,{type:`button`,onClick:()=>{r.refetch()},disabled:r.isFetching,className:`rounded border border-border px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover hover:text-foreground disabled:opacity-50`,children:r.isFetching?`Counting…`:`Refresh`})]})]}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`A migration repoints first and drains behind. If the drain was cancelled, failed, or was interrupted by a restart, the data below is still on the source — readable, but not where the defaults now point. Draining moves it; it changes no default and pauses nothing.`}),s(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:`This count is taken on demand: measuring it walks the whole media collection, so it is not refreshed on a timer. Press Refresh after a drain finishes.`}),a&&s(`p`,{className:`mt-2 text-[11px] text-danger`,children:a}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:l.map(t=>n(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5 text-[11px]`,children:[n(`span`,{className:`text-foreground`,children:[t.storageClass,`: `,t.fromLocationId,` → `,t.toLocationId,s(`span`,{className:`ml-2 text-foreground-subtle`,children:St(t)})]}),s(`button`,{type:`button`,onClick:()=>{u(t)},disabled:e||i.isPending,className:`shrink-0 rounded border border-border px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover hover:text-foreground disabled:opacity-50`,children:`Drain remaining`})]},`${t.storageClass}-${t.fromLocationId}`))})]})}function St(e){if(e.items===null)return`amount unknown — the archive could not be read`;let t=e.items.toLocaleString(`en-US`);return e.bytes===null?`${t} rows`:`${t} segments · ${L(e.bytes)}`}function Ct(){let{data:e}=ee({},{refetchInterval:2e3}),t=(e??[]).filter(e=>e.migrationJobId===null&&e.job.state===`running`);return t.length===0?null:n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Movers running outside a migration`}),s(`div`,{className:`mt-2 divide-y divide-border rounded-md border border-border`,children:t.map(e=>n(`div`,{className:`px-2.5 py-1.5 text-[11px]`,children:[n(`div`,{className:`text-foreground`,children:[e.lane,`: `,e.job.fromLocationId,` → `,e.job.toLocationId]}),s(`p`,{className:`mt-1 text-[10px] text-foreground-subtle`,children:mt({filesMoved:e.job.filesMoved,filesTotal:e.job.filesTotal,bytesMoved:e.job.bytesMoved,startedAt:e.job.startedAt,observedAt:e.observedAt})})]},e.job.jobId))})]})}function wt(){return n(`div`,{className:`flex flex-col gap-4`,children:[s(ct,{}),s(dt,{}),n(`section`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Move storage`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`Copy recordings, low-res recordings or event media to a new location, verify, then repoint the default. Applies to every camera.`}),s(`div`,{className:`mt-3`,children:s(_t,{})})]})]})}t();var Tt=`recorder`;function Et(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 Dt(){let e=a(),{nodes:t}=y(),{data:i,isLoading:o}=ue({addonId:Tt}),c=Et(i,`recordingNodeId`,`hub`),l=x({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:[s(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Recording node`}),s(`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:[o?s(G,{className:`h-4 w-4 animate-spin text-foreground-subtle`}):s(`select`,{value:c,onChange:e=>{e.target.value!==c&&l.mutate({addonId:Tt,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=>s(`option`,{value:e,children:e===`hub`?`hub (default)`:e},e))}),l.isPending&&s(G,{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`,` `,s(`span`,{className:`font-medium`,children:c}),`. If the auto-derived host doesn't work, set the recorder's`,s(`span`,{className:`font-medium`,children:` recordingHubHostname`}),` global setting.`]})]}),n(`section`,{className:`rounded-md border border-border bg-surface p-4`,children:[s(`h3`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Recordings folders`}),s(`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.`}),s(Se,{types:[`recordings`,`recordingsLow`]})]})]})}function Ot(e){return e.locationIds!==void 0&&e.locationIds.length>0?e.locationIds:e.locationId===null?[]:[e.locationId]}function Z(e,t){let n=Ot(e);return n.length===0?`default root`:n.map(e=>t.get(e)??e).join(` + `)}function kt(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=>Ot(e).includes(n));return i===void 0?null:{label:Z(i,t),exact:!1}}t();var At=[[`recording`]],jt=[{value:`retention`,label:`Retention policy`},{value:`quota`,label:`Quota / disk pressure`},{value:`operator`,label:`Operator`}],Mt={ok:`bg-primary`,warn:`bg-amber-500`,critical:`bg-danger`},Q={ok:`text-foreground-subtle`,warn:`text-amber-500`,critical:`text-danger`};function $(e){return`${String(Math.round(e*100))}%`}function Nt(e,t){let n=e.locationIds??(e.locationId===null?[]:[e.locationId]),r=n.map(e=>t.get(e)).filter(e=>e!==void 0);return r.length>0?r.join(` + `):e.root===void 0?n.length>0?n.join(` + `):`default root`:e.root}function Pt(){let t=a(),i=P(),[c,u]=o(`retention`),{data:d,isLoading:f}=C({},{refetchOnWindowFocus:!1}),{data:m}=g({isCamera:!0,projection:`slim`}),{data:h}=v({}),_=r(()=>{let e=new Map;for(let t of m??[])e.set(t.id,t.name);return e},[m]),y=r(()=>{let e=new Map;for(let t of h??[])e.set(t.id,t.displayName);return e},[h]),b=r(()=>{let e=h??[];return e.find(e=>e.type===`recordings`&&e.enabled!==!1)?.id??e.find(e=>e.type===`recordings`)?.id??null},[h]),x=r(()=>d?.locations??[],[d?.locations]),T=r(()=>kt(x,y,b),[x,y,b]),E=r(()=>fe(x),[x]),D=e(()=>{t.invalidateQueries({queryKey:At})},[t]),O=S({onSuccess:D}),k=p({onSuccess:D}),A=e(async e=>{await i({title:`Prune ${_.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`})&&O.mutate({deviceId:e.deviceId,reason:c})},[i,O,c,_]),j=e(async e=>{await i({title:`Delete all footage for ${_.get(e.deviceId)??`#${String(e.deviceId)}`}?`,message:`Permanently deletes ${L(e.usedBytes)} of recorded footage for this camera. This cannot be undone.`,confirmLabel:`Delete ${L(e.usedBytes)}`,variant:`danger`})&&k.mutate({deviceId:e.deviceId})},[i,k,_]),ee=r(()=>[{key:`camera`,header:`Camera`,render:e=>s(`span`,{className:`text-foreground`,children:_.get(e.deviceId)??`#${String(e.deviceId)}`})},{key:`disk`,header:`Disk`,nowrap:!0,render:()=>T===null?s(`span`,{className:`text-foreground-subtle`,children:`—`}):n(`span`,{className:T.exact?`text-foreground`:`text-foreground-subtle`,title:T.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:[T.label,!T.exact&&s(`span`,{className:`ml-1 text-foreground-subtle`,children:`(default)`})]})},{key:`used`,header:`Used`,align:`right`,nowrap:!0,render:e=>s(`span`,{className:`tabular-nums`,children:L(e.usedBytes)})},{key:`actions`,header:``,align:`right`,render:e=>n(`div`,{className:`flex items-center justify-end gap-1`,children:[n(`button`,{onClick:()=>{A(e)},disabled:O.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:[s(we,{className:`h-3 w-3`}),`Prune`]}),n(`button`,{onClick:()=>{j(e)},disabled:k.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:[s(W,{className:`h-3 w-3`}),`Delete`]})]})}],[_,T,A,j,O.isPending,k.isPending]);if(f&&!d)return n(`div`,{className:`flex items-center gap-2 py-8 text-xs text-foreground-subtle`,children:[s(G,{className:`h-4 w-4 animate-spin`}),`Loading storage usage…`]});if(!d)return s(w,{icon:R,title:`No storage data`,description:`The recording node has not reported any storage usage yet.`});let N=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:[s(l,{label:`Total used`,icon:s(R,{className:`h-3 w-3`}),footer:`${String(N)} camera${N===1?``:`s`} on ${d.nodeId}`,children:L(d.totalUsedBytes)}),E!==null&&E.severity!==null&&s(l,{label:`Free on recordings volumes`,icon:s(R,{className:`h-3 w-3`}),footer:`across ${String(E.knownVolumes)} volume${E.knownVolumes===1?``:`s`} of ${L(E.totalBytes)}`+(E.unknownVolumes>0?` · ${String(E.unknownVolumes)} did not report capacity`:``),children:s(`span`,{className:`tabular-nums ${Q[E.severity]}`,children:L(E.freeBytes)})}),x.map(e=>{let t=pe(e),r=e.locationId??e.root??`default`;return s(l,{label:`Disk: ${Nt(e,y)}`,footer:t===null?`${L(e.usedBytes)} of recordings · volume capacity unknown`:`${L(t.freeBytes)} free of ${L(t.totalBytes)} · ${L(e.usedBytes)} recordings (${$(t.recordingsFraction)})`,children:t===null?s(`span`,{className:`tabular-nums`,children:L(e.usedBytes)}):n(`div`,{className:`flex items-center gap-2`,title:`Volume fill — everything on the disk, not only recordings. Warn at 85%, critical at 95%.`,children:[s(`div`,{className:`h-2 flex-1 overflow-hidden rounded bg-muted`,children:s(`div`,{className:`h-full rounded ${Mt[t.severity]}`,style:{width:$(t.fraction)}})}),s(`span`,{className:`tabular-nums text-xs ${Q[t.severity]}`,children:$(t.fraction)})]})},r)})]}),n(`section`,{className:`flex items-center gap-2 text-xs`,children:[s(`label`,{htmlFor:`prune-reason`,className:`text-foreground-subtle`,children:`Prune reason`}),s(`select`,{id:`prune-reason`,value:c,onChange:e=>{let t=jt.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:jt.map(e=>s(`option`,{value:e.value,children:e.label},e.value))})]}),N===0?s(w,{icon:R,title:`No recorded footage`,description:`No camera has recorded footage on this node yet.`}):s(M,{columns:ee,rows:[...d.devices],rowKey:e=>e.deviceId,minWidthPx:480})]})}function Ft(){return n(`div`,{className:`flex flex-col gap-8`,children:[n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Footage on disk`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`What recorded footage occupies, per camera and per volume, with prune-by-policy and delete-all-footage.`}),s(`div`,{className:`mt-3`,children:s(Pt,{})})]}),n(`div`,{children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Recording node & folders`}),s(`p`,{className:`mt-1 text-[11px] text-foreground-subtle`,children:`The single node that records and serves playback, and the storage locations footage is written to.`}),s(`div`,{className:`mt-3`,children:s(Dt,{})})]})]})}function It(){return s(ve,{icon:U,title:`Recordings`,subtitle:`Recorded footage and the durable event store — what each occupies, where it is written, and the operations that move or reconcile both.`,children:s(xe,{tabs:[{id:`storage`,label:`Recordings`,icon:R,content:s(Ft,{})},{id:`events`,label:`Events`,icon:V,content:s(Be,{})},{id:`cameras`,label:`Cameras`,icon:z,content:s(je,{})},{id:`exports`,label:`Export`,icon:U,content:s(tt,{})},{id:`activity`,label:`Activity`,icon:ge,content:s(Ae,{})},{id:`management`,label:`Management`,icon:Te,content:s(wt,{})}]})})}export{It as RecordingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as e,S as t,q as n,x as r}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DhP-Lgiq.js";import{t as i}from"./CapabilityBadges-D2wnwjTn.js";import{t as a}from"./ProviderIcon-ChlkicsQ.js";import{t as o}from"./StatusBadge-CeptlsPG.js";import{t as s}from"./FormBuilder-DtoH-H2q.js";e();function c({title:e,children:n}){return t(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r(`div`,{className:`border-b border-border px-4 py-2.5`,children:r(`h2`,{className:`text-xs font-semibold text-foreground uppercase tracking-wider`,children:e})}),r(`div`,{className:`p-4`,children:n})]})}function l({name:e,cssVar:n,hex:i}){return t(`div`,{className:`flex flex-col items-center gap-1.5`,children:[r(`div`,{className:`h-10 w-10 rounded-lg border border-border shadow-inner`,style:{backgroundColor:n?`var(${n})`:i}}),r(`span`,{className:`text-[10px] text-foreground-subtle text-center leading-tight`,children:e})]})}var u={sections:[{id:`demo`,title:`Demo Fields`,columns:2,fields:[{key:`name`,type:`text`,label:`Name`,placeholder:`Enter name`},{key:`count`,type:`number`,label:`Count`,min:0,max:100,unit:`items`},{key:`enabled`,type:`boolean`,label:`Enabled`},{key:`mode`,type:`select`,label:`Mode`,options:[{value:`a`,label:`Alpha`},{value:`b`,label:`Beta`}]},{key:`tags`,type:`tags`,label:`Tags`,span:2,suggestions:[`camera`,`zone`,`alert`]},{key:`confidence`,type:`slider`,label:`Confidence`,min:0,max:100,step:5,unit:`%`,span:2},{key:`info`,type:`info`,label:`Note`,content:`This is an informational message for the user.`,variant:`info`}]}]};function d(){let[e,d]=n({name:`Example`,count:10,enabled:!0,mode:`a`,tags:[`camera`],confidence:60});return t(`div`,{className:`p-6 space-y-6 max-w-5xl mx-auto`,children:[t(`div`,{className:`mb-6`,children:[r(`h1`,{className:`text-xl font-bold text-foreground`,children:`Component Showroom`}),r(`p`,{className:`text-sm text-foreground-subtle mt-1`,children:`All UI components at a glance`})]}),r(c,{title:`Typography`,children:t(`div`,{className:`space-y-3`,children:[r(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Heading 1 — Display title`}),r(`h2`,{className:`text-xl font-semibold text-foreground`,children:`Heading 2 — Section title`}),r(`h3`,{className:`text-base font-semibold text-foreground`,children:`Heading 3 — Card title`}),r(`h4`,{className:`text-sm font-semibold text-foreground`,children:`Heading 4 — Sub-section`}),r(`p`,{className:`text-sm text-foreground`,children:`Body text — Regular paragraph content goes here. It uses the foreground color.`}),r(`p`,{className:`text-sm text-foreground-subtle`,children:`Subtle text — Secondary/descriptive text with reduced emphasis.`}),r(`p`,{className:`text-xs text-foreground-subtle uppercase tracking-wider font-semibold`,children:`Label / Caption`}),r(`p`,{className:`text-xs text-foreground-disabled`,children:`Disabled / placeholder text`})]})}),r(c,{title:`Colors`,children:t(`div`,{className:`flex flex-wrap gap-4`,children:[r(l,{name:`primary`,cssVar:`--color-primary`}),r(l,{name:`background`,cssVar:`--color-background`}),r(l,{name:`surface`,cssVar:`--color-surface`}),r(l,{name:`foreground`,cssVar:`--color-foreground`}),r(l,{name:`success`,cssVar:`--color-success`}),r(l,{name:`warning`,cssVar:`--color-warning`}),r(l,{name:`danger`,cssVar:`--color-danger`}),r(l,{name:`info`,cssVar:`--color-info`}),r(l,{name:`border`,cssVar:`--color-border`}),r(`div`,{className:`w-px`}),r(l,{name:`frigate`,hex:`#3b82f6`}),r(l,{name:`scrypted`,hex:`#a855f7`}),r(l,{name:`reolink`,hex:`#06b6d4`}),r(l,{name:`ha`,hex:`#22d3ee`}),r(l,{name:`rtsp`,hex:`#78716c`})]})}),r(c,{title:`Buttons`,children:t(`div`,{className:`flex flex-wrap gap-3`,children:[r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity`,children:`Primary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:`Secondary`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors`,children:`Danger`}),r(`button`,{disabled:!0,className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed`,children:`Disabled`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors`,children:`Warning`}),r(`button`,{className:`inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors`,children:`Success`})]})}),r(c,{title:`Inputs`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Text input`}),r(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`Type something...`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Number input`}),r(`input`,{type:`number`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`0`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Password input`}),r(`input`,{type:`password`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,placeholder:`••••••••`})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Select`}),t(`select`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30`,children:[r(`option`,{children:`Option A`}),r(`option`,{children:`Option B`}),r(`option`,{children:`Option C`})]})]}),t(`div`,{className:`md:col-span-2`,children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Textarea`}),r(`textarea`,{className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]`,placeholder:`Enter multi-line text...`,rows:3})]}),r(`div`,{children:t(`label`,{className:`flex items-center gap-2 cursor-pointer select-none`,children:[r(`input`,{type:`checkbox`,className:`h-3.5 w-3.5 rounded border-border accent-primary`,defaultChecked:!0}),r(`span`,{className:`text-xs font-medium text-foreground`,children:`Checkbox (checked)`})]})}),r(`div`,{children:t(`div`,{className:`flex items-center justify-between`,children:[r(`span`,{className:`text-xs font-medium text-foreground`,children:`Toggle switch`}),r(f,{})]})}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Slider`}),r(`input`,{type:`range`,className:`w-full h-1 accent-primary cursor-pointer`,min:0,max:100,defaultValue:60})]}),t(`div`,{children:[r(`label`,{className:`block text-xs font-medium text-foreground mb-1`,children:`Tags example`}),r(`div`,{className:`flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]`,children:[`camera`,`zone`,`alert`].map(e=>r(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary`,children:e},e))})]})]})}),r(c,{title:`Badges`,children:t(`div`,{className:`space-y-3`,children:[t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`StatusBadge`}),r(`div`,{className:`flex flex-wrap gap-2`,children:[`running`,`stopped`,`error`,`online`,`offline`,`idle`].map(e=>r(o,{status:e},e))})]}),t(`div`,{children:[r(`p`,{className:`text-xs text-foreground-subtle mb-2`,children:`CapabilityBadges`}),r(i,{capabilities:[`streaming`,`detection`,`recording`,`audio`]})]})]})}),r(c,{title:`Cards`,children:t(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[t(`div`,{className:`rounded-lg bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Surface card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-surface`. Default card background."})]}),t(`div`,{className:`rounded-lg border border-border bg-surface p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Bordered card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `border border-border bg-surface`."})]}),t(`div`,{className:`rounded-lg border border-primary/30 bg-primary/5 p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-primary mb-1`,children:`Accent card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:`Highlighted with primary color.`})]}),t(`div`,{className:`rounded-lg bg-background p-4`,children:[r(`h3`,{className:`text-sm font-semibold text-foreground mb-1`,children:`Background card`}),r(`p`,{className:`text-xs text-foreground-subtle`,children:"Uses `bg-background`. Inset card."})]})]})}),r(c,{title:`Provider Icons`,children:r(`div`,{className:`flex flex-wrap gap-4`,children:[`frigate`,`scrypted`,`reolink`,`homeassistant`,`rtsp`,`onvif`].map(e=>r(a,{type:e,size:`lg`,showLabel:!0},e))})}),t(c,{title:`Form Builder Demo`,children:[r(s,{schema:u,values:e,onChange:d}),t(`details`,{className:`mt-3`,children:[r(`summary`,{className:`text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground`,children:`View current values`}),r(`pre`,{className:`mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto`,children:JSON.stringify(e,null,2)})]})]}),r(c,{title:`Info Boxes`,children:r(`div`,{className:`space-y-2`,children:[{variant:`info`,label:`Info`,content:`This is an informational message. Use it for tips and hints.`},{variant:`warning`,label:`Warning`,content:`This action may have side effects. Proceed with caution.`},{variant:`success`,label:`Success`,content:`Operation completed successfully. All systems are green.`},{variant:`danger`,label:`Danger`,content:`This operation is irreversible. Data will be permanently deleted.`}].map(({variant:e,label:n,content:i})=>{let a={info:{border:`border-info`,bg:`bg-info/5`,text:`text-info`},warning:{border:`border-warning`,bg:`bg-warning/5`,text:`text-warning`},success:{border:`border-success`,bg:`bg-success/5`,text:`text-success`},danger:{border:`border-danger`,bg:`bg-danger/5`,text:`text-danger`}}[e];return t(`div`,{className:`rounded-md border-l-4 px-3 py-2.5 ${a.border} ${a.bg}`,children:[r(`p`,{className:`text-xs font-semibold mb-0.5 ${a.text}`,children:n}),r(`p`,{className:`text-xs text-foreground-subtle leading-relaxed`,children:i})]},e)})})})]})}function f(){let[e,t]=n(!0);return r(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>t(e=>!e),className:[`relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer`,e?`bg-primary`:`bg-foreground-subtle/30`].join(` `),children:r(`span`,{className:[`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150`,e?`translate-x-4`:`translate-x-0.5`].join(` `)})})}export{d as ShowroomPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-D5stGBcP.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{J as e}from"./index-D5stGBcP.js";var t=e(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-D5stGBcP.js";var t=e(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./index-D5stGBcP.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};
|