@overvis/hmi-workspace-ui 0.1.0 → 0.1.1
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/alarm-list-sheAq-pb.js +414 -0
- package/dist/alarm-rule-dialog-D_ml7V0v.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-DaA4soF4.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-OFjOQ-dm.js} +15 -18
- package/dist/alert-dialog-B60PF7S9.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DYCOZS0R.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D2u8KZQo.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-LXuRix0-.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-BMSyzAxu.js} +5 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-wnmmLpVC.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-hkEr2usK.js} +1 -2
- package/dist/diagnostic-text-CsbENUNI.js +116 -0
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-AtIYlNSy.js} +219 -227
- package/dist/{dialogs-D_v1LeH4.js → dialogs-DsHbKgZD.js} +2523 -2590
- package/dist/{display-DmOo23mi.js → display-DSyEwQt8.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CTfJBXMs.js} +3 -5
- package/dist/editor-page-BWbVGJvU.js +1337 -0
- package/dist/{en-BgercpT0.js → en-UW_k-Bd6.js} +1 -2
- package/dist/entity-controls-BCuRx882.js +71 -0
- package/dist/errors-Cawve9yD.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-B9XdpVzq.js} +2404 -2515
- package/dist/host.js +8143 -675
- package/dist/{i18n-BgzakKoC.js → i18n-Dt6xbSK6.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5149 -5345
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-agHupfNb.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-kxU6cgFl.js} +6 -6
- package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
- package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
- package/dist/{notice-card-DyGywFsW.js → notice-card-CH28rYUt.js} +54 -58
- package/dist/{page-v6LCwswN.js → page-CZPHJUmz.js} +92 -100
- package/dist/page-DpdkOGGb.js +449 -0
- package/dist/page-HCGXXGjy.js +507 -0
- package/dist/panel-BCwBlB_h.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-BokvsP3J.js} +1 -2
- package/dist/presence-code-cT6wxlTg.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-DqmHsZ07.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-DEqqwQxR.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-DZ0reGGe.js} +4 -6
- package/dist/retention-note-nequESpo.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-DZSlsRHq.js} +1 -2
- package/dist/run-text-DneX9rWh.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-DP9_alSQ.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-BU7NKUOQ.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-Te6Qv1Zu.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-BRcNKwjH.js} +182 -201
- package/dist/src/version.d.ts +1 -1
- package/dist/src/workspace/local-workspace-app.d.ts +1 -1
- package/dist/src/workspace/routes.d.ts +1 -1
- package/dist/{starter-fields-BRLX0z-v.js → starter-fields-yM4B49nd.js} +154 -157
- package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
- package/dist/styles.css +1 -1
- package/dist/ui.js +334 -374
- package/dist/{uk-CwpJAxmx.js → uk-CjXPq9Lk.js} +1 -2
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-CC8XKBR7.js} +14 -17
- package/package.json +15 -9
- package/dist/alarm-list-BL3xQ5Lf.js +0 -423
- package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
- package/dist/alert-B8MAoIO8.js +0 -45
- package/dist/alert-dialog-CYkuMg5D.js +0 -129
- package/dist/api-error-9rQmUN5L.js +0 -93
- package/dist/breadcrumb-DzVL1yHa.js +0 -74
- package/dist/button-6SxPBYMz.js +0 -44
- package/dist/context-u9KJQmdB.js +0 -102
- package/dist/copyable-id-DYGiAcnq.js +0 -40
- package/dist/dashboard-context-CBfG6DoT.js +0 -191
- package/dist/date-time-picker-C3FhMXk6.js +0 -266
- package/dist/diagnostic-text-BAkzW0SE.js +0 -111
- package/dist/diagnostic-text-DiKd2i1w.js +0 -76
- package/dist/dialog-BIhQXcZC.js +0 -237
- package/dist/dialog-BqyIxMD-.js +0 -54
- package/dist/dropdown-menu-DSzbBq3v.js +0 -136
- package/dist/editor-page-BiSZJz5b.js +0 -1353
- package/dist/empty-B-QJ-06w.js +0 -59
- package/dist/entity-controls-D1K4Ot3O.js +0 -76
- package/dist/errors-CcsvDHu8.js +0 -26
- package/dist/history-page-sAAhG54V.js +0 -1400
- package/dist/icon-D-pR9htW.js +0 -57
- package/dist/index-page-DMH82fZe.js +0 -214
- package/dist/item-B5SaTFQU.js +0 -120
- package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
- package/dist/mutations-THtGG6Ai.js +0 -240
- package/dist/page-2KPemaAj.js +0 -328
- package/dist/page-6rIoTg2L.js +0 -459
- package/dist/page-C6giEoEd.js +0 -1935
- package/dist/page-DCbTxKsi.js +0 -313
- package/dist/page-DWO427hT.js +0 -208
- package/dist/page-LXu_2zm3.js +0 -137
- package/dist/page-aaUiVOnk.js +0 -513
- package/dist/page-header-RB2YFWlE.js +0 -55
- package/dist/page-title-CdCbiLt8.js +0 -14
- package/dist/panel-DDy8tUNR.js +0 -338
- package/dist/presence-code-BfSXr50g.js +0 -83
- package/dist/progress-C7cxNJA1.js +0 -83
- package/dist/provider-BOeYHi0n.js +0 -134
- package/dist/quick-report-CUVJnbKP.js +0 -416
- package/dist/radio-group-CZGqVbkJ.js +0 -26
- package/dist/retention-note-CHhA6gjY.js +0 -42
- package/dist/run-text-DvaO8LDF.js +0 -113
- package/dist/select-eNgZdZ30.js +0 -521
- package/dist/skeleton-6yk8Tdh5.js +0 -19
- package/dist/slider-DorDsoF8.js +0 -37
- package/dist/status-page-DAHiKM9P.js +0 -3286
- package/dist/switch-BqD0RH_G.js +0 -18
- package/dist/table-Q2-voLuw.js +0 -65
- package/dist/tabs-CSIucYFP.js +0 -57
- package/dist/theme-provider-BkRohQFU.js +0 -61
- package/dist/toggle-group-9Bs0Mm3r.js +0 -82
- package/dist/trpc-CvJUuUXp.js +0 -153
- package/dist/utils-CX-Pz5p6.js +0 -8
- package/dist/writability-BuH-spxv.js +0 -57
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as y, i as b, l as x, o as S } from "./dialog-BIhQXcZC.js";
|
|
8
|
-
import { t as C } from "./writability-BuH-spxv.js";
|
|
9
|
-
import { r as w, t as T } from "./alert-B8MAoIO8.js";
|
|
10
|
-
import { n as E, t as D } from "./date-time-picker-C3FhMXk6.js";
|
|
11
|
-
import { n as O, t as k } from "./radio-group-CZGqVbkJ.js";
|
|
12
|
-
import { a as A, o as j } from "./retention-BYXNpYmR.js";
|
|
1
|
+
import { Kn as e, Mn as t, Qn as n, Vn as r, dr as i, ii as a, ur as o, zn as s } from "./quick-report-DEqqwQxR.js";
|
|
2
|
+
import { f as c, h as l, m as u } from "./i18n-Dt6xbSK6.js";
|
|
3
|
+
import { H as d, K as f, Nt as p, U as m, V as h, jt as g, rt as _, tt as v } from "./alert-dialog-B60PF7S9.js";
|
|
4
|
+
import { B as y, H as b, L as x, V as S, Y as C, c as w, z as T } from "./spinner-BRcNKwjH.js";
|
|
5
|
+
import { M as E, j as D, v as O, y as k } from "./panel-BCwBlB_h.js";
|
|
6
|
+
import { a as A, o as j } from "./retention-DZ0reGGe.js";
|
|
13
7
|
import { useMemo as M, useState as N } from "react";
|
|
14
8
|
import { jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
15
9
|
import { ChevronDownIcon as I, ChevronRightIcon as L, FolderIcon as R, TriangleAlertIcon as z } from "lucide-react";
|
|
16
10
|
import { appDateTimeToISOString as B, formatAppDateTime as V, resolveLocalized as H } from "@overvis/hmi-shared";
|
|
17
11
|
import { STORAGE_ALARM_LOG_RETENTION_MIN_DAYS as U, STORAGE_AUDIT_RETENTION_MIN_DAYS as W, STORAGE_RETENTION_MAX_DAYS as G, retentionCutoffMs as K } from "@overvis/hmi-shared/workspace";
|
|
18
|
-
|
|
12
|
+
// src/workspace/setup/parameters/tree/model.ts
|
|
19
13
|
var q = [
|
|
20
14
|
"pl-0",
|
|
21
15
|
"pl-4",
|
|
@@ -72,7 +66,7 @@ function ee(e, t) {
|
|
|
72
66
|
function te(e, t) {
|
|
73
67
|
if (t.length === 0) return !0;
|
|
74
68
|
let n = t.toLowerCase();
|
|
75
|
-
return
|
|
69
|
+
return i(e.name, n) || i(e.mnemonic, n) ? !0 : e.tags.some((e) => e.toLowerCase().includes(n));
|
|
76
70
|
}
|
|
77
71
|
function ne(e, t, n, r) {
|
|
78
72
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -94,46 +88,46 @@ function ne(e, t, n, r) {
|
|
|
94
88
|
}
|
|
95
89
|
function re(e, t) {
|
|
96
90
|
let n = /* @__PURE__ */ new Map();
|
|
97
|
-
for (let r of e) n.set(r.id,
|
|
91
|
+
for (let r of e) n.set(r.id, o(r, t));
|
|
98
92
|
return n;
|
|
99
93
|
}
|
|
100
94
|
function ie(e) {
|
|
101
|
-
let { branchesByParent:
|
|
102
|
-
for (let
|
|
103
|
-
if (
|
|
104
|
-
let
|
|
105
|
-
if (
|
|
95
|
+
let { branchesByParent: n, paramsByBranch: r, paramCountByBranchId: i, partsByParamId: a, effectiveExpanded: o, filterActive: s, matchingParamIds: c, ancestorsOfMatches: l } = e, u = [], d = (f, p) => {
|
|
96
|
+
for (let m of n.get(f) ?? []) {
|
|
97
|
+
if (l != null && !l.has(m.id)) continue;
|
|
98
|
+
let f = n.get(m.id) ?? [], h = r.get(m.id) ?? [], g = c == null ? h : h.filter((e) => c.has(e.id)), _ = f.length > 0 || h.length > 0, v = e.locale;
|
|
99
|
+
if (u.push({
|
|
106
100
|
kind: "branch",
|
|
107
|
-
id:
|
|
108
|
-
name: H(
|
|
109
|
-
depth:
|
|
110
|
-
paramCount:
|
|
111
|
-
hasChildren:
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
for (let e of
|
|
115
|
-
let
|
|
116
|
-
|
|
101
|
+
id: m.id,
|
|
102
|
+
name: H(m.name, v),
|
|
103
|
+
depth: p,
|
|
104
|
+
paramCount: i.get(m.id) ?? 0,
|
|
105
|
+
hasChildren: _
|
|
106
|
+
}), s || o.has(m.id)) {
|
|
107
|
+
d(m.id, p + 1);
|
|
108
|
+
for (let e of g) {
|
|
109
|
+
let n = a.get(e.id);
|
|
110
|
+
n != null && u.push({
|
|
117
111
|
kind: "param",
|
|
118
112
|
id: e.id,
|
|
119
113
|
branchId: e.branchId,
|
|
120
|
-
depth:
|
|
114
|
+
depth: p + 1,
|
|
121
115
|
icon: e.icon,
|
|
122
|
-
units:
|
|
116
|
+
units: n.units,
|
|
123
117
|
disabled: e.disabledSince != null,
|
|
124
118
|
backgroundReadingPeriodMs: e.backgroundReadingPeriodMs,
|
|
125
119
|
deviceLog: e.deviceLog,
|
|
126
120
|
lastReadingReceivedAt: e.lastReading?.receivedAt ?? null,
|
|
127
121
|
nextReadingDueAt: e.nextReading?.nextDueAt ?? null,
|
|
128
|
-
writable:
|
|
122
|
+
writable: t(e),
|
|
129
123
|
valueType: e.valueType,
|
|
130
|
-
parts:
|
|
124
|
+
parts: n
|
|
131
125
|
});
|
|
132
126
|
}
|
|
133
127
|
}
|
|
134
128
|
}
|
|
135
129
|
};
|
|
136
|
-
return
|
|
130
|
+
return d(null, 0), u;
|
|
137
131
|
}
|
|
138
132
|
function ae(e) {
|
|
139
133
|
let t = [], n = (r) => {
|
|
@@ -166,8 +160,7 @@ function se(e, t, n) {
|
|
|
166
160
|
branchCount: i.size
|
|
167
161
|
};
|
|
168
162
|
}
|
|
169
|
-
|
|
170
|
-
//#region src/workspace/setup/storage/dialogs.tsx
|
|
163
|
+
// src/workspace/setup/storage/dialogs.tsx
|
|
171
164
|
function X(e) {
|
|
172
165
|
return {
|
|
173
166
|
readingsKeepDays: e.readingsKeepDays,
|
|
@@ -186,30 +179,30 @@ function Z(e, t) {
|
|
|
186
179
|
return n >= t && n <= G ? n : null;
|
|
187
180
|
}
|
|
188
181
|
function ce(e) {
|
|
189
|
-
return () =>
|
|
182
|
+
return () => c("storage_days_invalid", {
|
|
190
183
|
min: String(e),
|
|
191
184
|
max: String(G)
|
|
192
185
|
});
|
|
193
186
|
}
|
|
194
187
|
function Q() {
|
|
195
|
-
let
|
|
188
|
+
let e = a.useUtils();
|
|
196
189
|
return async () => {
|
|
197
|
-
await
|
|
190
|
+
await e.storage.invalidate();
|
|
198
191
|
};
|
|
199
192
|
}
|
|
200
|
-
function le(
|
|
201
|
-
return
|
|
202
|
-
workspaceId:
|
|
203
|
-
retention:
|
|
204
|
-
}, { enabled:
|
|
193
|
+
function le(e, t) {
|
|
194
|
+
return a.storage.retentionPreview.useQuery({
|
|
195
|
+
workspaceId: e,
|
|
196
|
+
retention: t ?? X(de)
|
|
197
|
+
}, { enabled: t != null });
|
|
205
198
|
}
|
|
206
199
|
function $({ message: e, onRetry: t, retrying: n }) {
|
|
207
|
-
let
|
|
208
|
-
return /* @__PURE__ */ F(
|
|
200
|
+
let r = u();
|
|
201
|
+
return /* @__PURE__ */ F(v, {
|
|
209
202
|
variant: "destructive",
|
|
210
|
-
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ F(
|
|
203
|
+
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ F(_, {
|
|
211
204
|
className: "flex flex-col items-start gap-2",
|
|
212
|
-
children: [/* @__PURE__ */ P("span", { children: e }), /* @__PURE__ */ P(
|
|
205
|
+
children: [/* @__PURE__ */ P("span", { children: e }), /* @__PURE__ */ P(g, {
|
|
213
206
|
type: "button",
|
|
214
207
|
size: "sm",
|
|
215
208
|
variant: "outline",
|
|
@@ -217,33 +210,33 @@ function $({ message: e, onRetry: t, retrying: n }) {
|
|
|
217
210
|
onClick: () => {
|
|
218
211
|
t();
|
|
219
212
|
},
|
|
220
|
-
children:
|
|
213
|
+
children: r("ui_notice_retry")
|
|
221
214
|
})]
|
|
222
215
|
})]
|
|
223
216
|
});
|
|
224
217
|
}
|
|
225
218
|
function ue({ retention: e, preview: t }) {
|
|
226
|
-
let
|
|
219
|
+
let n = u(), r = l();
|
|
227
220
|
if (e == null) return null;
|
|
228
221
|
if (t.isError) return /* @__PURE__ */ P($, {
|
|
229
|
-
message:
|
|
222
|
+
message: n("storage_preview_failed"),
|
|
230
223
|
onRetry: () => t.refetch(),
|
|
231
224
|
retrying: t.isFetching
|
|
232
225
|
});
|
|
233
226
|
if (t.data == null) return /* @__PURE__ */ P("p", {
|
|
234
227
|
className: "text-sm text-muted-foreground",
|
|
235
|
-
children:
|
|
228
|
+
children: n("storage_preview_loading")
|
|
236
229
|
});
|
|
237
|
-
let { readingsRecords:
|
|
238
|
-
return
|
|
230
|
+
let { readingsRecords: i, auditRecords: a, alarmLogRecords: o } = t.data;
|
|
231
|
+
return i === 0 && a === 0 && o === 0 ? /* @__PURE__ */ P("p", {
|
|
239
232
|
className: "text-sm text-muted-foreground",
|
|
240
|
-
children:
|
|
241
|
-
}) : /* @__PURE__ */ F(
|
|
233
|
+
children: n("storage_preview_nothing")
|
|
234
|
+
}) : /* @__PURE__ */ F(v, {
|
|
242
235
|
variant: "destructive",
|
|
243
|
-
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(
|
|
244
|
-
readings: A(
|
|
245
|
-
history: A(
|
|
246
|
-
alarms: A(
|
|
236
|
+
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(_, { children: n("storage_preview_removes", {
|
|
237
|
+
readings: A(i, r),
|
|
238
|
+
history: A(a, r),
|
|
239
|
+
alarms: A(o, r)
|
|
247
240
|
}) })]
|
|
248
241
|
});
|
|
249
242
|
}
|
|
@@ -253,58 +246,58 @@ var de = {
|
|
|
253
246
|
alarmLogKeepDays: null,
|
|
254
247
|
overrides: []
|
|
255
248
|
};
|
|
256
|
-
function fe({ idPrefix: e, keep: t, days: n, min:
|
|
257
|
-
let
|
|
258
|
-
return /* @__PURE__ */ F(
|
|
249
|
+
function fe({ idPrefix: e, keep: t, days: n, min: r, daysInvalid: i, onKeepChange: a, onDaysChange: o }) {
|
|
250
|
+
let s = u();
|
|
251
|
+
return /* @__PURE__ */ F(O, {
|
|
259
252
|
value: t,
|
|
260
253
|
onValueChange: (e) => {
|
|
261
|
-
|
|
254
|
+
a(e === "days" ? "days" : "forever");
|
|
262
255
|
},
|
|
263
256
|
children: [
|
|
264
|
-
/* @__PURE__ */ F(
|
|
257
|
+
/* @__PURE__ */ F(x, {
|
|
265
258
|
orientation: "horizontal",
|
|
266
|
-
children: [/* @__PURE__ */ P(
|
|
259
|
+
children: [/* @__PURE__ */ P(k, {
|
|
267
260
|
value: "forever",
|
|
268
261
|
id: `${e}-forever`
|
|
269
|
-
}), /* @__PURE__ */ P(
|
|
262
|
+
}), /* @__PURE__ */ P(b, {
|
|
270
263
|
htmlFor: `${e}-forever`,
|
|
271
|
-
children:
|
|
264
|
+
children: s("storage_keep_forever")
|
|
272
265
|
})]
|
|
273
266
|
}),
|
|
274
|
-
/* @__PURE__ */ F(
|
|
267
|
+
/* @__PURE__ */ F(x, {
|
|
275
268
|
orientation: "horizontal",
|
|
276
|
-
children: [/* @__PURE__ */ P(
|
|
269
|
+
children: [/* @__PURE__ */ P(k, {
|
|
277
270
|
value: "days",
|
|
278
271
|
id: `${e}-days`
|
|
279
|
-
}), /* @__PURE__ */ P(
|
|
272
|
+
}), /* @__PURE__ */ P(b, {
|
|
280
273
|
htmlFor: `${e}-days`,
|
|
281
|
-
children:
|
|
274
|
+
children: s("storage_keep_for")
|
|
282
275
|
})]
|
|
283
276
|
}),
|
|
284
|
-
t === "days" ? /* @__PURE__ */ F(
|
|
285
|
-
"data-invalid":
|
|
277
|
+
t === "days" ? /* @__PURE__ */ F(x, {
|
|
278
|
+
"data-invalid": i ? !0 : void 0,
|
|
286
279
|
className: "pl-6",
|
|
287
280
|
children: [
|
|
288
|
-
/* @__PURE__ */ P(
|
|
281
|
+
/* @__PURE__ */ P(b, {
|
|
289
282
|
htmlFor: `${e}-days-input`,
|
|
290
|
-
children:
|
|
283
|
+
children: s("storage_days_field")
|
|
291
284
|
}),
|
|
292
|
-
/* @__PURE__ */ P(
|
|
285
|
+
/* @__PURE__ */ P(w, {
|
|
293
286
|
id: `${e}-days-input`,
|
|
294
287
|
name: "days",
|
|
295
288
|
inputMode: "numeric",
|
|
296
289
|
className: "w-32",
|
|
297
290
|
value: n,
|
|
298
291
|
onChange: (e) => {
|
|
299
|
-
|
|
292
|
+
o(e.target.value);
|
|
300
293
|
},
|
|
301
|
-
"aria-invalid":
|
|
294
|
+
"aria-invalid": i || void 0
|
|
302
295
|
}),
|
|
303
|
-
/* @__PURE__ */ P(
|
|
304
|
-
min: String(
|
|
296
|
+
/* @__PURE__ */ P(T, { children: s("storage_days_hint", {
|
|
297
|
+
min: String(r),
|
|
305
298
|
max: String(G)
|
|
306
299
|
}) }),
|
|
307
|
-
|
|
300
|
+
i ? /* @__PURE__ */ P(y, { errors: [{ message: ce(r)() }] }) : null
|
|
308
301
|
]
|
|
309
302
|
}) : null
|
|
310
303
|
]
|
|
@@ -324,30 +317,30 @@ var pe = {
|
|
|
324
317
|
field: "alarmLogKeepDays"
|
|
325
318
|
}
|
|
326
319
|
};
|
|
327
|
-
function me({ workspaceId: t, kind:
|
|
328
|
-
let
|
|
329
|
-
...X(
|
|
330
|
-
[
|
|
331
|
-
}, k = le(t, O), A = O != null && k.isSuccess, j =
|
|
320
|
+
function me({ workspaceId: t, kind: i, retention: o, onCancel: c, onDone: l }) {
|
|
321
|
+
let p = u(), _ = Q(), v = a.storage.setRetentionDefaults.useMutation(), { min: y, field: b } = pe[i], x = o[b], [C, w] = N(x == null ? "forever" : "days"), [T, E] = N(String(x ?? 365)), D = C === "forever" ? null : Z(T, y), O = C === "days" && D == null ? null : {
|
|
322
|
+
...X(o),
|
|
323
|
+
[b]: D
|
|
324
|
+
}, k = le(t, O), A = O != null && k.isSuccess, j = e({
|
|
332
325
|
defaultValues: {},
|
|
333
|
-
validators:
|
|
326
|
+
validators: s({ submit: async () => A ? (await v.mutateAsync({
|
|
334
327
|
workspaceId: t,
|
|
335
|
-
[
|
|
336
|
-
}), null) :
|
|
337
|
-
onSubmitInvalid:
|
|
328
|
+
[b]: D
|
|
329
|
+
}), null) : r(() => p("storage_preview_required")) }),
|
|
330
|
+
onSubmitInvalid: n,
|
|
338
331
|
onSubmit: async () => {
|
|
339
|
-
await
|
|
332
|
+
await _(), l();
|
|
340
333
|
}
|
|
341
334
|
});
|
|
342
335
|
return /* @__PURE__ */ P(j.AppForm, { children: /* @__PURE__ */ F(j.FormRoot, {
|
|
343
336
|
layout: "dialog",
|
|
344
337
|
children: [
|
|
345
|
-
/* @__PURE__ */ F(
|
|
346
|
-
/* @__PURE__ */ F(
|
|
347
|
-
idPrefix: `storage-${
|
|
338
|
+
/* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: p(i === "readings" ? "storage_readings_default_title" : i === "audit" ? "storage_history_retention_title" : "storage_alarm_log_retention_title") }), /* @__PURE__ */ P(h, { children: p(i === "readings" ? "storage_readings_default_description" : i === "audit" ? "storage_history_retention_description" : "storage_alarm_log_retention_description") })] }),
|
|
339
|
+
/* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(fe, {
|
|
340
|
+
idPrefix: `storage-${i}`,
|
|
348
341
|
keep: C,
|
|
349
342
|
days: T,
|
|
350
|
-
min:
|
|
343
|
+
min: y,
|
|
351
344
|
daysInvalid: C === "days" && D == null,
|
|
352
345
|
onKeepChange: w,
|
|
353
346
|
onDaysChange: E
|
|
@@ -355,21 +348,21 @@ function me({ workspaceId: t, kind: n, retention: i, onCancel: l, onDone: u }) {
|
|
|
355
348
|
retention: O,
|
|
356
349
|
preview: k
|
|
357
350
|
})] }),
|
|
358
|
-
/* @__PURE__ */ F(
|
|
351
|
+
/* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
|
|
359
352
|
type: "button",
|
|
360
353
|
variant: "outline",
|
|
361
|
-
onClick:
|
|
362
|
-
children:
|
|
354
|
+
onClick: c,
|
|
355
|
+
children: p("action_cancel")
|
|
363
356
|
}), /* @__PURE__ */ P(j.SubmitButton, {
|
|
364
|
-
label:
|
|
365
|
-
pendingLabel:
|
|
357
|
+
label: p("action_save"),
|
|
358
|
+
pendingLabel: p("action_saving"),
|
|
366
359
|
disabled: !A
|
|
367
360
|
})] })
|
|
368
361
|
]
|
|
369
362
|
}) });
|
|
370
363
|
}
|
|
371
|
-
function he({ tree: e, value: t, taken:
|
|
372
|
-
let
|
|
364
|
+
function he({ tree: e, value: t, taken: n, onChange: r }) {
|
|
365
|
+
let i = u(), a = l(), [o, s] = N(() => /* @__PURE__ */ new Set()), [c, d] = N(""), f = M(() => {
|
|
373
366
|
let t = /* @__PURE__ */ new Map();
|
|
374
367
|
for (let n of e.branches) t.set(n.parentId, [...t.get(n.parentId) ?? [], n]);
|
|
375
368
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -379,34 +372,34 @@ function he({ tree: e, value: t, taken: i, onChange: a }) {
|
|
|
379
372
|
parameters: n
|
|
380
373
|
};
|
|
381
374
|
}, [e]), m = /* @__PURE__ */ new Set([...t.parameterIds, ...t.branchIds]);
|
|
382
|
-
function
|
|
383
|
-
let
|
|
384
|
-
|
|
375
|
+
function h(e, n, i) {
|
|
376
|
+
let a = e === "parameter" ? "parameterIds" : "branchIds", o = t[a].filter((e) => e !== n);
|
|
377
|
+
r({
|
|
385
378
|
...t,
|
|
386
|
-
[
|
|
379
|
+
[a]: i ? [...o, n] : o
|
|
387
380
|
});
|
|
388
381
|
}
|
|
389
|
-
function
|
|
390
|
-
let
|
|
382
|
+
function g(e, t, r, a) {
|
|
383
|
+
let l = n.has(t), u = o.has(t);
|
|
391
384
|
return /* @__PURE__ */ F("li", {
|
|
392
|
-
className:
|
|
385
|
+
className: p("flex items-center gap-2 py-1", J(a)),
|
|
393
386
|
children: [
|
|
394
|
-
e === "branch" &&
|
|
387
|
+
e === "branch" && c === "" ? /* @__PURE__ */ P("button", {
|
|
395
388
|
type: "button",
|
|
396
389
|
className: "text-muted-foreground",
|
|
397
|
-
"aria-label":
|
|
390
|
+
"aria-label": i(u ? "storage_picker_collapse" : "storage_picker_expand"),
|
|
398
391
|
onClick: () => {
|
|
399
|
-
let e = new Set(
|
|
400
|
-
|
|
392
|
+
let e = new Set(o);
|
|
393
|
+
u ? e.delete(t) : e.add(t), s(e);
|
|
401
394
|
},
|
|
402
|
-
children: P(
|
|
395
|
+
children: P(u ? I : L, { className: "size-4" })
|
|
403
396
|
}) : /* @__PURE__ */ P("span", { className: "size-4 shrink-0" }),
|
|
404
|
-
/* @__PURE__ */ P(
|
|
397
|
+
/* @__PURE__ */ P(C, {
|
|
405
398
|
id: `storage-target-${t}`,
|
|
406
399
|
checked: m.has(t),
|
|
407
|
-
disabled:
|
|
400
|
+
disabled: l,
|
|
408
401
|
onCheckedChange: (n) => {
|
|
409
|
-
|
|
402
|
+
h(e, t, n);
|
|
410
403
|
}
|
|
411
404
|
}),
|
|
412
405
|
/* @__PURE__ */ F("label", {
|
|
@@ -416,74 +409,74 @@ function he({ tree: e, value: t, taken: i, onChange: a }) {
|
|
|
416
409
|
e === "branch" ? /* @__PURE__ */ P(R, { className: "size-4 shrink-0 text-muted-foreground" }) : null,
|
|
417
410
|
/* @__PURE__ */ P("span", {
|
|
418
411
|
className: "truncate",
|
|
419
|
-
children:
|
|
412
|
+
children: r
|
|
420
413
|
}),
|
|
421
|
-
|
|
414
|
+
l ? /* @__PURE__ */ P("span", {
|
|
422
415
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
423
|
-
children:
|
|
416
|
+
children: i("storage_picker_taken")
|
|
424
417
|
}) : null
|
|
425
418
|
]
|
|
426
419
|
})
|
|
427
420
|
]
|
|
428
421
|
}, t);
|
|
429
422
|
}
|
|
430
|
-
function
|
|
431
|
-
return (
|
|
423
|
+
function _(e, t) {
|
|
424
|
+
return (f.branches.get(e) ?? []).flatMap((e) => [g("branch", e.id, H(e.name, a), t), ...o.has(e.id) ? [..._(e.id, t + 1), ...(f.parameters.get(e.id) ?? []).map((e) => g("parameter", e.id, H(e.name, a), t + 1))] : []]);
|
|
432
425
|
}
|
|
433
|
-
let
|
|
426
|
+
let v = c.trim().toLocaleLowerCase(a), y = v === "" ? _(null, 0) : [...e.branches.map((e) => ({
|
|
434
427
|
kind: "branch",
|
|
435
428
|
item: e
|
|
436
429
|
})), ...e.parameters.map((e) => ({
|
|
437
430
|
kind: "parameter",
|
|
438
431
|
item: e
|
|
439
|
-
}))].filter(({ item: e }) => H(e.name,
|
|
432
|
+
}))].filter(({ item: e }) => H(e.name, a).toLocaleLowerCase(a).includes(v)).map(({ kind: e, item: t }) => g(e, t.id, H(t.name, a), 0));
|
|
440
433
|
return /* @__PURE__ */ F("div", {
|
|
441
434
|
className: "flex flex-col gap-2",
|
|
442
|
-
children: [/* @__PURE__ */ P(
|
|
443
|
-
value:
|
|
444
|
-
placeholder:
|
|
435
|
+
children: [/* @__PURE__ */ P(w, {
|
|
436
|
+
value: c,
|
|
437
|
+
placeholder: i("storage_picker_filter"),
|
|
445
438
|
onChange: (e) => {
|
|
446
|
-
|
|
439
|
+
d(e.target.value);
|
|
447
440
|
}
|
|
448
441
|
}), /* @__PURE__ */ P("ul", {
|
|
449
442
|
className: "max-h-64 overflow-y-auto rounded-md border p-2",
|
|
450
|
-
children:
|
|
443
|
+
children: y.length === 0 ? /* @__PURE__ */ P("li", {
|
|
451
444
|
className: "py-1 text-sm text-muted-foreground",
|
|
452
|
-
children:
|
|
453
|
-
}) :
|
|
445
|
+
children: i("storage_picker_empty")
|
|
446
|
+
}) : y
|
|
454
447
|
})]
|
|
455
448
|
});
|
|
456
449
|
}
|
|
457
|
-
function ge({ workspaceId: t, retention:
|
|
458
|
-
let
|
|
459
|
-
parameterIds: (
|
|
460
|
-
branchIds: (
|
|
461
|
-
})), I = E === "forever" ? null : Z(O, 1), L = A.parameterIds.length + A.branchIds.length > 0, R = X(
|
|
462
|
-
...X(
|
|
450
|
+
function ge({ workspaceId: t, retention: i, override: o, tree: c, onCancel: l, onDone: p }) {
|
|
451
|
+
let _ = u(), v = Q(), y = a.storage.saveRetentionOverride.useMutation(), C = M(() => /* @__PURE__ */ new Set([...c.parameters.map((e) => e.id), ...c.branches.map((e) => e.id)]), [c]), w = M(() => new Set(i.overrides.filter((e) => e.id !== o?.id).flatMap((e) => [...e.parameterIds, ...e.branchIds])), [o?.id, i.overrides]), [E, D] = N(o == null || o.keepDays != null ? "days" : "forever"), [O, k] = N(String(o?.keepDays ?? 30)), [A, j] = N(() => ({
|
|
452
|
+
parameterIds: (o?.parameterIds ?? []).filter((e) => C.has(e)),
|
|
453
|
+
branchIds: (o?.branchIds ?? []).filter((e) => C.has(e))
|
|
454
|
+
})), I = E === "forever" ? null : Z(O, 1), L = A.parameterIds.length + A.branchIds.length > 0, R = X(i).overrides.filter((e, t) => i.overrides[t]?.id !== o?.id), z = E === "days" && I == null || !L ? null : {
|
|
455
|
+
...X(i),
|
|
463
456
|
overrides: [...R, {
|
|
464
457
|
keepDays: I,
|
|
465
458
|
parameterIds: [...A.parameterIds],
|
|
466
459
|
branchIds: [...A.branchIds]
|
|
467
460
|
}]
|
|
468
|
-
}, B = le(t, z), V = z != null && B.isSuccess, H =
|
|
461
|
+
}, B = le(t, z), V = z != null && B.isSuccess, H = e({
|
|
469
462
|
defaultValues: {},
|
|
470
|
-
validators:
|
|
463
|
+
validators: s({ submit: async () => L ? V ? (await y.mutateAsync({
|
|
471
464
|
workspaceId: t,
|
|
472
|
-
...
|
|
465
|
+
...o == null ? {} : { overrideId: o.id },
|
|
473
466
|
keepDays: I,
|
|
474
467
|
parameterIds: [...A.parameterIds],
|
|
475
468
|
branchIds: [...A.branchIds]
|
|
476
|
-
}), null) :
|
|
477
|
-
onSubmitInvalid:
|
|
469
|
+
}), null) : r(() => _("storage_preview_required")) : r(() => _("error_storage_override_empty")) }),
|
|
470
|
+
onSubmitInvalid: n,
|
|
478
471
|
onSubmit: async () => {
|
|
479
|
-
await
|
|
472
|
+
await v(), p();
|
|
480
473
|
}
|
|
481
474
|
});
|
|
482
475
|
return /* @__PURE__ */ P(H.AppForm, { children: /* @__PURE__ */ F(H.FormRoot, {
|
|
483
476
|
layout: "dialog",
|
|
484
477
|
children: [
|
|
485
|
-
/* @__PURE__ */ F(
|
|
486
|
-
/* @__PURE__ */ F(
|
|
478
|
+
/* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: _(o == null ? "storage_rule_create_title" : "storage_rule_edit_title") }), /* @__PURE__ */ P(h, { children: _("storage_rule_description") })] }),
|
|
479
|
+
/* @__PURE__ */ F(S, { children: [
|
|
487
480
|
/* @__PURE__ */ P(fe, {
|
|
488
481
|
idPrefix: "storage-rule",
|
|
489
482
|
keep: E,
|
|
@@ -493,56 +486,56 @@ function ge({ workspaceId: t, retention: n, override: i, tree: l, onCancel: u, o
|
|
|
493
486
|
onKeepChange: D,
|
|
494
487
|
onDaysChange: k
|
|
495
488
|
}),
|
|
496
|
-
/* @__PURE__ */ F(
|
|
497
|
-
/* @__PURE__ */ P(
|
|
489
|
+
/* @__PURE__ */ F(x, { children: [
|
|
490
|
+
/* @__PURE__ */ P(b, { children: _("storage_rule_targets") }),
|
|
498
491
|
/* @__PURE__ */ P(he, {
|
|
499
|
-
tree:
|
|
492
|
+
tree: c,
|
|
500
493
|
value: A,
|
|
501
|
-
taken:
|
|
494
|
+
taken: w,
|
|
502
495
|
onChange: j
|
|
503
496
|
}),
|
|
504
|
-
/* @__PURE__ */ P(
|
|
497
|
+
/* @__PURE__ */ P(T, { children: _("storage_rule_targets_hint") })
|
|
505
498
|
] }),
|
|
506
499
|
/* @__PURE__ */ P(ue, {
|
|
507
500
|
retention: z,
|
|
508
501
|
preview: B
|
|
509
502
|
})
|
|
510
503
|
] }),
|
|
511
|
-
/* @__PURE__ */ F(
|
|
504
|
+
/* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
|
|
512
505
|
type: "button",
|
|
513
506
|
variant: "outline",
|
|
514
|
-
onClick:
|
|
515
|
-
children:
|
|
507
|
+
onClick: l,
|
|
508
|
+
children: _("action_cancel")
|
|
516
509
|
}), /* @__PURE__ */ P(H.SubmitButton, {
|
|
517
|
-
label:
|
|
518
|
-
pendingLabel:
|
|
510
|
+
label: _("action_save"),
|
|
511
|
+
pendingLabel: _("action_saving"),
|
|
519
512
|
disabled: !V
|
|
520
513
|
})] })
|
|
521
514
|
]
|
|
522
515
|
}) });
|
|
523
516
|
}
|
|
524
|
-
function _e({ workspaceId: t, override:
|
|
525
|
-
let
|
|
517
|
+
function _e({ workspaceId: t, override: r, onCancel: i, onDone: o }) {
|
|
518
|
+
let c = u(), l = Q(), p = a.storage.deleteRetentionOverride.useMutation(), _ = e({
|
|
526
519
|
defaultValues: {},
|
|
527
|
-
validators:
|
|
520
|
+
validators: s({ submit: async () => (await p.mutateAsync({
|
|
528
521
|
workspaceId: t,
|
|
529
|
-
overrideId:
|
|
522
|
+
overrideId: r.id
|
|
530
523
|
}), null) }),
|
|
531
|
-
onSubmitInvalid:
|
|
524
|
+
onSubmitInvalid: n,
|
|
532
525
|
onSubmit: async () => {
|
|
533
|
-
await
|
|
526
|
+
await l(), o();
|
|
534
527
|
}
|
|
535
528
|
});
|
|
536
|
-
return /* @__PURE__ */ P(
|
|
529
|
+
return /* @__PURE__ */ P(_.AppForm, { children: /* @__PURE__ */ F(_.FormRoot, {
|
|
537
530
|
layout: "dialog",
|
|
538
|
-
children: [/* @__PURE__ */ F(
|
|
531
|
+
children: [/* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: c("storage_rule_delete_title") }), /* @__PURE__ */ P(h, { children: c("storage_rule_delete_description", { keep: j(r.keepDays) }) })] }), /* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
|
|
539
532
|
type: "button",
|
|
540
533
|
variant: "outline",
|
|
541
534
|
onClick: i,
|
|
542
|
-
children:
|
|
543
|
-
}), /* @__PURE__ */ P(
|
|
544
|
-
label:
|
|
545
|
-
pendingLabel:
|
|
535
|
+
children: c("action_cancel")
|
|
536
|
+
}), /* @__PURE__ */ P(_.SubmitButton, {
|
|
537
|
+
label: c("storage_rule_delete_submit"),
|
|
538
|
+
pendingLabel: c("action_deleting"),
|
|
546
539
|
variant: "destructive"
|
|
547
540
|
})] })]
|
|
548
541
|
}) });
|
|
@@ -572,91 +565,91 @@ function ve(e, t, n) {
|
|
|
572
565
|
to: s
|
|
573
566
|
} : null;
|
|
574
567
|
}
|
|
575
|
-
function ye({ workspaceId: t, scope: i, onCancel:
|
|
576
|
-
let
|
|
568
|
+
function ye({ workspaceId: t, scope: i, onCancel: o, onStarted: c }) {
|
|
569
|
+
let p = u(), y = l(), C = a.storage.deleteReadings.useMutation(), [w, T] = N(i.kind === "workspace" ? "before" : "all"), [j, M] = N(""), [I, L] = N({
|
|
577
570
|
from: "",
|
|
578
571
|
to: ""
|
|
579
572
|
}), R = ve(t, i, {
|
|
580
|
-
range:
|
|
573
|
+
range: w,
|
|
581
574
|
before: j,
|
|
582
575
|
...I
|
|
583
|
-
}), B =
|
|
576
|
+
}), B = a.storage.readingsDeletePreview.useQuery(R ?? {
|
|
584
577
|
workspaceId: t,
|
|
585
578
|
scope: { kind: "workspace" }
|
|
586
|
-
}, { enabled: R != null }), V =
|
|
579
|
+
}, { enabled: R != null }), V = e({
|
|
587
580
|
defaultValues: {},
|
|
588
|
-
validators:
|
|
589
|
-
if (R == null || U == null || !B.isSuccess) return
|
|
590
|
-
let { jobId: e } = await
|
|
581
|
+
validators: s({ submit: async () => {
|
|
582
|
+
if (R == null || U == null || !B.isSuccess) return r(() => p("storage_delete_range_invalid"));
|
|
583
|
+
let { jobId: e } = await C.mutateAsync({
|
|
591
584
|
...R,
|
|
592
585
|
to: B.data.until
|
|
593
586
|
});
|
|
594
|
-
return
|
|
587
|
+
return c(e), null;
|
|
595
588
|
} }),
|
|
596
|
-
onSubmitInvalid:
|
|
589
|
+
onSubmitInvalid: n
|
|
597
590
|
}), H = R?.from != null && B.isSuccess && B.data.until <= R.from, U = R != null && B.isSuccess && !H ? B.data.records : null;
|
|
598
591
|
return /* @__PURE__ */ P(V.AppForm, { children: /* @__PURE__ */ F(V.FormRoot, {
|
|
599
592
|
layout: "dialog",
|
|
600
593
|
children: [
|
|
601
|
-
/* @__PURE__ */ F(
|
|
602
|
-
/* @__PURE__ */ F(
|
|
603
|
-
/* @__PURE__ */ P(
|
|
604
|
-
value:
|
|
594
|
+
/* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: i.kind === "workspace" ? p("storage_delete_readings_workspace_title") : p("storage_delete_readings_title", { name: i.label }) }), /* @__PURE__ */ P(h, { children: p("storage_delete_readings_description") })] }),
|
|
595
|
+
/* @__PURE__ */ F(S, { children: [
|
|
596
|
+
/* @__PURE__ */ P(O, {
|
|
597
|
+
value: w,
|
|
605
598
|
onValueChange: (e) => {
|
|
606
|
-
|
|
599
|
+
T(e === "all" ? "all" : e === "between" ? "between" : "before");
|
|
607
600
|
},
|
|
608
601
|
children: [
|
|
609
602
|
"before",
|
|
610
603
|
"between",
|
|
611
604
|
"all"
|
|
612
|
-
].map((e) => /* @__PURE__ */ F(
|
|
605
|
+
].map((e) => /* @__PURE__ */ F(x, {
|
|
613
606
|
orientation: "horizontal",
|
|
614
|
-
children: [/* @__PURE__ */ P(
|
|
607
|
+
children: [/* @__PURE__ */ P(k, {
|
|
615
608
|
value: e,
|
|
616
609
|
id: `storage-delete-${e}`
|
|
617
|
-
}), /* @__PURE__ */ P(
|
|
610
|
+
}), /* @__PURE__ */ P(b, {
|
|
618
611
|
htmlFor: `storage-delete-${e}`,
|
|
619
|
-
children:
|
|
612
|
+
children: p(e === "before" ? "storage_delete_range_before" : e === "between" ? "storage_delete_range_between" : "storage_delete_range_all")
|
|
620
613
|
})]
|
|
621
614
|
}, e))
|
|
622
615
|
}),
|
|
623
|
-
|
|
616
|
+
w === "before" ? /* @__PURE__ */ F(x, { children: [/* @__PURE__ */ P(b, {
|
|
624
617
|
htmlFor: "storage-delete-before-date",
|
|
625
|
-
children:
|
|
618
|
+
children: p("storage_delete_before_field")
|
|
626
619
|
}), /* @__PURE__ */ P(D, {
|
|
627
620
|
id: "storage-delete-before-date",
|
|
628
621
|
value: j,
|
|
629
622
|
onValueChange: M
|
|
630
|
-
})] }) :
|
|
623
|
+
})] }) : w === "between" ? /* @__PURE__ */ F(x, { children: [/* @__PURE__ */ P(b, { children: p("storage_delete_between_field") }), /* @__PURE__ */ P(E, {
|
|
631
624
|
value: I,
|
|
632
625
|
onValueChange: L
|
|
633
626
|
})] }) : null,
|
|
634
627
|
H ? /* @__PURE__ */ P("p", {
|
|
635
628
|
className: "text-sm text-muted-foreground",
|
|
636
|
-
children:
|
|
629
|
+
children: p("storage_delete_preview_nothing")
|
|
637
630
|
}) : R != null && B.isError ? /* @__PURE__ */ P($, {
|
|
638
|
-
message:
|
|
631
|
+
message: p("storage_delete_preview_failed"),
|
|
639
632
|
onRetry: () => B.refetch(),
|
|
640
633
|
retrying: B.isFetching
|
|
641
634
|
}) : U == null ? null : U === 0 ? /* @__PURE__ */ P("p", {
|
|
642
635
|
className: "text-sm text-muted-foreground",
|
|
643
|
-
children:
|
|
644
|
-
}) : /* @__PURE__ */ F(
|
|
636
|
+
children: p("storage_delete_preview_cleanup")
|
|
637
|
+
}) : /* @__PURE__ */ F(v, {
|
|
645
638
|
variant: "destructive",
|
|
646
|
-
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(
|
|
647
|
-
records: A(U,
|
|
648
|
-
parameters: A(B.data?.parameters ?? 0,
|
|
639
|
+
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(_, { children: p("storage_delete_preview", {
|
|
640
|
+
records: A(U, y),
|
|
641
|
+
parameters: A(B.data?.parameters ?? 0, y)
|
|
649
642
|
}) })]
|
|
650
643
|
})
|
|
651
644
|
] }),
|
|
652
|
-
/* @__PURE__ */ F(
|
|
645
|
+
/* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
|
|
653
646
|
type: "button",
|
|
654
647
|
variant: "outline",
|
|
655
|
-
onClick:
|
|
656
|
-
children:
|
|
648
|
+
onClick: o,
|
|
649
|
+
children: p("action_cancel")
|
|
657
650
|
}), /* @__PURE__ */ P(V.SubmitButton, {
|
|
658
|
-
label:
|
|
659
|
-
pendingLabel:
|
|
651
|
+
label: p("storage_delete_submit"),
|
|
652
|
+
pendingLabel: p("action_deleting"),
|
|
660
653
|
variant: "destructive",
|
|
661
654
|
disabled: U == null
|
|
662
655
|
})] })
|
|
@@ -666,65 +659,64 @@ function ye({ workspaceId: t, scope: i, onCancel: l, onStarted: u }) {
|
|
|
666
659
|
function be(e) {
|
|
667
660
|
return new Date(K(pe[e].min, Date.now()));
|
|
668
661
|
}
|
|
669
|
-
function xe({ workspaceId: t, kind: i, onCancel:
|
|
670
|
-
let
|
|
662
|
+
function xe({ workspaceId: t, kind: i, onCancel: o, onStarted: c }) {
|
|
663
|
+
let p = u(), C = l(), w = a.storage.deleteHistory.useMutation(), E = a.storage.deleteAlarmLog.useMutation(), O = M(() => be(i), [i]), [k, j] = N(() => V(O)), I = B(k), L = I != null && Date.parse(I) > O.getTime(), R = {
|
|
671
664
|
workspaceId: t,
|
|
672
665
|
before: I ?? O.toISOString()
|
|
673
|
-
}, H = I != null && !L, U =
|
|
666
|
+
}, H = I != null && !L, U = a.storage.historyDeletePreview.useQuery(R, { enabled: H && i === "audit" }), W = a.storage.alarmLogDeletePreview.useQuery(R, { enabled: H && i === "alarm_log" }), G = i === "audit" ? U : W, K = p(i === "audit" ? "error_storage_history_too_recent" : "error_storage_alarm_log_too_recent"), q = e({
|
|
674
667
|
defaultValues: {},
|
|
675
|
-
validators:
|
|
676
|
-
if (I == null || L || J == null) return
|
|
677
|
-
let { jobId: e } = await (i === "audit" ?
|
|
668
|
+
validators: s({ submit: async () => {
|
|
669
|
+
if (I == null || L || J == null) return r(() => K);
|
|
670
|
+
let { jobId: e } = await (i === "audit" ? w : E).mutateAsync({
|
|
678
671
|
workspaceId: t,
|
|
679
672
|
before: I
|
|
680
673
|
});
|
|
681
|
-
return
|
|
674
|
+
return c(e), null;
|
|
682
675
|
} }),
|
|
683
|
-
onSubmitInvalid:
|
|
676
|
+
onSubmitInvalid: n
|
|
684
677
|
}), J = H && G.isSuccess ? G.data.records : null;
|
|
685
678
|
return /* @__PURE__ */ P(q.AppForm, { children: /* @__PURE__ */ F(q.FormRoot, {
|
|
686
679
|
layout: "dialog",
|
|
687
680
|
children: [
|
|
688
|
-
/* @__PURE__ */ F(
|
|
689
|
-
/* @__PURE__ */ F(
|
|
681
|
+
/* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P(f, { children: p(i === "audit" ? "storage_delete_history_title" : "storage_delete_alarm_log_title") }), /* @__PURE__ */ P(h, { children: p(i === "audit" ? "storage_delete_history_description" : "storage_delete_alarm_log_description") })] }),
|
|
682
|
+
/* @__PURE__ */ F(S, { children: [/* @__PURE__ */ F(x, {
|
|
690
683
|
"data-invalid": L ? !0 : void 0,
|
|
691
684
|
children: [
|
|
692
|
-
/* @__PURE__ */ P(
|
|
685
|
+
/* @__PURE__ */ P(b, {
|
|
693
686
|
htmlFor: "storage-history-before",
|
|
694
|
-
children:
|
|
687
|
+
children: p("storage_delete_before_field")
|
|
695
688
|
}),
|
|
696
689
|
/* @__PURE__ */ P(D, {
|
|
697
690
|
id: "storage-history-before",
|
|
698
691
|
value: k,
|
|
699
692
|
onValueChange: j
|
|
700
693
|
}),
|
|
701
|
-
/* @__PURE__ */ P(
|
|
702
|
-
L ? /* @__PURE__ */ P(
|
|
694
|
+
/* @__PURE__ */ P(T, { children: p("storage_delete_history_hint", { latest: V(O) }) }),
|
|
695
|
+
L ? /* @__PURE__ */ P(y, { errors: [{ message: K }] }) : null
|
|
703
696
|
]
|
|
704
697
|
}), H && G.isError ? /* @__PURE__ */ P($, {
|
|
705
|
-
message:
|
|
698
|
+
message: p("storage_delete_preview_failed"),
|
|
706
699
|
onRetry: () => G.refetch(),
|
|
707
700
|
retrying: G.isFetching
|
|
708
701
|
}) : J == null ? null : J === 0 ? /* @__PURE__ */ P("p", {
|
|
709
702
|
className: "text-sm text-muted-foreground",
|
|
710
|
-
children:
|
|
711
|
-
}) : /* @__PURE__ */ F(
|
|
703
|
+
children: p("storage_delete_preview_nothing")
|
|
704
|
+
}) : /* @__PURE__ */ F(v, {
|
|
712
705
|
variant: "destructive",
|
|
713
|
-
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(
|
|
706
|
+
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P(_, { children: p(i === "audit" ? "storage_delete_history_preview" : "storage_delete_alarm_log_preview", { records: A(J, C) }) })]
|
|
714
707
|
})] }),
|
|
715
|
-
/* @__PURE__ */ F(
|
|
708
|
+
/* @__PURE__ */ F(d, { children: [/* @__PURE__ */ P(g, {
|
|
716
709
|
type: "button",
|
|
717
710
|
variant: "outline",
|
|
718
|
-
onClick:
|
|
719
|
-
children:
|
|
711
|
+
onClick: o,
|
|
712
|
+
children: p("action_cancel")
|
|
720
713
|
}), /* @__PURE__ */ P(q.SubmitButton, {
|
|
721
|
-
label:
|
|
722
|
-
pendingLabel:
|
|
714
|
+
label: p("storage_delete_submit"),
|
|
715
|
+
pendingLabel: p("action_deleting"),
|
|
723
716
|
variant: "destructive",
|
|
724
717
|
disabled: J == null || J === 0
|
|
725
718
|
})] })
|
|
726
719
|
]
|
|
727
720
|
}) });
|
|
728
721
|
}
|
|
729
|
-
//#endregion
|
|
730
722
|
export { ge as a, ee as c, se as d, Y as f, J as h, me as i, ie as l, te as m, ye as n, ne as o, oe as p, _e as r, re as s, xe as t, ae as u };
|