@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.
- package/dist/alarm-list-DKFio0hg.js +414 -0
- package/dist/alarm-rule-dialog-mb4_nHRW.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-CfZXTWkK.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-DBLSkrrG.js} +15 -18
- package/dist/alert-dialog-D_iDv2lQ.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DLF9EnGV.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D5R6Fz74.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-BkWosvh1.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-DCM0KdMJ.js} +9 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-DLc11Vzu.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-Z2er-E5v.js} +4 -2
- package/dist/diagnostic-text-CYZFPiND.js +116 -0
- package/dist/{dialogs-D_v1LeH4.js → dialogs-BX023zml.js} +2523 -2590
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-DEOg9lxy.js} +219 -227
- package/dist/{display-DmOo23mi.js → display-VYGzneE0.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CGENZxbI.js} +3 -5
- package/dist/editor-page-CaN52OQh.js +1337 -0
- package/dist/{en-BgercpT0.js → en-CKPPL6bQ.js} +4 -2
- package/dist/entity-controls-DJT47yeV.js +71 -0
- package/dist/errors-BAWoH_5w.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-CbPMP8aq.js} +2404 -2515
- package/dist/host.js +8254 -675
- package/dist/{i18n-BgzakKoC.js → i18n-ChjEbYEg.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5168 -5353
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-Fa29SkaJ.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-DvXIYc1Z.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-V_0K0lO0.js} +54 -58
- package/dist/page-B5te_1Lc.js +449 -0
- package/dist/{page-v6LCwswN.js → page-BorlLnMX.js} +92 -100
- package/dist/page-DxF7FOve.js +507 -0
- package/dist/panel-DuZD-cBP.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-DVABrn5G.js} +4 -2
- package/dist/presence-code-DsabLTZs.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-BbIo1Xrj.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-BcZsfkCZ.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-C7EZsq8u.js} +4 -6
- package/dist/retention-note-CmMeHV_u.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-CBRLC_xM.js} +8 -6
- package/dist/run-text-CDdfbKbg.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-C6xQ_Hvo.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-D_SBfVzV.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-nNLG-AMz.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-B-KLtBjp.js} +182 -201
- package/dist/src/code-editor/code-editor.d.ts +3 -0
- package/dist/src/code-editor/taskfile-language.d.ts +22 -2
- package/dist/src/i18n/catalogs/de/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/de.d.ts +3 -0
- package/dist/src/i18n/catalogs/en/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/en.d.ts +3 -0
- package/dist/src/i18n/catalogs/pl/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/pl.d.ts +3 -0
- package/dist/src/i18n/catalogs/ru/edge-program.d.ts +5 -2
- package/dist/src/i18n/catalogs/ru/graphics.d.ts +2 -2
- package/dist/src/i18n/catalogs/ru.d.ts +7 -4
- package/dist/src/i18n/catalogs/uk/edge-program.d.ts +5 -2
- package/dist/src/i18n/catalogs/uk/graphics.d.ts +2 -2
- package/dist/src/i18n/catalogs/uk.d.ts +7 -4
- package/dist/src/version.d.ts +1 -1
- package/dist/src/workspace/graphics/inspector/item.d.ts +6 -6
- 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-7S3LmtGa.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-17pbVYZa.js} +8 -6
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-Clb-7xRY.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,26 +1,16 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-
|
|
2
|
-
import { r as t } from "./
|
|
3
|
-
import { f as
|
|
4
|
-
import {
|
|
5
|
-
import { A as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { n as te } from "./dialog-BqyIxMD-.js";
|
|
15
|
-
import { a as F, r as ne } from "./provider-DoEpKcQ-.js";
|
|
16
|
-
import { t as re } from "./page-header-RB2YFWlE.js";
|
|
17
|
-
import { n as ie, r as I, t as ae } from "./query-gate-DVhNIkge.js";
|
|
18
|
-
import { t as oe } from "./breadcrumbs-0cjsV2cq.js";
|
|
19
|
-
import { n as se, t as ce } from "./base-revision-YCO27zR4.js";
|
|
20
|
-
import { a as le, c as ue, d as L, i as de, l as fe, n as pe, o as me, r as he, s as ge, t as _e, u as ve } from "./catalog-list-DjZojYLJ.js";
|
|
21
|
-
import { useQuery as ye } from "@tanstack/react-query";
|
|
22
|
-
import { createElement as be, useRef as xe, useState as R } from "react";
|
|
23
|
-
import { DASHBOARD_ABI_VERSION as Se, DASHBOARD_ICON_IDS as Ce, DASHBOARD_MANIFEST_FILE as we, DEFAULT_DASHBOARD_ICON_ID as z, DEFAULT_DASHBOARD_TEMPLATE_ID as B, dashboardConfigurationIssues as Te, dashboardCopyFormSchema as V, dashboardCopyFormToInput as Ee, dashboardCreateFormToInput as De, dashboardCreateFromReportFormSchema as Oe, dashboardCreateFromReportFormToInput as ke, dashboardEntrypointUrl as Ae, dashboardManifestSchema as je, dashboardNameFormSchema as Me, dashboardSettingsFormSchema as Ne, dashboardSettingsFormToInput as Pe, dashboardSettingsFormValues as Fe, dashboardSupportedLocalesType as Ie, formatDashboardConfigurationIssues as Le, isDashboardConfigType as Re } from "@overvis/hmi-shared/dashboard";
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
+
import { $r as t, Bn as n, Fr as r, Ft as i, Gt as a, Hn as o, Kn as s, Mr as c, Qn as l, Wn as u, Wt as d, c as f, ii as p, kt as m, o as h, zn as g } from "./quick-report-BcZsfkCZ.js";
|
|
3
|
+
import { f as _, h as v, m as y, n as b } from "./i18n-ChjEbYEg.js";
|
|
4
|
+
import { $ as x, B as S, H as C, K as w, R as T, U as E, V as D, X as O, Y as ee, jt as k, xt as A } from "./alert-dialog-D_iDv2lQ.js";
|
|
5
|
+
import { A as te, B as j, H as M, L as N, M as P, V as F, z as I } from "./spinner-B-KLtBjp.js";
|
|
6
|
+
import { b as ne } from "./panel-DuZD-cBP.js";
|
|
7
|
+
import { n as re, r as L, t as ie } from "./query-gate-BbIo1Xrj.js";
|
|
8
|
+
import { t as ae } from "./breadcrumbs-D5R6Fz74.js";
|
|
9
|
+
import { n as oe, t as se } from "./base-revision-DLF9EnGV.js";
|
|
10
|
+
import { a as ce, c as le, d as R, i as ue, l as de, n as fe, o as pe, r as me, s as he, t as ge, u as _e } from "./catalog-list-BkWosvh1.js";
|
|
11
|
+
import { useQuery as ve } from "@tanstack/react-query";
|
|
12
|
+
import { createElement as ye, useRef as be, useState as z } from "react";
|
|
13
|
+
import { DASHBOARD_ABI_VERSION as xe, DASHBOARD_ICON_IDS as Se, DASHBOARD_MANIFEST_FILE as Ce, DEFAULT_DASHBOARD_ICON_ID as B, DEFAULT_DASHBOARD_TEMPLATE_ID as V, dashboardConfigurationIssues as we, dashboardCopyFormSchema as Te, dashboardCopyFormToInput as Ee, dashboardCreateFormToInput as De, dashboardCreateFromReportFormSchema as Oe, dashboardCreateFromReportFormToInput as ke, dashboardEntrypointUrl as Ae, dashboardManifestSchema as je, dashboardNameFormSchema as Me, dashboardSettingsFormSchema as Ne, dashboardSettingsFormToInput as Pe, dashboardSettingsFormValues as Fe, dashboardSupportedLocalesType as Ie, formatDashboardConfigurationIssues as Le, isDashboardConfigType as Re } from "@overvis/hmi-shared/dashboard";
|
|
24
14
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
25
15
|
import { Compile as ze } from "typebox/compile";
|
|
26
16
|
import { CopyIcon as Be, GripVerticalIcon as Ve, LayoutDashboardIcon as He, PencilIcon as Ue, PlusIcon as We, Trash2Icon as Ge, icons as G } from "lucide-react";
|
|
@@ -30,7 +20,7 @@ import { Accessibility as qe } from "@dnd-kit/dom";
|
|
|
30
20
|
import { DragDropProvider as Je } from "@dnd-kit/react";
|
|
31
21
|
import { isSortable as J, useSortable as Ye } from "@dnd-kit/react/sortable";
|
|
32
22
|
import { builtinGraphicsSymbolPrefix as Xe } from "@overvis/hmi-shared/graphics";
|
|
33
|
-
|
|
23
|
+
// src/workspace/dashboards/icon.tsx
|
|
34
24
|
function Ze(e) {
|
|
35
25
|
return e.split("-").map((e) => e.length === 0 ? "" : e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
36
26
|
}
|
|
@@ -43,7 +33,7 @@ function $e(e) {
|
|
|
43
33
|
let n = Reflect.get(G, t);
|
|
44
34
|
return Qe(n) ? n : void 0;
|
|
45
35
|
}
|
|
46
|
-
var et = $e(
|
|
36
|
+
var et = $e(B) ?? G.LayoutDashboard;
|
|
47
37
|
function tt(e) {
|
|
48
38
|
if (e != null) {
|
|
49
39
|
let t = e.trim();
|
|
@@ -55,16 +45,15 @@ function tt(e) {
|
|
|
55
45
|
return et;
|
|
56
46
|
}
|
|
57
47
|
function Y({ icon: e, className: t, strokeWidth: n }) {
|
|
58
|
-
return
|
|
48
|
+
return ye(tt(e), {
|
|
59
49
|
className: t,
|
|
60
50
|
strokeWidth: n,
|
|
61
51
|
"aria-hidden": !0
|
|
62
52
|
});
|
|
63
53
|
}
|
|
64
|
-
|
|
65
|
-
//#region src/workspace/dashboards/copy-dialog.tsx
|
|
54
|
+
// src/workspace/dashboards/copy-dialog.tsx
|
|
66
55
|
function nt(e, t) {
|
|
67
|
-
let n = q(), r =
|
|
56
|
+
let n = q(), r = be(null);
|
|
68
57
|
return {
|
|
69
58
|
record: (e) => {
|
|
70
59
|
r.current = e;
|
|
@@ -82,51 +71,50 @@ function nt(e, t) {
|
|
|
82
71
|
};
|
|
83
72
|
}
|
|
84
73
|
function rt({ workspaceId: e, dashboard: t, onClose: n }) {
|
|
85
|
-
let
|
|
86
|
-
for (;
|
|
87
|
-
let
|
|
88
|
-
defaultValues: { name:
|
|
89
|
-
validators:
|
|
90
|
-
schema:
|
|
74
|
+
let r = y(), a = v(), o = nt(e, n), c = i(e).copy, u = Array.from(K(t.name, a)), d = r("dashboard_copy_default_name", { name: u.join("") });
|
|
75
|
+
for (; u.length > 0 && Te["~standard"].validate({ name: d }).issues?.some((e) => e.keyword === "maxLength");) u.pop(), d = r("dashboard_copy_default_name", { name: u.join("") });
|
|
76
|
+
let f = s({
|
|
77
|
+
defaultValues: { name: d },
|
|
78
|
+
validators: g({
|
|
79
|
+
schema: Te,
|
|
91
80
|
submit: async (e) => {
|
|
92
|
-
let n = await
|
|
93
|
-
return
|
|
81
|
+
let n = await c.mutateAsync(Ee(e, t.id));
|
|
82
|
+
return o.record(n.id), null;
|
|
94
83
|
}
|
|
95
84
|
}),
|
|
96
|
-
onSubmitInvalid:
|
|
97
|
-
onSubmit:
|
|
85
|
+
onSubmitInvalid: l,
|
|
86
|
+
onSubmit: o.onSubmit
|
|
98
87
|
});
|
|
99
88
|
return /* @__PURE__ */ U(T, {
|
|
100
89
|
open: !0,
|
|
101
90
|
onOpenChange: (e) => {
|
|
102
91
|
e || n();
|
|
103
92
|
},
|
|
104
|
-
children: /* @__PURE__ */ U(
|
|
93
|
+
children: /* @__PURE__ */ U(S, { children: /* @__PURE__ */ U(f.AppForm, { children: /* @__PURE__ */ W(f.FormRoot, {
|
|
105
94
|
layout: "dialog",
|
|
106
95
|
children: [
|
|
107
|
-
/* @__PURE__ */ W(
|
|
108
|
-
/* @__PURE__ */ U(
|
|
96
|
+
/* @__PURE__ */ W(E, { children: [/* @__PURE__ */ U(w, { children: r("dashboard_copy_title") }), /* @__PURE__ */ U(D, { children: r("dashboard_copy_description") })] }),
|
|
97
|
+
/* @__PURE__ */ U(F, { children: /* @__PURE__ */ U(f.AppField, {
|
|
109
98
|
name: "name",
|
|
110
99
|
children: (e) => /* @__PURE__ */ U(e.TextField, {
|
|
111
|
-
label:
|
|
100
|
+
label: r("dashboard_field_name"),
|
|
112
101
|
autoFocus: !0
|
|
113
102
|
})
|
|
114
103
|
}) }),
|
|
115
|
-
/* @__PURE__ */ W(
|
|
104
|
+
/* @__PURE__ */ W(C, { children: [/* @__PURE__ */ U(k, {
|
|
116
105
|
type: "button",
|
|
117
106
|
variant: "outline",
|
|
118
107
|
onClick: n,
|
|
119
|
-
children:
|
|
120
|
-
}), /* @__PURE__ */ U(
|
|
121
|
-
label:
|
|
122
|
-
pendingLabel:
|
|
108
|
+
children: r("action_cancel")
|
|
109
|
+
}), /* @__PURE__ */ U(f.SubmitButton, {
|
|
110
|
+
label: r("dashboard_copy_action"),
|
|
111
|
+
pendingLabel: r("dashboard_copy_pending")
|
|
123
112
|
})] })
|
|
124
113
|
]
|
|
125
114
|
}) }) })
|
|
126
115
|
});
|
|
127
116
|
}
|
|
128
|
-
|
|
129
|
-
//#region src/workspace/dashboards/load-module.ts
|
|
117
|
+
// src/workspace/dashboards/load-module.ts
|
|
130
118
|
var it = [
|
|
131
119
|
"en",
|
|
132
120
|
"pl",
|
|
@@ -138,7 +126,7 @@ function ot(e) {
|
|
|
138
126
|
}
|
|
139
127
|
function st(e, t) {
|
|
140
128
|
if (!e.ok) return e.reason === "rebuild_required" ? { kind: "rebuild_required" } : { kind: "load_failed" };
|
|
141
|
-
let n =
|
|
129
|
+
let n = we(e.module.dashboardConfigType, t);
|
|
142
130
|
return n.length > 0 ? {
|
|
143
131
|
kind: "issues",
|
|
144
132
|
text: Le(n)
|
|
@@ -176,7 +164,7 @@ function lt(e) {
|
|
|
176
164
|
reason: "invalid_module"
|
|
177
165
|
};
|
|
178
166
|
let i = "graphicsSymbols" in e ? e.graphicsSymbols : [];
|
|
179
|
-
return !Array.isArray(i) || !i.every(
|
|
167
|
+
return !Array.isArray(i) || !i.every(h) || i.some((e) => e.id.startsWith(Xe)) || new Set([...f, ...i].map((e) => e.id)).size !== i.length + f.length ? {
|
|
180
168
|
ok: !1,
|
|
181
169
|
reason: "invalid_module"
|
|
182
170
|
} : {
|
|
@@ -192,7 +180,7 @@ function lt(e) {
|
|
|
192
180
|
var ut = /\/static\/dashboard\/[^/]+\/index\.js$/;
|
|
193
181
|
function dt(e) {
|
|
194
182
|
let t = e.search(/[?#]/), n = t < 0 ? e : e.slice(0, t), r = t < 0 ? "" : e.slice(t);
|
|
195
|
-
return ut.test(n) ? `${n.slice(0, -8)}${
|
|
183
|
+
return ut.test(n) ? `${n.slice(0, -8)}${Ce}${r}` : null;
|
|
196
184
|
}
|
|
197
185
|
async function ft(e) {
|
|
198
186
|
let t = await fetch(e, { headers: { Accept: "application/json" } });
|
|
@@ -205,7 +193,7 @@ async function ft(e) {
|
|
|
205
193
|
return !1;
|
|
206
194
|
}
|
|
207
195
|
let r = je["~standard"].validate(n);
|
|
208
|
-
return r.issues == null && r.value.abi ===
|
|
196
|
+
return r.issues == null && r.value.abi === xe;
|
|
209
197
|
}
|
|
210
198
|
async function pt(e) {
|
|
211
199
|
let t = dt(e);
|
|
@@ -217,8 +205,7 @@ async function pt(e) {
|
|
|
217
205
|
e
|
|
218
206
|
));
|
|
219
207
|
}
|
|
220
|
-
|
|
221
|
-
//#region src/workspace/dashboards/entrypoint.ts
|
|
208
|
+
// src/workspace/dashboards/entrypoint.ts
|
|
222
209
|
async function mt(e) {
|
|
223
210
|
try {
|
|
224
211
|
let t = await fetch(e, {
|
|
@@ -242,10 +229,10 @@ async function ht(e) {
|
|
|
242
229
|
};
|
|
243
230
|
}
|
|
244
231
|
function gt(e) {
|
|
245
|
-
let { mode: t, getDashboardEntrypointUrl: n } =
|
|
246
|
-
return
|
|
232
|
+
let { mode: t, getDashboardEntrypointUrl: n } = r();
|
|
233
|
+
return ve({
|
|
247
234
|
queryKey: [
|
|
248
|
-
|
|
235
|
+
a,
|
|
249
236
|
t,
|
|
250
237
|
e
|
|
251
238
|
],
|
|
@@ -258,8 +245,7 @@ function gt(e) {
|
|
|
258
245
|
retry: !1
|
|
259
246
|
});
|
|
260
247
|
}
|
|
261
|
-
|
|
262
|
-
//#region src/workspace/dashboards/stylesheet.ts
|
|
248
|
+
// src/workspace/dashboards/stylesheet.ts
|
|
263
249
|
var _t = "data-overvis-dashboard-css", vt = 0;
|
|
264
250
|
function yt() {
|
|
265
251
|
return vt += 1, String(vt);
|
|
@@ -281,11 +267,7 @@ function bt(e, t) {
|
|
|
281
267
|
let o = (n) => {
|
|
282
268
|
r.signal.removeEventListener("abort", l), t.removeEventListener("load", s), t.removeEventListener("error", c), e(n);
|
|
283
269
|
}, s = () => {
|
|
284
|
-
|
|
285
|
-
t.remove(), o("missing");
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
o("ok");
|
|
270
|
+
i ? (t.remove(), o("missing")) : o("ok");
|
|
289
271
|
}, c = () => {
|
|
290
272
|
t.remove(), a === t && (a = null), o("missing");
|
|
291
273
|
}, l = () => {
|
|
@@ -298,17 +280,16 @@ function bt(e, t) {
|
|
|
298
280
|
}
|
|
299
281
|
};
|
|
300
282
|
}
|
|
301
|
-
|
|
302
|
-
//#region src/workspace/dashboards/enabled-switch.tsx
|
|
283
|
+
// src/workspace/dashboards/enabled-switch.tsx
|
|
303
284
|
function Z({ workspaceId: e, dashboard: t, compact: n = !1, className: r }) {
|
|
304
|
-
let
|
|
285
|
+
let a = y(), o = b(), { enable: s, disable: c } = i(e), l = (e) => ({
|
|
305
286
|
onSuccess: () => {
|
|
306
|
-
|
|
287
|
+
o.success(e);
|
|
307
288
|
},
|
|
308
289
|
onError: (e) => {
|
|
309
|
-
|
|
290
|
+
o.error(u(e));
|
|
310
291
|
}
|
|
311
|
-
});
|
|
292
|
+
}), d = t.disabledSince == null, f = c.isPending || s.isPending;
|
|
312
293
|
return /* @__PURE__ */ W("div", {
|
|
313
294
|
className: r,
|
|
314
295
|
onClick: (e) => {
|
|
@@ -319,39 +300,38 @@ function Z({ workspaceId: e, dashboard: t, compact: n = !1, className: r }) {
|
|
|
319
300
|
},
|
|
320
301
|
children: [/* @__PURE__ */ W("div", {
|
|
321
302
|
className: "flex items-center gap-2",
|
|
322
|
-
children: [/* @__PURE__ */ U(
|
|
323
|
-
checked:
|
|
324
|
-
disabled:
|
|
303
|
+
children: [/* @__PURE__ */ U(x, {
|
|
304
|
+
checked: d,
|
|
305
|
+
disabled: f,
|
|
325
306
|
size: "sm",
|
|
326
|
-
"aria-label":
|
|
307
|
+
"aria-label": a("dashboard_enabled_label"),
|
|
327
308
|
onCheckedChange: (e) => {
|
|
328
|
-
e ?
|
|
309
|
+
e ? s.mutate({
|
|
329
310
|
id: t.id,
|
|
330
311
|
baseRevision: t.revision
|
|
331
|
-
},
|
|
312
|
+
}, l(a("dashboard_enable_toast"))) : c.mutate({
|
|
332
313
|
id: t.id,
|
|
333
314
|
baseRevision: t.revision
|
|
334
|
-
},
|
|
315
|
+
}, l(a("dashboard_disable_toast")));
|
|
335
316
|
}
|
|
336
317
|
}), n ? null : /* @__PURE__ */ U("span", {
|
|
337
318
|
className: "text-sm text-muted-foreground",
|
|
338
|
-
children:
|
|
319
|
+
children: a("dashboard_enabled_label")
|
|
339
320
|
})]
|
|
340
321
|
}), !n && t.disabledSince != null ? /* @__PURE__ */ U("p", {
|
|
341
322
|
className: "mt-1 text-xs text-muted-foreground",
|
|
342
|
-
children:
|
|
323
|
+
children: a("dashboard_disabled_since", { since: Ke(t.disabledSince) })
|
|
343
324
|
}) : null]
|
|
344
325
|
});
|
|
345
326
|
}
|
|
346
327
|
function xt({ dashboard: e }) {
|
|
347
|
-
let t =
|
|
328
|
+
let t = y();
|
|
348
329
|
return e.disabledSince == null ? null : /* @__PURE__ */ U("span", {
|
|
349
330
|
className: "\n inline-flex shrink-0 items-center rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium\n text-muted-foreground\n ",
|
|
350
331
|
children: t("dashboard_disabled_badge")
|
|
351
332
|
});
|
|
352
333
|
}
|
|
353
|
-
|
|
354
|
-
//#region src/workspace/setup/dashboards-order.ts
|
|
334
|
+
// src/workspace/setup/dashboards-order.ts
|
|
355
335
|
function St(e) {
|
|
356
336
|
let { ids: t, fromIndex: n, toIndex: r } = e;
|
|
357
337
|
if (!Number.isInteger(n) || !Number.isInteger(r) || n < 0 || r < 0 || n >= t.length || r >= t.length || n === r) return null;
|
|
@@ -368,8 +348,7 @@ function Ct(e, t) {
|
|
|
368
348
|
for (let t of e) i.has(t.id) || (r.push(t), i.add(t.id));
|
|
369
349
|
return r;
|
|
370
350
|
}
|
|
371
|
-
|
|
372
|
-
//#region src/workspace/setup/dashboards-reorder-queue.ts
|
|
351
|
+
// src/workspace/setup/dashboards-reorder-queue.ts
|
|
373
352
|
function wt() {
|
|
374
353
|
let e = 0, t = null, n = !1;
|
|
375
354
|
async function r() {
|
|
@@ -399,8 +378,7 @@ function wt() {
|
|
|
399
378
|
}, r();
|
|
400
379
|
} };
|
|
401
380
|
}
|
|
402
|
-
|
|
403
|
-
//#region src/workspace/setup/dashboards-sortable-list.tsx
|
|
381
|
+
// src/workspace/setup/dashboards-sortable-list.tsx
|
|
404
382
|
function Q(e) {
|
|
405
383
|
let t = e.data;
|
|
406
384
|
return typeof t == "object" && t && "name" in t && typeof t.name == "string" ? t.name : "";
|
|
@@ -410,119 +388,119 @@ function Tt({ workspaceId: e, dashboards: t, onDelete: n }) {
|
|
|
410
388
|
workspaceId: e,
|
|
411
389
|
dashboards: t,
|
|
412
390
|
onDelete: n
|
|
413
|
-
}) : /* @__PURE__ */ U(
|
|
391
|
+
}) : /* @__PURE__ */ U(ce, { children: t.map((t) => /* @__PURE__ */ U(Ot, {
|
|
414
392
|
workspaceId: e,
|
|
415
393
|
dashboard: t,
|
|
416
394
|
onDelete: n
|
|
417
395
|
}, t.id)) });
|
|
418
396
|
}
|
|
419
|
-
function Et({ workspaceId: e, dashboards:
|
|
420
|
-
let
|
|
397
|
+
function Et({ workspaceId: e, dashboards: t, onDelete: n }) {
|
|
398
|
+
let r = y(), i = b(), a = p.useUtils(), o = p.dashboard.reorder.useMutation(), [s, c] = z(null), l = s ?? t, f = l.length, [m] = z(() => wt());
|
|
421
399
|
return /* @__PURE__ */ U(Je, {
|
|
422
400
|
plugins: (e) => [...e, qe.configure({
|
|
423
|
-
screenReaderInstructions: { draggable:
|
|
401
|
+
screenReaderInstructions: { draggable: r("dashboard_reorder_keyboard_instructions") },
|
|
424
402
|
announcements: {
|
|
425
403
|
dragstart(e) {
|
|
426
404
|
let t = e.operation.source;
|
|
427
|
-
if (J(t)) return
|
|
405
|
+
if (J(t)) return r("dashboard_reorder_announcement_start", {
|
|
428
406
|
name: Q(t),
|
|
429
407
|
position: t.index + 1,
|
|
430
|
-
total:
|
|
408
|
+
total: f
|
|
431
409
|
});
|
|
432
410
|
},
|
|
433
411
|
dragover(e) {
|
|
434
412
|
let t = e.operation.source;
|
|
435
|
-
if (J(t)) return
|
|
413
|
+
if (J(t)) return r("dashboard_reorder_announcement_move", {
|
|
436
414
|
name: Q(t),
|
|
437
415
|
position: t.index + 1,
|
|
438
|
-
total:
|
|
416
|
+
total: f
|
|
439
417
|
});
|
|
440
418
|
},
|
|
441
419
|
dragend(e) {
|
|
442
420
|
let t = e.operation.source;
|
|
443
|
-
if (J(t)) return e.canceled ?
|
|
421
|
+
if (J(t)) return e.canceled ? r("dashboard_reorder_announcement_cancel", {
|
|
444
422
|
name: Q(t),
|
|
445
423
|
position: t.initialIndex + 1,
|
|
446
|
-
total:
|
|
447
|
-
}) :
|
|
424
|
+
total: f
|
|
425
|
+
}) : r("dashboard_reorder_announcement_drop", {
|
|
448
426
|
name: Q(t),
|
|
449
427
|
position: t.index + 1,
|
|
450
|
-
total:
|
|
428
|
+
total: f
|
|
451
429
|
});
|
|
452
430
|
}
|
|
453
431
|
}
|
|
454
432
|
})],
|
|
455
433
|
onDragStart: () => {
|
|
456
|
-
|
|
434
|
+
c(t);
|
|
457
435
|
},
|
|
458
|
-
onDragEnd: (
|
|
459
|
-
let r =
|
|
460
|
-
if (
|
|
461
|
-
let { source:
|
|
462
|
-
if (!J(
|
|
463
|
-
let
|
|
436
|
+
onDragEnd: (n) => {
|
|
437
|
+
let r = s ?? t;
|
|
438
|
+
if (c(null), n.canceled) return;
|
|
439
|
+
let { source: l } = n.operation;
|
|
440
|
+
if (!J(l)) return;
|
|
441
|
+
let f = St({
|
|
464
442
|
ids: r.map((e) => e.id),
|
|
465
|
-
fromIndex:
|
|
466
|
-
toIndex:
|
|
443
|
+
fromIndex: l.initialIndex,
|
|
444
|
+
toIndex: l.index
|
|
467
445
|
});
|
|
468
|
-
|
|
469
|
-
send: (t) =>
|
|
446
|
+
f != null && (a.dashboard.list.setData({ workspaceId: e }, (e) => ({ dashboards: Ct(e?.dashboards ?? r, f) })), m.enqueue(f, {
|
|
447
|
+
send: (t) => o.mutateAsync({
|
|
470
448
|
workspaceId: e,
|
|
471
449
|
ids: t
|
|
472
450
|
}),
|
|
473
451
|
onLatestSuccess: (t) => {
|
|
474
452
|
let n = t.dashboards.map((e) => e.id);
|
|
475
|
-
|
|
453
|
+
a.dashboard.list.setData({ workspaceId: e }, (e) => e == null ? t : { dashboards: Ct(e.dashboards, n) });
|
|
476
454
|
},
|
|
477
455
|
onLatestFailure: (t) => {
|
|
478
|
-
|
|
456
|
+
i.error(u(t)), d(a, {
|
|
479
457
|
entity: "dashboard",
|
|
480
458
|
workspaceId: e
|
|
481
459
|
});
|
|
482
460
|
}
|
|
483
461
|
}));
|
|
484
462
|
},
|
|
485
|
-
children: /* @__PURE__ */ U(
|
|
463
|
+
children: /* @__PURE__ */ U(ce, { children: l.map((t, r) => /* @__PURE__ */ U(Dt, {
|
|
486
464
|
workspaceId: e,
|
|
487
465
|
dashboard: t,
|
|
488
|
-
index:
|
|
489
|
-
onDelete:
|
|
466
|
+
index: r,
|
|
467
|
+
onDelete: n
|
|
490
468
|
}, t.id)) })
|
|
491
469
|
});
|
|
492
470
|
}
|
|
493
|
-
function Dt({ workspaceId: e, dashboard: t, index: n, onDelete:
|
|
494
|
-
let
|
|
471
|
+
function Dt({ workspaceId: e, dashboard: t, index: n, onDelete: r }) {
|
|
472
|
+
let i = v(), a = K(t.name, i), { ref: o, handleRef: s, isDragging: c } = Ye({
|
|
495
473
|
id: t.id,
|
|
496
474
|
index: n,
|
|
497
|
-
data: { name:
|
|
475
|
+
data: { name: a }
|
|
498
476
|
});
|
|
499
477
|
return /* @__PURE__ */ U(Ot, {
|
|
500
478
|
workspaceId: e,
|
|
501
479
|
dashboard: t,
|
|
502
|
-
onDelete:
|
|
503
|
-
sortableRef:
|
|
504
|
-
handleRef:
|
|
505
|
-
isDragging:
|
|
480
|
+
onDelete: r,
|
|
481
|
+
sortableRef: o,
|
|
482
|
+
handleRef: s,
|
|
483
|
+
isDragging: c
|
|
506
484
|
});
|
|
507
485
|
}
|
|
508
|
-
function Ot({ workspaceId: e, dashboard: t, onDelete: n, sortableRef:
|
|
509
|
-
let
|
|
510
|
-
return /* @__PURE__ */ W(
|
|
511
|
-
ref:
|
|
486
|
+
function Ot({ workspaceId: e, dashboard: t, onDelete: n, sortableRef: r, handleRef: i, isDragging: a = !1 }) {
|
|
487
|
+
let o = y(), s = v(), l = q(), u = c(), [d, f] = z(!1), p = t.description == null ? "" : K(t.description, s);
|
|
488
|
+
return /* @__PURE__ */ W(_e, {
|
|
489
|
+
ref: r,
|
|
512
490
|
"data-context-dashboard-id": t.id,
|
|
513
491
|
className: `
|
|
514
|
-
${
|
|
515
|
-
${
|
|
492
|
+
${i == null ? "" : "gap-2"}
|
|
493
|
+
${a ? "border-b-transparent" : ""}
|
|
516
494
|
`,
|
|
517
495
|
children: [
|
|
518
|
-
|
|
496
|
+
i == null ? null : /* @__PURE__ */ U("button", {
|
|
519
497
|
type: "button",
|
|
520
|
-
"aria-label":
|
|
498
|
+
"aria-label": o("dashboard_reorder_handle"),
|
|
521
499
|
className: "\n -ml-1 flex h-7 w-4 shrink-0 cursor-grab touch-none items-center justify-center\n text-muted-foreground/50 transition-colors outline-none\n hover:text-muted-foreground\n focus-visible:rounded-sm focus-visible:ring-2 focus-visible:ring-ring\n active:cursor-grabbing\n [&_svg]:size-3.5\n ",
|
|
522
|
-
ref:
|
|
500
|
+
ref: i,
|
|
523
501
|
children: /* @__PURE__ */ U(Ve, {})
|
|
524
502
|
}),
|
|
525
|
-
/* @__PURE__ */ W(
|
|
503
|
+
/* @__PURE__ */ W(le, {
|
|
526
504
|
to: "/workspace/$workspaceId/d/$dashboardId",
|
|
527
505
|
params: {
|
|
528
506
|
workspaceId: e,
|
|
@@ -537,26 +515,26 @@ function Ot({ workspaceId: e, dashboard: t, onDelete: n, sortableRef: a, handleR
|
|
|
537
515
|
className: "min-w-0",
|
|
538
516
|
children: [/* @__PURE__ */ W("div", {
|
|
539
517
|
className: "flex min-w-0 items-center gap-2",
|
|
540
|
-
children: [/* @__PURE__ */ U(
|
|
541
|
-
}),
|
|
518
|
+
children: [/* @__PURE__ */ U(he, { children: K(t.name, s) }), /* @__PURE__ */ U(xt, { dashboard: t })]
|
|
519
|
+
}), p.length > 0 ? /* @__PURE__ */ U(pe, { children: p }) : null]
|
|
542
520
|
})]
|
|
543
521
|
}),
|
|
544
|
-
/* @__PURE__ */ W(
|
|
522
|
+
/* @__PURE__ */ W(ge, { children: [/* @__PURE__ */ U(Z, {
|
|
545
523
|
workspaceId: e,
|
|
546
524
|
dashboard: t,
|
|
547
525
|
compact: !0
|
|
548
|
-
}), /* @__PURE__ */ W(
|
|
549
|
-
|
|
550
|
-
"aria-label":
|
|
526
|
+
}), /* @__PURE__ */ W(ue, { children: [
|
|
527
|
+
u ? /* @__PURE__ */ U(R, {
|
|
528
|
+
"aria-label": o("dashboard_copy_action"),
|
|
551
529
|
onClick: () => {
|
|
552
|
-
|
|
530
|
+
f(!0);
|
|
553
531
|
},
|
|
554
532
|
children: /* @__PURE__ */ U(Be, {})
|
|
555
533
|
}) : null,
|
|
556
|
-
/* @__PURE__ */ U(
|
|
557
|
-
"aria-label":
|
|
534
|
+
/* @__PURE__ */ U(R, {
|
|
535
|
+
"aria-label": o("dashboard_edit_settings"),
|
|
558
536
|
onClick: () => {
|
|
559
|
-
|
|
537
|
+
l({
|
|
560
538
|
to: "/workspace/$workspaceId/setup/dashboards/$dashboardId",
|
|
561
539
|
params: {
|
|
562
540
|
workspaceId: e,
|
|
@@ -566,27 +544,26 @@ function Ot({ workspaceId: e, dashboard: t, onDelete: n, sortableRef: a, handleR
|
|
|
566
544
|
},
|
|
567
545
|
children: /* @__PURE__ */ U(Ue, {})
|
|
568
546
|
}),
|
|
569
|
-
/* @__PURE__ */ U(
|
|
547
|
+
/* @__PURE__ */ U(R, {
|
|
570
548
|
tone: "destructive",
|
|
571
|
-
"aria-label":
|
|
549
|
+
"aria-label": o("dashboard_delete_action"),
|
|
572
550
|
onClick: () => {
|
|
573
551
|
n(t);
|
|
574
552
|
},
|
|
575
553
|
children: /* @__PURE__ */ U(Ge, {})
|
|
576
554
|
})
|
|
577
555
|
] })] }),
|
|
578
|
-
|
|
556
|
+
d ? /* @__PURE__ */ U(rt, {
|
|
579
557
|
workspaceId: e,
|
|
580
558
|
dashboard: t,
|
|
581
559
|
onClose: () => {
|
|
582
|
-
|
|
560
|
+
f(!1);
|
|
583
561
|
}
|
|
584
562
|
}) : null
|
|
585
563
|
]
|
|
586
564
|
});
|
|
587
565
|
}
|
|
588
|
-
|
|
589
|
-
//#region src/workspace/setup/dashboards-page.tsx
|
|
566
|
+
// src/workspace/setup/dashboards-page.tsx
|
|
590
567
|
var kt = /* @__PURE__ */ e({
|
|
591
568
|
CreateDashboardForm: () => Nt,
|
|
592
569
|
CreateDashboardFromReportForm: () => jt,
|
|
@@ -595,409 +572,409 @@ var kt = /* @__PURE__ */ e({
|
|
|
595
572
|
SetupDashboardsPage: () => At
|
|
596
573
|
});
|
|
597
574
|
function At({ workspaceId: e }) {
|
|
598
|
-
let
|
|
599
|
-
return /* @__PURE__ */ W(
|
|
600
|
-
/* @__PURE__ */ U(
|
|
575
|
+
let t = y(), n = b(), r = q(), i = p.dashboard.list.useQuery({ workspaceId: e }), [a, o] = z(null);
|
|
576
|
+
return /* @__PURE__ */ W(de, { children: [
|
|
577
|
+
/* @__PURE__ */ U(ne, {
|
|
601
578
|
icon: /* @__PURE__ */ U(He, {}),
|
|
602
|
-
breadcrumbs: /* @__PURE__ */ U(
|
|
603
|
-
title:
|
|
604
|
-
description:
|
|
605
|
-
actions: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W(
|
|
579
|
+
breadcrumbs: /* @__PURE__ */ U(ae, { workspaceId: e }),
|
|
580
|
+
title: t("setup_dashboards_title"),
|
|
581
|
+
description: t("setup_dashboards_description"),
|
|
582
|
+
actions: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W(k, {
|
|
606
583
|
type: "button",
|
|
607
584
|
size: "sm",
|
|
608
585
|
variant: "outline",
|
|
609
586
|
onClick: () => {
|
|
610
|
-
|
|
587
|
+
r({
|
|
611
588
|
to: "/workspace/$workspaceId/setup/dashboards/new-from-report",
|
|
612
589
|
params: { workspaceId: e }
|
|
613
590
|
});
|
|
614
591
|
},
|
|
615
|
-
children: [/* @__PURE__ */ U(We, { "data-icon": "inline-start" }),
|
|
616
|
-
}), /* @__PURE__ */ W(
|
|
592
|
+
children: [/* @__PURE__ */ U(We, { "data-icon": "inline-start" }), t("dashboard_create_from_report_action")]
|
|
593
|
+
}), /* @__PURE__ */ W(k, {
|
|
617
594
|
type: "button",
|
|
618
595
|
size: "sm",
|
|
619
596
|
onClick: () => {
|
|
620
|
-
|
|
597
|
+
r({
|
|
621
598
|
to: "/workspace/$workspaceId/setup/dashboards/new",
|
|
622
599
|
params: { workspaceId: e }
|
|
623
600
|
});
|
|
624
601
|
},
|
|
625
|
-
children: [/* @__PURE__ */ U(We, { "data-icon": "inline-start" }),
|
|
602
|
+
children: [/* @__PURE__ */ U(We, { "data-icon": "inline-start" }), t("dashboard_create_action")]
|
|
626
603
|
})] })
|
|
627
604
|
}),
|
|
628
|
-
/* @__PURE__ */ U(
|
|
629
|
-
query:
|
|
605
|
+
/* @__PURE__ */ U(fe, { children: /* @__PURE__ */ U(L, {
|
|
606
|
+
query: i,
|
|
630
607
|
loading: /* @__PURE__ */ W("div", {
|
|
631
608
|
className: "space-y-2",
|
|
632
|
-
children: [/* @__PURE__ */ U(
|
|
609
|
+
children: [/* @__PURE__ */ U(A, { className: "h-10 w-full" }), /* @__PURE__ */ U(A, { className: "h-10 w-4/5" })]
|
|
633
610
|
}),
|
|
634
|
-
error: (e) => /* @__PURE__ */ U(
|
|
611
|
+
error: (e) => /* @__PURE__ */ U(ie, { message: u(e) }),
|
|
635
612
|
isEmpty: (e) => e.dashboards.length === 0,
|
|
636
|
-
empty: /* @__PURE__ */ U(
|
|
613
|
+
empty: /* @__PURE__ */ U(me, { children: t("setup_dashboards_empty") }),
|
|
637
614
|
children: ({ dashboards: t }) => /* @__PURE__ */ U(Tt, {
|
|
638
615
|
workspaceId: e,
|
|
639
616
|
dashboards: t,
|
|
640
|
-
onDelete:
|
|
617
|
+
onDelete: o
|
|
641
618
|
})
|
|
642
619
|
}) }),
|
|
643
620
|
/* @__PURE__ */ U(T, {
|
|
644
|
-
open:
|
|
621
|
+
open: a != null,
|
|
645
622
|
onOpenChange: (e) => {
|
|
646
|
-
e ||
|
|
623
|
+
e || o(null);
|
|
647
624
|
},
|
|
648
|
-
children: /* @__PURE__ */ U(
|
|
625
|
+
children: /* @__PURE__ */ U(S, { children: a ? /* @__PURE__ */ U(It, {
|
|
649
626
|
workspaceId: e,
|
|
650
|
-
dashboardId:
|
|
651
|
-
baseRevision:
|
|
627
|
+
dashboardId: a.id,
|
|
628
|
+
baseRevision: a.revision,
|
|
652
629
|
onCancel: () => {
|
|
653
|
-
|
|
630
|
+
o(null);
|
|
654
631
|
},
|
|
655
632
|
onDeleted: () => {
|
|
656
|
-
|
|
633
|
+
o(null), n.success(t("dashboard_delete_toast"));
|
|
657
634
|
}
|
|
658
635
|
}) : null })
|
|
659
636
|
})
|
|
660
637
|
] });
|
|
661
638
|
}
|
|
662
|
-
function jt({ workspaceId: e, onCancel: n, onCreated:
|
|
663
|
-
let
|
|
639
|
+
function jt({ workspaceId: e, onCancel: n, onCreated: r }) {
|
|
640
|
+
let a = y(), o = b(), c = v(), u = p.report.preset.list.useQuery({ workspaceId: e }), d = u.data?.reportPresets ?? [], f = u.isLoading, m = u.isError, h = !f && !m && d.length === 0, _ = f || m || h, x = i(e).create, S = s({
|
|
664
641
|
defaultValues: {
|
|
665
642
|
name: "",
|
|
666
643
|
presetId: ""
|
|
667
644
|
},
|
|
668
|
-
validators:
|
|
645
|
+
validators: g({
|
|
669
646
|
schema: Oe,
|
|
670
|
-
submit: async (t) => (await
|
|
647
|
+
submit: async (t) => (await x.mutateAsync(ke(t, {
|
|
671
648
|
workspaceId: e,
|
|
672
|
-
report:
|
|
673
|
-
locale:
|
|
649
|
+
report: d.find((e) => e.id === t.presetId),
|
|
650
|
+
locale: c
|
|
674
651
|
})), null)
|
|
675
652
|
}),
|
|
676
|
-
onSubmitInvalid:
|
|
653
|
+
onSubmitInvalid: l,
|
|
677
654
|
onSubmit: () => {
|
|
678
|
-
|
|
655
|
+
o.success(a("dashboard_create_toast")), r();
|
|
679
656
|
}
|
|
680
657
|
});
|
|
681
|
-
return /* @__PURE__ */ U(
|
|
658
|
+
return /* @__PURE__ */ U(S.AppForm, { children: /* @__PURE__ */ W(S.FormRoot, {
|
|
682
659
|
layout: "dialog",
|
|
683
660
|
children: [
|
|
684
|
-
/* @__PURE__ */ W(
|
|
685
|
-
/* @__PURE__ */ W(
|
|
661
|
+
/* @__PURE__ */ W(E, { children: [/* @__PURE__ */ U(w, { children: a("dashboard_create_from_report_title") }), /* @__PURE__ */ U(D, { children: a("dashboard_create_from_report_description") })] }),
|
|
662
|
+
/* @__PURE__ */ W(F, { children: [/* @__PURE__ */ U(S.AppField, {
|
|
686
663
|
name: "presetId",
|
|
687
664
|
children: (e) => {
|
|
688
|
-
let
|
|
689
|
-
return /* @__PURE__ */ W(
|
|
690
|
-
"data-invalid":
|
|
665
|
+
let n = !e.state.meta.isValid, r = t(e.state.meta.errors, e.name);
|
|
666
|
+
return /* @__PURE__ */ W(N, {
|
|
667
|
+
"data-invalid": n ? !0 : void 0,
|
|
691
668
|
children: [
|
|
692
|
-
/* @__PURE__ */ U(
|
|
669
|
+
/* @__PURE__ */ U(M, {
|
|
693
670
|
htmlFor: "setup-dashboard-from-report-preset",
|
|
694
|
-
children:
|
|
671
|
+
children: a("dashboard_create_from_report_field_preset")
|
|
695
672
|
}),
|
|
696
|
-
/* @__PURE__ */ U(
|
|
673
|
+
/* @__PURE__ */ U(te, {
|
|
697
674
|
id: "setup-dashboard-from-report-preset",
|
|
698
675
|
className: "w-full",
|
|
699
676
|
value: e.state.value,
|
|
700
|
-
disabled:
|
|
677
|
+
disabled: _,
|
|
701
678
|
onBlur: e.handleBlur,
|
|
702
679
|
onChange: (t) => {
|
|
703
680
|
let n = t.target.value;
|
|
704
681
|
e.handleChange(n);
|
|
705
|
-
let r =
|
|
706
|
-
r != null &&
|
|
682
|
+
let r = d.find((e) => e.id === n);
|
|
683
|
+
r != null && S.setFieldValue("name", K(r.title, c));
|
|
707
684
|
},
|
|
708
|
-
"aria-invalid":
|
|
709
|
-
children:
|
|
685
|
+
"aria-invalid": n || void 0,
|
|
686
|
+
children: f ? /* @__PURE__ */ U(P, {
|
|
710
687
|
value: "",
|
|
711
|
-
children:
|
|
712
|
-
}) :
|
|
688
|
+
children: a("dashboard_create_from_report_preset_loading")
|
|
689
|
+
}) : m ? /* @__PURE__ */ U(P, {
|
|
713
690
|
value: "",
|
|
714
|
-
children:
|
|
715
|
-
}) :
|
|
691
|
+
children: a("dashboard_create_from_report_preset_error")
|
|
692
|
+
}) : h ? /* @__PURE__ */ U(P, {
|
|
716
693
|
value: "",
|
|
717
|
-
children:
|
|
718
|
-
}) : /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
694
|
+
children: a("dashboard_create_from_report_preset_empty")
|
|
695
|
+
}) : /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(P, {
|
|
719
696
|
value: "",
|
|
720
|
-
children:
|
|
721
|
-
}),
|
|
697
|
+
children: a("dashboard_create_from_report_preset_placeholder")
|
|
698
|
+
}), d.map((e) => /* @__PURE__ */ U(P, {
|
|
722
699
|
value: e.id,
|
|
723
|
-
children: K(e.title,
|
|
700
|
+
children: K(e.title, c)
|
|
724
701
|
}, e.id))] })
|
|
725
702
|
}),
|
|
726
|
-
/* @__PURE__ */ U(
|
|
703
|
+
/* @__PURE__ */ U(j, { errors: r })
|
|
727
704
|
]
|
|
728
705
|
});
|
|
729
706
|
}
|
|
730
|
-
}), /* @__PURE__ */ U(
|
|
707
|
+
}), /* @__PURE__ */ U(S.AppField, {
|
|
731
708
|
name: "name",
|
|
732
709
|
children: (e) => /* @__PURE__ */ U(e.TextField, {
|
|
733
|
-
label:
|
|
710
|
+
label: a("dashboard_field_name"),
|
|
734
711
|
id: "setup-dashboard-from-report-name"
|
|
735
712
|
})
|
|
736
713
|
})] }),
|
|
737
|
-
/* @__PURE__ */ W(
|
|
714
|
+
/* @__PURE__ */ W(C, { children: [/* @__PURE__ */ U(k, {
|
|
738
715
|
type: "button",
|
|
739
716
|
variant: "outline",
|
|
740
717
|
onClick: () => {
|
|
741
718
|
n();
|
|
742
719
|
},
|
|
743
|
-
children:
|
|
744
|
-
}), /* @__PURE__ */ U(
|
|
745
|
-
label:
|
|
746
|
-
pendingLabel:
|
|
747
|
-
disabled:
|
|
720
|
+
children: a("action_cancel")
|
|
721
|
+
}), /* @__PURE__ */ U(S.SubmitButton, {
|
|
722
|
+
label: a("dashboard_create_from_report_submit"),
|
|
723
|
+
pendingLabel: a("action_creating"),
|
|
724
|
+
disabled: _
|
|
748
725
|
})] })
|
|
749
726
|
]
|
|
750
727
|
}) });
|
|
751
728
|
}
|
|
752
|
-
function Mt({ workspaceId: e, templateId:
|
|
753
|
-
let
|
|
729
|
+
function Mt({ workspaceId: e, templateId: t }) {
|
|
730
|
+
let n = y(), r = v(), i = p.templates.dashboard.get.useQuery({
|
|
754
731
|
workspaceId: e,
|
|
755
|
-
templateId:
|
|
732
|
+
templateId: t
|
|
756
733
|
});
|
|
757
|
-
if (
|
|
734
|
+
if (i.isPending) return /* @__PURE__ */ W("div", {
|
|
758
735
|
className: "grid gap-1.5",
|
|
759
736
|
"aria-busy": "true",
|
|
760
737
|
"data-testid": "dashboard-template-description",
|
|
761
|
-
children: [/* @__PURE__ */ U(
|
|
738
|
+
children: [/* @__PURE__ */ U(A, { className: "h-4 w-full" }), /* @__PURE__ */ U(A, { className: "h-4 w-2/3" })]
|
|
762
739
|
});
|
|
763
|
-
if (
|
|
740
|
+
if (i.isError) return /* @__PURE__ */ U(I, {
|
|
764
741
|
className: "text-destructive",
|
|
765
742
|
role: "alert",
|
|
766
743
|
"data-testid": "dashboard-template-description",
|
|
767
|
-
children:
|
|
744
|
+
children: n("dashboard_create_template_description_error")
|
|
768
745
|
});
|
|
769
|
-
let
|
|
770
|
-
return
|
|
746
|
+
let a = i.data.description;
|
|
747
|
+
return a == null ? null : /* @__PURE__ */ U(I, {
|
|
771
748
|
"data-testid": "dashboard-template-description",
|
|
772
|
-
children: K(
|
|
749
|
+
children: K(a, r)
|
|
773
750
|
});
|
|
774
751
|
}
|
|
775
|
-
function Nt({ workspaceId: e, onCancel:
|
|
776
|
-
let
|
|
752
|
+
function Nt({ workspaceId: e, onCancel: n, onCreated: r }) {
|
|
753
|
+
let a = y(), o = b(), c = v(), u = i(e).create, d = p.templates.dashboard.list.useQuery({ workspaceId: e }), f = d.data?.templates ?? [], m = d.isLoading, h = d.isError, x = !m && !h && f.length === 0, S = s({
|
|
777
754
|
defaultValues: {
|
|
778
|
-
name:
|
|
779
|
-
template:
|
|
755
|
+
name: a("dashboard_default_name"),
|
|
756
|
+
template: V
|
|
780
757
|
},
|
|
781
|
-
validators:
|
|
758
|
+
validators: g({
|
|
782
759
|
schema: Me,
|
|
783
|
-
submit: async (t) => (await
|
|
760
|
+
submit: async (t) => (await u.mutateAsync(De(t, {
|
|
784
761
|
workspaceId: e,
|
|
785
|
-
defaultName:
|
|
762
|
+
defaultName: _("dashboard_default_name")
|
|
786
763
|
})), null)
|
|
787
764
|
}),
|
|
788
|
-
onSubmitInvalid:
|
|
765
|
+
onSubmitInvalid: l,
|
|
789
766
|
onSubmit: () => {
|
|
790
|
-
|
|
767
|
+
o.success(a("dashboard_create_toast")), r();
|
|
791
768
|
}
|
|
792
|
-
}),
|
|
793
|
-
return /* @__PURE__ */ U(
|
|
769
|
+
}), T = c, D = m || h || x;
|
|
770
|
+
return /* @__PURE__ */ U(S.AppForm, { children: /* @__PURE__ */ W(S.FormRoot, {
|
|
794
771
|
layout: "dialog",
|
|
795
772
|
children: [
|
|
796
|
-
/* @__PURE__ */ U(
|
|
797
|
-
/* @__PURE__ */ W(
|
|
773
|
+
/* @__PURE__ */ U(E, { children: /* @__PURE__ */ U(w, { children: a("dashboard_create_title") }) }),
|
|
774
|
+
/* @__PURE__ */ W(F, { children: [/* @__PURE__ */ U(S.AppField, {
|
|
798
775
|
name: "template",
|
|
799
|
-
children: (
|
|
800
|
-
let
|
|
801
|
-
return /* @__PURE__ */ W(
|
|
802
|
-
/* @__PURE__ */ U(
|
|
776
|
+
children: (n) => {
|
|
777
|
+
let r = f.find((e) => e.id === n.state.value);
|
|
778
|
+
return /* @__PURE__ */ W(N, { children: [
|
|
779
|
+
/* @__PURE__ */ U(M, {
|
|
803
780
|
htmlFor: "setup-dashboard-template",
|
|
804
|
-
children:
|
|
781
|
+
children: a("dashboard_create_field_template")
|
|
805
782
|
}),
|
|
806
|
-
/* @__PURE__ */ U(
|
|
783
|
+
/* @__PURE__ */ U(te, {
|
|
807
784
|
id: "setup-dashboard-template",
|
|
808
|
-
value:
|
|
809
|
-
disabled:
|
|
810
|
-
onBlur:
|
|
785
|
+
value: n.state.value,
|
|
786
|
+
disabled: D,
|
|
787
|
+
onBlur: n.handleBlur,
|
|
811
788
|
onChange: (e) => {
|
|
812
|
-
|
|
789
|
+
n.handleChange(e.target.value);
|
|
813
790
|
},
|
|
814
|
-
children:
|
|
815
|
-
value:
|
|
791
|
+
children: m ? /* @__PURE__ */ U(P, {
|
|
792
|
+
value: V,
|
|
816
793
|
disabled: !0,
|
|
817
|
-
children:
|
|
818
|
-
}) :
|
|
819
|
-
value:
|
|
794
|
+
children: a("dashboard_create_template_loading")
|
|
795
|
+
}) : h ? /* @__PURE__ */ U(P, {
|
|
796
|
+
value: V,
|
|
820
797
|
disabled: !0,
|
|
821
|
-
children:
|
|
822
|
-
}) :
|
|
823
|
-
value:
|
|
798
|
+
children: a("dashboard_create_template_error")
|
|
799
|
+
}) : x ? /* @__PURE__ */ U(P, {
|
|
800
|
+
value: V,
|
|
824
801
|
disabled: !0,
|
|
825
|
-
children:
|
|
826
|
-
}) :
|
|
802
|
+
children: a("dashboard_create_template_empty")
|
|
803
|
+
}) : f.map((e) => /* @__PURE__ */ U(P, {
|
|
827
804
|
value: e.id,
|
|
828
|
-
children: K(e.name,
|
|
805
|
+
children: K(e.name, T)
|
|
829
806
|
}, e.id))
|
|
830
807
|
}),
|
|
831
|
-
|
|
808
|
+
r == null ? null : /* @__PURE__ */ U(Mt, {
|
|
832
809
|
workspaceId: e,
|
|
833
|
-
templateId:
|
|
810
|
+
templateId: r.id
|
|
834
811
|
}),
|
|
835
|
-
/* @__PURE__ */ U(
|
|
812
|
+
/* @__PURE__ */ U(j, { errors: t(n.state.meta.errors, n.name) })
|
|
836
813
|
] });
|
|
837
814
|
}
|
|
838
|
-
}), /* @__PURE__ */ U(
|
|
815
|
+
}), /* @__PURE__ */ U(S.AppField, {
|
|
839
816
|
name: "name",
|
|
840
817
|
children: (e) => /* @__PURE__ */ U(e.TextField, {
|
|
841
|
-
label:
|
|
818
|
+
label: a("dashboard_field_name"),
|
|
842
819
|
id: "setup-dashboard-name",
|
|
843
820
|
autoFocus: !0
|
|
844
821
|
})
|
|
845
822
|
})] }),
|
|
846
|
-
/* @__PURE__ */ W(
|
|
823
|
+
/* @__PURE__ */ W(C, { children: [/* @__PURE__ */ U(k, {
|
|
847
824
|
type: "button",
|
|
848
825
|
variant: "outline",
|
|
849
826
|
onClick: () => {
|
|
850
|
-
|
|
827
|
+
n();
|
|
851
828
|
},
|
|
852
|
-
children:
|
|
853
|
-
}), /* @__PURE__ */ U(
|
|
854
|
-
label:
|
|
855
|
-
pendingLabel:
|
|
856
|
-
disabled:
|
|
829
|
+
children: a("action_cancel")
|
|
830
|
+
}), /* @__PURE__ */ U(S.SubmitButton, {
|
|
831
|
+
label: a("dashboard_create_submit"),
|
|
832
|
+
pendingLabel: a("action_creating"),
|
|
833
|
+
disabled: D
|
|
857
834
|
})] })
|
|
858
835
|
]
|
|
859
836
|
}) });
|
|
860
837
|
}
|
|
861
|
-
function $({ workspaceId: e, dashboardId:
|
|
862
|
-
let
|
|
863
|
-
return /* @__PURE__ */ U(
|
|
838
|
+
function $({ workspaceId: e, dashboardId: t, onClose: n }) {
|
|
839
|
+
let r = y(), i = v(), a = p.dashboard.get.useQuery({ id: t }), o = p.useUtils(), s = gt(t), c = a.data, l = s.data, [u, d] = z(0);
|
|
840
|
+
return /* @__PURE__ */ U(L, {
|
|
864
841
|
query: {
|
|
865
|
-
isLoading:
|
|
866
|
-
isError:
|
|
867
|
-
error:
|
|
868
|
-
data:
|
|
869
|
-
dashboard:
|
|
870
|
-
entrypoint:
|
|
842
|
+
isLoading: a.isLoading || s.isLoading || l == null,
|
|
843
|
+
isError: a.isError,
|
|
844
|
+
error: a.error,
|
|
845
|
+
data: c != null && l != null ? {
|
|
846
|
+
dashboard: c,
|
|
847
|
+
entrypoint: l
|
|
871
848
|
} : void 0
|
|
872
849
|
},
|
|
873
850
|
loading: /* @__PURE__ */ W("div", {
|
|
874
851
|
className: "flex flex-col gap-4 p-4",
|
|
875
|
-
children: [/* @__PURE__ */ U(
|
|
852
|
+
children: [/* @__PURE__ */ U(A, { className: "h-8 w-48" }), /* @__PURE__ */ U(A, { className: "h-40 w-full" })]
|
|
876
853
|
}),
|
|
877
|
-
error: () => /* @__PURE__ */ U(
|
|
854
|
+
error: () => /* @__PURE__ */ U(re, {
|
|
878
855
|
className: "p-4",
|
|
879
|
-
message:
|
|
880
|
-
onRetry: () =>
|
|
856
|
+
message: r("error_request_failed"),
|
|
857
|
+
onRetry: () => a.refetch()
|
|
881
858
|
}),
|
|
882
|
-
children: ({ dashboard:
|
|
859
|
+
children: ({ dashboard: r, entrypoint: a }) => /* @__PURE__ */ U(Ft, {
|
|
883
860
|
workspaceId: e,
|
|
884
|
-
dashboardId:
|
|
885
|
-
entrypointUrl:
|
|
886
|
-
initialConfiguration:
|
|
887
|
-
initialRevision:
|
|
888
|
-
defaultValues: Fe(
|
|
889
|
-
onDone:
|
|
861
|
+
dashboardId: r.id,
|
|
862
|
+
entrypointUrl: a.url,
|
|
863
|
+
initialConfiguration: r.configuration,
|
|
864
|
+
initialRevision: r.revision,
|
|
865
|
+
defaultValues: Fe(r, i),
|
|
866
|
+
onDone: n,
|
|
890
867
|
onReload: async () => {
|
|
891
|
-
let e = await
|
|
892
|
-
|
|
868
|
+
let e = await o.client.dashboard.get.query({ id: t });
|
|
869
|
+
o.dashboard.get.setData({ id: t }, e), d((e) => e + 1);
|
|
893
870
|
}
|
|
894
|
-
}, `${
|
|
871
|
+
}, `${r.id}-${String(u)}`)
|
|
895
872
|
});
|
|
896
873
|
}
|
|
897
874
|
function Pt({ problem: e }) {
|
|
898
875
|
switch (e) {
|
|
899
|
-
case "configuration_invalid_json": return
|
|
900
|
-
case "configuration_must_be_object": return
|
|
901
|
-
case "name_required": return
|
|
876
|
+
case "configuration_invalid_json": return _("dashboard_config_invalid_json");
|
|
877
|
+
case "configuration_must_be_object": return _("dashboard_config_must_be_object");
|
|
878
|
+
case "name_required": return _("error_field_required");
|
|
902
879
|
}
|
|
903
880
|
}
|
|
904
|
-
function Ft({ workspaceId: e, dashboardId:
|
|
905
|
-
let
|
|
906
|
-
let e = await
|
|
907
|
-
|
|
908
|
-
},
|
|
909
|
-
id:
|
|
881
|
+
function Ft({ workspaceId: e, dashboardId: t, entrypointUrl: r, initialConfiguration: a, initialRevision: c, defaultValues: u, onDone: d, onReload: f }) {
|
|
882
|
+
let h = y(), v = b(), [x, S] = z(() => a), C = oe(c), w = p.useUtils(), T = async () => {
|
|
883
|
+
let e = await w.client.dashboard.get.query({ id: t });
|
|
884
|
+
S(e.configuration), C.rebase(e.revision);
|
|
885
|
+
}, E = p.dashboard.getSourceFile.useQuery({
|
|
886
|
+
id: t,
|
|
910
887
|
path: "config.schema.json"
|
|
911
|
-
}),
|
|
912
|
-
defaultValues:
|
|
913
|
-
validators:
|
|
888
|
+
}), D = i(e).update, A = s({
|
|
889
|
+
defaultValues: u,
|
|
890
|
+
validators: g({
|
|
914
891
|
schema: Ne,
|
|
915
892
|
submit: async (e) => {
|
|
916
|
-
let
|
|
917
|
-
id:
|
|
918
|
-
expectedConfiguration:
|
|
893
|
+
let i = Pe(e, {
|
|
894
|
+
id: t,
|
|
895
|
+
expectedConfiguration: x
|
|
919
896
|
});
|
|
920
|
-
if (!
|
|
897
|
+
if (!i.ok) return n(i, Pt);
|
|
921
898
|
try {
|
|
922
|
-
let e = st(await pt(X(
|
|
923
|
-
if (e?.kind === "load_failed") return { fields: { configurationText: () =>
|
|
924
|
-
if (e?.kind === "rebuild_required") return { fields: { configurationText: () =>
|
|
899
|
+
let e = st(await pt(X(r, yt())), i.input.configuration);
|
|
900
|
+
if (e?.kind === "load_failed") return { fields: { configurationText: () => _("dashboard_config_schema_load_failed") } };
|
|
901
|
+
if (e?.kind === "rebuild_required") return { fields: { configurationText: () => _("dashboard_rebuild_required_description") } };
|
|
925
902
|
if (e?.kind === "issues") return { fields: { configurationText: e.text } };
|
|
926
903
|
} catch {
|
|
927
|
-
return { fields: { configurationText: () =>
|
|
904
|
+
return { fields: { configurationText: () => _("dashboard_config_schema_load_failed") } };
|
|
928
905
|
}
|
|
929
|
-
return await
|
|
930
|
-
...
|
|
931
|
-
...
|
|
906
|
+
return await D.mutateAsync({
|
|
907
|
+
...i.input,
|
|
908
|
+
...C.baseRevision === void 0 ? {} : { baseRevision: C.baseRevision }
|
|
932
909
|
}), null;
|
|
933
910
|
},
|
|
934
|
-
mapError:
|
|
935
|
-
onError:
|
|
911
|
+
mapError: C.mapError((e, t) => o(e, t, { fieldMap: { configuration: "configurationText" } })),
|
|
912
|
+
onError: C.onError
|
|
936
913
|
}),
|
|
937
|
-
onSubmitInvalid:
|
|
914
|
+
onSubmitInvalid: l,
|
|
938
915
|
onSubmit: () => {
|
|
939
|
-
|
|
916
|
+
d(), v.success(h("dashboard_update_toast"));
|
|
940
917
|
}
|
|
941
918
|
});
|
|
942
|
-
return /* @__PURE__ */ U(
|
|
919
|
+
return /* @__PURE__ */ U(A.AppForm, { children: /* @__PURE__ */ U(A.FormRoot, {
|
|
943
920
|
layout: "dialog-fill",
|
|
944
|
-
children: /* @__PURE__ */ U(
|
|
945
|
-
notice: /* @__PURE__ */ U(
|
|
946
|
-
base:
|
|
947
|
-
onReload:
|
|
948
|
-
onKeepMine:
|
|
921
|
+
children: /* @__PURE__ */ U(m, {
|
|
922
|
+
notice: /* @__PURE__ */ U(se, {
|
|
923
|
+
base: C,
|
|
924
|
+
onReload: f,
|
|
925
|
+
onKeepMine: T
|
|
949
926
|
}),
|
|
950
|
-
footer: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
927
|
+
footer: /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(k, {
|
|
951
928
|
type: "button",
|
|
952
929
|
variant: "outline",
|
|
953
930
|
onClick: () => {
|
|
954
|
-
|
|
931
|
+
d();
|
|
955
932
|
},
|
|
956
|
-
children:
|
|
957
|
-
}), /* @__PURE__ */ U(
|
|
958
|
-
label:
|
|
959
|
-
pendingLabel:
|
|
933
|
+
children: h("action_cancel")
|
|
934
|
+
}), /* @__PURE__ */ U(A.SubmitButton, {
|
|
935
|
+
label: h("dashboard_settings_save"),
|
|
936
|
+
pendingLabel: h("action_saving")
|
|
960
937
|
})] }),
|
|
961
|
-
children: /* @__PURE__ */ W(
|
|
962
|
-
/* @__PURE__ */ U(
|
|
938
|
+
children: /* @__PURE__ */ W(F, { children: [
|
|
939
|
+
/* @__PURE__ */ U(A.AppField, {
|
|
963
940
|
name: "name",
|
|
964
941
|
children: (e) => /* @__PURE__ */ U(e.TextField, {
|
|
965
|
-
label:
|
|
942
|
+
label: h("dashboard_field_name"),
|
|
966
943
|
id: "setup-edit-dashboard-name"
|
|
967
944
|
})
|
|
968
945
|
}),
|
|
969
|
-
/* @__PURE__ */ U(
|
|
946
|
+
/* @__PURE__ */ U(A.AppField, {
|
|
970
947
|
name: "description",
|
|
971
948
|
children: (e) => /* @__PURE__ */ U(e.TextAreaField, {
|
|
972
|
-
label:
|
|
949
|
+
label: h("dashboard_field_description"),
|
|
973
950
|
id: "setup-edit-dashboard-description",
|
|
974
951
|
rows: 3
|
|
975
952
|
})
|
|
976
953
|
}),
|
|
977
|
-
/* @__PURE__ */ U(
|
|
954
|
+
/* @__PURE__ */ U(A.AppField, {
|
|
978
955
|
name: "icon",
|
|
979
956
|
children: (e) => {
|
|
980
|
-
let t = e.state.value, n = t === "" || t ===
|
|
981
|
-
return /* @__PURE__ */ W(
|
|
957
|
+
let t = e.state.value, n = t === "" || t === B ? B : t;
|
|
958
|
+
return /* @__PURE__ */ W(N, { children: [/* @__PURE__ */ U(M, { children: h("dashboard_field_icon") }), /* @__PURE__ */ W(ee, {
|
|
982
959
|
variant: "outline",
|
|
983
960
|
size: "sm",
|
|
984
961
|
spacing: 2,
|
|
985
962
|
value: [n],
|
|
986
963
|
onValueChange: (t) => {
|
|
987
964
|
let n = t[0];
|
|
988
|
-
n != null && e.handleChange(n ===
|
|
965
|
+
n != null && e.handleChange(n === B ? "" : n);
|
|
989
966
|
},
|
|
990
967
|
className: "grid w-full grid-cols-8",
|
|
991
|
-
children: [/* @__PURE__ */ U(
|
|
992
|
-
value:
|
|
993
|
-
"aria-label":
|
|
968
|
+
children: [/* @__PURE__ */ U(O, {
|
|
969
|
+
value: B,
|
|
970
|
+
"aria-label": h("dashboard_field_icon_default"),
|
|
994
971
|
className: "size-8 min-w-8 p-0 text-muted-foreground",
|
|
995
972
|
children: /* @__PURE__ */ U(Y, {
|
|
996
973
|
icon: null,
|
|
997
974
|
className: "size-4",
|
|
998
975
|
strokeWidth: 1.75
|
|
999
976
|
})
|
|
1000
|
-
}),
|
|
977
|
+
}), Se.filter((e) => e !== B).map((e) => /* @__PURE__ */ U(O, {
|
|
1001
978
|
value: e,
|
|
1002
979
|
"aria-label": e,
|
|
1003
980
|
className: "size-8 min-w-8 p-0 text-muted-foreground",
|
|
@@ -1010,19 +987,19 @@ function Ft({ workspaceId: e, dashboardId: r, entrypointUrl: s, initialConfigura
|
|
|
1010
987
|
})] });
|
|
1011
988
|
}
|
|
1012
989
|
}),
|
|
1013
|
-
/* @__PURE__ */ U(
|
|
990
|
+
/* @__PURE__ */ U(A.AppField, {
|
|
1014
991
|
name: "configurationText",
|
|
1015
992
|
children: (e) => /* @__PURE__ */ U(e.TextAreaField, {
|
|
1016
|
-
label:
|
|
993
|
+
label: h("dashboard_field_configuration"),
|
|
1017
994
|
id: "setup-edit-dashboard-config",
|
|
1018
995
|
spellCheck: !1,
|
|
1019
996
|
className: "\n min-h-40 font-mono\n md:text-xs\n "
|
|
1020
997
|
})
|
|
1021
998
|
}),
|
|
1022
|
-
/* @__PURE__ */ W(
|
|
1023
|
-
query:
|
|
1024
|
-
loading: /* @__PURE__ */ U(
|
|
1025
|
-
error: () => /* @__PURE__ */ U(
|
|
999
|
+
/* @__PURE__ */ W(N, { children: [/* @__PURE__ */ U(M, { children: h("dashboard_config_schema_title") }), /* @__PURE__ */ U(L, {
|
|
1000
|
+
query: E,
|
|
1001
|
+
loading: /* @__PURE__ */ U(I, { children: h("dashboard_config_schema_loading") }),
|
|
1002
|
+
error: () => /* @__PURE__ */ U(I, { children: h("dashboard_config_schema_missing") }),
|
|
1026
1003
|
children: (e) => /* @__PURE__ */ U("pre", {
|
|
1027
1004
|
className: "\n max-h-48 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs\n ",
|
|
1028
1005
|
children: e
|
|
@@ -1033,32 +1010,31 @@ function Ft({ workspaceId: e, dashboardId: r, entrypointUrl: s, initialConfigura
|
|
|
1033
1010
|
}) });
|
|
1034
1011
|
}
|
|
1035
1012
|
function It({ workspaceId: e, dashboardId: t, baseRevision: n, onCancel: r, onDeleted: a }) {
|
|
1036
|
-
let
|
|
1013
|
+
let o = y(), c = i(e).remove, u = s({
|
|
1037
1014
|
defaultValues: {},
|
|
1038
|
-
validators:
|
|
1015
|
+
validators: g({ submit: async () => (await c.mutateAsync({
|
|
1039
1016
|
id: t,
|
|
1040
1017
|
baseRevision: n
|
|
1041
1018
|
}), null) }),
|
|
1042
|
-
onSubmitInvalid:
|
|
1019
|
+
onSubmitInvalid: l,
|
|
1043
1020
|
onSubmit: () => {
|
|
1044
1021
|
a();
|
|
1045
1022
|
}
|
|
1046
1023
|
});
|
|
1047
1024
|
return /* @__PURE__ */ U(u.AppForm, { children: /* @__PURE__ */ W(u.FormRoot, {
|
|
1048
1025
|
layout: "dialog",
|
|
1049
|
-
children: [/* @__PURE__ */ W(
|
|
1026
|
+
children: [/* @__PURE__ */ W(E, { children: [/* @__PURE__ */ U(w, { children: o("dashboard_delete_confirm_title") }), /* @__PURE__ */ U(D, { children: o("dashboard_delete_confirm_description") })] }), /* @__PURE__ */ W(C, { children: [/* @__PURE__ */ U(k, {
|
|
1050
1027
|
type: "button",
|
|
1051
1028
|
variant: "outline",
|
|
1052
1029
|
onClick: () => {
|
|
1053
1030
|
r();
|
|
1054
1031
|
},
|
|
1055
|
-
children:
|
|
1032
|
+
children: o("action_cancel")
|
|
1056
1033
|
}), /* @__PURE__ */ U(u.SubmitButton, {
|
|
1057
|
-
label:
|
|
1058
|
-
pendingLabel:
|
|
1034
|
+
label: o("dashboard_delete_confirm_submit"),
|
|
1035
|
+
pendingLabel: o("action_deleting"),
|
|
1059
1036
|
variant: "destructive"
|
|
1060
1037
|
})] })]
|
|
1061
1038
|
}) });
|
|
1062
1039
|
}
|
|
1063
|
-
//#endregion
|
|
1064
1040
|
export { kt as a, yt as c, gt as d, pt as f, Y as h, At as i, bt as l, rt as m, jt as n, xt as o, ot as p, $ as r, Z as s, Nt as t, X as u };
|