@camstack/addon-admin-ui 1.2.113 → 1.2.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/assets/{AddLocationWizard-CqbB-rwE.js → AddLocationWizard-CGIOvC3P.js} +1 -1
  2. package/dist/assets/{AddonCollectionPage-DEZaloJi.js → AddonCollectionPage-CFaF5Vw9.js} +1 -1
  3. package/dist/assets/{Addons-BZsUobsZ.js → Addons-DZCZomaH.js} +1 -1
  4. package/dist/assets/{AdminTabs-CyjmxyDN.js → AdminTabs-BJEXfjyu.js} +1 -1
  5. package/dist/assets/{AiProfiles-C0_0XDlF.js → AiProfiles-BnJM-kV3.js} +1 -1
  6. package/dist/assets/{BrokerForm-YLFxJpIo.js → BrokerForm-ByK6-Bp9.js} +1 -1
  7. package/dist/assets/{Build-CWnvgWXx.js → Build-36exF1MS.js} +1 -1
  8. package/dist/assets/{Capabilities-DToMqW8B.js → Capabilities-0UWikL4K.js} +1 -1
  9. package/dist/assets/{CapabilityBadges-Sf7Am10m.js → CapabilityBadges-CGpdhPHy.js} +1 -1
  10. package/dist/assets/{Cluster-P1ZSjPXr.js → Cluster-DeA0so_x.js} +1 -1
  11. package/dist/assets/Data-BwbwqI-R.js +1 -0
  12. package/dist/assets/{DetectionIntelligence-BEjLE7_3.js → DetectionIntelligence-B4klGkOh.js} +1 -1
  13. package/dist/assets/{DeviceAggregateSection-DFj1880a.js → DeviceAggregateSection-0MLZqgcC.js} +1 -1
  14. package/dist/assets/{DeviceDetail-CUPKRIe-.js → DeviceDetail-C40U8em3.js} +1 -1
  15. package/dist/assets/{Devices-xOT2mVcG.js → Devices-Dn5VCAkY.js} +1 -1
  16. package/dist/assets/{EmbedPlayerPage-DuFIzNMq.js → EmbedPlayerPage-CsErD-aU.js} +1 -1
  17. package/dist/assets/{Events-BA-sdXXw.js → Events-DW7CqfPm.js} +1 -1
  18. package/dist/assets/{FormBuilder-osctJDVF.js → FormBuilder-BIwZtxC8.js} +1 -1
  19. package/dist/assets/{Identity-Ds0-b1zo.js → Identity-DeElzcC7.js} +1 -1
  20. package/dist/assets/{IntegrationDetail-_9IVew6o.js → IntegrationDetail-KIwepyEo.js} +1 -1
  21. package/dist/assets/{Integrations-ngf6xlgJ.js → Integrations-BWZIP2oy.js} +1 -1
  22. package/dist/assets/{Integrations-yy0lyr6D.js → Integrations-CNBZWNb8.js} +1 -1
  23. package/dist/assets/{Logs-B1l6Ludj.js → Logs-Blz6qLWG.js} +1 -1
  24. package/dist/assets/{MotionZonesSettings-ChjW_fMs.js → MotionZonesSettings-kcllZKfi.js} +1 -1
  25. package/dist/assets/{MyAccess-CK_4ACsy.js → MyAccess-B0WuiuOr.js} +1 -1
  26. package/dist/assets/{Network-CJ1m614E.js → Network-DCZ_Std9.js} +1 -1
  27. package/dist/assets/{NodeAddonsSettingsPanel-2hSyM7WQ.js → NodeAddonsSettingsPanel-D5n8FA1J.js} +1 -1
  28. package/dist/assets/{NodeInferenceDevices-BIvtsupd.js → NodeInferenceDevices-BXO_eElj.js} +1 -1
  29. package/dist/assets/{Notifications-BQzonvWh.js → Notifications-BvSUFvwo.js} +1 -1
  30. package/dist/assets/{Pipeline-BCOI0LUv.js → Pipeline-Bid2_o3k.js} +1 -1
  31. package/dist/assets/{Plates-BqkAYlBX.js → Plates-BmjpMJ8M.js} +1 -1
  32. package/dist/assets/{PrivacyMaskSettings-CKZgswYX.js → PrivacyMaskSettings-CNusEkLm.js} +1 -1
  33. package/dist/assets/{ProviderIcon-BXqB7l0I.js → ProviderIcon-CCmwPnj7.js} +1 -1
  34. package/dist/assets/{Recordings-zCz8150H.js → Recordings-Dx95yGAh.js} +1 -1
  35. package/dist/assets/{ScanNetworkModal-B1CnVDmq.js → ScanNetworkModal-popRbbnY.js} +1 -1
  36. package/dist/assets/{SceneMonitorEditor-CdsBRzaU.js → SceneMonitorEditor--U-5D4mi.js} +1 -1
  37. package/dist/assets/{Scenes-B7LlMxIM.js → Scenes-BUdZCtSm.js} +1 -1
  38. package/dist/assets/{Settings-DYI84R_3.js → Settings-Chyz9pil.js} +1 -1
  39. package/dist/assets/{Showroom-aKAj4KuT.js → Showroom-L0I-EMzO.js} +1 -1
  40. package/dist/assets/{Terminal-BWDl9iTB.js → Terminal-DFGgZjs0.js} +1 -1
  41. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BijWScLn.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D9FJNM6p.js} +1 -1
  42. package/dist/assets/{bell-ring-D94i5Myj.js → bell-ring-Dnavb4Im.js} +1 -1
  43. package/dist/assets/{boxes-CXXUCLcv.js → boxes-DVHIrGCL.js} +1 -1
  44. package/dist/assets/circle-check-big-BFWc5wJh.js +1 -0
  45. package/dist/assets/{circle-x-CRUSIt4G.js → circle-x-CaCMuaLw.js} +1 -1
  46. package/dist/assets/clock-cmGwdobA.js +1 -0
  47. package/dist/assets/{copy-qaS5fZlT.js → copy-BML9XMSw.js} +1 -1
  48. package/dist/assets/{debounced-invalidate-UxnQu3CI.js → debounced-invalidate-B1h2pckj.js} +1 -1
  49. package/dist/assets/{dist-MCFJ-7Ub.js → dist-Bow-GmSy.js} +1 -1
  50. package/dist/assets/dist-D8-6hzNY.js +349 -0
  51. package/dist/assets/{download-D9gIretO.js → download-QOZKEneZ.js} +1 -1
  52. package/dist/assets/{face-bbox-QzjqMdby.js → face-bbox-BF-SXIv8.js} +1 -1
  53. package/dist/assets/{hostInit-Cd42ZWGA.js → hostInit-CT2SNnwW.js} +1 -1
  54. package/dist/assets/{index-CYytvJdn.js → index-Z-wl-d5v.js} +3 -3
  55. package/dist/assets/{key-round-CEekm4p1.js → key-round-C3b-L-A3.js} +1 -1
  56. package/dist/assets/{layers-D0EbbLuv.js → layers-BbCt6KkN.js} +1 -1
  57. package/dist/assets/{mf-entry-bootstrap-0-4be22681.js → mf-entry-bootstrap-0-5980646d.js} +2 -2
  58. package/dist/assets/{pencil-CsnyPOUJ.js → pencil-C6wR4nZ6.js} +1 -1
  59. package/dist/assets/play-C6a3xrQ3.js +1 -0
  60. package/dist/assets/{player-overlays-BIPOmydD.js → player-overlays-BVWg5sq2.js} +1 -1
  61. package/dist/assets/plus-QSG2gY1B.js +1 -0
  62. package/dist/assets/power-CwFgOqTp.js +1 -0
  63. package/dist/assets/{radio-B51cTAoX.js → radio-XbexHVTT.js} +1 -1
  64. package/dist/assets/{refresh-cw-DMXtHXou.js → refresh-cw-GeVcZb88.js} +1 -1
  65. package/dist/assets/remoteEntry-DS4leWkd.js +1 -0
  66. package/dist/assets/rotate-ccw-BSDcy5mi.js +1 -0
  67. package/dist/assets/rotate-cw-CJsnyxHu.js +1 -0
  68. package/dist/assets/{send-Ddxe4N6s.js → send-oraC7Ohv.js} +1 -1
  69. package/dist/assets/{server-8OuURyDK.js → server-D8LYlM1F.js} +1 -1
  70. package/dist/assets/{shield-BgWhLKJB.js → shield-7mzChvvY.js} +1 -1
  71. package/dist/assets/{square-check-big-DBRYlPlh.js → square-check-big-BSmHZjeu.js} +1 -1
  72. package/dist/assets/square-qBqYsstR.js +1 -0
  73. package/dist/assets/src-B0h87dKs.js +67 -0
  74. package/dist/assets/src-CXH7iEed.js +349 -0
  75. package/dist/assets/{star-CVNX3qEF.js → star-BEgAOLq_.js} +1 -1
  76. package/dist/assets/{undo-2-B8xAd7ew.js → undo-2-CrALNUHJ.js} +1 -1
  77. package/dist/assets/{use-scenes-feed-B1JUlorj.js → use-scenes-feed-Cw8vHv_m.js} +1 -1
  78. package/dist/assets/useEventInvalidation-Dm4wRxi4.js +1 -0
  79. package/dist/assets/{video-DtcQ2exo.js → video-BKXq8xP8.js} +1 -1
  80. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-B0fgZ1v3.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DyISAdzQ.js} +2 -2
  81. package/dist/assets/{wifi-B2zHPrpM.js → wifi-DHK8q32C.js} +1 -1
  82. package/dist/assets/{zap-BmpnPEbF.js → zap-B0mfRLCS.js} +1 -1
  83. package/dist/index.html +5 -5
  84. package/dist/server/addon.js +128 -20
  85. package/package.json +1 -1
  86. package/dist/assets/Data-BKJ_jvjo.js +0 -1
  87. package/dist/assets/circle-check-big-Cu348x-L.js +0 -1
  88. package/dist/assets/clock-B2x5pphm.js +0 -1
  89. package/dist/assets/dist-D4DdRFMI.js +0 -349
  90. package/dist/assets/play-CxY_FDdC.js +0 -1
  91. package/dist/assets/plus-9OdTKOVf.js +0 -1
  92. package/dist/assets/power-D6etxZku.js +0 -1
  93. package/dist/assets/remoteEntry-BhKY-WiC.js +0 -1
  94. package/dist/assets/rotate-ccw-D2ViCaID.js +0 -1
  95. package/dist/assets/rotate-cw-B1p5pfYG.js +0 -1
  96. package/dist/assets/square-B5kePtEj.js +0 -1
  97. package/dist/assets/src-B2BYuwLe.js +0 -349
  98. package/dist/assets/src-CBTLUPXC.js +0 -67
  99. package/dist/assets/useEventInvalidation-BmWbP6Ct.js +0 -1
