@burdenoff/microfe-bigconsole 2026.804.2 → 2026.805.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/components/datasink/ImportDataGuideDialog.js +216 -49
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js.map +1 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +231 -214
- package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
- package/dist/bigconsole/utils/csv.js +91 -0
- package/dist/bigconsole/utils/csv.js.map +1 -0
- package/package.json +2 -2
|
@@ -5,44 +5,44 @@ import { newWorkflowPath as n } from "../BigConsoleRoutes.js";
|
|
|
5
5
|
import ee from "../components/datasink/DataSinkTableViewer.js";
|
|
6
6
|
import te from "../hooks/useDataSinkOperations.js";
|
|
7
7
|
import r from "../components/datasink/DataSinkStatusBadge.js";
|
|
8
|
-
import { isNative as i, nativeConfirm as ne, nativeImpact as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { memo as
|
|
17
|
-
import { useParams as
|
|
18
|
-
import { AlertCircle as
|
|
19
|
-
import { Button as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { formatDistanceToNow as
|
|
8
|
+
import { isNative as i, nativeConfirm as ne, nativeImpact as re, nativeNotify as a } from "../../utils/nativeBridge.js";
|
|
9
|
+
import ie from "../hooks/useDataSinkSubscription.js";
|
|
10
|
+
import ae from "../components/datasink/DataSinkDataViewer.js";
|
|
11
|
+
import oe from "../components/datasink/LinkedWorkflowsPanel.js";
|
|
12
|
+
import se from "../components/datasink/LinkedParsersPanel.js";
|
|
13
|
+
import ce from "../components/datasink/WorkflowStatusPanel.js";
|
|
14
|
+
import le from "../components/datasink/ExportDataSinkDialog.js";
|
|
15
|
+
import ue from "../components/datasink/ImportDataGuideDialog.js";
|
|
16
|
+
import { memo as o, useCallback as s, useEffect as de, useState as c } from "react";
|
|
17
|
+
import { useParams as fe } from "react-router";
|
|
18
|
+
import { AlertCircle as pe, ArrowLeft as l, Code as me, Database as u, Download as he, Edit as ge, Eye as _e, EyeOff as d, Grid3X3 as ve, Loader2 as f, RefreshCw as ye, Trash2 as be, Upload as p } from "lucide-react";
|
|
19
|
+
import { Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, GlassCard as xe, IllustratedEmptyState as Se, NextSteps as Ce, PagePurpose as we } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
21
|
+
import { formatDistanceToNow as S } from "date-fns";
|
|
22
22
|
//#region src/bigconsole/pages/DataSinkViewPage.tsx
|
|
23
|
-
var
|
|
24
|
-
let { dataSinkId:
|
|
25
|
-
|
|
26
|
-
dataSinkId:
|
|
27
|
-
enabled: !!
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
if (
|
|
37
|
-
|
|
23
|
+
var C = o(function() {
|
|
24
|
+
let { dataSinkId: o } = fe(), C = t(), [w, T] = c(!1), [E, D] = c(!1), [O, k] = c(!1), [Te, A] = c(!1), [Ee, j] = c(!1), [M, De] = c(null), [N, P] = c(!1), [F, I] = c("table"), [L, Oe] = c(100), [R, ke] = c(0), [z, Ae] = c(null), [je, Me] = c(!1), B = e((e) => o ? e.dataSinks.get(o) : void 0), { loading: Ne, error: V, fetchDataSink: H, getDataSinkData: U, refreshDataSink: W, updateDataSink: G, deleteDataSink: K } = te({ skipFetch: !0 });
|
|
25
|
+
ie({
|
|
26
|
+
dataSinkId: o,
|
|
27
|
+
enabled: !!o
|
|
28
|
+
}), de(() => {
|
|
29
|
+
o && H(o);
|
|
30
|
+
}, [o, H]);
|
|
31
|
+
let q = s(() => {
|
|
32
|
+
C("/datasinks");
|
|
33
|
+
}, [C]), Pe = s(() => {
|
|
34
|
+
C(`/datasinks/${o}/edit`);
|
|
35
|
+
}, [C, o]), J = s(async () => {
|
|
36
|
+
if (o) {
|
|
37
|
+
D(!0);
|
|
38
38
|
try {
|
|
39
|
-
await
|
|
39
|
+
await W({ id: o });
|
|
40
40
|
} catch {} finally {
|
|
41
|
-
|
|
41
|
+
D(!1);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
}, [
|
|
45
|
-
if (!
|
|
44
|
+
}, [o, W]), Fe = s(async () => {
|
|
45
|
+
if (!o) return;
|
|
46
46
|
let e = await ne({
|
|
47
47
|
title: "Delete DataSink?",
|
|
48
48
|
message: "Are you sure you want to delete this DataSink?",
|
|
@@ -50,173 +50,188 @@ var T = s(function() {
|
|
|
50
50
|
cancelButtonTitle: "Cancel"
|
|
51
51
|
});
|
|
52
52
|
if (e === null ? window.confirm("Are you sure you want to delete this DataSink?") : e) {
|
|
53
|
-
|
|
53
|
+
re("medium"), k(!0);
|
|
54
54
|
try {
|
|
55
|
-
await
|
|
55
|
+
await K(o), i() && a("success"), C("/datasinks");
|
|
56
56
|
} catch {
|
|
57
|
-
i() &&
|
|
57
|
+
i() && a("error");
|
|
58
58
|
} finally {
|
|
59
|
-
|
|
59
|
+
k(!1);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
]),
|
|
67
|
-
if (
|
|
68
|
-
|
|
63
|
+
o,
|
|
64
|
+
K,
|
|
65
|
+
C
|
|
66
|
+
]), Y = s(async (e, t) => {
|
|
67
|
+
if (o) {
|
|
68
|
+
P(!0);
|
|
69
69
|
try {
|
|
70
|
-
let n = await
|
|
70
|
+
let n = await U({ id: o }, {
|
|
71
71
|
limit: t,
|
|
72
72
|
offset: e
|
|
73
73
|
});
|
|
74
|
-
n && (
|
|
74
|
+
n && (De(n.raw || {}), Ae(typeof n.totalCount == "number" ? n.totalCount : null), Me(!!n.hasMore), ke(e));
|
|
75
75
|
} catch {} finally {
|
|
76
|
-
|
|
76
|
+
P(!1);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
}, [
|
|
80
|
-
if (
|
|
81
|
-
if (
|
|
82
|
-
|
|
79
|
+
}, [o, U]), X = s(async () => {
|
|
80
|
+
if (o) {
|
|
81
|
+
if (w) {
|
|
82
|
+
T(!1);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
await
|
|
85
|
+
await Y(0, L), T(!0);
|
|
86
86
|
}
|
|
87
87
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
]),
|
|
93
|
-
|
|
94
|
-
}, [
|
|
95
|
-
|
|
96
|
-
}, []),
|
|
97
|
-
|
|
98
|
-
}, []), $ =
|
|
99
|
-
|
|
100
|
-
}, []),
|
|
101
|
-
|
|
102
|
-
}, []),
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
|
|
88
|
+
o,
|
|
89
|
+
w,
|
|
90
|
+
Y,
|
|
91
|
+
L
|
|
92
|
+
]), Z = s((e) => {
|
|
93
|
+
Oe(e), Y(0, e);
|
|
94
|
+
}, [Y]), Q = s(() => {
|
|
95
|
+
A(!0);
|
|
96
|
+
}, []), Ie = s(() => {
|
|
97
|
+
A(!1);
|
|
98
|
+
}, []), $ = s(() => {
|
|
99
|
+
j(!0);
|
|
100
|
+
}, []), Le = s(() => {
|
|
101
|
+
j(!1);
|
|
102
|
+
}, []), Re = s(() => {
|
|
103
|
+
j(!1), C(n());
|
|
104
|
+
}, [C]), ze = s(async (e) => {
|
|
105
|
+
if (!B || !await G({
|
|
106
|
+
id: B.id,
|
|
107
|
+
version: B.version,
|
|
108
|
+
data: e
|
|
109
|
+
})) return !1;
|
|
110
|
+
try {
|
|
111
|
+
await Y(0, L), T(!0);
|
|
112
|
+
} catch {}
|
|
113
|
+
return !0;
|
|
114
|
+
}, [
|
|
115
|
+
B,
|
|
116
|
+
G,
|
|
117
|
+
Y,
|
|
118
|
+
L
|
|
119
|
+
]);
|
|
120
|
+
return Ne && !B ? /* @__PURE__ */ b("div", {
|
|
106
121
|
className: "flex items-center justify-center min-h-[400px]",
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
}) :
|
|
122
|
+
children: /* @__PURE__ */ b(f, { className: "w-8 h-8 text-text-secondary animate-spin" })
|
|
123
|
+
}) : V && !B ? /* @__PURE__ */ b("div", {
|
|
109
124
|
className: "flex items-center justify-center min-h-[400px] p-card-padding",
|
|
110
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ x("div", {
|
|
111
126
|
className: "text-center",
|
|
112
127
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ b(pe, { className: "w-12 h-12 text-status-error-text mx-auto mb-4" }),
|
|
129
|
+
/* @__PURE__ */ b("p", {
|
|
115
130
|
className: "text-status-error-text text-body-sm font-medium mb-2",
|
|
116
131
|
children: "Failed to load DataSink"
|
|
117
132
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ b("p", {
|
|
119
134
|
className: "text-text-tertiary text-body-xs mb-6",
|
|
120
|
-
children:
|
|
135
|
+
children: V.message
|
|
121
136
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
onClick:
|
|
137
|
+
/* @__PURE__ */ x(m, {
|
|
138
|
+
onClick: q,
|
|
124
139
|
variant: "ghost",
|
|
125
140
|
size: "sm",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), "Go back"]
|
|
127
142
|
})
|
|
128
143
|
]
|
|
129
144
|
})
|
|
130
|
-
}) :
|
|
145
|
+
}) : B ? /* @__PURE__ */ x("div", {
|
|
131
146
|
className: "p-card-padding space-y-6",
|
|
132
147
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ x("div", {
|
|
134
149
|
className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ x("div", {
|
|
136
151
|
className: "flex-1",
|
|
137
152
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
onClick:
|
|
153
|
+
/* @__PURE__ */ x(m, {
|
|
154
|
+
onClick: q,
|
|
140
155
|
variant: "ghost",
|
|
141
156
|
size: "sm",
|
|
142
157
|
className: "mb-4",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), "Back to DataSinks"]
|
|
144
159
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ x("div", {
|
|
146
161
|
className: "flex items-center gap-2 flex-wrap",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ b("h1", {
|
|
148
163
|
className: "text-heading-h1 font-bold text-text-primary",
|
|
149
|
-
children:
|
|
150
|
-
}), /* @__PURE__ */
|
|
164
|
+
children: B.name || "Untitled"
|
|
165
|
+
}), /* @__PURE__ */ b(r, { status: B.status })]
|
|
151
166
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ b("p", {
|
|
153
168
|
className: "text-body-sm text-text-tertiary font-mono mt-1",
|
|
154
|
-
children:
|
|
169
|
+
children: B.key
|
|
155
170
|
}),
|
|
156
|
-
|
|
171
|
+
B.description && /* @__PURE__ */ b("p", {
|
|
157
172
|
className: "text-body-sm text-text-secondary mt-2",
|
|
158
|
-
children:
|
|
173
|
+
children: B.description
|
|
159
174
|
})
|
|
160
175
|
]
|
|
161
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ x("div", {
|
|
162
177
|
className: "flex items-center gap-2 flex-wrap",
|
|
163
178
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
onClick:
|
|
166
|
-
disabled:
|
|
179
|
+
/* @__PURE__ */ x(m, {
|
|
180
|
+
onClick: J,
|
|
181
|
+
disabled: E,
|
|
167
182
|
variant: "secondary",
|
|
168
183
|
size: "default",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ b(ye, { className: `w-4 h-4 mr-2 ${E ? "animate-spin" : ""}` }), E ? "Refreshing..." : "Refresh"]
|
|
170
185
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ x(m, {
|
|
172
187
|
onClick: $,
|
|
173
188
|
variant: "secondary",
|
|
174
189
|
size: "default",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ b(p, { className: "w-4 h-4 mr-2" }), "Import Data"]
|
|
176
191
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ x(m, {
|
|
178
193
|
onClick: Q,
|
|
179
194
|
variant: "secondary",
|
|
180
195
|
size: "default",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ b(he, { className: "w-4 h-4 mr-2" }), "Export"]
|
|
182
197
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
onClick:
|
|
198
|
+
/* @__PURE__ */ x(m, {
|
|
199
|
+
onClick: Pe,
|
|
185
200
|
variant: "secondary",
|
|
186
201
|
size: "default",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ b(ge, { className: "w-4 h-4 mr-2" }), "Edit"]
|
|
188
203
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
onClick:
|
|
191
|
-
disabled:
|
|
204
|
+
/* @__PURE__ */ x(m, {
|
|
205
|
+
onClick: Fe,
|
|
206
|
+
disabled: O,
|
|
192
207
|
variant: "destructive",
|
|
193
208
|
size: "default",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ b(be, { className: "w-4 h-4 mr-2" }), O ? "Deleting..." : "Delete"]
|
|
195
210
|
})
|
|
196
211
|
]
|
|
197
212
|
})]
|
|
198
213
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ b(we, { children: "A data sink is a structured store that holds your processed data and serves it to dashboards. From here you can inspect its schema and stats, preview the cached rows, refresh it from its linked workflow, or export it." }),
|
|
215
|
+
/* @__PURE__ */ b(Ce, {
|
|
201
216
|
storageKey: "bigconsole-datasink-view",
|
|
202
217
|
steps: [
|
|
203
218
|
{
|
|
204
219
|
id: "preview",
|
|
205
220
|
label: "Preview the data",
|
|
206
221
|
description: "Open the cached rows to confirm the sink holds what you expect.",
|
|
207
|
-
onClick:
|
|
222
|
+
onClick: X
|
|
208
223
|
},
|
|
209
224
|
{
|
|
210
225
|
id: "refresh",
|
|
211
226
|
label: "Refresh from source",
|
|
212
227
|
description: "Re-run the linked workflow to pull the latest data.",
|
|
213
|
-
onClick:
|
|
228
|
+
onClick: J
|
|
214
229
|
},
|
|
215
230
|
{
|
|
216
231
|
id: "build-dashboard",
|
|
217
232
|
label: "Visualize it on a dashboard",
|
|
218
233
|
description: "Add widgets that query this sink to see your data live.",
|
|
219
|
-
onClick: () =>
|
|
234
|
+
onClick: () => C("/dashboards")
|
|
220
235
|
},
|
|
221
236
|
{
|
|
222
237
|
id: "export",
|
|
@@ -226,225 +241,227 @@ var T = s(function() {
|
|
|
226
241
|
}
|
|
227
242
|
]
|
|
228
243
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ x("div", {
|
|
230
245
|
className: "grid gap-6 md:grid-cols-2",
|
|
231
246
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ x(xe, {
|
|
233
248
|
treatment: "glass",
|
|
234
249
|
glow: !0,
|
|
235
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ b(_, { children: /* @__PURE__ */ b(v, { children: "Details" }) }), /* @__PURE__ */ b(g, { children: /* @__PURE__ */ x("dl", {
|
|
236
251
|
className: "space-y-4 text-body-sm",
|
|
237
252
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ x("div", {
|
|
239
254
|
className: "flex justify-between items-center",
|
|
240
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
241
256
|
className: "text-text-secondary",
|
|
242
257
|
children: "Status"
|
|
243
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ b("dd", { children: /* @__PURE__ */ b(r, { status: B.status }) })]
|
|
244
259
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ x("div", {
|
|
246
261
|
className: "flex justify-between items-center",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
248
263
|
className: "text-text-secondary",
|
|
249
264
|
children: "Cache TTL"
|
|
250
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ b("dd", {
|
|
251
266
|
className: "text-text-primary font-medium",
|
|
252
|
-
children:
|
|
267
|
+
children: B.ttl ? `${B.ttl}s` : "None"
|
|
253
268
|
})]
|
|
254
269
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ x("div", {
|
|
256
271
|
className: "flex justify-between items-center",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
258
273
|
className: "text-text-secondary",
|
|
259
274
|
children: "Refresh Type"
|
|
260
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ b("dd", {
|
|
261
276
|
className: "text-text-primary font-medium capitalize",
|
|
262
|
-
children:
|
|
277
|
+
children: B.refresh?.type || "Manual"
|
|
263
278
|
})]
|
|
264
279
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ x("div", {
|
|
266
281
|
className: "flex justify-between items-center",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
268
283
|
className: "text-text-secondary",
|
|
269
284
|
children: "Size"
|
|
270
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ b("dd", {
|
|
271
286
|
className: "text-text-primary font-medium",
|
|
272
|
-
children:
|
|
287
|
+
children: B.sizeBytes ? `${(B.sizeBytes / 1024).toFixed(2)} KB` : "0 KB"
|
|
273
288
|
})]
|
|
274
289
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ x("div", {
|
|
276
291
|
className: "flex justify-between items-center",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
278
293
|
className: "text-text-secondary",
|
|
279
294
|
children: "Version"
|
|
280
|
-
}), /* @__PURE__ */
|
|
295
|
+
}), /* @__PURE__ */ b("dd", {
|
|
281
296
|
className: "text-text-primary font-medium",
|
|
282
|
-
children:
|
|
297
|
+
children: B.version || 1
|
|
283
298
|
})]
|
|
284
299
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ x("div", {
|
|
286
301
|
className: "flex justify-between items-center",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
288
303
|
className: "text-text-secondary",
|
|
289
304
|
children: "Last Refreshed"
|
|
290
|
-
}), /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ b("dd", {
|
|
291
306
|
className: "text-text-primary font-medium",
|
|
292
|
-
children:
|
|
307
|
+
children: B.lastRefreshedAt ? S(new Date(B.lastRefreshedAt), { addSuffix: !0 }) : "Never"
|
|
293
308
|
})]
|
|
294
309
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ x("div", {
|
|
296
311
|
className: "flex justify-between items-center",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
312
|
+
children: [/* @__PURE__ */ b("dt", {
|
|
298
313
|
className: "text-text-secondary",
|
|
299
314
|
children: "Created"
|
|
300
|
-
}), /* @__PURE__ */
|
|
315
|
+
}), /* @__PURE__ */ b("dd", {
|
|
301
316
|
className: "text-text-primary font-medium",
|
|
302
|
-
children:
|
|
317
|
+
children: S(new Date(B.createdAt), { addSuffix: !0 })
|
|
303
318
|
})]
|
|
304
319
|
})
|
|
305
320
|
]
|
|
306
321
|
}) })]
|
|
307
322
|
}),
|
|
308
|
-
|
|
309
|
-
workflowId:
|
|
310
|
-
executionId:
|
|
311
|
-
lastRefreshedAt:
|
|
312
|
-
setupState:
|
|
313
|
-
status:
|
|
314
|
-
onRerunWorkflow:
|
|
315
|
-
disabled:
|
|
316
|
-
isRerunning:
|
|
323
|
+
B.fluidGridsWorkflowId && /* @__PURE__ */ b(ce, {
|
|
324
|
+
workflowId: B.fluidGridsWorkflowId,
|
|
325
|
+
executionId: B.fluidGridsWorkflowExecutionId || void 0,
|
|
326
|
+
lastRefreshedAt: B.lastRefreshedAt || void 0,
|
|
327
|
+
setupState: B.setupState,
|
|
328
|
+
status: B.status,
|
|
329
|
+
onRerunWorkflow: J,
|
|
330
|
+
disabled: E,
|
|
331
|
+
isRerunning: E
|
|
317
332
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ b(oe, { workflowLinks: B.workflowLinks }),
|
|
334
|
+
/* @__PURE__ */ b(se, { dataSinkKey: B.key })
|
|
320
335
|
]
|
|
321
336
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ x(h, { children: [
|
|
338
|
+
/* @__PURE__ */ x(_, {
|
|
324
339
|
className: "flex flex-row items-center justify-between space-y-0",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ x(v, {
|
|
326
341
|
className: "flex items-center gap-2",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
328
|
-
}), /* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ b(u, { className: "w-4 h-4 text-text-secondary" }), "Data Preview"]
|
|
343
|
+
}), /* @__PURE__ */ x("div", {
|
|
329
344
|
className: "flex items-center gap-2",
|
|
330
|
-
children: [
|
|
345
|
+
children: [w && /* @__PURE__ */ x("div", {
|
|
331
346
|
className: "flex items-center border border-border-default rounded-md overflow-hidden",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ b("button", {
|
|
333
348
|
type: "button",
|
|
334
|
-
onClick: () =>
|
|
335
|
-
className: `p-1.5 ${
|
|
349
|
+
onClick: () => I("table"),
|
|
350
|
+
className: `p-1.5 ${F === "table" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
|
|
336
351
|
title: "Table view",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
-
}), /* @__PURE__ */
|
|
352
|
+
children: /* @__PURE__ */ b(ve, { className: "w-4 h-4" })
|
|
353
|
+
}), /* @__PURE__ */ b("button", {
|
|
339
354
|
type: "button",
|
|
340
|
-
onClick: () =>
|
|
341
|
-
className: `p-1.5 ${
|
|
355
|
+
onClick: () => I("json"),
|
|
356
|
+
className: `p-1.5 ${F === "json" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
|
|
342
357
|
title: "JSON view",
|
|
343
|
-
children: /* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ b(me, { className: "w-4 h-4" })
|
|
344
359
|
})]
|
|
345
|
-
}), /* @__PURE__ */
|
|
346
|
-
onClick:
|
|
347
|
-
disabled:
|
|
348
|
-
variant:
|
|
360
|
+
}), /* @__PURE__ */ b(m, {
|
|
361
|
+
onClick: X,
|
|
362
|
+
disabled: N,
|
|
363
|
+
variant: w ? "secondary" : "default",
|
|
349
364
|
size: "sm",
|
|
350
|
-
children:
|
|
365
|
+
children: N ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(f, { className: "w-4 h-4 mr-2 animate-spin" }), "Loading..."] }) : w ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(d, { className: "w-4 h-4 mr-2" }), "Hide Data"] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(_e, { className: "w-4 h-4 mr-2" }), "Show Data"] })
|
|
351
366
|
})]
|
|
352
367
|
})]
|
|
353
368
|
}),
|
|
354
|
-
|
|
355
|
-
data:
|
|
369
|
+
w && M && /* @__PURE__ */ x(g, { children: [b(F === "table" ? ee : ae, {
|
|
370
|
+
data: M,
|
|
356
371
|
maxHeight: "400px"
|
|
357
|
-
}),
|
|
372
|
+
}), z !== null && /* @__PURE__ */ x("div", {
|
|
358
373
|
className: "flex items-center justify-between gap-4 mt-4 pt-4 border-t border-border-subtle",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ x("div", {
|
|
360
375
|
className: "flex items-center gap-2 text-body-sm text-text-secondary",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
376
|
+
children: [/* @__PURE__ */ b("span", { children: "Rows per page" }), /* @__PURE__ */ b("select", {
|
|
362
377
|
"aria-label": "Rows per page",
|
|
363
378
|
className: "bg-bg-canvas border border-border-default rounded px-2 py-0.5 text-text-primary",
|
|
364
|
-
value:
|
|
365
|
-
onChange: (e) =>
|
|
379
|
+
value: L,
|
|
380
|
+
onChange: (e) => Z(Number(e.target.value)),
|
|
366
381
|
children: [
|
|
367
382
|
100,
|
|
368
383
|
500,
|
|
369
384
|
1e3
|
|
370
|
-
].map((e) => /* @__PURE__ */
|
|
385
|
+
].map((e) => /* @__PURE__ */ b("option", {
|
|
371
386
|
value: e,
|
|
372
387
|
children: e
|
|
373
388
|
}, e))
|
|
374
389
|
})]
|
|
375
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ x("div", {
|
|
376
391
|
className: "flex items-center gap-4 text-body-sm text-text-secondary",
|
|
377
392
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ b("span", { children: z === 0 ? "0 rows" : `${R + 1}–${Math.min(R + L, z)} of ${z}` }),
|
|
394
|
+
/* @__PURE__ */ b(m, {
|
|
380
395
|
variant: "secondary",
|
|
381
396
|
size: "sm",
|
|
382
|
-
disabled:
|
|
383
|
-
onClick: () => void
|
|
397
|
+
disabled: R === 0 || N,
|
|
398
|
+
onClick: () => void Y(Math.max(0, R - L), L),
|
|
384
399
|
children: "Previous"
|
|
385
400
|
}),
|
|
386
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ b(m, {
|
|
387
402
|
variant: "secondary",
|
|
388
403
|
size: "sm",
|
|
389
|
-
disabled: !
|
|
390
|
-
onClick: () => void
|
|
404
|
+
disabled: !je || N,
|
|
405
|
+
onClick: () => void Y(R + L, L),
|
|
391
406
|
children: "Next"
|
|
392
407
|
})
|
|
393
408
|
]
|
|
394
409
|
})]
|
|
395
410
|
})] }),
|
|
396
|
-
!
|
|
411
|
+
!w && (B.data && Object.keys(B.data).length > 0 ? /* @__PURE__ */ x(g, {
|
|
397
412
|
className: "text-center p-8",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ b(u, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }), /* @__PURE__ */ b("p", {
|
|
399
414
|
className: "text-body-sm text-text-secondary",
|
|
400
415
|
children: "Click \"Show Data\" to preview the cached data."
|
|
401
416
|
})]
|
|
402
|
-
}) : /* @__PURE__ */
|
|
417
|
+
}) : /* @__PURE__ */ x(g, {
|
|
403
418
|
className: "text-center p-8",
|
|
404
419
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ b(u, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }),
|
|
421
|
+
/* @__PURE__ */ b("p", {
|
|
407
422
|
className: "text-body-sm text-text-secondary mb-4",
|
|
408
|
-
children: "This data sink has no data yet.
|
|
423
|
+
children: "This data sink has no data yet. Upload a CSV or build a workflow to import data."
|
|
409
424
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ x(m, {
|
|
411
426
|
onClick: $,
|
|
412
427
|
variant: "default",
|
|
413
428
|
size: "sm",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ b(p, { className: "w-4 h-4 mr-2" }), "Import Data"]
|
|
415
430
|
})
|
|
416
431
|
]
|
|
417
432
|
}))
|
|
418
433
|
] }),
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
-
isOpen:
|
|
421
|
-
dataSinkId:
|
|
422
|
-
dataSinkName:
|
|
423
|
-
onClose:
|
|
434
|
+
/* @__PURE__ */ b(le, {
|
|
435
|
+
isOpen: Te,
|
|
436
|
+
dataSinkId: o || null,
|
|
437
|
+
dataSinkName: B.name || B.key,
|
|
438
|
+
onClose: Ie
|
|
424
439
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
isOpen:
|
|
427
|
-
dataSinkName:
|
|
428
|
-
|
|
429
|
-
|
|
440
|
+
/* @__PURE__ */ b(ue, {
|
|
441
|
+
isOpen: Ee,
|
|
442
|
+
dataSinkName: B.name || B.key,
|
|
443
|
+
hasExistingData: !!(B.data && Object.keys(B.data).length > 0),
|
|
444
|
+
onClose: Le,
|
|
445
|
+
onGoToWorkflows: Re,
|
|
446
|
+
onImportCsv: ze
|
|
430
447
|
})
|
|
431
448
|
]
|
|
432
|
-
}) : /* @__PURE__ */
|
|
449
|
+
}) : /* @__PURE__ */ b("div", {
|
|
433
450
|
className: "flex items-center justify-center min-h-[400px] p-card-padding",
|
|
434
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ b(Se, {
|
|
435
452
|
illustration: "empty-data",
|
|
436
453
|
title: "DataSink not found",
|
|
437
454
|
description: "The DataSink you're looking for doesn't exist or has been deleted.",
|
|
438
|
-
action: /* @__PURE__ */
|
|
439
|
-
onClick:
|
|
455
|
+
action: /* @__PURE__ */ x(m, {
|
|
456
|
+
onClick: q,
|
|
440
457
|
variant: "default",
|
|
441
458
|
size: "default",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
459
|
+
children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), "Go back to DataSinks"]
|
|
443
460
|
})
|
|
444
461
|
})
|
|
445
462
|
});
|
|
446
463
|
});
|
|
447
464
|
//#endregion
|
|
448
|
-
export {
|
|
465
|
+
export { C as DataSinkViewPage, C as default };
|
|
449
466
|
|
|
450
467
|
//# sourceMappingURL=DataSinkViewPage.js.map
|