@burdenoff/microfe-bigconsole 2026.711.2 → 2026.712.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/assistant/createSandboxAssistantTransport.js +42 -18
- package/dist/bigconsole/assistant/createSandboxAssistantTransport.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +196 -188
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +135 -122
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +166 -158
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js.map +1 -1
- package/dist/bigconsole/hooks/index.js +1 -0
- package/dist/bigconsole/hooks/useBigConsoleAnalytics.js +13 -0
- package/dist/bigconsole/hooks/useBigConsoleAnalytics.js.map +1 -0
- package/dist/bigconsole/hooks/useWidgetOperations.js +102 -68
- package/dist/bigconsole/hooks/useWidgetOperations.js.map +1 -1
- package/dist/bigconsole/pages/InsightsPage.js +102 -87
- package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import e from "../../hooks/
|
|
1
|
+
import e from "../../hooks/useBigConsoleAnalytics.js";
|
|
2
|
+
import t from "../../hooks/useImportDashboard.js";
|
|
2
3
|
import "../../hooks/index.js";
|
|
3
|
-
import { memo as
|
|
4
|
-
import { AlertTriangle as
|
|
5
|
-
import { Badge as m, Button as h, Card as g, CardContent as _, Checkbox as v, Dialog as y, DialogContent as b, DialogDescription as x, DialogFooter as S, DialogHeader as C, DialogTitle as w, Input as
|
|
6
|
-
import { Fragment as
|
|
4
|
+
import { memo as n, useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
5
|
+
import { AlertTriangle as s, ArrowLeft as ee, Check as c, FileJson as l, Info as u, RefreshCw as d, Upload as f, XCircle as p } from "lucide-react";
|
|
6
|
+
import { Badge as m, Button as h, Card as g, CardContent as _, Checkbox as v, Dialog as y, DialogContent as b, DialogDescription as x, DialogFooter as S, DialogHeader as C, DialogTitle as w, Input as te, Label as T, Spinner as E } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
7
8
|
//#region src/bigconsole/components/dashboard/ImportDashboardDialog.tsx
|
|
8
|
-
function
|
|
9
|
+
function A(e) {
|
|
9
10
|
if (!e) return null;
|
|
10
11
|
try {
|
|
11
12
|
let t = JSON.parse(e);
|
|
@@ -14,184 +15,191 @@ function j(e) {
|
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
var
|
|
18
|
-
let [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
let
|
|
18
|
+
var j = n(function({ isOpen: n, onClose: j, onSuccess: M }) {
|
|
19
|
+
let [N, P] = o("select"), [, F] = o(null), [I, L] = o(null), [R, z] = o(""), [B, V] = o("PRIVATE"), [H, U] = o(!1), W = a(null), { loading: G, error: K, validationResult: q, importResult: J, validateImport: Y, importDashboard: X, clearState: Z } = t(), Q = e();
|
|
20
|
+
i(() => {
|
|
21
|
+
n && (P("select"), F(null), L(null), z(""), V("PRIVATE"), U(!1), Z());
|
|
22
|
+
}, [n, Z]);
|
|
23
|
+
let ne = r(async (e) => {
|
|
23
24
|
let t = e.target.files?.[0];
|
|
24
25
|
if (!t) return;
|
|
25
26
|
if (!t.name.endsWith(".json")) {
|
|
26
27
|
alert("Please select a JSON file");
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
F(t);
|
|
30
31
|
let n = new FileReader();
|
|
31
32
|
n.onload = async (e) => {
|
|
32
33
|
let t = e.target?.result;
|
|
33
|
-
|
|
34
|
-
let n = await
|
|
35
|
-
n && (
|
|
34
|
+
L(t);
|
|
35
|
+
let n = await Y(t);
|
|
36
|
+
n && (P("preview"), n.dashboardInfo?.name && z(n.dashboardInfo.name));
|
|
36
37
|
}, n.onerror = () => {
|
|
37
38
|
alert("Failed to read file");
|
|
38
39
|
}, n.readAsText(t);
|
|
39
|
-
}, [
|
|
40
|
+
}, [Y]), re = r((e) => {
|
|
40
41
|
e.preventDefault();
|
|
41
42
|
let t = e.dataTransfer.files?.[0];
|
|
42
43
|
if (t) {
|
|
43
44
|
let e = new DataTransfer();
|
|
44
|
-
e.items.add(t),
|
|
45
|
+
e.items.add(t), W.current && (W.current.files = e.files, W.current.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
45
46
|
}
|
|
46
|
-
}, []),
|
|
47
|
-
if (!
|
|
48
|
-
|
|
49
|
-
let e =
|
|
50
|
-
name:
|
|
51
|
-
visibility:
|
|
52
|
-
skipWarnings:
|
|
53
|
-
}
|
|
54
|
-
|
|
47
|
+
}, []), ie = r(async () => {
|
|
48
|
+
if (!I) return;
|
|
49
|
+
P("importing");
|
|
50
|
+
let e = {
|
|
51
|
+
name: R.trim() || void 0,
|
|
52
|
+
visibility: B,
|
|
53
|
+
skipWarnings: H
|
|
54
|
+
};
|
|
55
|
+
Q("bigconsole.dashboard.import_clicked", { source: "import" });
|
|
56
|
+
let t = await X(I, e);
|
|
57
|
+
t?.success && t.dashboard ? (P("complete"), Q("bigconsole.dashboard.imported", {
|
|
58
|
+
dashboardId: t.dashboard.id,
|
|
59
|
+
source: "import",
|
|
60
|
+
originalUpdated: t.originalUpdated ?? !1
|
|
61
|
+
}), M?.(t.dashboard.id, t.dashboard.name, t.originalUpdated ?? !1)) : P("preview");
|
|
55
62
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
Q,
|
|
64
|
+
I,
|
|
65
|
+
X,
|
|
66
|
+
R,
|
|
67
|
+
M,
|
|
68
|
+
H,
|
|
69
|
+
B
|
|
70
|
+
]), $ = !G && N !== "importing";
|
|
71
|
+
return /* @__PURE__ */ O(y, {
|
|
72
|
+
open: n,
|
|
73
|
+
onOpenChange: (e) => !e && $ && j(),
|
|
74
|
+
children: /* @__PURE__ */ k(b, {
|
|
67
75
|
className: "sm:max-w-lg max-h-[85vh] flex flex-col",
|
|
68
76
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ k(C, { children: [/* @__PURE__ */ k("div", {
|
|
70
78
|
className: "flex items-center gap-3",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ O("div", {
|
|
72
80
|
className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10",
|
|
73
|
-
children: /* @__PURE__ */
|
|
74
|
-
}), /* @__PURE__ */
|
|
75
|
-
}), /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ O(f, { className: "size-5 text-primary" })
|
|
82
|
+
}), /* @__PURE__ */ O(w, { children: "Import Dashboard" })]
|
|
83
|
+
}), /* @__PURE__ */ O(x, { children: "Upload a Dashboard export file to restore it into this workspace." })] }),
|
|
84
|
+
/* @__PURE__ */ k("div", {
|
|
77
85
|
className: "flex-1 overflow-y-auto py-4 space-y-4",
|
|
78
86
|
children: [
|
|
79
|
-
|
|
87
|
+
N === "select" && /* @__PURE__ */ k("div", {
|
|
80
88
|
onDragOver: (e) => e.preventDefault(),
|
|
81
|
-
onDrop:
|
|
89
|
+
onDrop: re,
|
|
82
90
|
className: "border-2 border-dashed rounded-lg p-8 text-center hover:border-primary transition-colors",
|
|
83
91
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ O(l, { className: "size-12 mx-auto text-text-secondary mb-4" }),
|
|
93
|
+
/* @__PURE__ */ O("p", {
|
|
86
94
|
className: "text-sm mb-2",
|
|
87
95
|
children: "Drag and drop a dashboard export file here"
|
|
88
96
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ O("p", {
|
|
90
98
|
className: "text-xs text-text-secondary mb-4",
|
|
91
99
|
children: "or"
|
|
92
100
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
ref:
|
|
101
|
+
/* @__PURE__ */ O("input", {
|
|
102
|
+
ref: W,
|
|
95
103
|
type: "file",
|
|
96
104
|
accept: ".json",
|
|
97
|
-
onChange:
|
|
105
|
+
onChange: ne,
|
|
98
106
|
className: "hidden"
|
|
99
107
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
onClick: () =>
|
|
102
|
-
disabled:
|
|
108
|
+
/* @__PURE__ */ O(h, {
|
|
109
|
+
onClick: () => W.current?.click(),
|
|
110
|
+
disabled: G,
|
|
103
111
|
children: "Browse Files"
|
|
104
112
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ O("p", {
|
|
106
114
|
className: "text-xs text-text-secondary mt-4",
|
|
107
115
|
children: "Only .json files exported from BigConsole are supported"
|
|
108
116
|
})
|
|
109
117
|
]
|
|
110
118
|
}),
|
|
111
|
-
(
|
|
112
|
-
/* @__PURE__ */
|
|
119
|
+
(N === "preview" || N === "importing") && q && /* @__PURE__ */ k(D, { children: [
|
|
120
|
+
/* @__PURE__ */ O(g, { children: /* @__PURE__ */ k(_, {
|
|
113
121
|
className: "p-4 space-y-2",
|
|
114
122
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ k("div", {
|
|
116
124
|
className: "flex items-center justify-between",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ O("span", {
|
|
118
126
|
className: "text-sm text-text-secondary",
|
|
119
127
|
children: "Dashboard"
|
|
120
|
-
}), /* @__PURE__ */
|
|
128
|
+
}), /* @__PURE__ */ O("span", {
|
|
121
129
|
className: "text-sm font-medium",
|
|
122
|
-
children:
|
|
130
|
+
children: q.dashboardInfo.name
|
|
123
131
|
})]
|
|
124
132
|
}),
|
|
125
|
-
|
|
133
|
+
q.dashboardInfo.description && /* @__PURE__ */ k("div", {
|
|
126
134
|
className: "flex items-start justify-between",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ O("span", {
|
|
128
136
|
className: "text-sm text-text-secondary",
|
|
129
137
|
children: "Description"
|
|
130
|
-
}), /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ O("span", {
|
|
131
139
|
className: "text-sm text-right max-w-[60%] truncate",
|
|
132
|
-
children:
|
|
140
|
+
children: q.dashboardInfo.description
|
|
133
141
|
})]
|
|
134
142
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ k("div", {
|
|
136
144
|
className: "flex items-center justify-between",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ O("span", {
|
|
138
146
|
className: "text-sm text-text-secondary",
|
|
139
147
|
children: "Pages"
|
|
140
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ O(m, {
|
|
141
149
|
variant: "secondary",
|
|
142
|
-
children:
|
|
150
|
+
children: q.dashboardInfo.pageCount
|
|
143
151
|
})]
|
|
144
152
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ k("div", {
|
|
146
154
|
className: "flex items-center justify-between",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ O("span", {
|
|
148
156
|
className: "text-sm text-text-secondary",
|
|
149
157
|
children: "Widgets"
|
|
150
|
-
}), /* @__PURE__ */
|
|
158
|
+
}), /* @__PURE__ */ O(m, {
|
|
151
159
|
variant: "secondary",
|
|
152
|
-
children:
|
|
160
|
+
children: q.dashboardInfo.widgetCount
|
|
153
161
|
})]
|
|
154
162
|
}),
|
|
155
|
-
|
|
163
|
+
q.dashboardInfo.exportedFrom && /* @__PURE__ */ k("div", {
|
|
156
164
|
className: "flex items-center justify-between",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ O("span", {
|
|
158
166
|
className: "text-sm text-text-secondary",
|
|
159
167
|
children: "Source ID"
|
|
160
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ O("span", {
|
|
161
169
|
className: "text-xs text-text-secondary font-mono truncate max-w-[180px]",
|
|
162
|
-
children:
|
|
170
|
+
children: q.dashboardInfo.exportedFrom
|
|
163
171
|
})]
|
|
164
172
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ k("div", {
|
|
166
174
|
className: "flex items-center justify-between",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ O("span", {
|
|
168
176
|
className: "text-sm text-text-secondary",
|
|
169
177
|
children: "Schema Version"
|
|
170
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ O("span", {
|
|
171
179
|
className: "text-xs text-text-secondary",
|
|
172
|
-
children:
|
|
180
|
+
children: q.dashboardInfo.schemaVersion
|
|
173
181
|
})]
|
|
174
182
|
})
|
|
175
183
|
]
|
|
176
184
|
}) }),
|
|
177
|
-
|
|
185
|
+
q.errors.length > 0 && /* @__PURE__ */ O(g, {
|
|
178
186
|
className: "border-status-error-border/50 bg-status-error-bg/5",
|
|
179
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ k(_, {
|
|
180
188
|
className: "p-3",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ k("div", {
|
|
182
190
|
className: "flex items-center gap-2 mb-2",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ O(p, { className: "size-4 text-status-error-text" }), /* @__PURE__ */ k("span", {
|
|
184
192
|
className: "text-sm font-medium text-status-error-text",
|
|
185
193
|
children: [
|
|
186
194
|
"Errors (",
|
|
187
|
-
|
|
195
|
+
q.errors.length,
|
|
188
196
|
")"
|
|
189
197
|
]
|
|
190
198
|
})]
|
|
191
|
-
}), /* @__PURE__ */
|
|
199
|
+
}), /* @__PURE__ */ O("ul", {
|
|
192
200
|
className: "text-xs text-status-error-text space-y-1",
|
|
193
|
-
children:
|
|
194
|
-
/* @__PURE__ */
|
|
201
|
+
children: q.errors.map((e, t) => /* @__PURE__ */ k("li", { children: [
|
|
202
|
+
/* @__PURE__ */ k("span", {
|
|
195
203
|
className: "font-mono",
|
|
196
204
|
children: [
|
|
197
205
|
"[",
|
|
@@ -205,24 +213,24 @@ var M = t(function({ isOpen: t, onClose: M, onSuccess: N }) {
|
|
|
205
213
|
})]
|
|
206
214
|
})
|
|
207
215
|
}),
|
|
208
|
-
|
|
216
|
+
q.warnings.length > 0 && /* @__PURE__ */ O(g, {
|
|
209
217
|
className: "border-yellow-500/50 bg-yellow-500/5",
|
|
210
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ k(_, {
|
|
211
219
|
className: "p-3",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ k("div", {
|
|
213
221
|
className: "flex items-center gap-2 mb-2",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ O(s, { className: "size-4 text-yellow-600" }), /* @__PURE__ */ k("span", {
|
|
215
223
|
className: "text-sm font-medium text-yellow-600",
|
|
216
224
|
children: [
|
|
217
225
|
"Warnings (",
|
|
218
|
-
|
|
226
|
+
q.warnings.length,
|
|
219
227
|
")"
|
|
220
228
|
]
|
|
221
229
|
})]
|
|
222
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ O("ul", {
|
|
223
231
|
className: "text-xs text-yellow-600 space-y-1",
|
|
224
|
-
children:
|
|
225
|
-
/* @__PURE__ */
|
|
232
|
+
children: q.warnings.map((e, t) => /* @__PURE__ */ k("li", { children: [
|
|
233
|
+
/* @__PURE__ */ k("span", {
|
|
226
234
|
className: "font-mono",
|
|
227
235
|
children: [
|
|
228
236
|
"[",
|
|
@@ -236,93 +244,93 @@ var M = t(function({ isOpen: t, onClose: M, onSuccess: N }) {
|
|
|
236
244
|
})]
|
|
237
245
|
})
|
|
238
246
|
}),
|
|
239
|
-
|
|
247
|
+
q.isValid && /* @__PURE__ */ k("div", {
|
|
240
248
|
className: "space-y-4",
|
|
241
249
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ O("p", {
|
|
243
251
|
className: "text-sm font-medium",
|
|
244
252
|
children: "Import Options"
|
|
245
253
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ O(g, {
|
|
247
255
|
className: "border-blue-500/50 bg-blue-500/5",
|
|
248
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ O(_, {
|
|
249
257
|
className: "p-3",
|
|
250
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ k("div", {
|
|
251
259
|
className: "flex items-start gap-2",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ O(u, { className: "size-4 text-blue-600 mt-0.5 shrink-0" }), /* @__PURE__ */ O("div", {
|
|
253
261
|
className: "text-xs text-blue-700 dark:text-blue-400",
|
|
254
|
-
children:
|
|
255
|
-
/* @__PURE__ */
|
|
262
|
+
children: A(I) ? /* @__PURE__ */ k(D, { children: [
|
|
263
|
+
/* @__PURE__ */ O("p", {
|
|
256
264
|
className: "font-medium mb-1",
|
|
257
265
|
children: "Import will check for existing dashboard"
|
|
258
266
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ k("p", { children: [
|
|
260
268
|
"If the original dashboard (ID:",
|
|
261
269
|
" ",
|
|
262
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ k("code", {
|
|
263
271
|
className: "font-mono bg-blue-200/50 px-1 rounded",
|
|
264
|
-
children: [
|
|
272
|
+
children: [A(I)?.slice(0, 8), "..."]
|
|
265
273
|
}),
|
|
266
274
|
") exists:"
|
|
267
275
|
] }),
|
|
268
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ k("ul", {
|
|
269
277
|
className: "list-disc list-inside mt-1 space-y-0.5",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ O("li", { children: "With changes → Update the existing dashboard" }), /* @__PURE__ */ O("li", { children: "No changes → Show \"already exists\" message" })]
|
|
271
279
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ O("p", {
|
|
273
281
|
className: "mt-1",
|
|
274
282
|
children: "If original doesn't exist → Create a new dashboard"
|
|
275
283
|
})
|
|
276
|
-
] }) : /* @__PURE__ */
|
|
284
|
+
] }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("p", {
|
|
277
285
|
className: "font-medium mb-1",
|
|
278
286
|
children: "A new dashboard will be created"
|
|
279
|
-
}), /* @__PURE__ */
|
|
287
|
+
}), /* @__PURE__ */ O("p", { children: "Import as a new dashboard with the specified configuration." })] })
|
|
280
288
|
})]
|
|
281
289
|
})
|
|
282
290
|
})
|
|
283
291
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ k("div", {
|
|
285
293
|
className: "space-y-2",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ O(T, {
|
|
287
295
|
htmlFor: "import-name",
|
|
288
296
|
children: "Dashboard Name"
|
|
289
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ O(te, {
|
|
290
298
|
id: "import-name",
|
|
291
299
|
type: "text",
|
|
292
|
-
value:
|
|
293
|
-
onChange: (e) =>
|
|
294
|
-
placeholder:
|
|
295
|
-
disabled:
|
|
300
|
+
value: R,
|
|
301
|
+
onChange: (e) => z(e.target.value),
|
|
302
|
+
placeholder: q.dashboardInfo.name,
|
|
303
|
+
disabled: N === "importing"
|
|
296
304
|
})]
|
|
297
305
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ k("div", {
|
|
299
307
|
className: "space-y-2",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ O(T, { children: "Visibility" }), /* @__PURE__ */ O("div", {
|
|
301
309
|
className: "flex gap-2",
|
|
302
310
|
children: [
|
|
303
311
|
"PRIVATE",
|
|
304
312
|
"TEAM",
|
|
305
313
|
"PUBLIC"
|
|
306
|
-
].map((e) => /* @__PURE__ */
|
|
314
|
+
].map((e) => /* @__PURE__ */ O(h, {
|
|
307
315
|
type: "button",
|
|
308
|
-
variant:
|
|
316
|
+
variant: B === e ? "default" : "outline",
|
|
309
317
|
size: "sm",
|
|
310
|
-
onClick: () =>
|
|
311
|
-
disabled:
|
|
318
|
+
onClick: () => V(e),
|
|
319
|
+
disabled: N === "importing",
|
|
312
320
|
children: e.charAt(0) + e.slice(1).toLowerCase()
|
|
313
321
|
}, e))
|
|
314
322
|
})]
|
|
315
323
|
}),
|
|
316
|
-
|
|
324
|
+
q.warnings.length > 0 && /* @__PURE__ */ k("div", {
|
|
317
325
|
className: "flex items-start space-x-3",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ O(v, {
|
|
319
327
|
id: "skipWarnings",
|
|
320
|
-
checked:
|
|
321
|
-
onCheckedChange: (e) =>
|
|
322
|
-
disabled:
|
|
323
|
-
}), /* @__PURE__ */
|
|
328
|
+
checked: H,
|
|
329
|
+
onCheckedChange: (e) => U(e === !0),
|
|
330
|
+
disabled: N === "importing"
|
|
331
|
+
}), /* @__PURE__ */ O("div", {
|
|
324
332
|
className: "grid gap-1.5 leading-none",
|
|
325
|
-
children: /* @__PURE__ */
|
|
333
|
+
children: /* @__PURE__ */ O(T, {
|
|
326
334
|
htmlFor: "skipWarnings",
|
|
327
335
|
className: "cursor-pointer",
|
|
328
336
|
children: "Acknowledge warnings and proceed"
|
|
@@ -332,87 +340,87 @@ var M = t(function({ isOpen: t, onClose: M, onSuccess: N }) {
|
|
|
332
340
|
]
|
|
333
341
|
})
|
|
334
342
|
] }),
|
|
335
|
-
|
|
343
|
+
N === "complete" && J?.success && /* @__PURE__ */ k("div", {
|
|
336
344
|
className: "text-center py-6",
|
|
337
345
|
children: [
|
|
338
|
-
|
|
339
|
-
/* @__PURE__ */
|
|
346
|
+
J.alreadyExists && /* @__PURE__ */ k(D, { children: [
|
|
347
|
+
/* @__PURE__ */ O("div", {
|
|
340
348
|
className: "size-16 mx-auto mb-4 rounded-full bg-blue-100 dark:bg-blue-900/30 flex items-center justify-center",
|
|
341
|
-
children: /* @__PURE__ */
|
|
349
|
+
children: /* @__PURE__ */ O(u, { className: "size-8 text-blue-600" })
|
|
342
350
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ O("h3", {
|
|
344
352
|
className: "text-lg font-medium mb-2",
|
|
345
353
|
children: "Dashboard Already Exists"
|
|
346
354
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ k("p", {
|
|
348
356
|
className: "text-sm text-text-secondary mb-4",
|
|
349
357
|
children: [
|
|
350
358
|
"Dashboard \"",
|
|
351
|
-
|
|
359
|
+
J.dashboard?.name,
|
|
352
360
|
"\" already exists with the same data. No changes were made."
|
|
353
361
|
]
|
|
354
362
|
})
|
|
355
363
|
] }),
|
|
356
|
-
|
|
357
|
-
/* @__PURE__ */
|
|
364
|
+
J.originalUpdated && !J.alreadyExists && /* @__PURE__ */ k(D, { children: [
|
|
365
|
+
/* @__PURE__ */ O("div", {
|
|
358
366
|
className: "size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",
|
|
359
|
-
children: /* @__PURE__ */
|
|
367
|
+
children: /* @__PURE__ */ O(d, { className: "size-8 text-green-600" })
|
|
360
368
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ O("h3", {
|
|
362
370
|
className: "text-lg font-medium mb-2",
|
|
363
371
|
children: "Dashboard Updated!"
|
|
364
372
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ k("p", {
|
|
366
374
|
className: "text-sm text-text-secondary mb-4",
|
|
367
375
|
children: [
|
|
368
376
|
"Dashboard \"",
|
|
369
|
-
|
|
377
|
+
J.dashboard?.name,
|
|
370
378
|
"\" has been updated with the imported data."
|
|
371
379
|
]
|
|
372
380
|
})
|
|
373
381
|
] }),
|
|
374
|
-
!
|
|
375
|
-
/* @__PURE__ */
|
|
382
|
+
!J.originalUpdated && !J.alreadyExists && /* @__PURE__ */ k(D, { children: [
|
|
383
|
+
/* @__PURE__ */ O("div", {
|
|
376
384
|
className: "size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",
|
|
377
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ O(c, { className: "size-8 text-green-600" })
|
|
378
386
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ O("h3", {
|
|
380
388
|
className: "text-lg font-medium mb-2",
|
|
381
389
|
children: "Import Successful!"
|
|
382
390
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ k("p", {
|
|
384
392
|
className: "text-sm text-text-secondary mb-4",
|
|
385
393
|
children: [
|
|
386
394
|
"Dashboard \"",
|
|
387
|
-
|
|
395
|
+
J.dashboard?.name,
|
|
388
396
|
"\" has been created."
|
|
389
397
|
]
|
|
390
398
|
}),
|
|
391
|
-
|
|
399
|
+
J.stats && /* @__PURE__ */ O(g, {
|
|
392
400
|
className: "inline-block text-left",
|
|
393
|
-
children: /* @__PURE__ */
|
|
401
|
+
children: /* @__PURE__ */ k(_, {
|
|
394
402
|
className: "p-4",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ O("p", {
|
|
396
404
|
className: "text-xs font-medium text-text-secondary mb-2",
|
|
397
405
|
children: "Import Summary"
|
|
398
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ k("div", {
|
|
399
407
|
className: "grid grid-cols-2 gap-x-6 gap-y-1 text-xs",
|
|
400
408
|
children: [
|
|
401
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ O("span", {
|
|
402
410
|
className: "text-text-secondary",
|
|
403
411
|
children: "Pages:"
|
|
404
412
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ O("span", { children: J.stats.pagesCreated }),
|
|
414
|
+
/* @__PURE__ */ O("span", {
|
|
407
415
|
className: "text-text-secondary",
|
|
408
416
|
children: "Widgets:"
|
|
409
417
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ O("span", { children: J.stats.widgetsCreated }),
|
|
419
|
+
/* @__PURE__ */ O("span", {
|
|
412
420
|
className: "text-text-secondary",
|
|
413
421
|
children: "Actions:"
|
|
414
422
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ O("span", { children: J.stats.actionsCreated })
|
|
416
424
|
]
|
|
417
425
|
})]
|
|
418
426
|
})
|
|
@@ -420,57 +428,57 @@ var M = t(function({ isOpen: t, onClose: M, onSuccess: N }) {
|
|
|
420
428
|
] })
|
|
421
429
|
]
|
|
422
430
|
}),
|
|
423
|
-
|
|
431
|
+
K && /* @__PURE__ */ O(g, {
|
|
424
432
|
className: "border-status-error-border/50 bg-status-error-bg/5",
|
|
425
|
-
children: /* @__PURE__ */
|
|
433
|
+
children: /* @__PURE__ */ O(_, {
|
|
426
434
|
className: "p-3",
|
|
427
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ O("p", {
|
|
428
436
|
className: "text-sm text-status-error-text",
|
|
429
|
-
children:
|
|
437
|
+
children: K.message
|
|
430
438
|
})
|
|
431
439
|
})
|
|
432
440
|
}),
|
|
433
|
-
|
|
441
|
+
J && !J.success && J.errorMessage && /* @__PURE__ */ O(g, {
|
|
434
442
|
className: "border-status-error-border/50 bg-status-error-bg/5",
|
|
435
|
-
children: /* @__PURE__ */
|
|
443
|
+
children: /* @__PURE__ */ O(_, {
|
|
436
444
|
className: "p-3",
|
|
437
|
-
children: /* @__PURE__ */
|
|
445
|
+
children: /* @__PURE__ */ O("p", {
|
|
438
446
|
className: "text-sm text-status-error-text",
|
|
439
|
-
children:
|
|
447
|
+
children: J.errorMessage
|
|
440
448
|
})
|
|
441
449
|
})
|
|
442
450
|
})
|
|
443
451
|
]
|
|
444
452
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ k(S, {
|
|
446
454
|
className: "flex-row justify-between sm:justify-between",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ O("div", { children: N === "preview" && /* @__PURE__ */ k(h, {
|
|
448
456
|
variant: "ghost",
|
|
449
457
|
onClick: () => {
|
|
450
|
-
|
|
458
|
+
P("select"), F(null), L(null), Z();
|
|
451
459
|
},
|
|
452
|
-
disabled:
|
|
453
|
-
children: [/* @__PURE__ */
|
|
454
|
-
}) }), /* @__PURE__ */
|
|
460
|
+
disabled: G,
|
|
461
|
+
children: [/* @__PURE__ */ O(ee, { className: "size-4" }), "Back"]
|
|
462
|
+
}) }), /* @__PURE__ */ k("div", {
|
|
455
463
|
className: "flex items-center gap-2",
|
|
456
464
|
children: [
|
|
457
|
-
|
|
465
|
+
N !== "complete" && /* @__PURE__ */ O(h, {
|
|
458
466
|
variant: "outline",
|
|
459
|
-
onClick:
|
|
467
|
+
onClick: j,
|
|
460
468
|
disabled: !$,
|
|
461
469
|
children: "Cancel"
|
|
462
470
|
}),
|
|
463
|
-
|
|
464
|
-
onClick:
|
|
465
|
-
disabled:
|
|
466
|
-
children: [/* @__PURE__ */
|
|
471
|
+
N === "preview" && q?.isValid && /* @__PURE__ */ k(h, {
|
|
472
|
+
onClick: ie,
|
|
473
|
+
disabled: G || q.warnings.length > 0 && !H,
|
|
474
|
+
children: [/* @__PURE__ */ O(f, { className: "size-4" }), "Import Dashboard"]
|
|
467
475
|
}),
|
|
468
|
-
|
|
476
|
+
N === "importing" && /* @__PURE__ */ k("div", {
|
|
469
477
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
470
|
-
children: [/* @__PURE__ */
|
|
478
|
+
children: [/* @__PURE__ */ O(E, { className: "size-4" }), "Importing..."]
|
|
471
479
|
}),
|
|
472
|
-
|
|
473
|
-
onClick:
|
|
480
|
+
N === "complete" && /* @__PURE__ */ O(h, {
|
|
481
|
+
onClick: j,
|
|
474
482
|
children: "Done"
|
|
475
483
|
})
|
|
476
484
|
]
|
|
@@ -481,6 +489,6 @@ var M = t(function({ isOpen: t, onClose: M, onSuccess: N }) {
|
|
|
481
489
|
});
|
|
482
490
|
});
|
|
483
491
|
//#endregion
|
|
484
|
-
export {
|
|
492
|
+
export { j as default };
|
|
485
493
|
|
|
486
494
|
//# sourceMappingURL=ImportDashboardDialog.js.map
|