@overvis/hmi-workspace-ui 0.1.0 → 0.1.2

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 (130) hide show
  1. package/dist/alarm-list-DKFio0hg.js +414 -0
  2. package/dist/alarm-rule-dialog-mb4_nHRW.js +417 -0
  3. package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-CfZXTWkK.js} +123 -125
  4. package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-DBLSkrrG.js} +15 -18
  5. package/dist/alert-dialog-D_iDv2lQ.js +891 -0
  6. package/dist/{base-revision-YCO27zR4.js → base-revision-DLF9EnGV.js} +26 -29
  7. package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D5R6Fz74.js} +6 -7
  8. package/dist/{catalog-list-DjZojYLJ.js → catalog-list-BkWosvh1.js} +2 -4
  9. package/dist/{code-editor-BVimvjDV.js → code-editor-DCM0KdMJ.js} +9 -6
  10. package/dist/dashboard-bindings.js +1 -2
  11. package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-DLc11Vzu.js} +335 -359
  12. package/dist/{de-14WdmJxZ.js → de-Z2er-E5v.js} +4 -2
  13. package/dist/diagnostic-text-CYZFPiND.js +116 -0
  14. package/dist/{dialogs-D_v1LeH4.js → dialogs-BX023zml.js} +2523 -2590
  15. package/dist/{dialogs-B6BRnf3Q.js → dialogs-DEOg9lxy.js} +219 -227
  16. package/dist/{display-DmOo23mi.js → display-VYGzneE0.js} +4 -6
  17. package/dist/{editor-language-To9MxloY.js → editor-language-CGENZxbI.js} +3 -5
  18. package/dist/editor-page-CaN52OQh.js +1337 -0
  19. package/dist/{en-BgercpT0.js → en-CKPPL6bQ.js} +4 -2
  20. package/dist/entity-controls-DJT47yeV.js +71 -0
  21. package/dist/errors-BAWoH_5w.js +25 -0
  22. package/dist/{footer-DC-Q0052.js → footer-CbPMP8aq.js} +2404 -2515
  23. package/dist/host.js +8254 -675
  24. package/dist/{i18n-BgzakKoC.js → i18n-ChjEbYEg.js} +77 -90
  25. package/dist/i18n.js +1 -2
  26. package/dist/index.js +5168 -5353
  27. package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
  28. package/dist/{list-page-CvsdZb86.js → list-page-Fa29SkaJ.js} +116 -123
  29. package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-DvXIYc1Z.js} +6 -6
  30. package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
  31. package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
  32. package/dist/{notice-card-DyGywFsW.js → notice-card-V_0K0lO0.js} +54 -58
  33. package/dist/page-B5te_1Lc.js +449 -0
  34. package/dist/{page-v6LCwswN.js → page-BorlLnMX.js} +92 -100
  35. package/dist/page-DxF7FOve.js +507 -0
  36. package/dist/panel-DuZD-cBP.js +949 -0
  37. package/dist/parameter-values.js +3 -16
  38. package/dist/{pl-lQ9HXV9k.js → pl-DVABrn5G.js} +4 -2
  39. package/dist/presence-code-DsabLTZs.js +73 -0
  40. package/dist/{query-gate-DVhNIkge.js → query-gate-BbIo1Xrj.js} +6 -6
  41. package/dist/{provider-DoEpKcQ-.js → quick-report-BcZsfkCZ.js} +9423 -5102
  42. package/dist/{retention-BYXNpYmR.js → retention-C7EZsq8u.js} +4 -6
  43. package/dist/retention-note-CmMeHV_u.js +40 -0
  44. package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
  45. package/dist/{ru-qTKINoUj.js → ru-CBRLC_xM.js} +8 -6
  46. package/dist/run-text-CDdfbKbg.js +112 -0
  47. package/dist/{search-D4rDnE9T.js → search-C6xQ_Hvo.js} +26 -29
  48. package/dist/{sections-kCOyc4NR.js → sections-D_SBfVzV.js} +2 -3
  49. package/dist/{select-BKiOWdSr.js → select-nNLG-AMz.js} +17 -23
  50. package/dist/{spinner-C-HPNxOc.js → spinner-B-KLtBjp.js} +182 -201
  51. package/dist/src/code-editor/code-editor.d.ts +3 -0
  52. package/dist/src/code-editor/taskfile-language.d.ts +22 -2
  53. package/dist/src/i18n/catalogs/de/edge-program.d.ts +3 -0
  54. package/dist/src/i18n/catalogs/de.d.ts +3 -0
  55. package/dist/src/i18n/catalogs/en/edge-program.d.ts +3 -0
  56. package/dist/src/i18n/catalogs/en.d.ts +3 -0
  57. package/dist/src/i18n/catalogs/pl/edge-program.d.ts +3 -0
  58. package/dist/src/i18n/catalogs/pl.d.ts +3 -0
  59. package/dist/src/i18n/catalogs/ru/edge-program.d.ts +5 -2
  60. package/dist/src/i18n/catalogs/ru/graphics.d.ts +2 -2
  61. package/dist/src/i18n/catalogs/ru.d.ts +7 -4
  62. package/dist/src/i18n/catalogs/uk/edge-program.d.ts +5 -2
  63. package/dist/src/i18n/catalogs/uk/graphics.d.ts +2 -2
  64. package/dist/src/i18n/catalogs/uk.d.ts +7 -4
  65. package/dist/src/version.d.ts +1 -1
  66. package/dist/src/workspace/graphics/inspector/item.d.ts +6 -6
  67. package/dist/src/workspace/local-workspace-app.d.ts +1 -1
  68. package/dist/src/workspace/routes.d.ts +1 -1
  69. package/dist/{starter-fields-BRLX0z-v.js → starter-fields-7S3LmtGa.js} +154 -157
  70. package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
  71. package/dist/styles.css +1 -1
  72. package/dist/ui.js +334 -374
  73. package/dist/{uk-CwpJAxmx.js → uk-17pbVYZa.js} +8 -6
  74. package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-Clb-7xRY.js} +14 -17
  75. package/package.json +15 -9
  76. package/dist/alarm-list-BL3xQ5Lf.js +0 -423
  77. package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
  78. package/dist/alert-B8MAoIO8.js +0 -45
  79. package/dist/alert-dialog-CYkuMg5D.js +0 -129
  80. package/dist/api-error-9rQmUN5L.js +0 -93
  81. package/dist/breadcrumb-DzVL1yHa.js +0 -74
  82. package/dist/button-6SxPBYMz.js +0 -44
  83. package/dist/context-u9KJQmdB.js +0 -102
  84. package/dist/copyable-id-DYGiAcnq.js +0 -40
  85. package/dist/dashboard-context-CBfG6DoT.js +0 -191
  86. package/dist/date-time-picker-C3FhMXk6.js +0 -266
  87. package/dist/diagnostic-text-BAkzW0SE.js +0 -111
  88. package/dist/diagnostic-text-DiKd2i1w.js +0 -76
  89. package/dist/dialog-BIhQXcZC.js +0 -237
  90. package/dist/dialog-BqyIxMD-.js +0 -54
  91. package/dist/dropdown-menu-DSzbBq3v.js +0 -136
  92. package/dist/editor-page-BiSZJz5b.js +0 -1353
  93. package/dist/empty-B-QJ-06w.js +0 -59
  94. package/dist/entity-controls-D1K4Ot3O.js +0 -76
  95. package/dist/errors-CcsvDHu8.js +0 -26
  96. package/dist/history-page-sAAhG54V.js +0 -1400
  97. package/dist/icon-D-pR9htW.js +0 -57
  98. package/dist/index-page-DMH82fZe.js +0 -214
  99. package/dist/item-B5SaTFQU.js +0 -120
  100. package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
  101. package/dist/mutations-THtGG6Ai.js +0 -240
  102. package/dist/page-2KPemaAj.js +0 -328
  103. package/dist/page-6rIoTg2L.js +0 -459
  104. package/dist/page-C6giEoEd.js +0 -1935
  105. package/dist/page-DCbTxKsi.js +0 -313
  106. package/dist/page-DWO427hT.js +0 -208
  107. package/dist/page-LXu_2zm3.js +0 -137
  108. package/dist/page-aaUiVOnk.js +0 -513
  109. package/dist/page-header-RB2YFWlE.js +0 -55
  110. package/dist/page-title-CdCbiLt8.js +0 -14
  111. package/dist/panel-DDy8tUNR.js +0 -338
  112. package/dist/presence-code-BfSXr50g.js +0 -83
  113. package/dist/progress-C7cxNJA1.js +0 -83
  114. package/dist/provider-BOeYHi0n.js +0 -134
  115. package/dist/quick-report-CUVJnbKP.js +0 -416
  116. package/dist/radio-group-CZGqVbkJ.js +0 -26
  117. package/dist/retention-note-CHhA6gjY.js +0 -42
  118. package/dist/run-text-DvaO8LDF.js +0 -113
  119. package/dist/select-eNgZdZ30.js +0 -521
  120. package/dist/skeleton-6yk8Tdh5.js +0 -19
  121. package/dist/slider-DorDsoF8.js +0 -37
  122. package/dist/status-page-DAHiKM9P.js +0 -3286
  123. package/dist/switch-BqD0RH_G.js +0 -18
  124. package/dist/table-Q2-voLuw.js +0 -65
  125. package/dist/tabs-CSIucYFP.js +0 -57
  126. package/dist/theme-provider-BkRohQFU.js +0 -61
  127. package/dist/toggle-group-9Bs0Mm3r.js +0 -82
  128. package/dist/trpc-CvJUuUXp.js +0 -153
  129. package/dist/utils-CX-Pz5p6.js +0 -8
  130. package/dist/writability-BuH-spxv.js +0 -57