@@ -8042,18 +8042,61 @@ var RelocateFootageInputSchema = object({
8042
8042
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8043
8043
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8044
8044
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8045
+ /**
8046
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8047
+ * mover (the engine already walks both collections with a timestamp cursor and
8048
+ * already has a stamp-without-copy path).
8049
+ *
8050
+ * - `move` — the default and the historical behaviour: event-media and
8051
+ * retrain blobs move to `toLocationId` and their rows are
8052
+ * stamped. The enrolled gallery is skipped (D197).
8053
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8054
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8055
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8056
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8057
+ * instant a repoint moves that pointer the row reads from the
8058
+ * new disk while its bytes are on the old one.
8059
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8060
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8061
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8062
+ * never run beside a live second location: it is stop-the-world
8063
+ * by construction, which is acceptable only because the gallery
8064
+ * is a few KB per enrolled sample.
8065
+ */
8066
+ var MediaRelocateModeSchema = _enum([
8067
+ "move",
8068
+ "seal",
8069
+ "gallery"
8070
+ ]);
8045
8071
  var RelocateMediaInputSchema = object({
8046
8072
  toLocationId: string(),
8047
- throttleMbps: number().min(1).max(1e3).optional()
8073
+ throttleMbps: number().min(1).max(1e3).optional(),
8074
+ /** Omitted = `move`, the pre-existing behaviour. */
8075
+ mode: MediaRelocateModeSchema.optional()
8076
+ });
8077
+ /** How many rows still carry NO `locationId` — the population a repoint would
8078
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8079
+ * value that permits a non-blocking `eventMedia` cutover. */
8080
+ var UnstampedEventMediaCountSchema = object({
8081
+ media: number().int().nonnegative(),
8082
+ retrainFrames: number().int().nonnegative(),
8083
+ total: number().int().nonnegative()
8048
8084
  });
8049
8085
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8050
- /** The independently selectable logical storage classes. `recordings`
8051
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8052
- * segments; `eventMedia` is post-analysis blobs. */
8086
+ /** The independently selectable logical storage classes — every class
8087
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8088
+ * Zod enum error where they should meet an explanation.
8089
+ *
8090
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8091
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8092
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8093
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8053
8094
  var StorageMigrationClassSchema = _enum([
8054
8095
  "recordings",
8055
8096
  "recordingsLow",
8056
- "eventMedia"
8097
+ "eventMedia",
8098
+ "backups",
8099
+ "galleryMedia"
8057
8100
  ]);
8058
8101
  /** A destination is always an existing, fully-qualified location id. The
8059
8102
  * migration API intentionally never changes a source location's `basePath`:
@@ -8061,20 +8104,56 @@ var StorageMigrationClassSchema = _enum([
8061
8104
  var StorageMigrationDestinationsSchema = object({
8062
8105
  recordings: string().min(1).optional(),
8063
8106
  recordingsLow: string().min(1).optional(),
8064
- eventMedia: string().min(1).optional()
8107
+ eventMedia: string().min(1).optional(),
8108
+ backups: string().min(1).optional(),
8109
+ galleryMedia: string().min(1).optional()
8065
8110
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8111
+ /**
8112
+ * How a migration sequences the cutover against the byte move.
8113
+ *
8114
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8115
+ * resume. Recording is stopped for the whole move. Right
8116
+ * for a small or a cold class, and the only legal mode for
8117
+ * a `cardinality: 'single'` class.
8118
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8119
+ * refresh, resume, then move the past with everything
8120
+ * running. The pause is three bounded instants (a detach +
8121
+ * attach round, a write-gate drain, a lease) instead of one
8122
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8123
+ * stopped recording under `blocking`; the same move is
8124
+ * seconds of stopped recording under `nonBlocking`.
8125
+ *
8126
+ * The mode is on the JOB, not only on the input, because `status` is where an
8127
+ * operator finds out which one is running.
8128
+ */
8129
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8066
8130
  /** Shared input for planning and starting an orchestrated storage migration. */
8067
8131
  var StorageMigrationInputSchema = object({
8068
8132
  destinations: StorageMigrationDestinationsSchema,
8069
- throttleMbps: number().min(1).max(1e3).optional()
8133
+ throttleMbps: number().min(1).max(1e3).optional(),
8134
+ /** Omitted = `blocking`, which stays the default. */
8135
+ mode: StorageMigrationModeSchema.optional()
8070
8136
  });
8071
- /** The durable coordinator state machine. The only phase that changes default
8072
- * locations is `repointing`, after every selected mover has completed and been
8073
- * verified. */
8137
+ /**
8138
+ * The durable coordinator state machine.
8139
+ *
8140
+ * `blocking`:
8141
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8142
+ *
8143
+ * `nonBlocking`:
8144
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8145
+ *
8146
+ * Same phases, different order plus two new ones — not a second mover.
8147
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8148
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8149
+ * `repointing` is still the only phase that changes a default location.
8150
+ */
8074
8151
  var StorageMigrationPhaseSchema = _enum([
8075
8152
  "planning",
8153
+ "sealing",
8076
8154
  "pausing",
8077
8155
  "moving",
8156
+ "draining",
8078
8157
  "verifying",
8079
8158
  "repointing",
8080
8159
  "refreshing",
@@ -8099,6 +8178,9 @@ var StorageMigrationMoveSchema = object({
8099
8178
  var StorageMigrationJobSchema = object({
8100
8179
  jobId: string(),
8101
8180
  phase: StorageMigrationPhaseSchema,
8181
+ /** Which order this job is running. `status` is the only place an operator
8182
+ * can tell a seconds-long cutover from a thirty-hour one. */
8183
+ mode: StorageMigrationModeSchema,
8102
8184
  destinations: StorageMigrationDestinationsSchema,
8103
8185
  throttleMbps: number(),
8104
8186
  moves: array(StorageMigrationMoveSchema),
@@ -8111,13 +8193,30 @@ var StorageMigrationJobSchema = object({
8111
8193
  finishedAt: number().nullable(),
8112
8194
  error: string().nullable()
8113
8195
  });
8196
+ var StorageMigrationFindingSchema = object({
8197
+ code: _enum([
8198
+ "sharesDeviceWithSource",
8199
+ "deviceIdentityUnknown",
8200
+ "unstampedEventMediaRows",
8201
+ "blockingOnly",
8202
+ "noMover"
8203
+ ]),
8204
+ storageClass: StorageMigrationClassSchema,
8205
+ /** Human-readable, already carrying the ids and counts. */
8206
+ message: string()
8207
+ });
8114
8208
  var StorageMigrationPlanSchema = object({
8115
8209
  destinations: StorageMigrationDestinationsSchema,
8210
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8211
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8212
+ * it. */
8213
+ mode: StorageMigrationModeSchema,
8116
8214
  moves: array(object({
8117
8215
  storageClass: StorageMigrationClassSchema,
8118
8216
  fromLocationId: string(),
8119
8217
  toLocationId: string()
8120
- }))
8218
+ })),
8219
+ findings: array(StorageMigrationFindingSchema)
8121
8220
  });
8122
8221
  /**
8123
8222
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -18628,7 +18727,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18628
18727
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18629
18728
  kind: "mutation",
18630
18729
  auth: "admin"
18631
- }), method(object({}), array(RelocateJobSchema).readonly(), {
18730
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
18632
18731
  kind: "query",
18633
18732
  auth: "admin"
18634
18733
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -20535,7 +20634,10 @@ method(object({
20535
20634
  }), StorageLocationSchema, {
20536
20635
  kind: "mutation",
20537
20636
  auth: "admin"
20538
- }), method(object({ id: string() }), _void(), {
20637
+ }), method(object({
20638
+ id: string(),
20639
+ force: boolean().optional()
20640
+ }), _void(), {
20539
20641
  kind: "mutation",
20540
20642
  auth: "admin"
20541
20643
  }), method(object({ id: string() }), object({
@@ -23621,23 +23723,23 @@ DeviceType.Camera, method(object({ deviceId: number() }), object({
23621
23723
  sdpOffer: string()
23622
23724
  }), {
23623
23725
  kind: "mutation",
23624
- auth: "admin"
23726
+ auth: "protected"
23625
23727
  }), method(object({
23626
23728
  deviceId: number(),
23627
23729
  sessionId: string(),
23628
23730
  sdpAnswer: string()
23629
23731
  }), _void(), {
23630
23732
  kind: "mutation",
23631
- auth: "admin"
23733
+ auth: "protected"
23632
23734
  }), method(object({
23633
23735
  deviceId: number(),
23634
23736
  sessionId: string()
23635
23737
  }), _void(), {
23636
23738
  kind: "mutation",
23637
- auth: "admin"
23739
+ auth: "protected"
23638
23740
  }), method(object({ deviceId: number() }), object({ sessionId: string() }), {
23639
23741
  kind: "mutation",
23640
- auth: "admin"
23742
+ auth: "protected"
23641
23743
  }), method(object({
23642
23744
  deviceId: number(),
23643
23745
  /** Audio bytes for ONE frame, base64-encoded so the payload
@@ -23656,10 +23758,10 @@ DeviceType.Camera, method(object({ deviceId: number() }), object({
23656
23758
  sequenceNumber: number().int()
23657
23759
  }), object({ accepted: boolean() }), {
23658
23760
  kind: "mutation",
23659
- auth: "admin"
23761
+ auth: "protected"
23660
23762
  }), method(object({ deviceId: number() }), _void(), {
23661
23763
  kind: "mutation",
23662
- auth: "admin"
23764
+ auth: "protected"
23663
23765
  }), object({
23664
23766
  deviceId: number(),
23665
23767
  status: IntercomStatusSchema
@@ -31008,6 +31110,12 @@ Object.freeze({
31008
31110
  addonId: null,
31009
31111
  access: "create"
31010
31112
  },
31113
+ "pipelineAnalytics.countUnstampedEventMedia": {
31114
+ capName: "pipeline-analytics",
31115
+ capScope: "device",
31116
+ addonId: null,
31117
+ access: "view"
31118
+ },
31011
31119
  "pipelineAnalytics.deleteDeviceEvents": {
31012
31120
  capName: "pipeline-analytics",
31013
31121
  capScope: "device",
@@ -35995,7 +36103,7 @@ var AdminUIAddon = class extends BaseAddon {
35995
36103
  capability: adminUiCapability,
35996
36104
  provider: {
35997
36105
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
35998
- getVersion: async () => ({ version: "1.2.113" })
36106
+ getVersion: async () => ({ version: "1.2.115" })
35999
36107
  }
36000
36108
  }];
36001
36109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.113",
3
+ "version": "1.2.115",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -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{$n as l,Bo as u,Ho as d,Jo as f,Pn as p,Qn as m,Vo as h,Xn as g,Zn as _,ar as v,er as y,ir as b,nr as x,rr as S,tr as C,un as w}from"./src-CBTLUPXC.js";import{t as T}from"./download-D9gIretO.js";import{a as E,i as D,n as O,r as k,t as A}from"./AddLocationWizard-CqbB-rwE.js";import{t as j}from"./pencil-CsnyPOUJ.js";import{t as M}from"./play-CxY_FDdC.js";import{t as N}from"./plus-9OdTKOVf.js";import{t as P}from"./rotate-cw-B1p5pfYG.js";import{C as F,I,K as L,R as ee,W as te,o as R,r as z}from"./index-CYytvJdn.js";import{t as B}from"./AdminPage-CCD07UMs.js";import{r as ne}from"./authed-media-BPd_L9jr.js";import{t as re}from"./AdminTabs-CyjmxyDN.js";import{t as V}from"./format-size-DIxKXxtj.js";var H=L(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),U=L(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),W=L(`calendar-clock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]);t();function G(){let e=a(),t=w(),{data:i,isLoading:c,isError:l}=d({}),p=h(),m=r(()=>p.data??[],[p.data]),[g,_]=o(null),[v,y]=o(null),b=u({onSuccess:()=>{e.invalidateQueries({queryKey:[[`storage`,`listLocations`]]})}}),x=f({onSuccess:()=>{e.invalidateQueries({queryKey:[[`storage`,`listLocations`]]})}}),S=e=>{e.isDefault||x.mutate(D(e,{isDefault:!0}))},C=(e,t)=>{x.mutate(D(e,{enabled:t}))},T=async e=>{if(e.isDefault){await t({title:`Cannot delete default location`,message:`"${e.displayName}" is the default for type "${e.type}". Mark another location as default first, then delete this one.`,confirmLabel:`OK`,variant:`warning`});return}await t({title:`Delete location "${e.displayName}"?`,message:`This removes the location record. Files on disk are not deleted; the underlying directory or remote path stays untouched.`,confirmLabel:`Delete`,variant:`danger`})&&b.mutate({id:e.id})},E=r(()=>{let e=new Map;for(let t of i??[]){let n=e.get(t.type);n?n.push(t):e.set(t.type,[t])}return e},[i]),j=c||p.isLoading,M=l||p.isError;return n(B,{children:[j&&s(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading locations…`}),M&&s(`div`,{className:`text-xs text-danger`,children:`Failed to load storage locations.`}),!j&&!M&&n(`div`,{className:`space-y-3`,children:[m.length===0&&s(`div`,{className:`rounded-lg border border-border bg-surface px-3 py-4 text-center text-[11px] text-foreground-subtle italic`,children:`No storage locations declared by any installed addon.`}),m.map(e=>s(k,{type:e.id,displayName:e.displayName,description:e.description,cardinality:e.cardinality,locations:E.get(e.id)??[],onAdd:e=>_(e),onEdit:e=>y(e),onDelete:e=>{T(e)},onSetDefault:e=>S(e),onToggleEnabled:(e,t)=>C(e,t)},e.id))]}),g!==null&&s(A,{initialType:g,onClose:()=>_(null),onCreated:()=>{e.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),_(null)}}),v!==null&&s(O,{location:v,onClose:()=>y(null),onSaved:()=>{e.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),y(null)}})]})}t();var K=[[`backup`,`listDestinations`]],q=[`backup`,`listArchives`];function J({destinationId:t,restoreSupported:i,onOpenRestoreWizard:c}){let u=a(),d=w(),{data:f,isLoading:p,isError:m}=l({destinationId:t}),h=f??[],_=g({onSuccess:()=>{u.invalidateQueries({queryKey:[[...q]]}),u.invalidateQueries({queryKey:K})}}),v=e(async e=>{await d({title:`Delete this archive?`,message:`Permanently deletes "${e.label??e.id}" and frees ${V(e.sizeBytes)}.`,confirmLabel:`Delete`,variant:`danger`})&&_.mutate({destinationId:t,backupId:e.id})},[d,t,_]),[y,b]=o(null),x=e(async e=>{b(e.id);try{let n=await ne(Y(t,e.id)),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e.label??e.id}.tar.gz`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}finally{b(null)}},[t]),S=r(()=>[...h].toSorted((e,t)=>t.createdAt-e.createdAt),[h]);return p?s(`div`,{className:`text-xs text-foreground-subtle animate-pulse py-2`,children:`Loading archives…`}):m?s(`div`,{className:`text-xs text-danger py-2`,children:`Failed to read manifest for this destination`}):S.length===0?s(`div`,{className:`text-xs text-foreground-subtle italic py-2`,children:`No archives at this destination yet.`}):s(`div`,{className:`rounded border border-border bg-surface overflow-x-auto`,children:n(`table`,{className:`w-full text-xs min-w-[640px]`,children:[s(`thead`,{children:n(`tr`,{className:`text-foreground-subtle bg-background/30`,children:[s(`th`,{className:`text-left px-3 py-1.5 font-medium`,children:`When`}),s(`th`,{className:`text-left px-3 py-1.5 font-medium`,children:`Label`}),s(`th`,{className:`text-left px-3 py-1.5 font-medium`,children:`Includes`}),s(`th`,{className:`text-right px-3 py-1.5 font-medium`,children:`Size`}),s(`th`,{className:`text-right px-3 py-1.5 font-medium w-52`,children:`Actions`})]})}),s(`tbody`,{children:S.map(e=>n(`tr`,{className:`border-t border-border hover:bg-primary/5`,children:[s(`td`,{className:`px-3 py-1.5 text-foreground tabular-nums`,children:ie(e.createdAt)}),s(`td`,{className:`px-3 py-1.5 text-foreground`,children:e.label??s(`span`,{className:`text-foreground-subtle italic`,children:`—`})}),s(`td`,{className:`px-3 py-1.5 text-foreground-subtle`,children:e.locations.join(`, `)}),s(`td`,{className:`px-3 py-1.5 text-foreground text-right tabular-nums`,children:V(e.sizeBytes)}),s(`td`,{className:`px-3 py-1.5`,children:n(`div`,{className:`flex items-center justify-end gap-1`,children:[n(`button`,{onClick:()=>{x(e)},disabled:y===e.id,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle hover:text-foreground hover:bg-primary/10 disabled:opacity-50`,title:`Download archive`,children:[y===e.id?s(F,{className:`h-3 w-3 animate-spin`}):s(T,{className:`h-3 w-3`}),`Download`]}),i&&c&&n(`button`,{onClick:()=>c({destinationId:t,archiveId:e.id}),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-primary hover:bg-primary/10`,title:`Restore from this archive`,children:[s(P,{className:`h-3 w-3`}),`Restore`]}),s(`button`,{onClick:()=>{v(e)},disabled:_.isPending,className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10 disabled:opacity-50`,title:`Delete archive`,children:_.isPending?s(F,{className:`h-3 w-3 animate-spin`}):s(R,{className:`h-3 w-3`})})]})})]},e.id))})]})})}function Y(e,t){return`/api/backup/download/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}function ie(e){return new Date(e).toLocaleString(void 0,{day:`2-digit`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}t();var X=[[`backup`,`listSchedules`]];function ae({onEdit:e,onOpenRestoreWizard:t}){let{data:i,isLoading:a,isError:c}=C(),l=i??[],u=y().data??[],d=r(()=>{let e=new Map;for(let t of u)e.set(t.id,t);return e},[u]),[f,p]=o(null),m=e=>{p(t=>t===e?null:e)};return a?s(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading backup entries…`}):c?s(`div`,{className:`text-xs text-danger`,children:`Failed to load backup entries`}):l.length===0?s(`div`,{className:`rounded-lg border border-border bg-surface px-4 py-8 text-center`,children:s(`p`,{className:`text-xs text-foreground-subtle`,children:`No backup entries yet. Create one to schedule backups across one or more storage locations.`})}):s(`div`,{className:`rounded-lg border border-border bg-surface overflow-x-auto`,children:n(`table`,{className:`w-full text-xs min-w-[820px]`,children:[s(`thead`,{children:n(`tr`,{className:`text-foreground-subtle border-b border-border bg-background/40`,children:[s(`th`,{className:`text-left px-3 py-2 font-medium w-6`}),s(`th`,{className:`text-left px-3 py-2 font-medium`,children:`Entry`}),s(`th`,{className:`text-left px-3 py-2 font-medium w-20`,children:`Enabled`}),s(`th`,{className:`text-left px-3 py-2 font-medium`,children:`Locations`}),s(`th`,{className:`text-left px-3 py-2 font-medium w-24`,children:`Retention`}),s(`th`,{className:`text-left px-3 py-2 font-medium w-48`,children:`Schedule`}),s(`th`,{className:`text-right px-3 py-2 font-medium w-52`,children:`Actions`})]})}),s(`tbody`,{children:l.map(n=>s(oe,{row:n,destById:d,isOpen:f===n.id,onToggle:()=>m(n.id),onEdit:()=>e(n),...t?{onOpenRestoreWizard:t}:{}},n.id))})]})})}function oe({row:t,destById:l,isOpen:u,onToggle:d,onEdit:f,onOpenRestoreWizard:p}){let m=a(),h=w(),g=v({onSuccess:()=>{m.invalidateQueries({queryKey:X})}}),y=_({onSuccess:()=>{m.invalidateQueries({queryKey:X})}}),x=b({onSuccess:()=>{m.invalidateQueries({queryKey:[[`backup`,`listArchives`]]}),m.invalidateQueries({queryKey:[[`backup`,`listDestinations`]]})}}),[S,C]=o(String(t.retentionCount));c(()=>{C(String(t.retentionCount))},[t.retentionCount]);let T=r(()=>({id:t.id,label:t.label,cron:t.cron,locationIds:[...t.locationIds],retentionCount:t.retentionCount,...t.dataSources?{dataSources:[...t.dataSources]}:{}}),[t]),E=e(e=>{g.mutate({...T,enabled:e})},[g,T]),D=e(()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)||e<1){C(String(t.retentionCount));return}e!==t.retentionCount&&g.mutate({...T,enabled:t.enabled,retentionCount:e})},[g,T,S,t.retentionCount,t.enabled]),O=e(()=>{t.locationIds.length!==0&&x.mutate({destinations:[...t.locationIds],...t.dataSources&&t.dataSources.length>0?{locations:[...t.dataSources]}:{},label:t.label,retentionCount:t.retentionCount})},[x,t]),k=e(async()=>{await h({title:`Delete backup entry?`,message:`"${t.label||t.id}" will stop running. Existing archives are kept.`,confirmLabel:`Delete`,variant:`warning`})&&y.mutate({id:t.id})},[h,y,t.id,t.label]),A=t.cron.trim().length>0,N=g.isPending||y.isPending;return n(i,{children:[n(`tr`,{className:`border-t border-border first:border-t-0 hover:bg-primary/5`,children:[s(`td`,{className:`px-2 py-2`,children:s(`button`,{onClick:d,className:`inline-flex items-center justify-center rounded p-1 text-foreground-subtle hover:bg-primary/10 hover:text-foreground`,title:u?`Hide archives`:`Show archives`,children:s(u?ee:I,{className:`h-3.5 w-3.5`})})}),s(`td`,{className:`px-3 py-2`,children:n(`button`,{onClick:f,className:`text-left hover:underline focus:outline-none`,children:[s(`div`,{className:`text-foreground font-medium`,children:t.label||`(unnamed)`}),t.lastRunAt!==void 0&&n(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:[`last run `,new Date(t.lastRunAt).toLocaleString()]})]})}),s(`td`,{className:`px-3 py-2`,children:s(`label`,{className:`inline-flex items-center cursor-pointer`,children:s(`input`,{type:`checkbox`,className:`accent-primary`,checked:t.enabled,disabled:N,onChange:e=>E(e.target.checked)})})}),s(`td`,{className:`px-3 py-2`,children:n(`div`,{className:`flex flex-wrap gap-1`,children:[t.locationIds.length===0&&s(`span`,{className:`text-[11px] text-danger italic`,children:`No locations`}),t.locationIds.map(e=>s(`span`,{className:`inline-flex items-center rounded border border-border bg-background px-1.5 py-0.5 text-[10px] text-foreground`,title:e,children:l.get(e)?.displayName??e},e))]})}),s(`td`,{className:`px-3 py-2`,children:s(`input`,{type:`number`,min:1,max:1e3,value:S,disabled:N,onChange:e=>C(e.target.value),onBlur:D,onKeyDown:e=>{e.key===`Enter`&&e.target.blur(),e.key===`Escape`&&C(String(t.retentionCount))},className:`w-16 rounded border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})}),s(`td`,{className:`px-3 py-2`,children:n(`button`,{onClick:f,className:`group flex flex-col items-start gap-0.5 text-left`,title:`Edit schedule`,children:[n(`span`,{className:`inline-flex items-center gap-1`,children:[s(W,{className:`h-3 w-3 text-foreground-subtle group-hover:text-foreground`}),s(`span`,{className:`font-mono text-[11px] text-foreground`,children:A?t.cron:`Manual`})]}),A&&t.nextRunAt!==void 0&&n(`span`,{className:`text-[10px] text-foreground-subtle`,children:[`next `,new Date(t.nextRunAt).toLocaleString()]})]})}),s(`td`,{className:`px-3 py-2`,children:n(`div`,{className:`flex items-center justify-end gap-1.5`,children:[n(`button`,{onClick:O,disabled:x.isPending||t.locationIds.length===0,className:`inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,title:`Run this entry now`,children:[x.isPending?s(F,{className:`h-3 w-3 animate-spin`}):s(M,{className:`h-3 w-3`}),`Run now`]}),s(`button`,{onClick:f,className:`inline-flex items-center justify-center rounded border border-border p-1 text-foreground-subtle hover:text-foreground hover:bg-primary/5`,title:`Edit entry`,children:s(j,{className:`h-3 w-3`})}),s(`button`,{onClick:()=>{k()},disabled:N,className:`inline-flex items-center justify-center rounded border border-border p-1 text-foreground-subtle hover:text-danger hover:border-danger/40 disabled:opacity-50`,title:`Delete entry`,children:s(R,{className:`h-3 w-3`})})]})})]}),u&&s(`tr`,{className:`border-t border-border bg-background/30`,children:n(`td`,{colSpan:7,className:`px-4 py-3 space-y-4`,children:[t.locationIds.length===0&&s(`p`,{className:`text-xs text-foreground-subtle italic`,children:`This entry has no locations selected.`}),t.locationIds.map(e=>n(`div`,{className:`space-y-1.5`,children:[s(`div`,{className:`text-[11px] font-medium text-foreground-subtle`,children:l.get(e)?.displayName??e}),s(J,{destinationId:e,restoreSupported:l.get(e)?.restoreSupported??!0,...p?{onOpenRestoreWizard:p}:{}})]},e))]})})]})}t();var Z=[{id:`manual`,label:`Manual only`,cron:``},{id:`hourly`,label:`Every hour`,cron:`0 * * * *`,description:`On the hour`},{id:`every-3h`,label:`Every 3 hours`,cron:`0 */3 * * *`,description:`00:00, 03:00, 06:00, 09:00 …`},{id:`every-6h`,label:`Every 6 hours`,cron:`0 */6 * * *`,description:`00:00, 06:00, 12:00, 18:00`},{id:`daily-3am`,label:`Daily at 03:00`,cron:`0 3 * * *`,description:`Every night at 3 AM`},{id:`weekly-sun`,label:`Weekly Sunday 03:00`,cron:`0 3 * * 0`,description:`Sunday morning at 3 AM`}];function se(e){let t=e.trim();for(let e of Z)if(e.cron===t)return e.id;return`custom`}function ce({value:e,onChange:t,previewCount:r=5,disabled:i=!1}){let a=se(e),[l,u]=o(a===`custom`);c(()=>{a!==`custom`&&u(!1)},[a]);let d=de(e,250),f=x({cron:d,count:r},{enabled:d.trim().length>0}),p=f.data??null,m=e=>{u(!1),t(e.cron)},h=l||a===`custom`;return n(`div`,{className:`space-y-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Schedule preset`}),n(`div`,{className:`flex flex-wrap gap-1.5`,children:[Z.map(e=>s(`button`,{type:`button`,onClick:()=>m(e),disabled:i,className:`rounded border px-2 py-1 text-[11px] transition-colors disabled:opacity-50 `+(!l&&a===e.id?`border-primary bg-primary/10 text-primary`:`border-border bg-background text-foreground-subtle hover:bg-primary/5 hover:text-foreground`),title:e.description??e.label,children:e.label},e.id)),s(`button`,{type:`button`,onClick:()=>{u(!0),e.trim().length===0&&t(`0 3 * * *`)},disabled:i,className:`rounded border px-2 py-1 text-[11px] transition-colors disabled:opacity-50 `+(h?`border-primary bg-primary/10 text-primary`:`border-border bg-background text-foreground-subtle hover:bg-primary/5 hover:text-foreground`),children:`Custom…`})]})]}),h&&n(`div`,{className:`space-y-1`,children:[s(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Cron expression (5-field POSIX)`}),s(`input`,{type:`text`,value:e,onChange:e=>t(e.target.value),disabled:i,placeholder:`0 3 * * *`,spellCheck:!1,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs font-mono text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary`}),n(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`Format: `,s(`span`,{className:`font-mono`,children:`minute hour day-of-month month day-of-week`}),` · all times server-local`]})]}),s(le,{cron:d,preview:p,loading:f.isFetching})]})}function le({cron:e,preview:t,loading:r}){return r&&t===null?n(`div`,{className:`flex items-center gap-2 rounded border border-border bg-background/40 px-3 py-2 text-[11px] text-foreground-subtle`,children:[s(F,{className:`h-3 w-3 animate-spin`}),`Validating…`]}):t===null?null:t.ok?t.nextRuns.length===0?s(`div`,{className:`rounded border border-border bg-background/40 px-3 py-2 text-[11px] text-foreground-subtle`,children:`No future runs match this expression.`}):n(`div`,{className:`space-y-1`,children:[s(`div`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Next runs`}),s(`ul`,{className:`rounded border border-border bg-background/40 divide-y divide-border`,children:t.nextRuns.map((e,t)=>n(`li`,{className:`flex items-center justify-between px-3 py-1.5 text-[11px]`,children:[s(`span`,{className:`text-foreground tabular-nums`,children:new Date(e).toLocaleString()}),s(`span`,{className:`text-foreground-subtle text-[10px] tabular-nums`,children:ue(e)})]},`${e}-${t}`))})]}):s(`div`,{className:`rounded border border-danger/40 bg-danger/10 px-3 py-2 text-[11px] text-danger`,children:t.error??`Invalid cron expression`})}function ue(e){let t=e-Date.now();if(t<=0)return`now`;let n=Math.floor(t/1e3);if(n<60)return`in ${n}s`;let r=Math.floor(n/60);if(r<60)return`in ${r}m`;let i=Math.floor(r/60);return i<24?`in ${i}h`:`in ${Math.floor(i/24)}d`}function de(e,t){let[n,i]=o(e),a=r(()=>e,[e]);return c(()=>{let e=setTimeout(()=>i(a),t);return()=>clearTimeout(e)},[a,t]),n}t();var fe=[[`backup`,`listSchedules`]];function pe({entry:e,onClose:t,onSaved:i}){let c=a(),l=y(),u=l.data??[],[d,f]=o(e?.label??``),[p,m]=o(e?.cron??`0 3 * * *`),[h,g]=o(e?.enabled??!0),[_,b]=o(String(e?.retentionCount??7)),[x,S]=o(new Set(e?.locationIds??[])),C=v({onSuccess:()=>{c.invalidateQueries({queryKey:fe}),i()}}),w=e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},T=Number.parseInt(_,10),E=r(()=>d.trim().length>0&&x.size>0&&!Number.isNaN(T)&&T>=1&&T<=1e3,[d,x,T]),D=()=>{E&&C.mutate({...e?{id:e.id}:{},label:d.trim(),cron:p.trim(),enabled:h,locationIds:Array.from(x),retentionCount:T})},O=C.error instanceof Error?C.error.message:null;return s(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:t,children:n(`div`,{className:`w-full max-w-lg rounded-xl border border-border bg-surface shadow-2xl max-h-[90vh] overflow-y-auto`,onClick:e=>e.stopPropagation(),children:[n(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3 sticky top-0 bg-surface`,children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:e?`Edit backup entry`:`New backup entry`}),s(`button`,{onClick:t,className:`text-foreground-subtle hover:text-foreground`,children:s(z,{className:`h-4 w-4`})})]}),n(`div`,{className:`p-4 space-y-4`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:`Name`}),s(`input`,{type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`Nightly offsite`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary`})]}),n(`div`,{className:`space-y-1.5`,children:[n(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:[`Locations (`,x.size,` selected)`]}),l.isLoading&&n(`div`,{className:`flex items-center gap-2 px-1 py-2 text-xs text-foreground-subtle`,children:[s(F,{className:`h-3.5 w-3.5 animate-spin`}),`Loading locations…`]}),!l.isLoading&&u.length===0&&s(`div`,{className:`rounded border border-border bg-background px-3 py-2 text-xs text-foreground-subtle italic`,children:"No `backups` storage locations configured. Add one in Settings → Storage first."}),u.length>0&&s(`div`,{className:`rounded border border-border bg-background divide-y divide-border max-h-52 overflow-y-auto`,children:u.map(e=>n(`label`,{className:`flex items-center justify-between px-3 py-2 text-xs hover:bg-primary/5 cursor-pointer`,children:[n(`div`,{className:`flex items-center gap-2`,children:[s(`input`,{type:`checkbox`,checked:x.has(e.id),onChange:()=>w(e.id),className:`accent-primary`}),s(`span`,{className:`text-foreground`,children:e.displayName})]}),n(`div`,{className:`flex items-center gap-1.5`,children:[s(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-surface border border-border rounded px-1.5 py-0.5`,children:e.kind}),s(`span`,{className:`text-[10px] text-foreground-subtle font-mono`,children:e.id})]})]},e.id))})]}),n(`div`,{className:`grid grid-cols-2 gap-3`,children:[n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:`Retention (archives kept)`}),s(`input`,{type:`number`,min:1,max:1e3,value:_,onChange:e=>b(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),n(`div`,{className:`space-y-1`,children:[s(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:`Enabled`}),n(`label`,{className:`inline-flex items-center gap-2 py-1.5 cursor-pointer`,children:[s(`input`,{type:`checkbox`,checked:h,onChange:e=>g(e.target.checked),className:`accent-primary`}),s(`span`,{className:`text-xs text-foreground-subtle`,children:`Run on schedule`})]})]})]}),n(`div`,{className:`space-y-1.5 border-t border-border pt-3`,children:[s(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:`Schedule`}),s(ce,{value:p,onChange:m,disabled:C.isPending})]}),O&&s(`div`,{className:`rounded border border-danger/40 bg-danger/10 px-3 py-2 text-[11px] text-danger`,children:O})]}),n(`div`,{className:`flex justify-end gap-2 border-t border-border px-4 py-3 sticky bottom-0 bg-surface`,children:[s(`button`,{onClick:t,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Cancel`}),n(`button`,{onClick:D,disabled:!E||C.isPending,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[C.isPending&&s(F,{className:`h-3.5 w-3.5 animate-spin`}),e?`Save`:`Create entry`]})]})]})})}t();var me=[[`backup`,`list`]];function he({initialDestinationId:e,initialArchiveId:t,onClose:i,onScheduled:u}){let d=a(),[f,p]=o(e&&t?2:1),[h,g]=o(e),[_,v]=o(t),[b,x]=o(new Set),{data:C}=y(),w=C??[],{data:T,isLoading:E}=l({destinationId:h??``},{enabled:!!h}),D=T??[];c(()=>{if(h!==void 0)return;let e=w.filter(e=>e.restoreSupported);e.length===1&&g(e[0].id)},[h,w]);let{data:O}=m({destinationId:h??``,backupId:_??``},{enabled:!!h&&!!_}),k=r(()=>O?.locations??[],[O]);c(()=>{k.length!==0&&x(e=>e.size===0?new Set(k):e)},[k]);let A=S({onSuccess:()=>{d.invalidateQueries({queryKey:me}),u(),i()}}),j=e=>{x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},M=!!h&&!!_,N=b.size>0,I=M&&N&&!A.isPending,L=()=>{!h||!_||A.mutate({destinationId:h,backupId:_,locations:[...b]})};return s(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:i,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(`div`,{className:`space-y-0.5`,children:[s(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Restore Backup`}),n(`p`,{className:`text-xs text-foreground-subtle`,children:[`Step `,f,` of 3 —`,` `,f===1?`pick source`:f===2?`pick locations`:`confirm`]})]}),s(`button`,{onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:s(z,{className:`h-4 w-4`})})]}),f===1&&s(Q,{destinations:w,destinationId:h,onPickDestination:e=>{g(e),v(void 0),x(new Set)},archives:D,archivesLoading:E,archiveId:_,onPickArchive:v}),f===2&&s(ge,{locations:k,picked:b,onToggle:j}),f===3&&s(_e,{destinationName:w.find(e=>e.id===h)?.displayName??h??``,archive:D.find(e=>e.id===_),picked:[...b]}),n(`div`,{className:`flex justify-between gap-2 border-t border-border px-4 py-3`,children:[s(`div`,{children:f>1&&n(`button`,{onClick:()=>p(e=>e===3?2:1),className:`inline-flex items-center gap-1 rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:[s(te,{className:`h-3 w-3`}),`Back`]})}),n(`div`,{className:`flex items-center gap-2`,children:[s(`button`,{onClick:i,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Cancel`}),f<3?n(`button`,{disabled:f===1&&!M||f===2&&!N,onClick:()=>p(e=>e===1?2:3),className:`inline-flex items-center gap-1 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[`Next`,s(U,{className:`h-3 w-3`})]}):n(`button`,{onClick:L,disabled:!I,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[A.isPending?s(F,{className:`h-3.5 w-3.5 animate-spin`}):s(P,{className:`h-3.5 w-3.5`}),`Schedule Restore`]})]})]})]})})}function Q({destinations:e,destinationId:t,onPickDestination:r,archives:i,archivesLoading:a,archiveId:o,onPickArchive:c}){let l=e.filter(e=>e.restoreSupported);return n(`div`,{className:`p-4 space-y-3`,children:[n(`div`,{className:`space-y-1.5`,children:[s(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:`Destination`}),n(`select`,{value:t??``,onChange:e=>r(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`,children:[s(`option`,{value:``,disabled:!0,children:`Select destination…`}),l.map(e=>n(`option`,{value:e.id,children:[e.displayName,` (`,e.kind,`)`]},e.id))]})]}),n(`div`,{className:`space-y-1.5`,children:[s(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:`Archive`}),!t&&s(`div`,{className:`text-xs text-foreground-subtle italic`,children:`Pick a destination first.`}),t&&a&&s(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Reading archives…`}),t&&!a&&i.length===0&&s(`div`,{className:`text-xs text-foreground-subtle italic`,children:`No archives available at this destination.`}),t&&i.length>0&&s(`div`,{className:`rounded border border-border bg-background divide-y divide-border max-h-64 overflow-y-auto`,children:i.map(e=>{let t=o===e.id;return n(`label`,{className:`flex items-center justify-between px-3 py-2 text-xs cursor-pointer ${t?`bg-primary/10`:`hover:bg-primary/5`}`,children:[n(`div`,{className:`flex items-center gap-2`,children:[s(`input`,{type:`radio`,name:`archive`,checked:t,onChange:()=>c(e.id),className:`accent-primary`}),n(`div`,{children:[s(`div`,{className:`font-medium text-foreground`,children:e.label??e.id}),s(`div`,{className:`text-[10px] text-foreground-subtle`,children:new Date(e.createdAt).toLocaleString()})]})]}),s(`span`,{className:`text-[10px] text-foreground-subtle tabular-nums`,children:V(e.sizeBytes)})]},e.id)})})]})]})}function ge({locations:e,picked:t,onToggle:r}){return e.length===0?s(`div`,{className:`p-4`,children:s(`div`,{className:`text-xs text-foreground-subtle`,children:`Loading archive manifest… If this persists, the archive may predate manifests — restoring will apply everything in the tarball.`})}):n(`div`,{className:`p-4 space-y-3`,children:[s(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-700 dark:text-amber-300`,children:`Selected entries will overwrite live data on the next server restart. Unchecked entries stay current.`}),n(`div`,{className:`space-y-1.5`,children:[s(`label`,{className:`text-[10px] text-foreground-subtle uppercase tracking-wide`,children:`Apply`}),s(`div`,{className:`rounded border border-border bg-background divide-y divide-border max-h-64 overflow-y-auto`,children:e.map(e=>n(`label`,{className:`flex items-center gap-2 px-3 py-2 text-xs hover:bg-primary/5 cursor-pointer`,children:[s(`input`,{type:`checkbox`,checked:t.has(e),onChange:()=>r(e),className:`accent-primary`}),s(`span`,{className:`font-mono text-foreground`,children:e}),s(`span`,{className:`ml-auto text-[10px] text-foreground-subtle`,children:ye(e)})]},e))})]})]})}function _e({destinationName:e,archive:t,picked:r}){return n(`div`,{className:`p-4 space-y-3 text-xs`,children:[s(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-amber-700 dark:text-amber-300`,children:`Restore is applied at next server boot. Active connections will drop when you restart.`}),n(`dl`,{className:`space-y-1.5`,children:[s($,{term:`Destination`,value:e}),s($,{term:`Archive`,value:t?.label??t?.id??`—`}),t&&s($,{term:`Created`,value:`${new Date(t.createdAt).toLocaleString()} · ${V(t.sizeBytes)}`}),s($,{term:`Locations`,value:r.length>0?r.join(`, `):`— (full archive)`})]})]})}function $({term:e,value:t}){return n(`div`,{className:`flex justify-between gap-3`,children:[s(`dt`,{className:`text-foreground-subtle`,children:e}),s(`dd`,{className:`text-foreground font-mono text-right truncate`,children:t})]})}var ve={db:`Database`,addons:`Addon configs`,"addons-data":`Addon data`,tls:`TLS certificates`,cache:`Cache`,data:`Top-level data`};function ye(e){return ve[e]??``}t();function be(){let e=w(),t=p(),[r,i]=o(null),[a,c]=o(!1),[l,u]=o(!1),[d,f]=o(void 0),m=async()=>{await e({title:`Restart server now?`,message:`Active connections will drop and the apply-backup hook will run before boot.`,confirmLabel:`Restart`,variant:`warning`})&&t.mutate({confirm:!0})};return n(B,{children:[n(`div`,{className:`flex items-center justify-end gap-2 flex-wrap`,children:[n(`button`,{onClick:()=>c(!0),className:`inline-flex items-center gap-1.5 rounded-lg bg-surface border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-primary/5 hover:border-primary/30`,children:[s(P,{className:`h-3.5 w-3.5`}),`Restore…`]}),n(`button`,{onClick:()=>f(null),className:`inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:[s(N,{className:`h-3.5 w-3.5`}),`New entry`]})]}),l&&s(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2.5 text-xs text-amber-700 dark:text-amber-300`,children:n(`div`,{className:`flex items-center justify-between gap-3`,children:[n(`div`,{className:`flex items-center gap-2`,children:[s(P,{className:`h-3.5 w-3.5`}),s(`span`,{children:`Restore scheduled. Restart the server to apply.`})]}),n(`button`,{onClick:()=>{m()},disabled:t.isPending,className:`inline-flex items-center gap-1.5 rounded bg-amber-500/20 px-2 py-1 font-medium text-amber-800 dark:text-amber-200 hover:bg-amber-500/30 disabled:opacity-50`,children:[t.isPending?s(F,{className:`h-3.5 w-3.5 animate-spin`}):s(P,{className:`h-3.5 w-3.5`}),`Restart Now`]})]})}),s(ae,{onEdit:e=>f(e),onOpenRestoreWizard:e=>i(e)}),d!==void 0&&s(pe,{entry:d,onClose:()=>f(void 0),onSaved:()=>f(void 0)}),(r||a)&&s(he,{...r?{initialDestinationId:r.destinationId,initialArchiveId:r.archiveId}:{},onClose:()=>{i(null),c(!1)},onScheduled:()=>u(!0)})]})}function xe(){return s(`div`,{className:`flex flex-col p-4`,children:s(re,{tabs:[{id:`storage`,label:`Storage`,icon:E,content:s(G,{})},{id:`backup`,label:`Backup`,icon:H,content:s(be,{})}]})})}export{xe as DataPage};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-CYytvJdn.js";var t=e(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]);export{t};
@@ -1 +0,0 @@
1
- import{K as e}from"./index-CYytvJdn.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};