@burdenoff/microfe-bigconsole 2026.712.1 → 2026.713.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/bigconsole/assistant/createSandboxAssistantTransport.js +144 -69
- package/dist/bigconsole/assistant/createSandboxAssistantTransport.js.map +1 -1
- package/dist/bigconsole/components/builder/BuilderCanvas.js +21 -0
- package/dist/bigconsole/components/builder/BuilderCanvas.js.map +1 -0
- package/dist/bigconsole/components/builder/BuilderTopbar.js +33 -0
- package/dist/bigconsole/components/builder/BuilderTopbar.js.map +1 -0
- package/dist/bigconsole/components/builder/DashboardEditorShell.js +20 -0
- package/dist/bigconsole/components/builder/DashboardEditorShell.js.map +1 -0
- package/dist/bigconsole/components/builder/WidgetInspector.js +14 -0
- package/dist/bigconsole/components/builder/WidgetInspector.js.map +1 -0
- package/dist/bigconsole/components/builder/index.js +4 -0
- package/dist/bigconsole/components/builder/inspector/AdvancedSection.js +45 -0
- package/dist/bigconsole/components/builder/inspector/AdvancedSection.js.map +1 -0
- package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +43 -0
- package/dist/bigconsole/components/builder/inspector/AppearanceSection.js.map +1 -0
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +124 -0
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -0
- package/dist/bigconsole/components/builder/inspector/GeneralSection.js +50 -0
- package/dist/bigconsole/components/builder/inspector/GeneralSection.js.map +1 -0
- package/dist/bigconsole/components/builder/inspector/index.js +4 -0
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +221 -199
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +145 -102
- package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
- package/dist/bigconsole/components/dashboard/index.js +4 -0
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +529 -742
- package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -226
- package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
- package/dist/bigconsole/pages/DashboardBuilderPage.js +221 -316
- package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
- package/dist/bigconsole/utils/widgetBinding.js +115 -0
- package/dist/bigconsole/utils/widgetBinding.js.map +1 -0
- package/package.json +2 -2
- package/dist/bigconsole/components/widgets/WidgetConfigDialog.js +0 -883
- package/dist/bigconsole/components/widgets/WidgetConfigDialog.js.map +0 -1
- package/dist/bigconsole/components/widgets/WidgetTypeSelector.js +0 -311
- package/dist/bigconsole/components/widgets/WidgetTypeSelector.js.map +0 -1
|
@@ -1,174 +1,151 @@
|
|
|
1
1
|
import { useWidgetStore as e } from "../store/widgetStore.js";
|
|
2
2
|
import { useDashboardStore as t } from "../store/dashboardStore.js";
|
|
3
3
|
import "../store/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useBigConsoleNavigate as n } from "../context/BigConsoleContext.js";
|
|
5
5
|
import "../context/index.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import s from "../hooks/useDashboardOperations.js";
|
|
10
|
-
import c from "../hooks/usePageOperations.js";
|
|
6
|
+
import r from "../hooks/useWidgetOperations.js";
|
|
7
|
+
import i from "../hooks/useDashboardOperations.js";
|
|
8
|
+
import a from "../hooks/usePageOperations.js";
|
|
11
9
|
import "../hooks/index.js";
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
10
|
+
import { BuilderCanvas as o } from "../components/builder/BuilderCanvas.js";
|
|
11
|
+
import { BuilderTopbar as s } from "../components/builder/BuilderTopbar.js";
|
|
12
|
+
import { DashboardEditorShell as c } from "../components/builder/DashboardEditorShell.js";
|
|
13
|
+
import "../components/builder/index.js";
|
|
14
|
+
import { findNextAvailablePosition as l } from "../utils/widgetPositioning.js";
|
|
15
|
+
import u from "../components/dashboard/DashboardCanvas.js";
|
|
16
|
+
import d from "../components/dashboard/ExportDashboardDialog.js";
|
|
16
17
|
import "../components/dashboard/index.js";
|
|
17
|
-
import { memo as
|
|
18
|
-
import { useParams as
|
|
19
|
-
import {
|
|
20
|
-
import { Button as te } from "@burdenoff/fe-libs/ui";
|
|
21
|
-
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
18
|
+
import { memo as f, useCallback as p, useEffect as m, useState as h } from "react";
|
|
19
|
+
import { useParams as g } from "react-router-dom";
|
|
20
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
22
21
|
//#region src/bigconsole/pages/DashboardBuilderPage.tsx
|
|
23
|
-
function
|
|
22
|
+
function y() {
|
|
24
23
|
try {
|
|
25
24
|
return window.__breadcrumbRegistry;
|
|
26
25
|
} catch {
|
|
27
26
|
return;
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
|
-
function
|
|
31
|
-
let n =
|
|
29
|
+
function b(e, t) {
|
|
30
|
+
let n = y();
|
|
32
31
|
n?.register && n.register(e, t);
|
|
33
32
|
}
|
|
34
|
-
function
|
|
35
|
-
let t =
|
|
33
|
+
function x(e) {
|
|
34
|
+
let t = y();
|
|
36
35
|
t?.unregister && t.unregister(e);
|
|
37
36
|
}
|
|
38
|
-
var S =
|
|
39
|
-
let { dashboardId:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}), [E, D] = g(!1), [re, O] = g(!1), [ie, k] = g(!1), [A, j] = g(null), { fetchDashboard: M, updateDashboard: N, loading: P, error: F } = s(), { createWidget: I, updateWidget: L, deleteWidget: R, duplicateWidget: z, batchUpdatePositions: B } = o(void 0, p), { createPage: V, updatePage: H, deletePage: U, reorderPages: W } = c(), G = t((e) => e.setCurrentDashboard), K = t((e) => e.currentDashboard), q = t((e) => e.setViewMode), J = e((e) => e.selectWidget), Y = e((e) => e.widgets), X = e((e) => e.clipboardWidgetId), Z = e((e) => e.clipboardAction), Q = e((e) => e.clearClipboard);
|
|
44
|
-
h(() => (q("edit"), () => q("view")), [q]), h(() => {
|
|
45
|
-
if (!p) {
|
|
46
|
-
b("/dashboards");
|
|
37
|
+
var S = f(function() {
|
|
38
|
+
let { dashboardId: f } = g(), y = n(), [S, C] = h(!1), [w, T] = h(null), [E, D] = h(!1), [O, k] = h(null), { fetchDashboard: A, updateDashboard: j, loading: M, error: N } = i(), { createWidget: P, updateWidget: F, deleteWidget: I, duplicateWidget: L, batchUpdatePositions: R } = r(void 0, f), { createPage: z, updatePage: B, deletePage: V, reorderPages: H } = a(), U = t((e) => e.setCurrentDashboard), W = t((e) => e.currentDashboard), G = t((e) => e.setViewMode), K = e((e) => e.selectWidget), q = e((e) => e.widgets), J = e((e) => e.clipboardWidgetId), Y = e((e) => e.clipboardAction), X = e((e) => e.clearClipboard);
|
|
39
|
+
m(() => (G("edit"), () => G("view")), [G]), m(() => {
|
|
40
|
+
if (!f) {
|
|
41
|
+
y("/dashboards");
|
|
47
42
|
return;
|
|
48
43
|
}
|
|
49
|
-
return
|
|
50
|
-
e ? (
|
|
51
|
-
|
|
44
|
+
return A(f).then((e) => {
|
|
45
|
+
e ? (U({
|
|
46
|
+
...e,
|
|
52
47
|
title: e.name,
|
|
53
|
-
description: e.description
|
|
48
|
+
description: e.description ?? "",
|
|
54
49
|
pages: e.pages.map((e, t) => ({
|
|
50
|
+
...e,
|
|
55
51
|
id: e.id,
|
|
56
|
-
title: e.name
|
|
52
|
+
title: e.name ?? "",
|
|
57
53
|
index: t,
|
|
58
|
-
layoutConfig: e.layoutConfig
|
|
59
|
-
}))
|
|
60
|
-
|
|
61
|
-
updatedAt: e.updatedAt
|
|
62
|
-
}), e.pages.length > 0 && !A && j(e.pages[0].id), e.name && x(p, e.name)) : b("/dashboards");
|
|
54
|
+
layoutConfig: e.layoutConfig ?? {}
|
|
55
|
+
}))
|
|
56
|
+
}), e.pages.length > 0 && !O && k(e.pages[0].id), e.name && b(f, e.name)) : y("/dashboards");
|
|
63
57
|
}), () => {
|
|
64
|
-
|
|
58
|
+
f && x(f);
|
|
65
59
|
};
|
|
66
60
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
f,
|
|
62
|
+
y,
|
|
63
|
+
U,
|
|
64
|
+
A,
|
|
65
|
+
O
|
|
72
66
|
]);
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
let Z = p(async () => {
|
|
68
|
+
let e = O ?? W?.pages?.[0]?.id;
|
|
69
|
+
if (!J || !f || !e) return;
|
|
70
|
+
let t = q.get(J);
|
|
71
|
+
if (!t) {
|
|
72
|
+
X();
|
|
78
73
|
return;
|
|
79
74
|
}
|
|
80
|
-
let
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
83
|
-
}, { x: i, y: a } =
|
|
75
|
+
let n = Array.from(q.values()).filter((t) => t.pageId === e), r = {
|
|
76
|
+
width: t.positionWidth ?? 4,
|
|
77
|
+
height: t.positionHeight ?? 4
|
|
78
|
+
}, { x: i, y: a } = l(n, r, { cols: 12 }), o = {
|
|
84
79
|
x: i,
|
|
85
80
|
y: a,
|
|
86
81
|
width: r.width,
|
|
87
82
|
height: r.height
|
|
88
|
-
}, s =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
pageId: t,
|
|
94
|
-
dashboardId: p,
|
|
95
|
-
type: e.type,
|
|
83
|
+
}, s = Y === "copy" ? `${t.title} (Copy)` : t.title, c = await L(J, o, s).catch(() => null);
|
|
84
|
+
c ||= await P({
|
|
85
|
+
pageId: e,
|
|
86
|
+
dashboardId: f,
|
|
87
|
+
type: t.type,
|
|
96
88
|
title: s,
|
|
97
|
-
description:
|
|
98
|
-
dataSinkId:
|
|
99
|
-
datasetId:
|
|
100
|
-
parserId:
|
|
101
|
-
parserRules:
|
|
102
|
-
config:
|
|
89
|
+
description: t.description,
|
|
90
|
+
dataSinkId: t.dataSinkId ?? void 0,
|
|
91
|
+
datasetId: t.datasetId ?? void 0,
|
|
92
|
+
parserId: t.parserId ?? void 0,
|
|
93
|
+
parserRules: t.parserRules ?? void 0,
|
|
94
|
+
config: t.config || {},
|
|
103
95
|
position: o,
|
|
104
|
-
refreshInterval:
|
|
105
|
-
metadata:
|
|
106
|
-
}), c && (
|
|
96
|
+
refreshInterval: t.refreshInterval ?? void 0,
|
|
97
|
+
metadata: t.metadata
|
|
98
|
+
}), c && (K(c.id), Y === "cut" && await I(J)), X();
|
|
107
99
|
}, [
|
|
108
|
-
|
|
109
|
-
Z,
|
|
110
|
-
p,
|
|
111
|
-
K,
|
|
100
|
+
J,
|
|
112
101
|
Y,
|
|
113
|
-
|
|
102
|
+
f,
|
|
103
|
+
O,
|
|
104
|
+
W,
|
|
105
|
+
q,
|
|
106
|
+
L,
|
|
107
|
+
P,
|
|
114
108
|
I,
|
|
115
|
-
R,
|
|
116
|
-
J,
|
|
117
|
-
Q
|
|
118
|
-
]), oe = m(async (e) => {
|
|
119
|
-
if (!p || !K?.pages?.[0]?.id) return;
|
|
120
|
-
let t = K.pages[0].id, n = e.replace(/_/g, " ").toLowerCase().replace(/^\w/, (e) => e.toUpperCase()), r = Array.from(Y.values()), a = T.find((t) => t.type === e) ?? i(e), o = {
|
|
121
|
-
width: a?.defaultSize?.width ?? 4,
|
|
122
|
-
height: a?.defaultSize?.height ?? 4
|
|
123
|
-
}, { x: s, y: c } = u(r, o, { cols: 12 }), l = await I({
|
|
124
|
-
pageId: t,
|
|
125
|
-
dashboardId: p,
|
|
126
|
-
type: e,
|
|
127
|
-
title: n,
|
|
128
|
-
config: {},
|
|
129
|
-
position: {
|
|
130
|
-
x: s,
|
|
131
|
-
y: c,
|
|
132
|
-
width: o.width,
|
|
133
|
-
height: o.height
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
l && (J(l.id), D(!1));
|
|
137
|
-
}, [
|
|
138
|
-
p,
|
|
139
109
|
K,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
110
|
+
X
|
|
111
|
+
]);
|
|
112
|
+
m(() => {
|
|
113
|
+
let n = (n) => {
|
|
114
|
+
if (t.getState().viewMode !== "edit" || n.target?.closest("input, textarea, select, [contenteditable=\"true\"]") || document.querySelector("[data-slot=\"dialog-overlay\"]")) return;
|
|
115
|
+
let r = e.getState(), i = r.selectedWidgetId;
|
|
116
|
+
if (n.key === "Escape") {
|
|
117
|
+
r.selectWidget(null);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if ((n.key === "Delete" || n.key === "Backspace") && i) {
|
|
121
|
+
n.preventDefault(), I(i), r.selectWidget(null);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
(n.metaKey || n.ctrlKey) && (n.key === "c" && i ? r.copyWidget(i) : n.key === "x" && i ? r.cutWidget(i) : n.key === "v" && (n.preventDefault(), Z()));
|
|
125
|
+
};
|
|
126
|
+
return document.addEventListener("keydown", n, !0), () => document.removeEventListener("keydown", n, !0);
|
|
127
|
+
}, [I, Z]);
|
|
128
|
+
let Q = p(() => {
|
|
129
|
+
y("/dashboards");
|
|
130
|
+
}, [y]), $ = p(async () => {
|
|
131
|
+
if (f) {
|
|
132
|
+
C(!0), T(null);
|
|
149
133
|
try {
|
|
150
134
|
let t = e.getState(), n = Array.from(t.widgets.values()), r = t.dirtyWidgetIds, i = n.filter((e) => r.has(e.id));
|
|
151
135
|
if (i.length > 0) {
|
|
152
|
-
let e = i.map(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
};
|
|
163
|
-
try {
|
|
164
|
-
return await L(t);
|
|
165
|
-
} catch (e) {
|
|
166
|
-
throw e;
|
|
167
|
-
}
|
|
168
|
-
});
|
|
136
|
+
let e = i.map((e) => F({
|
|
137
|
+
id: e.id,
|
|
138
|
+
title: e.title,
|
|
139
|
+
config: e.config,
|
|
140
|
+
refreshInterval: e.refreshInterval ?? void 0,
|
|
141
|
+
dataSinkId: e.dataSinkId ?? void 0,
|
|
142
|
+
datasetId: e.datasetId ?? void 0,
|
|
143
|
+
parserId: e.parserId ?? void 0,
|
|
144
|
+
parserRules: e.parserRules ?? void 0
|
|
145
|
+
}));
|
|
169
146
|
await Promise.all(e), t.clearAllDirty();
|
|
170
147
|
}
|
|
171
|
-
n.length > 0 && await
|
|
148
|
+
n.length > 0 && await R(n.map((e) => ({
|
|
172
149
|
id: e.id,
|
|
173
150
|
position: e.position || {
|
|
174
151
|
x: e.positionX ?? 0,
|
|
@@ -176,248 +153,176 @@ var S = p(function() {
|
|
|
176
153
|
width: e.positionWidth ?? 4,
|
|
177
154
|
height: e.positionHeight ?? 4
|
|
178
155
|
}
|
|
179
|
-
}))),
|
|
180
|
-
id:
|
|
181
|
-
name:
|
|
182
|
-
description:
|
|
156
|
+
}))), W && await j({
|
|
157
|
+
id: f,
|
|
158
|
+
name: W.title,
|
|
159
|
+
description: W.description
|
|
183
160
|
});
|
|
184
|
-
} catch
|
|
185
|
-
|
|
161
|
+
} catch (e) {
|
|
162
|
+
T(e instanceof Error ? e.message : "Failed to save dashboard");
|
|
163
|
+
} finally {
|
|
164
|
+
C(!1);
|
|
186
165
|
}
|
|
187
166
|
}
|
|
188
167
|
}, [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
]),
|
|
195
|
-
|
|
196
|
-
}, []),
|
|
197
|
-
|
|
198
|
-
}, []),
|
|
199
|
-
|
|
200
|
-
}, []),
|
|
201
|
-
if (!
|
|
202
|
-
let e = await
|
|
203
|
-
dashboardId:
|
|
204
|
-
name: `Page ${
|
|
168
|
+
f,
|
|
169
|
+
W,
|
|
170
|
+
F,
|
|
171
|
+
R,
|
|
172
|
+
j
|
|
173
|
+
]), ee = p(() => {
|
|
174
|
+
D(!0);
|
|
175
|
+
}, []), te = p(() => {
|
|
176
|
+
D(!1);
|
|
177
|
+
}, []), ne = p((e) => {
|
|
178
|
+
k(e);
|
|
179
|
+
}, []), re = p(async () => {
|
|
180
|
+
if (!W || !f) return;
|
|
181
|
+
let e = await z({
|
|
182
|
+
dashboardId: f,
|
|
183
|
+
name: `Page ${W.pages.length + 1}`
|
|
205
184
|
});
|
|
206
|
-
e && (
|
|
207
|
-
...
|
|
208
|
-
pages: [...
|
|
185
|
+
e && (U({
|
|
186
|
+
...W,
|
|
187
|
+
pages: [...W.pages, {
|
|
209
188
|
id: e.id,
|
|
210
189
|
title: e.name,
|
|
211
190
|
index: e.order,
|
|
212
191
|
layoutConfig: e.layoutConfig || {}
|
|
213
192
|
}]
|
|
214
|
-
}),
|
|
193
|
+
}), k(e.id));
|
|
215
194
|
}, [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
]),
|
|
221
|
-
|
|
195
|
+
W,
|
|
196
|
+
f,
|
|
197
|
+
U,
|
|
198
|
+
z
|
|
199
|
+
]), ie = p(async (e, t) => {
|
|
200
|
+
W && await B({
|
|
222
201
|
id: e,
|
|
223
202
|
name: t
|
|
224
|
-
}) &&
|
|
225
|
-
...
|
|
226
|
-
pages:
|
|
203
|
+
}) && U({
|
|
204
|
+
...W,
|
|
205
|
+
pages: W.pages.map((n) => n.id === e ? {
|
|
227
206
|
...n,
|
|
228
207
|
title: t
|
|
229
208
|
} : n)
|
|
230
209
|
});
|
|
231
210
|
}, [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
]),
|
|
236
|
-
if (!
|
|
237
|
-
let t =
|
|
211
|
+
W,
|
|
212
|
+
U,
|
|
213
|
+
B
|
|
214
|
+
]), ae = p(async (e) => {
|
|
215
|
+
if (!W || !f) return;
|
|
216
|
+
let t = W.pages.find((t) => t.id === e);
|
|
238
217
|
if (!t) return;
|
|
239
|
-
let n = await
|
|
240
|
-
dashboardId:
|
|
218
|
+
let n = await z({
|
|
219
|
+
dashboardId: f,
|
|
241
220
|
name: `${t.title} (Copy)`
|
|
242
221
|
});
|
|
243
|
-
n && (
|
|
244
|
-
...
|
|
245
|
-
pages: [...
|
|
222
|
+
n && (U({
|
|
223
|
+
...W,
|
|
224
|
+
pages: [...W.pages, {
|
|
246
225
|
id: n.id,
|
|
247
226
|
title: n.name,
|
|
248
227
|
index: n.order,
|
|
249
228
|
layoutConfig: n.layoutConfig || {}
|
|
250
229
|
}]
|
|
251
|
-
}),
|
|
230
|
+
}), k(n.id));
|
|
252
231
|
}, [
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
]),
|
|
258
|
-
if (!(!
|
|
259
|
-
let t =
|
|
232
|
+
W,
|
|
233
|
+
f,
|
|
234
|
+
U,
|
|
235
|
+
z
|
|
236
|
+
]), oe = p(async (e) => {
|
|
237
|
+
if (!(!W || W.pages.length <= 1) && await V(e)) {
|
|
238
|
+
let t = W.pages.filter((t) => t.id !== e).map((e, t) => ({
|
|
260
239
|
...e,
|
|
261
240
|
index: t
|
|
262
241
|
}));
|
|
263
|
-
|
|
264
|
-
...
|
|
242
|
+
U({
|
|
243
|
+
...W,
|
|
265
244
|
pages: t
|
|
266
|
-
}),
|
|
245
|
+
}), O === e && k(t[0]?.id || null);
|
|
267
246
|
}
|
|
268
247
|
}, [
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
]),
|
|
274
|
-
!
|
|
275
|
-
...
|
|
248
|
+
W,
|
|
249
|
+
U,
|
|
250
|
+
O,
|
|
251
|
+
V
|
|
252
|
+
]), se = p(async (e) => {
|
|
253
|
+
!W || !f || (U({
|
|
254
|
+
...W,
|
|
276
255
|
pages: e.map((e, t) => ({
|
|
277
256
|
...e,
|
|
278
257
|
index: t
|
|
279
258
|
}))
|
|
280
|
-
}), await
|
|
259
|
+
}), await H(f, e.map((e) => e.id)));
|
|
281
260
|
}, [
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
261
|
+
W,
|
|
262
|
+
f,
|
|
263
|
+
U,
|
|
264
|
+
H
|
|
286
265
|
]);
|
|
287
|
-
return
|
|
288
|
-
className: "flex items-center justify-center h-full",
|
|
289
|
-
children: /* @__PURE__ */ v("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
|
|
290
|
-
}) : F ? /* @__PURE__ */ v("div", {
|
|
266
|
+
return N ? /* @__PURE__ */ _("div", {
|
|
291
267
|
className: "flex flex-col items-center justify-center h-full p-6",
|
|
292
|
-
children: /* @__PURE__ */
|
|
268
|
+
children: /* @__PURE__ */ v("div", {
|
|
293
269
|
className: "bg-status-error-bg border border-status-error-border rounded-lg p-4 max-w-md",
|
|
294
270
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ _("h3", {
|
|
296
272
|
className: "text-sm font-medium text-status-error-text",
|
|
297
273
|
children: "Failed to load dashboard"
|
|
298
274
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ _("p", {
|
|
300
276
|
className: "text-sm text-text-secondary mt-1",
|
|
301
|
-
children:
|
|
277
|
+
children: N.message
|
|
302
278
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ _("button", {
|
|
304
280
|
type: "button",
|
|
305
|
-
onClick: () =>
|
|
281
|
+
onClick: () => y("/dashboards"),
|
|
306
282
|
className: "mt-3 px-3 py-1.5 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md",
|
|
307
283
|
children: "Back to Dashboards"
|
|
308
284
|
})
|
|
309
285
|
]
|
|
310
286
|
})
|
|
311
|
-
}) : /* @__PURE__ */
|
|
312
|
-
className: "flex
|
|
313
|
-
children:
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
children:
|
|
322
|
-
})
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
className: "w-4 h-4",
|
|
351
|
-
fill: "none",
|
|
352
|
-
stroke: "currentColor",
|
|
353
|
-
viewBox: "0 0 24 24",
|
|
354
|
-
children: /* @__PURE__ */ v("path", {
|
|
355
|
-
strokeLinecap: "round",
|
|
356
|
-
strokeLinejoin: "round",
|
|
357
|
-
strokeWidth: 2,
|
|
358
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
359
|
-
})
|
|
360
|
-
})
|
|
361
|
-
})]
|
|
362
|
-
}), /* @__PURE__ */ v("div", {
|
|
363
|
-
className: "flex-1 overflow-auto",
|
|
364
|
-
children: /* @__PURE__ */ v(l, {
|
|
365
|
-
onSelect: oe,
|
|
366
|
-
definitions: T
|
|
367
|
-
})
|
|
368
|
-
})]
|
|
369
|
-
})
|
|
370
|
-
}),
|
|
371
|
-
!E && /* @__PURE__ */ v("button", {
|
|
372
|
-
type: "button",
|
|
373
|
-
onClick: () => D(!0),
|
|
374
|
-
className: "\n absolute left-0 top-1/2 -translate-y-1/2 z-20\n w-8 h-24\n bg-bg-surface\n border border-l-0 border-border-default\n rounded-r-lg\n flex items-center justify-center\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-sunken\n transition-colors\n ",
|
|
375
|
-
title: "Open widget panel",
|
|
376
|
-
children: /* @__PURE__ */ v("svg", {
|
|
377
|
-
className: "w-4 h-4",
|
|
378
|
-
fill: "none",
|
|
379
|
-
stroke: "currentColor",
|
|
380
|
-
viewBox: "0 0 24 24",
|
|
381
|
-
children: /* @__PURE__ */ v("path", {
|
|
382
|
-
strokeLinecap: "round",
|
|
383
|
-
strokeLinejoin: "round",
|
|
384
|
-
strokeWidth: 2,
|
|
385
|
-
d: "M9 5l7 7-7 7"
|
|
386
|
-
})
|
|
387
|
-
})
|
|
388
|
-
}),
|
|
389
|
-
/* @__PURE__ */ v("div", {
|
|
390
|
-
className: "flex-1 relative",
|
|
391
|
-
children: /* @__PURE__ */ v(d, {
|
|
392
|
-
dashboardId: K.id,
|
|
393
|
-
pageId: A || K.pages?.[0]?.id,
|
|
394
|
-
title: K.title,
|
|
395
|
-
onPaste: ae,
|
|
396
|
-
onSave: $,
|
|
397
|
-
isSaving: re,
|
|
398
|
-
onExport: ce,
|
|
399
|
-
pages: K.pages.map((e) => ({
|
|
400
|
-
id: e.id,
|
|
401
|
-
name: e.title || `Page ${(e.index ?? 0) + 1}`,
|
|
402
|
-
order: e.index ?? 0
|
|
403
|
-
})),
|
|
404
|
-
activePageId: A || K.pages?.[0]?.id,
|
|
405
|
-
onPageChange: ue,
|
|
406
|
-
onPageAdd: de,
|
|
407
|
-
onPageRename: fe,
|
|
408
|
-
onPageDuplicate: pe,
|
|
409
|
-
onPageDelete: me,
|
|
410
|
-
onPagesReorder: he,
|
|
411
|
-
showPageTabs: !0
|
|
412
|
-
})
|
|
413
|
-
}),
|
|
414
|
-
/* @__PURE__ */ v(f, {
|
|
415
|
-
isOpen: ie,
|
|
416
|
-
dashboardId: K.id,
|
|
417
|
-
dashboardName: K.title,
|
|
418
|
-
onClose: le
|
|
419
|
-
})
|
|
420
|
-
]
|
|
287
|
+
}) : M || !W ? /* @__PURE__ */ _("div", {
|
|
288
|
+
className: "flex items-center justify-center h-full",
|
|
289
|
+
children: /* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
|
|
290
|
+
}) : /* @__PURE__ */ v(c, {
|
|
291
|
+
topbar: /* @__PURE__ */ _(s, {
|
|
292
|
+
title: W.title || "Untitled dashboard",
|
|
293
|
+
onBack: Q,
|
|
294
|
+
actions: w ? /* @__PURE__ */ _("span", {
|
|
295
|
+
className: "text-xs font-medium text-status-error-text",
|
|
296
|
+
role: "alert",
|
|
297
|
+
children: w
|
|
298
|
+
}) : void 0
|
|
299
|
+
}),
|
|
300
|
+
children: [/* @__PURE__ */ _(o, { canvas: /* @__PURE__ */ _(u, {
|
|
301
|
+
dashboardId: W.id,
|
|
302
|
+
pageId: O || W.pages?.[0]?.id,
|
|
303
|
+
title: W.title,
|
|
304
|
+
onPaste: Z,
|
|
305
|
+
onSave: $,
|
|
306
|
+
isSaving: S,
|
|
307
|
+
onExport: ee,
|
|
308
|
+
pages: W.pages.map((e) => ({
|
|
309
|
+
id: e.id,
|
|
310
|
+
name: e.title || `Page ${(e.index ?? 0) + 1}`,
|
|
311
|
+
order: e.index ?? 0
|
|
312
|
+
})),
|
|
313
|
+
activePageId: O || W.pages?.[0]?.id,
|
|
314
|
+
onPageChange: ne,
|
|
315
|
+
onPageAdd: re,
|
|
316
|
+
onPageRename: ie,
|
|
317
|
+
onPageDuplicate: ae,
|
|
318
|
+
onPageDelete: oe,
|
|
319
|
+
onPagesReorder: se,
|
|
320
|
+
showPageTabs: !0
|
|
321
|
+
}) }), /* @__PURE__ */ _(d, {
|
|
322
|
+
isOpen: E,
|
|
323
|
+
dashboardId: W.id,
|
|
324
|
+
dashboardName: W.title,
|
|
325
|
+
onClose: te
|
|
421
326
|
})]
|
|
422
327
|
});
|
|
423
328
|
});
|