@@ -1,313 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { r as t } from "./trpc-CvJUuUXp.js";
3
- import { f as n, m as r, n as i } from "./i18n-BgzakKoC.js";
4
- import { a, d as o, r as s, t as c } from "./mutation-form-validators-BNz5bsv1.js";
5
- import { t as l } from "./button-6SxPBYMz.js";
6
- import { a as u, i as d, l as f, o as p, r as m, t as h } from "./dialog-BIhQXcZC.js";
7
- import { n as g } from "./skeleton-6yk8Tdh5.js";
8
- import { o as _ } from "./context-u9KJQmdB.js";
9
- import { n as v } from "./api-error-9rQmUN5L.js";
10
- import { s as y } from "./mutations-THtGG6Ai.js";
11
- import { t as b } from "./page-header-RB2YFWlE.js";
12
- import { r as x, t as S } from "./query-gate-DVhNIkge.js";
13
- import { t as C } from "./breadcrumbs-0cjsV2cq.js";
14
- import { a as w, d as T, i as E, l as ee, n as te, o as ne, r as D, s as O, t as k, u as A } from "./catalog-list-DjZojYLJ.js";
15
- import { useRef as j, useState as M } from "react";
16
- import { isPublicApiErrorCode as N } from "@overvis/hmi-shared/api-errors";
17
- import { jsx as P, jsxs as F } from "react/jsx-runtime";
18
- import { FolderIcon as I, Trash2Icon as L, UploadIcon as R } from "lucide-react";
19
- import { API_INTERNAL_ERROR_CODE as z, formatAppDateTime as B } from "@overvis/hmi-shared";
20
- import { WORKSPACE_UPLOADS_MAX_FILE_BYTES as V, uploadsIngestButtonVisible as H, uploadsIngestedDirName as re } from "@overvis/hmi-shared/workspace";
21
- //#region src/workspace/setup/files/errors.ts
22
- function U(e) {
23
- switch (e) {
24
- case "gs_missing": return n("setup_files_ingest_error_gs_missing");
25
- case "raster_failed": return n("setup_files_ingest_error_raster_failed");
26
- case "uploads_not_pdf": return n("setup_files_ingest_error_not_pdf");
27
- case "pdf_gone": return n("setup_files_ingest_error_pdf_gone");
28
- case "xlsx_gone": return n("setup_files_ingest_error_xlsx_gone");
29
- case "xlsx_password": return n("setup_files_ingest_error_xlsx_password");
30
- case "xlsx_unreadable": return n("setup_files_ingest_error_xlsx_unreadable");
31
- case "dest_gone": return n("setup_files_ingest_error_dest_gone");
32
- case "mistral_unauthorized":
33
- case "mistral_payment":
34
- case "mistral_api_key_missing": return n("setup_files_ingest_error_ocr");
35
- case "wall_timeout": return n("setup_files_ingest_error_timeout");
36
- case "jobrunner_restart": return n("setup_files_ingest_error_restart");
37
- default: return n("setup_files_ingest_failed");
38
- }
39
- }
40
- //#endregion
41
- //#region src/workspace/setup/files/http.ts
42
- function W(e) {
43
- return e.replace(/\/+$/, "");
44
- }
45
- function G(e, t) {
46
- return `${W(e.apiBaseUrl)}/api/workspaces/${t}/uploads`;
47
- }
48
- function K(e, t, n, r) {
49
- let i = encodeURIComponent(n), a = `${G(e, t)}/${i}`;
50
- return r === "dir" ? `${a}/archive` : a;
51
- }
52
- function q(e, t) {
53
- t != null && new Headers(t()).forEach((t, n) => {
54
- e.set(n, t);
55
- });
56
- }
57
- function J(e) {
58
- if (typeof e != "object" || !e) return null;
59
- let t = Reflect.get(e, "message");
60
- return typeof t == "string" && N(t) ? t : null;
61
- }
62
- async function Y(e) {
63
- let t;
64
- try {
65
- t = await e.json();
66
- } catch {
67
- t = null;
68
- }
69
- let n = J(t);
70
- throw n == null ? e.status === 401 ? Error("workspace_no_access") : e.status === 403 ? Error("workspace_not_editor") : e.status === 413 ? Error("uploads_too_large") : e.status === 404 ? Error("uploads_not_found") : Error(z) : Error(n);
71
- }
72
- function X(e) {
73
- if (typeof e != "object" || !e) throw Error("uploads_invalid_name");
74
- let t = Reflect.get(e, "kind"), n = Reflect.get(e, "name");
75
- if ((t === "file" || t === "dir") && typeof n == "string" && n.length > 0) return {
76
- kind: t,
77
- name: n
78
- };
79
- throw Error("uploads_invalid_name");
80
- }
81
- async function Z(e) {
82
- let t = new Headers();
83
- q(t, e.host.getHeaders);
84
- let n = new FormData();
85
- n.append("file", e.file, e.file.name);
86
- let r = await fetch(G(e.host, e.workspaceId), {
87
- method: "POST",
88
- credentials: e.host.credentials,
89
- headers: t,
90
- body: n,
91
- ...e.signal == null ? {} : { signal: e.signal }
92
- });
93
- return r.ok || await Y(r), X(await r.json());
94
- }
95
- async function ie(e) {
96
- let t = new Headers();
97
- q(t, e.host.getHeaders);
98
- let n = await fetch(K(e.host, e.workspaceId, e.name, e.kind), {
99
- method: "GET",
100
- credentials: e.host.credentials,
101
- headers: t
102
- });
103
- n.ok || await Y(n);
104
- let r = await n.blob();
105
- return {
106
- filename: e.kind === "dir" ? `${e.name}.zip` : e.name,
107
- blob: r
108
- };
109
- }
110
- //#endregion
111
- //#region src/workspace/setup/files/page.tsx
112
- var ae = /* @__PURE__ */ e({ SetupFilesPage: () => $ });
113
- function oe(e) {
114
- if (e < 1024) return n("setup_files_size_b", { n: String(e) });
115
- let t = e / 1024;
116
- if (t < 1024) return n("setup_files_size_kib", { n: t < 10 ? t.toFixed(1) : String(Math.round(t)) });
117
- let r = t / 1024;
118
- return n("setup_files_size_mib", { n: r < 10 ? r.toFixed(1) : String(Math.round(r)) });
119
- }
120
- function se(e) {
121
- let t = n("setup_files_file_meta", {
122
- size: oe(e.size),
123
- at: B(e.updatedAt)
124
- });
125
- return e.ingest?.status === "failed" ? `${U(e.ingest.errorCode)} · ${t}` : t;
126
- }
127
- function Q(e, t) {
128
- let n = URL.createObjectURL(t), r = document.createElement("a");
129
- r.href = n, r.download = e, r.click(), setTimeout(() => {
130
- URL.revokeObjectURL(n);
131
- }, 6e4);
132
- }
133
- function $({ workspaceId: e }) {
134
- let n = r(), a = i(), o = _(), s = y(e), c = t.workspace.uploads.list.useQuery({ workspaceId: e }, { refetchInterval: (e) => {
135
- let t = e.state.data;
136
- return t == null ? !1 : t.entries.some((e) => e.kind === "file" && e.ingest?.status === "running") ? 2e3 : !1;
137
- } }), u = s.ingest, d = new Set((c.data?.entries ?? []).map((e) => e.name)), [f, p] = M(null);
138
- return /* @__PURE__ */ F(ee, { children: [
139
- /* @__PURE__ */ P(b, {
140
- icon: /* @__PURE__ */ P(I, {}),
141
- breadcrumbs: /* @__PURE__ */ P(C, { workspaceId: e }),
142
- title: n("setup_files_title"),
143
- description: n("setup_files_description")
144
- }),
145
- /* @__PURE__ */ F(te, { children: [/* @__PURE__ */ P(le, { workspaceId: e }), /* @__PURE__ */ P(x, {
146
- query: c,
147
- loading: /* @__PURE__ */ F("div", {
148
- className: "space-y-2",
149
- children: [/* @__PURE__ */ P(g, { className: "h-10 w-full" }), /* @__PURE__ */ P(g, { className: "h-10 w-4/5" })]
150
- }),
151
- error: () => /* @__PURE__ */ P(S, { message: n("error_request_failed") }),
152
- isEmpty: (e) => e.entries.length === 0,
153
- empty: /* @__PURE__ */ P(D, { children: n("setup_files_empty") }),
154
- children: ({ entries: t }) => /* @__PURE__ */ P(w, { children: t.map((t) => /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ F("button", {
155
- type: "button",
156
- className: "\n min-w-0 flex-1 rounded-sm text-left outline-none\n focus-visible:ring-2 focus-visible:ring-ring\n ",
157
- onClick: () => {
158
- ie({
159
- workspaceId: e,
160
- name: t.name,
161
- kind: t.kind,
162
- host: {
163
- apiBaseUrl: o.apiBaseUrl,
164
- credentials: o.credentials,
165
- ...o.getHeaders == null ? {} : { getHeaders: o.getHeaders }
166
- }
167
- }).then(({ filename: e, blob: t }) => {
168
- Q(e, t);
169
- }).catch((e) => {
170
- a.error(v(e));
171
- });
172
- },
173
- children: [/* @__PURE__ */ F("span", {
174
- className: "flex min-w-0 items-center gap-2",
175
- children: [t.kind === "dir" ? /* @__PURE__ */ P(I, { className: "size-4 shrink-0 text-muted-foreground" }) : null, /* @__PURE__ */ P(O, { children: t.name })]
176
- }), /* @__PURE__ */ P(ne, { children: t.kind === "file" ? se(t) : n("setup_files_dir_meta", {
177
- count: String(t.fileCount),
178
- at: B(t.updatedAt)
179
- }) })]
180
- }), /* @__PURE__ */ F(k, { children: [H({
181
- kind: t.kind,
182
- name: t.name,
183
- destOccupied: d.has(re(t.name)),
184
- ingestRunning: t.kind === "file" && t.ingest?.status === "running"
185
- }) ? /* @__PURE__ */ P(l, {
186
- type: "button",
187
- size: "sm",
188
- disabled: u.isPending && u.variables.name === t.name,
189
- onClick: () => {
190
- u.mutateAsync({
191
- workspaceId: e,
192
- name: t.name
193
- }).catch((e) => {
194
- a.error(v(e));
195
- });
196
- },
197
- children: n("setup_files_ingest")
198
- }) : t.kind === "file" && t.ingest?.status === "running" ? /* @__PURE__ */ P("span", {
199
- className: "\n inline-flex h-8 items-center px-2.5 text-sm text-muted-foreground\n tabular-nums\n ",
200
- children: t.ingest.total === 0 ? n("setup_files_ingest_starting") : n("setup_files_ingest_progress", {
201
- processed: String(t.ingest.processed),
202
- total: String(t.ingest.total)
203
- })
204
- }) : null, /* @__PURE__ */ P(E, { children: /* @__PURE__ */ P(T, {
205
- tone: "destructive",
206
- "aria-label": n("setup_files_delete_action"),
207
- onClick: () => {
208
- p(t);
209
- },
210
- children: /* @__PURE__ */ P(L, {})
211
- }) })] })] }, `${t.kind}:${t.name}`)) })
212
- })] }),
213
- /* @__PURE__ */ P(h, {
214
- open: f != null,
215
- onOpenChange: (e) => {
216
- e || p(null);
217
- },
218
- children: /* @__PURE__ */ P(m, { children: f ? /* @__PURE__ */ P(ue, {
219
- workspaceId: e,
220
- entry: f,
221
- onCancel: () => {
222
- p(null);
223
- },
224
- onDeleted: () => {
225
- p(null), a.success(n("setup_files_delete_toast"));
226
- }
227
- }) : null })
228
- })
229
- ] });
230
- }
231
- function ce() {
232
- return {
233
- file: null,
234
- uploadedKind: null,
235
- uploadedName: ""
236
- };
237
- }
238
- function le({ workspaceId: e }) {
239
- let t = r(), u = i(), d = _(), f = y(e), p = j(null), m = a({
240
- defaultValues: ce(),
241
- validators: c({ submit: async (t) => {
242
- let r = t.file;
243
- if (r == null) return s(() => n("setup_files_no_file"));
244
- if (r.size > V) return s(() => n("error_uploads_too_large"));
245
- let i = await Z({
246
- workspaceId: e,
247
- file: r,
248
- host: {
249
- apiBaseUrl: d.apiBaseUrl,
250
- credentials: d.credentials,
251
- ...d.getHeaders == null ? {} : { getHeaders: d.getHeaders }
252
- }
253
- });
254
- return t.file = null, t.uploadedKind = i.kind, t.uploadedName = i.name, null;
255
- } }),
256
- onSubmitInvalid: o,
257
- onSubmit: ({ value: e }) => {
258
- e.uploadedKind === "dir" ? u.success(t("setup_files_uploaded_dir", { name: e.uploadedName })) : e.uploadedKind === "file" && u.success(t("setup_files_uploaded_file", { name: e.uploadedName })), f.uploaded();
259
- }
260
- });
261
- return /* @__PURE__ */ P(m.AppForm, { children: /* @__PURE__ */ F(m.FormRoot, { children: [/* @__PURE__ */ P("input", {
262
- ref: p,
263
- type: "file",
264
- "aria-label": t("setup_files_upload"),
265
- className: "sr-only",
266
- onChange: (e) => {
267
- let t = e.target.files?.[0] ?? null;
268
- e.target.value = "", t != null && (m.setFieldValue("file", t), m.handleSubmit());
269
- }
270
- }), /* @__PURE__ */ P(m.Subscribe, {
271
- selector: (e) => e.isSubmitting,
272
- children: (e) => /* @__PURE__ */ F(l, {
273
- type: "button",
274
- size: "sm",
275
- disabled: e,
276
- onClick: () => {
277
- p.current?.click();
278
- },
279
- children: [/* @__PURE__ */ P(R, { "data-icon": "inline-start" }), t(e ? "action_uploading" : "setup_files_upload")]
280
- })
281
- })] }) });
282
- }
283
- function ue({ workspaceId: e, entry: t, onCancel: n, onDeleted: i }) {
284
- let s = r(), m = y(e).remove, h = a({
285
- defaultValues: {},
286
- validators: c({ submit: async () => (await m.mutateAsync({
287
- workspaceId: e,
288
- kind: t.kind,
289
- name: t.name
290
- }), null) }),
291
- onSubmitInvalid: o,
292
- onSubmit: () => {
293
- i();
294
- }
295
- });
296
- return /* @__PURE__ */ P(h.AppForm, { children: /* @__PURE__ */ F(h.FormRoot, {
297
- layout: "dialog",
298
- children: [/* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(f, { children: t.kind === "dir" ? s("setup_files_delete_dir_title", { name: t.name }) : s("setup_files_delete_file_title", { name: t.name }) }), /* @__PURE__ */ P(d, { children: t.kind === "dir" ? s("setup_files_delete_dir_description", { count: String(t.fileCount) }) : s("setup_files_delete_file_description") })] }), /* @__PURE__ */ F(u, { children: [/* @__PURE__ */ P(l, {
299
- type: "button",
300
- variant: "outline",
301
- onClick: () => {
302
- n();
303
- },
304
- children: s("action_cancel")
305
- }), /* @__PURE__ */ P(h.SubmitButton, {
306
- label: s("setup_files_delete_confirm_submit"),
307
- pendingLabel: s("action_deleting"),
308
- variant: "destructive"
309
- })] })]
310
- }) });
311
- }
312
- //#endregion
313
- export { ae as n, Z as r, $ as t };
@@ -1,208 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { r as t } from "./trpc-CvJUuUXp.js";
3
- import { h as n, m as r } from "./i18n-BgzakKoC.js";
4
- import { t as i } from "./utils-CX-Pz5p6.js";
5
- import { n as a, t as o } from "./button-6SxPBYMz.js";
6
- import { n as s } from "./skeleton-6yk8Tdh5.js";
7
- import { s as c } from "./context-u9KJQmdB.js";
8
- import { s as l } from "./dialogs-D_v1LeH4.js";
9
- import { n as u } from "./api-error-9rQmUN5L.js";
10
- import { _ as d, h as f, n as p, r as m, t as h, v as g } from "./footer-DC-Q0052.js";
11
- import { t as _ } from "./page-header-RB2YFWlE.js";
12
- import { n as v } from "./query-gate-DVhNIkge.js";
13
- import { t as y } from "./model-B8gGi4OK.js";
14
- import { useCallback as b, useState as x } from "react";
15
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
16
- import { ArrowLeftIcon as w, ChartLineIcon as T, PencilIcon as E, SaveIcon as D } from "lucide-react";
17
- import { resolveLocalized as O } from "@overvis/hmi-shared";
18
- import { canWriteSetup as k } from "@overvis/hmi-shared/workspace";
19
- import { formatReportDateTimeIso as A } from "@overvis/hmi-shared/report";
20
- import { createLink as j } from "@tanstack/react-router";
21
- //#region src/chrome/text-link.tsx
22
- function M({ className: e, ...t }) {
23
- return /* @__PURE__ */ S("a", {
24
- className: i(a({
25
- variant: "link",
26
- size: "sm"
27
- }), "\n h-auto px-0 text-primary/80\n hover:text-primary hover:no-underline\n ", e),
28
- ...t
29
- });
30
- }
31
- var N = j(M);
32
- //#endregion
33
- //#region src/workspace/page-state/report.ts
34
- function P(e) {
35
- if (e == null) return null;
36
- let t = e.type;
37
- return typeof t == "string" && t.length > 0 ? t : null;
38
- }
39
- function F(e) {
40
- let t = [];
41
- for (let n of e.visibleParameterIds) {
42
- let r = e.parametersById.get(n);
43
- r != null && t.push({
44
- id: r.parameterId,
45
- name: O(r.label, e.locale),
46
- units: y(r.units, e.locale),
47
- valueType: r.type,
48
- branchPath: []
49
- });
50
- }
51
- let n = [], r = /* @__PURE__ */ new Set();
52
- for (let t of e.mountedWidgets) {
53
- if (r.has(t.representationKey)) continue;
54
- let i = P(e.preset.representations[t.representationKey]);
55
- i != null && (r.add(t.representationKey), n.push({
56
- key: t.representationKey,
57
- type: i
58
- }));
59
- }
60
- return {
61
- kind: "report",
62
- presetId: e.preset.id,
63
- title: O(e.preset.title, e.locale),
64
- from: e.from,
65
- to: e.to,
66
- fromIso: A(e.from, e.timeZone),
67
- toIso: A(e.to, e.timeZone),
68
- timeZone: e.timeZone,
69
- followLive: e.followLive,
70
- visibleParameters: t,
71
- representations: n
72
- };
73
- }
74
- //#endregion
75
- //#region src/workspace/reports/runtime-chrome.ts
76
- function I(e) {
77
- return e.isTemporary ? {
78
- kind: "temporary",
79
- showSave: e.canWriteSetup,
80
- backTarget: e.canWriteSetup ? "parameters" : null
81
- } : {
82
- kind: "permanent",
83
- showEdit: e.canWriteSetup && e.showEditButton,
84
- backTarget: e.canWriteSetup ? "reports" : null
85
- };
86
- }
87
- //#endregion
88
- //#region src/workspace/reports/page.tsx
89
- var L = /* @__PURE__ */ e({ ReportPage: () => B });
90
- function R({ workspaceId: e, canWriteSetup: t, onEdit: i }) {
91
- let a = r(), s = n(), { preset: c, usedFullRangeFallback: l } = g(), u = I({
92
- isTemporary: c.isTemporary,
93
- canWriteSetup: t,
94
- showEditButton: c.showEditButton
95
- }), d = "\n text-muted-foreground\n hover:text-foreground\n ", f = u.kind === "permanent" && u.showEdit ? /* @__PURE__ */ S(o, {
96
- type: "button",
97
- variant: "ghost",
98
- size: "icon-sm",
99
- className: "\n text-muted-foreground\n hover:text-foreground\n ",
100
- "aria-label": a("report_runtime_edit"),
101
- onClick: i,
102
- children: /* @__PURE__ */ S(E, {})
103
- }) : u.kind === "temporary" && u.showSave ? /* @__PURE__ */ C(o, {
104
- type: "button",
105
- variant: "outline",
106
- size: "sm",
107
- "aria-label": a("report_save"),
108
- onClick: i,
109
- children: [/* @__PURE__ */ S(D, { "data-icon": "inline-start" }), a("report_save")]
110
- }) : null, m = u.backTarget === "parameters" ? /* @__PURE__ */ C(N, {
111
- to: "/workspace/$workspaceId/setup/parameters",
112
- params: { workspaceId: e },
113
- className: d,
114
- children: [/* @__PURE__ */ S(w, { "data-icon": "inline-start" }), a("setup_back_to_parameters")]
115
- }) : u.backTarget === "reports" ? /* @__PURE__ */ C(N, {
116
- to: "/workspace/$workspaceId/setup/reports",
117
- params: { workspaceId: e },
118
- className: d,
119
- children: [/* @__PURE__ */ S(w, { "data-icon": "inline-start" }), a("setup_back_to_reports")]
120
- }) : null;
121
- return /* @__PURE__ */ C(_, {
122
- icon: /* @__PURE__ */ S(T, {}),
123
- title: O(c.title, s),
124
- description: c.description != null && O(c.description, s).length > 0 ? O(c.description, s) : void 0,
125
- titleActions: f,
126
- actions: m,
127
- children: [l ? /* @__PURE__ */ S("p", {
128
- className: "text-xs text-muted-foreground",
129
- children: a("report_runtime_full_range_fallback")
130
- }) : null, /* @__PURE__ */ S(p, {})]
131
- });
132
- }
133
- function z({ workspaceId: e, canEdit: t }) {
134
- let r = n(), i = g(), { preset: a } = i, { getMountedWidgets: o } = d();
135
- c("report", b(() => F({
136
- preset: i.preset,
137
- from: i.from,
138
- to: i.to,
139
- timeZone: i.timeZone,
140
- followLive: i.followLive,
141
- visibleParameterIds: i.visibleParameterIds,
142
- parametersById: i.parametersById,
143
- mountedWidgets: o(),
144
- locale: r
145
- }), [
146
- r,
147
- o,
148
- i
149
- ]));
150
- let [s, u] = x(!1);
151
- return /* @__PURE__ */ C("div", {
152
- className: "mx-auto flex w-full max-w-6xl flex-1 flex-col",
153
- children: [
154
- /* @__PURE__ */ S(R, {
155
- workspaceId: e,
156
- canWriteSetup: t,
157
- onEdit: () => {
158
- u(!0);
159
- }
160
- }),
161
- /* @__PURE__ */ C("div", {
162
- className: "flex flex-1 flex-col gap-4 p-4",
163
- children: [/* @__PURE__ */ S(m, {}), /* @__PURE__ */ S(h, {})]
164
- }),
165
- s && t ? /* @__PURE__ */ S(l, {
166
- workspaceId: e,
167
- presetId: a.id,
168
- promoteTemporary: a.isTemporary,
169
- backdropBlur: !1,
170
- onClose: () => {
171
- u(!1);
172
- }
173
- }) : null
174
- ]
175
- });
176
- }
177
- function B({ workspaceId: e, presetId: n }) {
178
- let r = t.workspace.get.useQuery({ id: e }), i = t.report.preset.get.useQuery({ id: n });
179
- if (r.isLoading || i.isLoading) return /* @__PURE__ */ C("div", {
180
- className: "mx-auto flex w-full max-w-6xl flex-col gap-4 p-4",
181
- children: [
182
- /* @__PURE__ */ S(s, { className: "h-8 w-64" }),
183
- /* @__PURE__ */ S(s, { className: "h-10 w-full max-w-md" }),
184
- /* @__PURE__ */ S(s, { className: "h-40 w-full" })
185
- ]
186
- });
187
- if (i.isError || i.data == null) return /* @__PURE__ */ S("div", {
188
- className: "\n flex flex-1 flex-col items-center justify-center p-4\n sm:p-8\n ",
189
- children: /* @__PURE__ */ S(v, {
190
- message: u(i.error ?? "report_preset_not_found"),
191
- ...i.isError ? {
192
- onRetry: () => i.refetch(),
193
- retrying: i.isFetching
194
- } : {}
195
- })
196
- });
197
- let a = r.data != null && k(r.data.access), o = i.data;
198
- return /* @__PURE__ */ S(f, {
199
- workspaceId: e,
200
- preset: o,
201
- children: /* @__PURE__ */ S(z, {
202
- workspaceId: e,
203
- canEdit: a
204
- })
205
- }, `${e}:${o.id}:${o.updatedAt}`);
206
- }
207
- //#endregion
208
- export { L as n, N as r, B as t };
@@ -1,137 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { r as t } from "./trpc-CvJUuUXp.js";
3
- import { h as n, m as r, n as i } from "./i18n-BgzakKoC.js";
4
- import { a, d as o, i as s, t as c } from "./mutation-form-validators-BNz5bsv1.js";
5
- import { t as l } from "./button-6SxPBYMz.js";
6
- import { a as u, i as d, l as f, o as p, r as m, t as h } from "./dialog-BIhQXcZC.js";
7
- import { n as g } from "./skeleton-6yk8Tdh5.js";
8
- import { n as _ } from "./api-error-9rQmUN5L.js";
9
- import { u as v } from "./mutations-THtGG6Ai.js";
10
- import { t as y } from "./page-header-RB2YFWlE.js";
11
- import { r as b, t as x } from "./query-gate-DVhNIkge.js";
12
- import { t as S } from "./breadcrumbs-0cjsV2cq.js";
13
- import { a as C, c as w, d as T, i as E, l as D, n as O, o as k, r as A, s as j, t as M, u as N } from "./catalog-list-DjZojYLJ.js";
14
- import { t as P } from "./errors-CcsvDHu8.js";
15
- import { useState as F } from "react";
16
- import { jsx as I, jsxs as L } from "react/jsx-runtime";
17
- import { ChartLineIcon as R, PencilIcon as z, PlusIcon as B, Trash2Icon as V } from "lucide-react";
18
- import { formatAppDateTime as H, resolveLocalized as U } from "@overvis/hmi-shared";
19
- import { useNavigate as W } from "@tanstack/react-router";
20
- //#region src/workspace/setup/report/page.tsx
21
- var G = /* @__PURE__ */ e({ SetupReportsPage: () => K });
22
- function K({ workspaceId: e }) {
23
- let a = r(), o = i(), s = n(), c = W(), u = t.report.preset.list.useQuery({ workspaceId: e }), [d, f] = F(null);
24
- return /* @__PURE__ */ L(D, { children: [
25
- /* @__PURE__ */ I(y, {
26
- icon: /* @__PURE__ */ I(R, {}),
27
- breadcrumbs: /* @__PURE__ */ I(S, { workspaceId: e }),
28
- title: a("setup_reports_title"),
29
- description: a("setup_reports_description"),
30
- actions: /* @__PURE__ */ L(l, {
31
- type: "button",
32
- size: "sm",
33
- onClick: () => {
34
- c({
35
- to: "/workspace/$workspaceId/setup/reports/new",
36
- params: { workspaceId: e }
37
- });
38
- },
39
- children: [/* @__PURE__ */ I(B, { "data-icon": "inline-start" }), a("report_create_action")]
40
- })
41
- }),
42
- /* @__PURE__ */ I(O, { children: /* @__PURE__ */ I(b, {
43
- query: u,
44
- loading: /* @__PURE__ */ L("div", {
45
- className: "space-y-2",
46
- children: [/* @__PURE__ */ I(g, { className: "h-10 w-full" }), /* @__PURE__ */ I(g, { className: "h-10 w-4/5" })]
47
- }),
48
- error: (e) => /* @__PURE__ */ I(x, { message: _(e) }),
49
- isEmpty: (e) => e.reportPresets.length === 0,
50
- empty: /* @__PURE__ */ I(A, { children: a("setup_reports_empty") }),
51
- children: ({ reportPresets: t }) => /* @__PURE__ */ I(C, { children: t.map((t) => /* @__PURE__ */ L(N, {
52
- "data-context-report-preset-id": t.id,
53
- children: [/* @__PURE__ */ L(w, {
54
- to: "/workspace/$workspaceId/reports/$presetId",
55
- params: {
56
- workspaceId: e,
57
- presetId: t.id
58
- },
59
- children: [
60
- /* @__PURE__ */ I(j, { children: U(t.title, s) }),
61
- t.description != null && U(t.description, s).length > 0 ? /* @__PURE__ */ I(k, { children: U(t.description, s) }) : null,
62
- /* @__PURE__ */ I(k, { children: a("report_updated_at", { at: H(t.updatedAt) }) })
63
- ]
64
- }), /* @__PURE__ */ I(M, { children: /* @__PURE__ */ L(E, { children: [/* @__PURE__ */ I(T, {
65
- "aria-label": a("setup_report_edit_title"),
66
- onClick: () => {
67
- c({
68
- to: "/workspace/$workspaceId/setup/reports/$presetId",
69
- params: {
70
- workspaceId: e,
71
- presetId: t.id
72
- }
73
- });
74
- },
75
- children: /* @__PURE__ */ I(z, {})
76
- }), /* @__PURE__ */ I(T, {
77
- tone: "destructive",
78
- "aria-label": a("report_delete_action"),
79
- onClick: () => {
80
- f(t);
81
- },
82
- children: /* @__PURE__ */ I(V, {})
83
- })] }) })]
84
- }, t.id)) })
85
- }) }),
86
- /* @__PURE__ */ I(h, {
87
- open: d != null,
88
- onOpenChange: (e) => {
89
- e || f(null);
90
- },
91
- children: /* @__PURE__ */ I(m, { children: d ? /* @__PURE__ */ I(q, {
92
- workspaceId: e,
93
- presetId: d.id,
94
- baseRevision: d.revision,
95
- onCancel: () => {
96
- f(null);
97
- },
98
- onDeleted: () => {
99
- f(null), o.success(a("report_delete_toast"));
100
- }
101
- }) : null })
102
- })
103
- ] });
104
- }
105
- function q({ workspaceId: e, presetId: t, baseRevision: n, onCancel: i, onDeleted: m }) {
106
- let h = r(), g = v(e).remove, _ = a({
107
- defaultValues: {},
108
- validators: c({
109
- submit: async () => (await g.mutateAsync({
110
- id: t,
111
- baseRevision: n
112
- }), null),
113
- mapError: (e, t) => s(e, t, { message: P })
114
- }),
115
- onSubmitInvalid: o,
116
- onSubmit: () => {
117
- m();
118
- }
119
- });
120
- return /* @__PURE__ */ I(_.AppForm, { children: /* @__PURE__ */ L(_.FormRoot, {
121
- layout: "dialog",
122
- children: [/* @__PURE__ */ L(p, { children: [/* @__PURE__ */ I(f, { children: h("report_delete_confirm_title") }), /* @__PURE__ */ I(d, { children: h("report_delete_confirm_description") })] }), /* @__PURE__ */ L(u, { children: [/* @__PURE__ */ I(l, {
123
- type: "button",
124
- variant: "outline",
125
- onClick: () => {
126
- i();
127
- },
128
- children: h("action_cancel")
129
- }), /* @__PURE__ */ I(_.SubmitButton, {
130
- label: h("report_delete_confirm_submit"),
131
- pendingLabel: h("action_deleting"),
132
- variant: "destructive"
133
- })] })]
134
- }) });
135
- }
136
- //#endregion
137
- export { G as n, K as t };