@burdenoff/microfe-bigconsole 2026.812.1 → 2026.825.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/widgets/PropertiesPanel.js +480 -473
- package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +4 -4
- package/dist/bigconsole/components/widgets/WidgetRegistry.js.map +1 -1
- package/dist/bigconsole/components/widgets/gauge/CircularGauge.js +36 -32
- package/dist/bigconsole/components/widgets/gauge/CircularGauge.js.map +1 -1
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +60 -50
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/gauge/GaugeWidget.js +63 -34
- package/dist/bigconsole/components/widgets/gauge/GaugeWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/gauge/LinearGauge.js +46 -45
- package/dist/bigconsole/components/widgets/gauge/LinearGauge.js.map +1 -1
- package/dist/bigconsole/components/widgets/kpi-comparison/KPIComparisonWidget.js +152 -89
- package/dist/bigconsole/components/widgets/kpi-comparison/KPIComparisonWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +5 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +112 -89
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +21 -13
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/index.js +4 -4
- package/dist/bigconsole/components/widgets/progress/ProgressWidget.js +129 -114
- package/dist/bigconsole/components/widgets/progress/ProgressWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/utils/targetProgress.js +13 -0
- package/dist/bigconsole/components/widgets/utils/targetProgress.js.map +1 -0
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +44 -47
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js.map +1 -1
- package/dist/bigconsole/customWidget/proposalSource.js +31 -24
- package/dist/bigconsole/customWidget/proposalSource.js.map +1 -1
- package/dist/bigconsole/hooks/useDataSinkOperations.js +2 -2
- package/dist/bigconsole/hooks/useDataSinkOperations.js.map +1 -1
- package/package.json +1 -1
|
@@ -22,13 +22,13 @@ import { AppearanceSection as le } from "../builder/inspector/AppearanceSection.
|
|
|
22
22
|
import { GeneralSection as ue } from "../builder/inspector/GeneralSection.js";
|
|
23
23
|
import { DataBindingSection as de } from "../builder/inspector/DataBindingSection.js";
|
|
24
24
|
import "../builder/inspector/index.js";
|
|
25
|
-
import { memo as fe, useCallback as u, useEffect as d, useMemo as f, useRef as
|
|
26
|
-
import { Check as
|
|
27
|
-
import { useI18n as
|
|
28
|
-
import { Button as
|
|
29
|
-
import { jsx as
|
|
25
|
+
import { memo as fe, useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
26
|
+
import { Check as h, ChevronDown as pe, ChevronUp as me, ExternalLink as he, Info as ge, Pencil as _e, Plus as ve, Trash2 as ye, X as g } from "lucide-react";
|
|
27
|
+
import { useI18n as be } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
28
|
+
import { Button as _, Card as xe, CardContent as Se, Input as v, Label as y, Select as Ce, SelectContent as we, SelectItem as b, SelectTrigger as Te, SelectValue as Ee, Sheet as De, SheetContent as Oe, SheetDescription as ke, SheetHeader as Ae, SheetTitle as je, Spinner as Me, Tabs as Ne, TabsContent as x, TabsList as Pe, TabsTrigger as S, Textarea as C } from "@burdenoff/fe-libs/ui";
|
|
29
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
30
30
|
//#region src/bigconsole/components/widgets/PropertiesPanel.tsx
|
|
31
|
-
var
|
|
31
|
+
var Fe = [
|
|
32
32
|
{
|
|
33
33
|
value: "BIGCONSOLE",
|
|
34
34
|
labelKey: "bigconsole.widget.properties.renderer.bigconsole.label",
|
|
@@ -57,7 +57,7 @@ var Le = [
|
|
|
57
57
|
descriptionKey: "bigconsole.widget.properties.renderer.custom.description",
|
|
58
58
|
description: "Custom React component"
|
|
59
59
|
}
|
|
60
|
-
],
|
|
60
|
+
], Ie = [
|
|
61
61
|
{
|
|
62
62
|
value: "DATASINK",
|
|
63
63
|
labelKey: "bigconsole.widget.properties.dataSourceType.datasink.label",
|
|
@@ -101,23 +101,23 @@ var Le = [
|
|
|
101
101
|
description: "Manually enter sample JSON data"
|
|
102
102
|
}
|
|
103
103
|
];
|
|
104
|
-
function
|
|
104
|
+
function Le(e) {
|
|
105
105
|
return `widget:${e.toLowerCase().replace(/\s+/g, "_")}:clicked`;
|
|
106
106
|
}
|
|
107
|
-
var
|
|
107
|
+
var Re = {
|
|
108
108
|
PRIMARY: "bg-action-primary-bg",
|
|
109
109
|
SECONDARY: "bg-[var(--color-text-muted)]",
|
|
110
110
|
SUCCESS: "bg-status-success-bg",
|
|
111
111
|
WARNING: "bg-status-warning-bg",
|
|
112
112
|
DANGER: "bg-status-error-bg"
|
|
113
|
-
},
|
|
113
|
+
}, ze = "bg-[var(--color-text-muted)]", E = {
|
|
114
114
|
fontWeight: "var(--font-weight-semibold)",
|
|
115
115
|
fontSize: "var(--font-size-body-sm)",
|
|
116
116
|
padding: "6px 10px",
|
|
117
117
|
minHeight: "var(--size-controlHeight-md)",
|
|
118
118
|
flexShrink: 0
|
|
119
119
|
};
|
|
120
|
-
function
|
|
120
|
+
function Be(e) {
|
|
121
121
|
if (!e) return {};
|
|
122
122
|
let t = Array.isArray(e) ? e[0] : e;
|
|
123
123
|
if (!t || typeof t != "object") return {};
|
|
@@ -161,8 +161,8 @@ function He(e) {
|
|
|
161
161
|
xAxisField: a
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
var
|
|
165
|
-
let { t: r } =
|
|
164
|
+
var Ve = fe(function({ widget: e, onSave: n }) {
|
|
165
|
+
let { t: r } = be(), [i, a] = m(""), [o, s] = m(null), c = p(!1);
|
|
166
166
|
d(() => {
|
|
167
167
|
try {
|
|
168
168
|
a(e.template && typeof e.template == "object" ? JSON.stringify(e.template, null, 2) : ""), s(null), c.current = !0;
|
|
@@ -187,21 +187,21 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
187
187
|
s(e.message);
|
|
188
188
|
}
|
|
189
189
|
}, [i, n]);
|
|
190
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ T(t, {
|
|
191
191
|
emphasis: "muted",
|
|
192
192
|
padding: "compact",
|
|
193
193
|
headingLevel: 4,
|
|
194
194
|
title: r("bigconsole.widget.properties.template.label", "Template (JSON)"),
|
|
195
195
|
description: `The ${e.renderer} payload this widget renders.`,
|
|
196
196
|
tone: o ? "danger" : "neutral",
|
|
197
|
-
meta: o ? /* @__PURE__ */
|
|
197
|
+
meta: o ? /* @__PURE__ */ w("span", {
|
|
198
198
|
className: "text-xs font-medium text-[var(--color-status-error-text)]",
|
|
199
199
|
children: r("bigconsole.widget.properties.template.invalidJson", "Invalid JSON")
|
|
200
200
|
}) : void 0,
|
|
201
201
|
className: "mt-form-gap",
|
|
202
202
|
"data-testid": "widget-inspector-template",
|
|
203
203
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ w(C, {
|
|
205
205
|
value: i,
|
|
206
206
|
onChange: ee,
|
|
207
207
|
spellCheck: !1,
|
|
@@ -214,7 +214,7 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
214
214
|
resize: "vertical"
|
|
215
215
|
}
|
|
216
216
|
}),
|
|
217
|
-
o && /* @__PURE__ */
|
|
217
|
+
o && /* @__PURE__ */ w("p", {
|
|
218
218
|
style: {
|
|
219
219
|
fontSize: "var(--font-size-body-sm)",
|
|
220
220
|
color: "var(--color-status-error-text)",
|
|
@@ -225,9 +225,9 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
225
225
|
},
|
|
226
226
|
children: o
|
|
227
227
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ T("div", {
|
|
229
229
|
className: "mt-control-gap flex flex-wrap items-center gap-control-gap",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ w(_, {
|
|
231
231
|
variant: "outline",
|
|
232
232
|
size: "sm",
|
|
233
233
|
onClick: l,
|
|
@@ -237,7 +237,7 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
237
237
|
fontWeight: "var(--font-weight-semibold)"
|
|
238
238
|
},
|
|
239
239
|
children: r("bigconsole.widget.properties.template.format", "Format")
|
|
240
|
-
}), !o && i.trim() !== "" && /* @__PURE__ */
|
|
240
|
+
}), !o && i.trim() !== "" && /* @__PURE__ */ T("span", {
|
|
241
241
|
style: {
|
|
242
242
|
fontSize: "var(--font-size-body-sm)",
|
|
243
243
|
color: "var(--color-status-success-text)",
|
|
@@ -245,20 +245,20 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
245
245
|
alignItems: "center",
|
|
246
246
|
gap: "4px"
|
|
247
247
|
},
|
|
248
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ w(h, { style: {
|
|
249
249
|
width: "12px",
|
|
250
250
|
height: "12px"
|
|
251
251
|
} }), r("bigconsole.widget.properties.template.validJson", "Valid JSON")]
|
|
252
252
|
})]
|
|
253
253
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ T("div", {
|
|
255
255
|
className: "mt-control-gap flex flex-wrap items-center justify-between gap-x-4 gap-y-1 border-t border-[var(--color-border-subtle)] pt-control-gap text-xs text-text-muted",
|
|
256
256
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ w("span", {
|
|
258
258
|
className: "font-medium",
|
|
259
259
|
children: r("bigconsole.widget.properties.template.ctrlSToSave", "Ctrl+S to save")
|
|
260
260
|
}),
|
|
261
|
-
e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */
|
|
261
|
+
e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */ T("a", {
|
|
262
262
|
href: "https://adaptivecards.io/designer/",
|
|
263
263
|
target: "_blank",
|
|
264
264
|
rel: "noopener noreferrer",
|
|
@@ -271,12 +271,12 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
271
271
|
fontWeight: "var(--font-weight-medium)",
|
|
272
272
|
textDecoration: "none"
|
|
273
273
|
},
|
|
274
|
-
children: [r("bigconsole.widget.properties.template.designer", "Designer"), /* @__PURE__ */
|
|
274
|
+
children: [r("bigconsole.widget.properties.template.designer", "Designer"), /* @__PURE__ */ w(he, { style: {
|
|
275
275
|
height: "var(--size-icon-sm)",
|
|
276
276
|
width: "var(--size-icon-sm)"
|
|
277
277
|
} })]
|
|
278
278
|
}),
|
|
279
|
-
e.renderer === "BLOCKKIT" && /* @__PURE__ */
|
|
279
|
+
e.renderer === "BLOCKKIT" && /* @__PURE__ */ T("a", {
|
|
280
280
|
href: "https://app.slack.com/block-kit-builder",
|
|
281
281
|
target: "_blank",
|
|
282
282
|
rel: "noopener noreferrer",
|
|
@@ -289,7 +289,7 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
289
289
|
fontWeight: "var(--font-weight-medium)",
|
|
290
290
|
textDecoration: "none"
|
|
291
291
|
},
|
|
292
|
-
children: [r("bigconsole.widget.properties.template.blockKitBuilder", "Block Kit Builder"), /* @__PURE__ */
|
|
292
|
+
children: [r("bigconsole.widget.properties.template.blockKitBuilder", "Block Kit Builder"), /* @__PURE__ */ w(he, { style: {
|
|
293
293
|
height: "var(--size-icon-sm)",
|
|
294
294
|
width: "var(--size-icon-sm)"
|
|
295
295
|
} })]
|
|
@@ -299,7 +299,7 @@ var Ue = fe(function({ widget: e, onSave: n }) {
|
|
|
299
299
|
]
|
|
300
300
|
});
|
|
301
301
|
});
|
|
302
|
-
function
|
|
302
|
+
function He(e) {
|
|
303
303
|
let t = e, n = l({
|
|
304
304
|
dataSinkId: t.dataSinkId,
|
|
305
305
|
parserId: t.parserId,
|
|
@@ -327,328 +327,335 @@ function We(e) {
|
|
|
327
327
|
} : void 0
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
|
-
var
|
|
331
|
-
let { t:
|
|
330
|
+
var D = fe(function({ isOpen: fe, onClose: he }) {
|
|
331
|
+
let { t: D } = be(), [Ue, We] = m("general"), [O, k] = m("idle"), [A, j] = m(null), [M, N] = m(!1), P = e((e) => e.selectedWidgetId), Ge = e((e) => e.widgets), F = e((e) => e.updateWidget), I = P ? Ge.get(P) : void 0, Ke = p(null), qe = p({}), Je = p(0), L = u(() => {
|
|
332
|
+
Je.current += 1, N(!0);
|
|
333
|
+
}, []);
|
|
332
334
|
d(() => {
|
|
333
|
-
if (!
|
|
334
|
-
|
|
335
|
+
if (!P) {
|
|
336
|
+
Ke.current = null, j(null), N(!1), k("idle");
|
|
335
337
|
return;
|
|
336
338
|
}
|
|
337
|
-
let e =
|
|
338
|
-
if (
|
|
339
|
-
if (
|
|
340
|
-
|
|
341
|
-
} else
|
|
339
|
+
let e = Ke.current !== P;
|
|
340
|
+
if (Ke.current = P, I) {
|
|
341
|
+
if (M && !e) return;
|
|
342
|
+
j(He(I)), qe.current = I.config || {}, N(!1), k("idle");
|
|
343
|
+
} else j(null), N(!1), k("idle");
|
|
342
344
|
}, [
|
|
343
|
-
M,
|
|
344
345
|
P,
|
|
345
|
-
|
|
346
|
+
I,
|
|
347
|
+
M
|
|
346
348
|
]);
|
|
347
|
-
let { updateWidget:
|
|
348
|
-
consoleId:
|
|
349
|
+
let { updateWidget: Ye } = i(I?.pageId, I?.dashboardId, { skipFetch: !0 }), { createDrilldown: Xe, updateDrilldown: Ze, deleteDrilldown: Qe } = a(), { dataSinks: R } = c({ skipFetch: !1 }), [$e, et] = m(null), { executeParser: tt } = ee({
|
|
350
|
+
consoleId: I?.dashboardId,
|
|
349
351
|
skipFetch: !0
|
|
350
|
-
}), [
|
|
352
|
+
}), [nt, rt] = m(!1), [it, z] = m(void 0), [at, B] = m(!1), [ot, V] = m(null);
|
|
351
353
|
d(() => {
|
|
352
|
-
z(void 0), B(!1), V(null),
|
|
353
|
-
}, [
|
|
354
|
-
let { actions: H, loading:
|
|
355
|
-
widgetId:
|
|
356
|
-
skipFetch: !
|
|
354
|
+
z(void 0), B(!1), V(null), rt(!1);
|
|
355
|
+
}, [P]);
|
|
356
|
+
let { actions: H, loading: st, createAction: ct, updateAction: lt, deleteAction: ut, reorderActions: U } = o(P || void 0), { webhooks: dt, loading: ft, createWebhook: pt, updateWebhook: mt, deleteWebhook: W, refetch: ht } = s({
|
|
357
|
+
widgetId: P || void 0,
|
|
358
|
+
skipFetch: !P
|
|
357
359
|
}), G = u((e, t) => {
|
|
358
|
-
let n =
|
|
359
|
-
return e.find((e) => e.widgetId ===
|
|
360
|
-
}, [
|
|
361
|
-
if (!
|
|
362
|
-
let n =
|
|
363
|
-
return !r &&
|
|
360
|
+
let n = Le(t);
|
|
361
|
+
return e.find((e) => e.widgetId === P && e.eventPattern === n) ?? null;
|
|
362
|
+
}, [P]), K = u((e) => G(dt, e), [G, dt]), gt = u(async (e, t) => {
|
|
363
|
+
if (!P || t === void 0) return !0;
|
|
364
|
+
let n = Le(e), r = K(e);
|
|
365
|
+
return !r && ft && (r = G((await ht())?.data?.listEventWebhookMappings ?? [], e)), t && t.url ? r ? await mt({
|
|
364
366
|
id: r.id,
|
|
365
367
|
eventPattern: n,
|
|
366
368
|
webhookUrl: t.url,
|
|
367
369
|
method: t.method,
|
|
368
370
|
isActive: !0
|
|
369
|
-
}) !== null : await
|
|
370
|
-
widgetId:
|
|
371
|
+
}) !== null : await pt({
|
|
372
|
+
widgetId: P,
|
|
371
373
|
eventPattern: n,
|
|
372
374
|
webhookUrl: t.url,
|
|
373
375
|
method: t.method
|
|
374
376
|
}) !== null : t === null && r ? W(r.id) : !0;
|
|
375
377
|
}, [
|
|
376
|
-
|
|
378
|
+
P,
|
|
377
379
|
K,
|
|
378
|
-
ut,
|
|
379
|
-
pt,
|
|
380
|
-
G,
|
|
381
|
-
dt,
|
|
382
380
|
ft,
|
|
381
|
+
ht,
|
|
382
|
+
G,
|
|
383
|
+
pt,
|
|
384
|
+
mt,
|
|
383
385
|
W
|
|
384
|
-
]), [
|
|
386
|
+
]), [_t, q] = m(!1), [J, Y] = m(void 0), [vt, yt] = m(!1), [bt, X] = m(void 0), [xt, Z] = m(null), St = f(() => {
|
|
385
387
|
if (!J) return null;
|
|
386
388
|
let e = K(J.name);
|
|
387
389
|
return e ? {
|
|
388
390
|
url: e.webhookUrl,
|
|
389
391
|
method: e.method
|
|
390
392
|
} : null;
|
|
391
|
-
}, [J, K]),
|
|
393
|
+
}, [J, K]), Ct = bt === void 0 ? St : bt, wt = f(() => {
|
|
392
394
|
let e = /* @__PURE__ */ new Map();
|
|
393
395
|
for (let t of H) {
|
|
394
396
|
let n = K(t.name);
|
|
395
397
|
n && e.set(t.name, n);
|
|
396
398
|
}
|
|
397
399
|
return e;
|
|
398
|
-
}, [H, K]),
|
|
400
|
+
}, [H, K]), Tt = u(() => {
|
|
399
401
|
X(void 0), Z(null), Y(void 0), q(!0);
|
|
400
|
-
}, []),
|
|
402
|
+
}, []), Et = u((e) => {
|
|
401
403
|
X(void 0), Z(null), Y(e), q(!0);
|
|
402
|
-
}, []),
|
|
403
|
-
if (
|
|
404
|
-
|
|
404
|
+
}, []), Dt = u(async (e, t) => {
|
|
405
|
+
if (P) {
|
|
406
|
+
yt(!0), Z(null);
|
|
405
407
|
try {
|
|
406
408
|
let n = "id" in e && !!e.id, r = null;
|
|
407
|
-
if (r = n ? await
|
|
409
|
+
if (r = n ? await lt(e) : await ct(e), r) {
|
|
408
410
|
let e = [...H];
|
|
409
411
|
if (n) {
|
|
410
412
|
let t = e.findIndex((e) => e.id === r?.id);
|
|
411
413
|
t >= 0 && (e[t] = r);
|
|
412
414
|
} else e.push(r);
|
|
413
|
-
if (
|
|
414
|
-
X(t), Z(t ?
|
|
415
|
+
if (F(P, { actions: e.sort((e, t) => e.order - t.order) }), !await gt(r.name, t)) {
|
|
416
|
+
X(t), Z(t ? D("bigconsole.widget.properties.action.webhookSaveFailed", "The button was saved, but its webhook could not be saved. Check the URL and try again.") : D("bigconsole.widget.properties.action.webhookRemoveFailed", "The button was saved, but its old webhook could not be removed. Try again.")), Y(r);
|
|
415
417
|
return;
|
|
416
418
|
}
|
|
417
419
|
X(void 0), Z(null), q(!1), Y(void 0);
|
|
418
420
|
}
|
|
419
421
|
} catch (e) {
|
|
420
|
-
console.warn("Failed to save widget action:", e), Z(e instanceof Error ? e.message :
|
|
422
|
+
console.warn("Failed to save widget action:", e), Z(e instanceof Error ? e.message : D("bigconsole.widget.properties.action.saveFailed", "Could not save the button. Please try again."));
|
|
421
423
|
} finally {
|
|
422
|
-
|
|
424
|
+
yt(!1);
|
|
423
425
|
}
|
|
424
426
|
}
|
|
425
427
|
}, [
|
|
426
|
-
|
|
428
|
+
P,
|
|
427
429
|
H,
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
]),
|
|
434
|
-
if (
|
|
430
|
+
ct,
|
|
431
|
+
lt,
|
|
432
|
+
F,
|
|
433
|
+
gt,
|
|
434
|
+
D
|
|
435
|
+
]), Ot = u(async (e) => {
|
|
436
|
+
if (P && window.confirm(D("bigconsole.widget.properties.action.deleteConfirm", "Are you sure you want to delete this action?"))) {
|
|
435
437
|
let t = H.find((t) => t.id === e);
|
|
436
|
-
if (await
|
|
438
|
+
if (await ut(e) && (F(P, { actions: H.filter((t) => t.id !== e) }), t)) {
|
|
437
439
|
let e = K(t.name);
|
|
438
440
|
e && await W(e.id);
|
|
439
441
|
}
|
|
440
442
|
}
|
|
441
443
|
}, [
|
|
442
|
-
|
|
444
|
+
P,
|
|
443
445
|
H,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
+
ut,
|
|
447
|
+
F,
|
|
446
448
|
K,
|
|
447
449
|
W,
|
|
448
|
-
|
|
449
|
-
]),
|
|
450
|
-
if (!
|
|
450
|
+
D
|
|
451
|
+
]), kt = u(async (e) => {
|
|
452
|
+
if (!P || e === 0) return;
|
|
451
453
|
let t = [...H].sort((e, t) => e.order - t.order), n = t.map((e) => e.id);
|
|
452
|
-
[n[e - 1], n[e]] = [n[e], n[e - 1]], await U(n) &&
|
|
454
|
+
[n[e - 1], n[e]] = [n[e], n[e - 1]], await U(n) && F(P, { actions: t.map((e, t) => ({
|
|
453
455
|
...e,
|
|
454
456
|
order: n.indexOf(e.id)
|
|
455
457
|
})).sort((e, t) => e.order - t.order) });
|
|
456
458
|
}, [
|
|
457
|
-
|
|
459
|
+
P,
|
|
458
460
|
H,
|
|
459
461
|
U,
|
|
460
|
-
|
|
461
|
-
]),
|
|
462
|
-
if (!
|
|
462
|
+
F
|
|
463
|
+
]), At = u(async (e) => {
|
|
464
|
+
if (!P) return;
|
|
463
465
|
let t = [...H].sort((e, t) => e.order - t.order);
|
|
464
466
|
if (e === t.length - 1) return;
|
|
465
467
|
let n = t.map((e) => e.id);
|
|
466
|
-
[n[e], n[e + 1]] = [n[e + 1], n[e]], await U(n) &&
|
|
468
|
+
[n[e], n[e + 1]] = [n[e + 1], n[e]], await U(n) && F(P, { actions: t.map((e, t) => ({
|
|
467
469
|
...e,
|
|
468
470
|
order: n.indexOf(e.id)
|
|
469
471
|
})).sort((e, t) => e.order - t.order) });
|
|
470
472
|
}, [
|
|
471
|
-
|
|
473
|
+
P,
|
|
472
474
|
H,
|
|
473
475
|
U,
|
|
474
|
-
|
|
476
|
+
F
|
|
475
477
|
]);
|
|
476
478
|
d(() => {
|
|
477
|
-
|
|
479
|
+
P && H.length >= 0 && !st && F(P, { actions: H });
|
|
478
480
|
}, [
|
|
479
|
-
|
|
481
|
+
P,
|
|
480
482
|
H,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
+
st,
|
|
484
|
+
F
|
|
483
485
|
]);
|
|
484
486
|
let Q = u((e, t) => {
|
|
485
|
-
|
|
487
|
+
j((n) => n && {
|
|
486
488
|
...n,
|
|
487
489
|
[e]: t
|
|
488
|
-
}),
|
|
489
|
-
}, []), $ = u((e) => {
|
|
490
|
-
|
|
490
|
+
}), L();
|
|
491
|
+
}, [L]), $ = u((e) => {
|
|
492
|
+
j((t) => t && {
|
|
491
493
|
...t,
|
|
492
494
|
config: e
|
|
493
|
-
}),
|
|
494
|
-
}, []);
|
|
495
|
+
}), L();
|
|
496
|
+
}, [L]);
|
|
495
497
|
d(() => {
|
|
496
|
-
if (
|
|
497
|
-
let e =
|
|
498
|
-
e &&
|
|
499
|
-
} else
|
|
500
|
-
}, [
|
|
501
|
-
let
|
|
502
|
-
if (z(void 0), B(!1), V(null),
|
|
503
|
-
let t =
|
|
504
|
-
t && (Q("dataSinkId", t.id),
|
|
498
|
+
if (A?.dataSinkId && R.length > 0) {
|
|
499
|
+
let e = R.find((e) => e.id === A.dataSinkId);
|
|
500
|
+
e && et(e.key);
|
|
501
|
+
} else et(null);
|
|
502
|
+
}, [A?.dataSinkId, R]);
|
|
503
|
+
let jt = u((e) => {
|
|
504
|
+
if (z(void 0), B(!1), V(null), et(e), e) {
|
|
505
|
+
let t = R.find((t) => t.key === e);
|
|
506
|
+
t && (Q("dataSinkId", t.id), j((t) => t && {
|
|
505
507
|
...t,
|
|
506
508
|
config: {
|
|
507
509
|
...t.config,
|
|
508
510
|
dataSinkKey: e
|
|
509
511
|
}
|
|
510
|
-
}),
|
|
511
|
-
} else Q("dataSinkId", void 0),
|
|
512
|
+
}), L());
|
|
513
|
+
} else Q("dataSinkId", void 0), j((e) => e && {
|
|
512
514
|
...e,
|
|
513
515
|
config: {
|
|
514
516
|
...e.config,
|
|
515
517
|
dataSinkKey: void 0
|
|
516
518
|
},
|
|
517
519
|
parserId: void 0
|
|
518
|
-
}),
|
|
519
|
-
}, [
|
|
520
|
-
|
|
521
|
-
|
|
520
|
+
}), L();
|
|
521
|
+
}, [
|
|
522
|
+
R,
|
|
523
|
+
Q,
|
|
524
|
+
L
|
|
525
|
+
]), Mt = u(async (e) => {
|
|
526
|
+
if (Q("parserId", e || void 0), z(void 0), B(!1), V(null), e && I) {
|
|
527
|
+
rt(!0);
|
|
522
528
|
try {
|
|
523
|
-
let t = await
|
|
529
|
+
let t = await tt(e);
|
|
524
530
|
if (t?.success) {
|
|
525
531
|
z(t.output), B(!0);
|
|
526
|
-
let e =
|
|
527
|
-
(e.labelField || e.valueField) && (
|
|
532
|
+
let e = Be(t.output);
|
|
533
|
+
(e.labelField || e.valueField) && (j((t) => {
|
|
528
534
|
if (!t) return t;
|
|
529
535
|
let n = t.config || {}, r = { ...n };
|
|
530
536
|
return e.labelField && !n.labelField && (r.labelField = e.labelField), e.valueField && !n.valueField && (r.valueField = e.valueField), e.xAxisField && !n.xAxisField && (r.xAxisField = e.xAxisField), {
|
|
531
537
|
...t,
|
|
532
538
|
config: r
|
|
533
539
|
};
|
|
534
|
-
}),
|
|
535
|
-
} else B(!0), V(t?.error ||
|
|
540
|
+
}), L());
|
|
541
|
+
} else B(!0), V(t?.error || D("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview."));
|
|
536
542
|
} catch (e) {
|
|
537
|
-
B(!0), V(e instanceof Error ? e.message :
|
|
543
|
+
B(!0), V(e instanceof Error ? e.message : D("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview.")), console.warn("Failed to auto-detect parser fields:", e);
|
|
538
544
|
} finally {
|
|
539
|
-
|
|
545
|
+
rt(!1);
|
|
540
546
|
}
|
|
541
547
|
}
|
|
542
548
|
}, [
|
|
543
549
|
Q,
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
550
|
+
tt,
|
|
551
|
+
I,
|
|
552
|
+
L,
|
|
553
|
+
D
|
|
554
|
+
]), Nt = u(async () => {
|
|
555
|
+
if (!I || !A) return;
|
|
556
|
+
let t = Je.current;
|
|
557
|
+
k("saving");
|
|
558
|
+
try {
|
|
559
|
+
let n = {
|
|
560
|
+
...I.metadata || {},
|
|
561
|
+
description: A.description || ""
|
|
562
|
+
}, r = ne(e.getState().widgets.get(I.id)?.config ?? {}, qe.current, A.config), i = re(l({
|
|
563
|
+
dataSinkId: A.dataSinkId,
|
|
564
|
+
parserId: A.parserId,
|
|
565
|
+
config: {
|
|
566
|
+
...r,
|
|
567
|
+
binding: void 0
|
|
568
|
+
}
|
|
569
|
+
}), r), a = await Ye({
|
|
570
|
+
id: I.id,
|
|
571
|
+
title: A.title,
|
|
572
|
+
renderer: A.renderer,
|
|
573
|
+
template: A.template,
|
|
574
|
+
config: i.config,
|
|
575
|
+
refreshInterval: A.refreshInterval,
|
|
576
|
+
dataSinkId: i.dataSinkId,
|
|
577
|
+
datasetId: A.datasetId,
|
|
578
|
+
parserId: i.parserId,
|
|
579
|
+
parserRules: A.parserRules,
|
|
580
|
+
metadata: n
|
|
581
|
+
}), o = I.drilldown;
|
|
582
|
+
if (A.drilldownConfig) {
|
|
583
|
+
let { enabled: e, targetDashboardId: t, navigationMode: n, parameterMapping: r, passGlobalFilters: i, maxDepth: a, openIn: s } = A.drilldownConfig;
|
|
584
|
+
if (I.drilldown?.id) {
|
|
585
|
+
let c = await Ze({
|
|
586
|
+
id: I.drilldown.id,
|
|
587
|
+
targetDashboardId: t,
|
|
588
|
+
parameterMapping: r,
|
|
589
|
+
navigationMode: n,
|
|
590
|
+
enabled: e,
|
|
591
|
+
passGlobalFilters: i,
|
|
592
|
+
maxDepth: a,
|
|
593
|
+
openIn: s
|
|
594
|
+
});
|
|
595
|
+
c && (o = c);
|
|
596
|
+
} else if (t) {
|
|
597
|
+
let c = await Xe({
|
|
598
|
+
sourceWidgetId: I.id,
|
|
599
|
+
targetDashboardId: t,
|
|
600
|
+
parameterMapping: r || {},
|
|
601
|
+
navigationMode: n,
|
|
602
|
+
passGlobalFilters: i,
|
|
603
|
+
maxDepth: a,
|
|
604
|
+
openIn: s
|
|
605
|
+
});
|
|
606
|
+
c && (o = {
|
|
607
|
+
...c,
|
|
608
|
+
enabled: e
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
} else I.drilldown?.id && !A.drilldownConfig && (await Qe(I.drilldown.id), o = void 0);
|
|
612
|
+
a ? (F(I.id, {
|
|
613
|
+
title: A.title,
|
|
614
|
+
description: A.description,
|
|
615
|
+
renderer: A.renderer,
|
|
616
|
+
template: A.template,
|
|
617
|
+
config: i.config,
|
|
618
|
+
refreshInterval: A.refreshInterval,
|
|
619
|
+
dataSinkId: i.dataSinkId,
|
|
620
|
+
datasetId: A.datasetId,
|
|
621
|
+
parserId: i.parserId,
|
|
622
|
+
parserRules: A.parserRules,
|
|
623
|
+
drilldown: o,
|
|
624
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
625
|
+
}), k("saved"), Je.current === t && N(!1), setTimeout(() => k("idle"), 2e3)) : k("error");
|
|
626
|
+
} catch {
|
|
627
|
+
k("error");
|
|
621
628
|
}
|
|
622
629
|
}, [
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
Je,
|
|
626
|
-
N,
|
|
630
|
+
I,
|
|
631
|
+
A,
|
|
627
632
|
Ye,
|
|
633
|
+
F,
|
|
628
634
|
Xe,
|
|
629
|
-
Ze
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
635
|
+
Ze,
|
|
636
|
+
Qe
|
|
637
|
+
]), Pt = u(() => {
|
|
638
|
+
I && (j(He(I)), qe.current = I.config || {}, N(!1), k("idle"));
|
|
639
|
+
}, [I]), Ft = u((e) => {
|
|
633
640
|
$(e);
|
|
634
|
-
}, [$]),
|
|
635
|
-
|
|
641
|
+
}, [$]), It = u((e) => {
|
|
642
|
+
j((t) => t && {
|
|
636
643
|
...t,
|
|
637
644
|
drilldownConfig: e
|
|
638
|
-
}),
|
|
639
|
-
}, []),
|
|
645
|
+
}), L();
|
|
646
|
+
}, [L]), Lt = I ? r(I.type) : null, Rt = f(() => Fe.map((e) => ({
|
|
640
647
|
value: e.value,
|
|
641
|
-
label:
|
|
642
|
-
description:
|
|
643
|
-
})), [
|
|
648
|
+
label: D(e.labelKey, e.label),
|
|
649
|
+
description: D(e.descriptionKey, e.description)
|
|
650
|
+
})), [D]), zt = f(() => Ie.map((e) => ({
|
|
644
651
|
value: e.value,
|
|
645
|
-
label:
|
|
646
|
-
})), [
|
|
647
|
-
return /* @__PURE__ */
|
|
652
|
+
label: D(e.labelKey, e.label)
|
|
653
|
+
})), [D]);
|
|
654
|
+
return /* @__PURE__ */ w(De, {
|
|
648
655
|
open: fe,
|
|
649
|
-
onOpenChange: (e) => !e &&
|
|
656
|
+
onOpenChange: (e) => !e && he(),
|
|
650
657
|
modal: !1,
|
|
651
|
-
children: /* @__PURE__ */
|
|
658
|
+
children: /* @__PURE__ */ T(Oe, {
|
|
652
659
|
style: {
|
|
653
660
|
width: "min(420px, 100vw)",
|
|
654
661
|
maxWidth: "100vw",
|
|
@@ -659,20 +666,20 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
659
666
|
overflow: "hidden"
|
|
660
667
|
},
|
|
661
668
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ w(Ae, {
|
|
663
670
|
style: {
|
|
664
671
|
padding: "var(--space-cardPadding)",
|
|
665
672
|
borderBottom: "1px solid var(--color-border-subtle)",
|
|
666
673
|
backgroundColor: "var(--color-bg-surface)",
|
|
667
674
|
flexShrink: 0
|
|
668
675
|
},
|
|
669
|
-
children: /* @__PURE__ */
|
|
676
|
+
children: /* @__PURE__ */ T("div", {
|
|
670
677
|
style: {
|
|
671
678
|
display: "flex",
|
|
672
679
|
alignItems: "center",
|
|
673
680
|
gap: "var(--space-controlGap)"
|
|
674
681
|
},
|
|
675
|
-
children: [/* @__PURE__ */
|
|
682
|
+
children: [/* @__PURE__ */ w("div", {
|
|
676
683
|
style: {
|
|
677
684
|
display: "flex",
|
|
678
685
|
height: "var(--size-controlHeight-lg)",
|
|
@@ -684,62 +691,62 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
684
691
|
boxShadow: "var(--shadow-elevation-2)",
|
|
685
692
|
flexShrink: 0
|
|
686
693
|
},
|
|
687
|
-
children: /* @__PURE__ */
|
|
694
|
+
children: /* @__PURE__ */ w(ge, { style: {
|
|
688
695
|
height: "var(--size-icon-md)",
|
|
689
696
|
width: "var(--size-icon-md)",
|
|
690
697
|
color: "var(--color-action-primary-text)"
|
|
691
698
|
} })
|
|
692
|
-
}), /* @__PURE__ */
|
|
699
|
+
}), /* @__PURE__ */ T("div", {
|
|
693
700
|
style: {
|
|
694
701
|
flex: 1,
|
|
695
702
|
minWidth: 0
|
|
696
703
|
},
|
|
697
|
-
children: [/* @__PURE__ */
|
|
704
|
+
children: [/* @__PURE__ */ T("div", {
|
|
698
705
|
style: {
|
|
699
706
|
display: "flex",
|
|
700
707
|
alignItems: "center",
|
|
701
708
|
gap: "var(--space-iconGap)"
|
|
702
709
|
},
|
|
703
710
|
children: [
|
|
704
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ w(je, {
|
|
705
712
|
style: {
|
|
706
713
|
fontSize: "var(--font-size-body-md)",
|
|
707
714
|
fontWeight: "var(--font-weight-bold)",
|
|
708
715
|
color: "var(--color-text-primary)",
|
|
709
716
|
margin: 0
|
|
710
717
|
},
|
|
711
|
-
children:
|
|
718
|
+
children: I ? D("bigconsole.widget.properties.header.widgetProperties", "Widget Properties") : D("bigconsole.widget.properties.header.properties", "Properties")
|
|
712
719
|
}),
|
|
713
|
-
|
|
720
|
+
O === "saving" && /* @__PURE__ */ w(Me, { style: {
|
|
714
721
|
height: "var(--size-icon-sm)",
|
|
715
722
|
width: "var(--size-icon-sm)"
|
|
716
723
|
} }),
|
|
717
|
-
|
|
724
|
+
O === "saved" && /* @__PURE__ */ w(h, { style: {
|
|
718
725
|
height: "var(--size-icon-sm)",
|
|
719
726
|
width: "var(--size-icon-sm)",
|
|
720
727
|
color: "var(--color-status-success-bg)"
|
|
721
728
|
} }),
|
|
722
|
-
|
|
729
|
+
O === "error" && /* @__PURE__ */ w(g, { style: {
|
|
723
730
|
height: "var(--size-icon-sm)",
|
|
724
731
|
width: "var(--size-icon-sm)",
|
|
725
732
|
color: "var(--color-status-error-bg)"
|
|
726
733
|
} })
|
|
727
734
|
]
|
|
728
|
-
}),
|
|
735
|
+
}), Lt && /* @__PURE__ */ w(ke, {
|
|
729
736
|
style: {
|
|
730
737
|
fontSize: "var(--font-size-body-sm)",
|
|
731
738
|
color: "var(--color-text-secondary)",
|
|
732
739
|
margin: "var(--space-controlGap) 0 0 0",
|
|
733
740
|
fontWeight: "var(--font-weight-medium)"
|
|
734
741
|
},
|
|
735
|
-
children:
|
|
742
|
+
children: Lt.name
|
|
736
743
|
})]
|
|
737
744
|
})]
|
|
738
745
|
})
|
|
739
746
|
}),
|
|
740
|
-
|
|
741
|
-
value:
|
|
742
|
-
onValueChange: (e) =>
|
|
747
|
+
I ? /* @__PURE__ */ T(Ne, {
|
|
748
|
+
value: Ue,
|
|
749
|
+
onValueChange: (e) => We(e),
|
|
743
750
|
style: {
|
|
744
751
|
flex: 1,
|
|
745
752
|
display: "flex",
|
|
@@ -747,7 +754,7 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
747
754
|
minHeight: 0,
|
|
748
755
|
overflow: "hidden"
|
|
749
756
|
},
|
|
750
|
-
children: [/* @__PURE__ */
|
|
757
|
+
children: [/* @__PURE__ */ T(Pe, {
|
|
751
758
|
style: {
|
|
752
759
|
width: "100%",
|
|
753
760
|
display: "flex",
|
|
@@ -763,28 +770,28 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
763
770
|
gap: "2px"
|
|
764
771
|
},
|
|
765
772
|
children: [
|
|
766
|
-
/* @__PURE__ */ S
|
|
773
|
+
/* @__PURE__ */ w(S, {
|
|
767
774
|
value: "general",
|
|
768
|
-
style:
|
|
769
|
-
children:
|
|
775
|
+
style: E,
|
|
776
|
+
children: D("bigconsole.widget.properties.tab.general", "General")
|
|
770
777
|
}),
|
|
771
|
-
/* @__PURE__ */ S
|
|
778
|
+
/* @__PURE__ */ w(S, {
|
|
772
779
|
value: "data",
|
|
773
|
-
style:
|
|
774
|
-
children:
|
|
780
|
+
style: E,
|
|
781
|
+
children: D("bigconsole.widget.properties.tab.data", "Data")
|
|
775
782
|
}),
|
|
776
|
-
/* @__PURE__ */ S
|
|
783
|
+
/* @__PURE__ */ w(S, {
|
|
777
784
|
value: "advanced",
|
|
778
|
-
style:
|
|
779
|
-
children:
|
|
785
|
+
style: E,
|
|
786
|
+
children: D("bigconsole.widget.properties.tab.advanced", "Advanced")
|
|
780
787
|
}),
|
|
781
|
-
/* @__PURE__ */ S
|
|
788
|
+
/* @__PURE__ */ w(S, {
|
|
782
789
|
value: "appearance",
|
|
783
|
-
style:
|
|
784
|
-
children:
|
|
790
|
+
style: E,
|
|
791
|
+
children: D("bigconsole.widget.properties.tab.style", "Style")
|
|
785
792
|
})
|
|
786
793
|
]
|
|
787
|
-
}), /* @__PURE__ */
|
|
794
|
+
}), /* @__PURE__ */ T("div", {
|
|
788
795
|
style: {
|
|
789
796
|
flex: 1,
|
|
790
797
|
overflow: "auto",
|
|
@@ -792,76 +799,76 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
792
799
|
minHeight: 0
|
|
793
800
|
},
|
|
794
801
|
children: [
|
|
795
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ w(x, {
|
|
796
803
|
value: "general",
|
|
797
804
|
className: "mt-0",
|
|
798
|
-
children:
|
|
799
|
-
title:
|
|
800
|
-
description:
|
|
801
|
-
refreshInterval:
|
|
805
|
+
children: A && /* @__PURE__ */ w(n, { children: /* @__PURE__ */ w(ue, {
|
|
806
|
+
title: A.title,
|
|
807
|
+
description: A.description,
|
|
808
|
+
refreshInterval: A.refreshInterval,
|
|
802
809
|
onTitleChange: (e) => Q("title", e),
|
|
803
810
|
onDescriptionChange: (e) => Q("description", e),
|
|
804
811
|
onRefreshIntervalChange: (e) => Q("refreshInterval", e)
|
|
805
812
|
}) })
|
|
806
813
|
}),
|
|
807
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ w(x, {
|
|
808
815
|
value: "data",
|
|
809
816
|
className: "mt-0",
|
|
810
|
-
children:
|
|
817
|
+
children: A && /* @__PURE__ */ T(n, { children: [(() => {
|
|
811
818
|
let e = l({
|
|
812
|
-
dataSinkId:
|
|
813
|
-
parserId:
|
|
819
|
+
dataSinkId: A.dataSinkId,
|
|
820
|
+
parserId: A.parserId,
|
|
814
821
|
config: {
|
|
815
|
-
...
|
|
822
|
+
...A.config,
|
|
816
823
|
binding: void 0
|
|
817
824
|
}
|
|
818
825
|
}), t = te({
|
|
819
826
|
binding: e,
|
|
820
|
-
loading:
|
|
821
|
-
error:
|
|
822
|
-
preview:
|
|
823
|
-
previewComplete:
|
|
827
|
+
loading: nt,
|
|
828
|
+
error: ot,
|
|
829
|
+
preview: it,
|
|
830
|
+
previewComplete: at
|
|
824
831
|
});
|
|
825
|
-
return /* @__PURE__ */
|
|
826
|
-
consoleId:
|
|
832
|
+
return /* @__PURE__ */ w(de, {
|
|
833
|
+
consoleId: I?.dashboardId || "",
|
|
827
834
|
binding: e,
|
|
828
|
-
dataSinkKey:
|
|
829
|
-
dataPath: typeof
|
|
835
|
+
dataSinkKey: $e,
|
|
836
|
+
dataPath: typeof A.config.dataPath == "string" ? A.config.dataPath : void 0,
|
|
830
837
|
status: t.status,
|
|
831
838
|
missingFields: t.missingFields,
|
|
832
|
-
preview:
|
|
833
|
-
error:
|
|
834
|
-
onDataSinkChange:
|
|
835
|
-
onParserChange:
|
|
839
|
+
preview: it,
|
|
840
|
+
error: ot,
|
|
841
|
+
onDataSinkChange: jt,
|
|
842
|
+
onParserChange: Mt,
|
|
836
843
|
onDataPathChange: (e) => $({
|
|
837
|
-
...
|
|
844
|
+
...A.config,
|
|
838
845
|
dataPath: e
|
|
839
846
|
})
|
|
840
847
|
});
|
|
841
|
-
})(), /* @__PURE__ */
|
|
848
|
+
})(), /* @__PURE__ */ w(t, {
|
|
842
849
|
emphasis: "muted",
|
|
843
|
-
title:
|
|
850
|
+
title: D("bigconsole.widget.properties.data.alternativeSources", "Alternative Data Sources"),
|
|
844
851
|
description: "Skip the DataSink pipeline and fetch straight from an API, a GraphQL endpoint or sample JSON.",
|
|
845
852
|
headingLevel: 3,
|
|
846
853
|
"data-testid": "widget-inspector-alt-sources",
|
|
847
|
-
children: /* @__PURE__ */
|
|
854
|
+
children: /* @__PURE__ */ T("div", {
|
|
848
855
|
className: "flex flex-col gap-form-gap",
|
|
849
856
|
children: [
|
|
850
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ T("div", {
|
|
851
858
|
className: "space-y-2",
|
|
852
|
-
children: [/* @__PURE__ */
|
|
853
|
-
value:
|
|
859
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.data.sourceTypeLabel", "Data Source Type") }), /* @__PURE__ */ T(Ce, {
|
|
860
|
+
value: A.config?.dataSourceType || "",
|
|
854
861
|
onValueChange: (e) => $({
|
|
855
|
-
...
|
|
862
|
+
...A.config,
|
|
856
863
|
dataSourceType: e || void 0
|
|
857
864
|
}),
|
|
858
|
-
children: [/* @__PURE__ */
|
|
865
|
+
children: [/* @__PURE__ */ w(Te, {
|
|
859
866
|
style: {
|
|
860
867
|
height: "var(--size-controlHeight-md)",
|
|
861
868
|
fontSize: "var(--font-size-body-sm)"
|
|
862
869
|
},
|
|
863
|
-
children: /* @__PURE__ */
|
|
864
|
-
}), /* @__PURE__ */
|
|
870
|
+
children: /* @__PURE__ */ w(Ee, { placeholder: D("bigconsole.widget.properties.data.selectTypePlaceholder", "Select type...") })
|
|
871
|
+
}), /* @__PURE__ */ w(we, {
|
|
865
872
|
position: "popper",
|
|
866
873
|
side: "bottom",
|
|
867
874
|
sideOffset: 4,
|
|
@@ -874,56 +881,56 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
874
881
|
boxShadow: "var(--shadow-elevation-3)",
|
|
875
882
|
borderRadius: "var(--radius-button)"
|
|
876
883
|
},
|
|
877
|
-
children:
|
|
884
|
+
children: zt.map((e) => /* @__PURE__ */ w(b, {
|
|
878
885
|
value: e.value,
|
|
879
886
|
children: e.label
|
|
880
887
|
}, e.value))
|
|
881
888
|
})]
|
|
882
889
|
})]
|
|
883
890
|
}),
|
|
884
|
-
|
|
891
|
+
A.config?.dataSourceType === "REST_API" && /* @__PURE__ */ T("div", {
|
|
885
892
|
className: "space-y-3",
|
|
886
893
|
children: [
|
|
887
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ T("div", {
|
|
888
895
|
className: "space-y-2",
|
|
889
|
-
children: [/* @__PURE__ */
|
|
890
|
-
value:
|
|
896
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.rest.endpointUrlLabel", "Endpoint URL *") }), /* @__PURE__ */ w(v, {
|
|
897
|
+
value: A.config?.endpointUrl || "",
|
|
891
898
|
onChange: (e) => $({
|
|
892
|
-
...
|
|
899
|
+
...A.config,
|
|
893
900
|
endpointUrl: e.target.value || void 0
|
|
894
901
|
}),
|
|
895
902
|
placeholder: "https://api.example.com/data"
|
|
896
903
|
})]
|
|
897
904
|
}),
|
|
898
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ T("div", {
|
|
899
906
|
className: "space-y-2",
|
|
900
|
-
children: [/* @__PURE__ */
|
|
901
|
-
value:
|
|
907
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.rest.httpMethodLabel", "HTTP Method") }), /* @__PURE__ */ T(Ce, {
|
|
908
|
+
value: A.config?.httpMethod || "GET",
|
|
902
909
|
onValueChange: (e) => $({
|
|
903
|
-
...
|
|
910
|
+
...A.config,
|
|
904
911
|
httpMethod: e
|
|
905
912
|
}),
|
|
906
|
-
children: [/* @__PURE__ */
|
|
913
|
+
children: [/* @__PURE__ */ w(Te, {
|
|
907
914
|
style: { height: "var(--size-controlHeight-md)" },
|
|
908
|
-
children: /* @__PURE__ */
|
|
909
|
-
}), /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ w(Ee, {})
|
|
916
|
+
}), /* @__PURE__ */ T(we, {
|
|
910
917
|
position: "popper",
|
|
911
918
|
side: "bottom",
|
|
912
919
|
sideOffset: 4,
|
|
913
920
|
children: [
|
|
914
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ w(b, {
|
|
915
922
|
value: "GET",
|
|
916
923
|
children: "GET"
|
|
917
924
|
}),
|
|
918
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ w(b, {
|
|
919
926
|
value: "POST",
|
|
920
927
|
children: "POST"
|
|
921
928
|
}),
|
|
922
|
-
/* @__PURE__ */
|
|
929
|
+
/* @__PURE__ */ w(b, {
|
|
923
930
|
value: "PUT",
|
|
924
931
|
children: "PUT"
|
|
925
932
|
}),
|
|
926
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ w(b, {
|
|
927
934
|
value: "DELETE",
|
|
928
935
|
children: "DELETE"
|
|
929
936
|
})
|
|
@@ -931,12 +938,12 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
931
938
|
})]
|
|
932
939
|
})]
|
|
933
940
|
}),
|
|
934
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ T("div", {
|
|
935
942
|
className: "space-y-2",
|
|
936
|
-
children: [/* @__PURE__ */
|
|
937
|
-
value:
|
|
943
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.rest.headersLabel", "Headers (JSON)") }), /* @__PURE__ */ w(C, {
|
|
944
|
+
value: A.config?.headers || "",
|
|
938
945
|
onChange: (e) => $({
|
|
939
|
-
...
|
|
946
|
+
...A.config,
|
|
940
947
|
headers: e.target.value || void 0
|
|
941
948
|
}),
|
|
942
949
|
rows: 3,
|
|
@@ -944,60 +951,60 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
944
951
|
className: "font-mono text-xs"
|
|
945
952
|
})]
|
|
946
953
|
}),
|
|
947
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ T("div", {
|
|
948
955
|
className: "space-y-2",
|
|
949
|
-
children: [/* @__PURE__ */
|
|
950
|
-
value:
|
|
956
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.rest.authenticationLabel", "Authentication") }), /* @__PURE__ */ T(Ce, {
|
|
957
|
+
value: A.config?.authType || "none",
|
|
951
958
|
onValueChange: (e) => $({
|
|
952
|
-
...
|
|
959
|
+
...A.config,
|
|
953
960
|
authType: e
|
|
954
961
|
}),
|
|
955
|
-
children: [/* @__PURE__ */
|
|
962
|
+
children: [/* @__PURE__ */ w(Te, {
|
|
956
963
|
style: { height: "var(--size-controlHeight-md)" },
|
|
957
|
-
children: /* @__PURE__ */
|
|
958
|
-
}), /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ w(Ee, {})
|
|
965
|
+
}), /* @__PURE__ */ T(we, {
|
|
959
966
|
position: "popper",
|
|
960
967
|
side: "bottom",
|
|
961
968
|
sideOffset: 4,
|
|
962
969
|
children: [
|
|
963
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ w(b, {
|
|
964
971
|
value: "none",
|
|
965
|
-
children:
|
|
972
|
+
children: D("bigconsole.widget.properties.rest.authNone", "None")
|
|
966
973
|
}),
|
|
967
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ w(b, {
|
|
968
975
|
value: "api_key",
|
|
969
|
-
children:
|
|
976
|
+
children: D("bigconsole.widget.properties.rest.authApiKey", "API Key")
|
|
970
977
|
}),
|
|
971
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ w(b, {
|
|
972
979
|
value: "bearer",
|
|
973
|
-
children:
|
|
980
|
+
children: D("bigconsole.widget.properties.rest.authBearer", "Bearer Token")
|
|
974
981
|
}),
|
|
975
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ w(b, {
|
|
976
983
|
value: "basic",
|
|
977
|
-
children:
|
|
984
|
+
children: D("bigconsole.widget.properties.rest.authBasic", "Basic Auth")
|
|
978
985
|
})
|
|
979
986
|
]
|
|
980
987
|
})]
|
|
981
988
|
})]
|
|
982
989
|
}),
|
|
983
|
-
!!(
|
|
990
|
+
!!(A.config?.authType && A.config.authType !== "none") && /* @__PURE__ */ T("div", {
|
|
984
991
|
className: "space-y-2",
|
|
985
|
-
children: [/* @__PURE__ */
|
|
992
|
+
children: [/* @__PURE__ */ w(y, { children: String(A.config.authType) === "basic" ? D("bigconsole.widget.properties.rest.credentialsLabel", "Credentials (user:pass)") : D("bigconsole.widget.properties.rest.tokenKeyLabel", "Token/Key") }), /* @__PURE__ */ w(v, {
|
|
986
993
|
type: "password",
|
|
987
|
-
value:
|
|
994
|
+
value: A.config?.authValue || "",
|
|
988
995
|
onChange: (e) => $({
|
|
989
|
-
...
|
|
996
|
+
...A.config,
|
|
990
997
|
authValue: e.target.value || void 0
|
|
991
998
|
}),
|
|
992
|
-
placeholder:
|
|
999
|
+
placeholder: A.config.authType === "basic" ? D("bigconsole.widget.properties.rest.credentialsPlaceholder", "username:password") : D("bigconsole.widget.properties.rest.tokenKeyPlaceholder", "Enter token or API key")
|
|
993
1000
|
})]
|
|
994
1001
|
}),
|
|
995
|
-
(
|
|
1002
|
+
(A.config?.httpMethod === "POST" || A.config?.httpMethod === "PUT") && /* @__PURE__ */ T("div", {
|
|
996
1003
|
className: "space-y-2",
|
|
997
|
-
children: [/* @__PURE__ */
|
|
998
|
-
value:
|
|
1004
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.rest.requestBodyLabel", "Request Body (JSON)") }), /* @__PURE__ */ w(C, {
|
|
1005
|
+
value: A.config?.requestBody || "",
|
|
999
1006
|
onChange: (e) => $({
|
|
1000
|
-
...
|
|
1007
|
+
...A.config,
|
|
1001
1008
|
requestBody: e.target.value || void 0
|
|
1002
1009
|
}),
|
|
1003
1010
|
rows: 4,
|
|
@@ -1005,46 +1012,46 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
1005
1012
|
className: "font-mono text-xs"
|
|
1006
1013
|
})]
|
|
1007
1014
|
}),
|
|
1008
|
-
/* @__PURE__ */
|
|
1015
|
+
/* @__PURE__ */ T("div", {
|
|
1009
1016
|
className: "space-y-2",
|
|
1010
1017
|
children: [
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
value:
|
|
1018
|
+
/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
|
|
1019
|
+
/* @__PURE__ */ w(v, {
|
|
1020
|
+
value: A.config?.dataPath || "",
|
|
1014
1021
|
onChange: (e) => $({
|
|
1015
|
-
...
|
|
1022
|
+
...A.config,
|
|
1016
1023
|
dataPath: e.target.value || void 0
|
|
1017
1024
|
}),
|
|
1018
1025
|
placeholder: "$.data.items or .data.items"
|
|
1019
1026
|
}),
|
|
1020
|
-
/* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ w("p", {
|
|
1021
1028
|
className: "text-xs text-text-secondary",
|
|
1022
|
-
children:
|
|
1029
|
+
children: D("bigconsole.widget.properties.dataPath.restHelp", "JSONPath or dot notation to extract data from response")
|
|
1023
1030
|
})
|
|
1024
1031
|
]
|
|
1025
1032
|
})
|
|
1026
1033
|
]
|
|
1027
1034
|
}),
|
|
1028
|
-
|
|
1035
|
+
A.config?.dataSourceType === "GRAPHQL" && /* @__PURE__ */ T("div", {
|
|
1029
1036
|
className: "space-y-3",
|
|
1030
1037
|
children: [
|
|
1031
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ T("div", {
|
|
1032
1039
|
className: "space-y-2",
|
|
1033
|
-
children: [/* @__PURE__ */
|
|
1034
|
-
value:
|
|
1040
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.graphql.endpointLabel", "GraphQL Endpoint *") }), /* @__PURE__ */ w(v, {
|
|
1041
|
+
value: A.config?.graphqlEndpoint || "",
|
|
1035
1042
|
onChange: (e) => $({
|
|
1036
|
-
...
|
|
1043
|
+
...A.config,
|
|
1037
1044
|
graphqlEndpoint: e.target.value || void 0
|
|
1038
1045
|
}),
|
|
1039
1046
|
placeholder: "https://api.example.com/graphql"
|
|
1040
1047
|
})]
|
|
1041
1048
|
}),
|
|
1042
|
-
/* @__PURE__ */
|
|
1049
|
+
/* @__PURE__ */ T("div", {
|
|
1043
1050
|
className: "space-y-2",
|
|
1044
|
-
children: [/* @__PURE__ */
|
|
1045
|
-
value:
|
|
1051
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.graphql.queryLabel", "Query *") }), /* @__PURE__ */ w(C, {
|
|
1052
|
+
value: A.config?.graphqlQuery || "",
|
|
1046
1053
|
onChange: (e) => $({
|
|
1047
|
-
...
|
|
1054
|
+
...A.config,
|
|
1048
1055
|
graphqlQuery: e.target.value || void 0
|
|
1049
1056
|
}),
|
|
1050
1057
|
rows: 6,
|
|
@@ -1052,12 +1059,12 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
1052
1059
|
className: "font-mono text-xs"
|
|
1053
1060
|
})]
|
|
1054
1061
|
}),
|
|
1055
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ T("div", {
|
|
1056
1063
|
className: "space-y-2",
|
|
1057
|
-
children: [/* @__PURE__ */
|
|
1058
|
-
value:
|
|
1064
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.graphql.variablesLabel", "Variables (JSON, optional)") }), /* @__PURE__ */ w(C, {
|
|
1065
|
+
value: A.config?.graphqlVariables || "",
|
|
1059
1066
|
onChange: (e) => $({
|
|
1060
|
-
...
|
|
1067
|
+
...A.config,
|
|
1061
1068
|
graphqlVariables: e.target.value || void 0
|
|
1062
1069
|
}),
|
|
1063
1070
|
rows: 3,
|
|
@@ -1065,12 +1072,12 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
1065
1072
|
className: "font-mono text-xs"
|
|
1066
1073
|
})]
|
|
1067
1074
|
}),
|
|
1068
|
-
/* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ T("div", {
|
|
1069
1076
|
className: "space-y-2",
|
|
1070
|
-
children: [/* @__PURE__ */
|
|
1071
|
-
value:
|
|
1077
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.graphql.headersLabel", "Headers (JSON, optional)") }), /* @__PURE__ */ w(C, {
|
|
1078
|
+
value: A.config?.headers || "",
|
|
1072
1079
|
onChange: (e) => $({
|
|
1073
|
-
...
|
|
1080
|
+
...A.config,
|
|
1074
1081
|
headers: e.target.value || void 0
|
|
1075
1082
|
}),
|
|
1076
1083
|
rows: 2,
|
|
@@ -1078,32 +1085,32 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
1078
1085
|
className: "font-mono text-xs"
|
|
1079
1086
|
})]
|
|
1080
1087
|
}),
|
|
1081
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ T("div", {
|
|
1082
1089
|
className: "space-y-2",
|
|
1083
1090
|
children: [
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
value:
|
|
1091
|
+
/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
|
|
1092
|
+
/* @__PURE__ */ w(v, {
|
|
1093
|
+
value: A.config?.dataPath || "",
|
|
1087
1094
|
onChange: (e) => $({
|
|
1088
|
-
...
|
|
1095
|
+
...A.config,
|
|
1089
1096
|
dataPath: e.target.value || void 0
|
|
1090
1097
|
}),
|
|
1091
1098
|
placeholder: ".data.items"
|
|
1092
1099
|
}),
|
|
1093
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ w("p", {
|
|
1094
1101
|
className: "text-xs text-text-secondary",
|
|
1095
|
-
children:
|
|
1102
|
+
children: D("bigconsole.widget.properties.dataPath.graphqlHelp", "Path to extract data from GraphQL response")
|
|
1096
1103
|
})
|
|
1097
1104
|
]
|
|
1098
1105
|
})
|
|
1099
1106
|
]
|
|
1100
1107
|
}),
|
|
1101
|
-
|
|
1108
|
+
A.config?.dataSourceType === "MOCK" && /* @__PURE__ */ T("div", {
|
|
1102
1109
|
className: "space-y-2",
|
|
1103
|
-
children: [/* @__PURE__ */
|
|
1104
|
-
value:
|
|
1110
|
+
children: [/* @__PURE__ */ w(y, { children: D("bigconsole.widget.properties.mock.sampleDataLabel", "Sample Data (JSON)") }), /* @__PURE__ */ w(C, {
|
|
1111
|
+
value: A.config?.mockData || "",
|
|
1105
1112
|
onChange: (e) => $({
|
|
1106
|
-
...
|
|
1113
|
+
...A.config,
|
|
1107
1114
|
mockData: e.target.value || void 0
|
|
1108
1115
|
}),
|
|
1109
1116
|
rows: 5,
|
|
@@ -1115,103 +1122,103 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
1115
1122
|
})
|
|
1116
1123
|
})] })
|
|
1117
1124
|
}),
|
|
1118
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ w(x, {
|
|
1119
1126
|
value: "advanced",
|
|
1120
1127
|
className: "mt-0",
|
|
1121
|
-
children: /* @__PURE__ */
|
|
1122
|
-
|
|
1123
|
-
renderer:
|
|
1124
|
-
rendererOptions:
|
|
1128
|
+
children: /* @__PURE__ */ T(n, { children: [
|
|
1129
|
+
A && /* @__PURE__ */ w(ce, {
|
|
1130
|
+
renderer: A.renderer,
|
|
1131
|
+
rendererOptions: Rt,
|
|
1125
1132
|
onRendererChange: (e) => {
|
|
1126
1133
|
Q("renderer", e), e === "BIGCONSOLE" && Q("template", void 0);
|
|
1127
1134
|
},
|
|
1128
|
-
templateEditor:
|
|
1135
|
+
templateEditor: A.renderer === "BIGCONSOLE" ? void 0 : /* @__PURE__ */ w(Ve, {
|
|
1129
1136
|
widget: {
|
|
1130
|
-
...
|
|
1131
|
-
template:
|
|
1132
|
-
renderer:
|
|
1137
|
+
...I,
|
|
1138
|
+
template: A.template,
|
|
1139
|
+
renderer: A.renderer
|
|
1133
1140
|
},
|
|
1134
1141
|
onSave: (e) => Q("template", e)
|
|
1135
1142
|
})
|
|
1136
1143
|
}),
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
title:
|
|
1139
|
-
description:
|
|
1144
|
+
/* @__PURE__ */ w(t, {
|
|
1145
|
+
title: D("bigconsole.widget.properties.actions.heading", "Widget Actions"),
|
|
1146
|
+
description: D("bigconsole.widget.properties.actions.subheading", "Configure buttons on this widget"),
|
|
1140
1147
|
headingLevel: 3,
|
|
1141
|
-
meta: H.length > 0 ? /* @__PURE__ */
|
|
1148
|
+
meta: H.length > 0 ? /* @__PURE__ */ w("span", {
|
|
1142
1149
|
className: "rounded-pill bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
1143
1150
|
children: H.length
|
|
1144
1151
|
}) : void 0,
|
|
1145
|
-
actions: /* @__PURE__ */
|
|
1152
|
+
actions: /* @__PURE__ */ T(_, {
|
|
1146
1153
|
size: "sm",
|
|
1147
|
-
onClick:
|
|
1148
|
-
children: [/* @__PURE__ */
|
|
1154
|
+
onClick: Tt,
|
|
1155
|
+
children: [/* @__PURE__ */ w(ve, { className: "size-4" }), D("bigconsole.widget.properties.actions.add", "Add")]
|
|
1149
1156
|
}),
|
|
1150
1157
|
"data-testid": "widget-inspector-actions",
|
|
1151
|
-
children:
|
|
1158
|
+
children: st ? /* @__PURE__ */ w("div", {
|
|
1152
1159
|
className: "flex justify-center py-8",
|
|
1153
|
-
children: /* @__PURE__ */
|
|
1154
|
-
}) : H.length === 0 ? /* @__PURE__ */
|
|
1160
|
+
children: /* @__PURE__ */ w(Me, { className: "size-6" })
|
|
1161
|
+
}) : H.length === 0 ? /* @__PURE__ */ w("p", {
|
|
1155
1162
|
className: "text-sm text-text-secondary",
|
|
1156
|
-
children:
|
|
1157
|
-
}) : /* @__PURE__ */
|
|
1163
|
+
children: D("bigconsole.widget.properties.actions.empty", "No actions configured")
|
|
1164
|
+
}) : /* @__PURE__ */ w("div", {
|
|
1158
1165
|
className: "space-y-2",
|
|
1159
|
-
children: [...H].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */
|
|
1166
|
+
children: [...H].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ w(xe, {
|
|
1160
1167
|
className: e.disabled ? "opacity-60" : "",
|
|
1161
|
-
children: /* @__PURE__ */
|
|
1168
|
+
children: /* @__PURE__ */ T(Se, {
|
|
1162
1169
|
className: "p-3 flex items-center gap-2",
|
|
1163
1170
|
children: [
|
|
1164
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ T("div", {
|
|
1165
1172
|
className: "flex flex-col gap-0.5",
|
|
1166
|
-
children: [/* @__PURE__ */
|
|
1173
|
+
children: [/* @__PURE__ */ w(_, {
|
|
1167
1174
|
variant: "ghost",
|
|
1168
1175
|
size: "icon-sm",
|
|
1169
|
-
onClick: () =>
|
|
1176
|
+
onClick: () => kt(t),
|
|
1170
1177
|
disabled: t === 0,
|
|
1171
1178
|
className: "h-5 w-5",
|
|
1172
|
-
children: /* @__PURE__ */
|
|
1173
|
-
}), /* @__PURE__ */
|
|
1179
|
+
children: /* @__PURE__ */ w(me, { className: "size-3" })
|
|
1180
|
+
}), /* @__PURE__ */ w(_, {
|
|
1174
1181
|
variant: "ghost",
|
|
1175
1182
|
size: "icon-sm",
|
|
1176
|
-
onClick: () =>
|
|
1183
|
+
onClick: () => At(t),
|
|
1177
1184
|
disabled: t === H.length - 1,
|
|
1178
1185
|
className: "h-5 w-5",
|
|
1179
|
-
children: /* @__PURE__ */
|
|
1186
|
+
children: /* @__PURE__ */ w(pe, { className: "size-3" })
|
|
1180
1187
|
})]
|
|
1181
1188
|
}),
|
|
1182
|
-
/* @__PURE__ */
|
|
1189
|
+
/* @__PURE__ */ T("div", {
|
|
1183
1190
|
className: "flex-1 min-w-0",
|
|
1184
|
-
children: [/* @__PURE__ */
|
|
1191
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1185
1192
|
className: "flex items-center gap-2",
|
|
1186
|
-
children: [/* @__PURE__ */
|
|
1193
|
+
children: [/* @__PURE__ */ w("span", {
|
|
1187
1194
|
"aria-hidden": "true",
|
|
1188
|
-
className: `size-2 shrink-0 rounded-full ${
|
|
1189
|
-
}), /* @__PURE__ */
|
|
1195
|
+
className: `size-2 shrink-0 rounded-full ${Re[e.style] || ze}`
|
|
1196
|
+
}), /* @__PURE__ */ w("span", {
|
|
1190
1197
|
className: "text-sm font-medium truncate",
|
|
1191
1198
|
children: e.label
|
|
1192
1199
|
})]
|
|
1193
|
-
}), /* @__PURE__ */
|
|
1200
|
+
}), /* @__PURE__ */ w("p", {
|
|
1194
1201
|
className: "text-xs text-text-secondary truncate",
|
|
1195
|
-
children:
|
|
1196
|
-
method:
|
|
1197
|
-
url:
|
|
1198
|
-
}) :
|
|
1202
|
+
children: wt.has(e.name) ? D("bigconsole.widget.properties.actions.webhookSummary", "→ {{method}} {{url}}", {
|
|
1203
|
+
method: wt.get(e.name)?.method ?? "",
|
|
1204
|
+
url: wt.get(e.name)?.webhookUrl ?? ""
|
|
1205
|
+
}) : D("bigconsole.widget.properties.actions.emitsEvent", "Emits an event")
|
|
1199
1206
|
})]
|
|
1200
1207
|
}),
|
|
1201
|
-
/* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ T("div", {
|
|
1202
1209
|
className: "flex shrink-0 gap-1",
|
|
1203
|
-
children: [/* @__PURE__ */
|
|
1210
|
+
children: [/* @__PURE__ */ w(_, {
|
|
1204
1211
|
variant: "ghost",
|
|
1205
1212
|
size: "icon-sm",
|
|
1206
1213
|
"aria-label": `Edit ${e.label}`,
|
|
1207
|
-
onClick: () =>
|
|
1208
|
-
children: /* @__PURE__ */
|
|
1209
|
-
}), /* @__PURE__ */
|
|
1214
|
+
onClick: () => Et(e),
|
|
1215
|
+
children: /* @__PURE__ */ w(_e, { className: "size-4" })
|
|
1216
|
+
}), /* @__PURE__ */ w(_, {
|
|
1210
1217
|
variant: "ghost",
|
|
1211
1218
|
size: "icon-sm",
|
|
1212
1219
|
"aria-label": `Delete ${e.label}`,
|
|
1213
|
-
onClick: () =>
|
|
1214
|
-
children: /* @__PURE__ */
|
|
1220
|
+
onClick: () => Ot(e.id),
|
|
1221
|
+
children: /* @__PURE__ */ w(ye, { className: "size-4" })
|
|
1215
1222
|
})]
|
|
1216
1223
|
})
|
|
1217
1224
|
]
|
|
@@ -1219,67 +1226,67 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
1219
1226
|
}, e.id))
|
|
1220
1227
|
})
|
|
1221
1228
|
}),
|
|
1222
|
-
/* @__PURE__ */
|
|
1223
|
-
title:
|
|
1229
|
+
/* @__PURE__ */ w(t, {
|
|
1230
|
+
title: D("bigconsole.widget.properties.section.drilldown", "Drilldown"),
|
|
1224
1231
|
description: "Where a click on this widget's data takes the viewer.",
|
|
1225
1232
|
headingLevel: 3,
|
|
1226
1233
|
"data-testid": "widget-inspector-drilldown",
|
|
1227
|
-
children: /* @__PURE__ */
|
|
1228
|
-
widget:
|
|
1229
|
-
onChange:
|
|
1234
|
+
children: /* @__PURE__ */ w(se, {
|
|
1235
|
+
widget: I,
|
|
1236
|
+
onChange: It
|
|
1230
1237
|
})
|
|
1231
1238
|
}),
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
title:
|
|
1239
|
+
/* @__PURE__ */ w(t, {
|
|
1240
|
+
title: D("bigconsole.widget.properties.section.webhooks", "Webhooks"),
|
|
1234
1241
|
description: "HTTP endpoints called when this widget emits an event.",
|
|
1235
1242
|
headingLevel: 3,
|
|
1236
1243
|
"data-testid": "widget-inspector-webhooks",
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1238
|
-
dashboardId:
|
|
1239
|
-
widgetId:
|
|
1244
|
+
children: /* @__PURE__ */ w(ae, {
|
|
1245
|
+
dashboardId: I.dashboardId,
|
|
1246
|
+
widgetId: I.id
|
|
1240
1247
|
})
|
|
1241
1248
|
}),
|
|
1242
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ w(t, {
|
|
1243
1250
|
emphasis: "muted",
|
|
1244
|
-
title:
|
|
1251
|
+
title: D("bigconsole.widget.properties.section.events", "Events"),
|
|
1245
1252
|
description: "Recent deliveries for this widget, newest first. Supporting detail — nothing here changes the widget.",
|
|
1246
1253
|
headingLevel: 3,
|
|
1247
1254
|
"data-testid": "widget-inspector-events",
|
|
1248
|
-
children: /* @__PURE__ */
|
|
1249
|
-
dashboardId:
|
|
1250
|
-
widgetId:
|
|
1255
|
+
children: /* @__PURE__ */ w(oe, {
|
|
1256
|
+
dashboardId: I.dashboardId,
|
|
1257
|
+
widgetId: I.id,
|
|
1251
1258
|
maxHeight: "min(50vh, 360px)"
|
|
1252
1259
|
})
|
|
1253
1260
|
})
|
|
1254
1261
|
] })
|
|
1255
1262
|
}),
|
|
1256
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ w(x, {
|
|
1257
1264
|
value: "appearance",
|
|
1258
1265
|
className: "mt-0",
|
|
1259
|
-
children:
|
|
1260
|
-
widgetType:
|
|
1261
|
-
config:
|
|
1262
|
-
onChange:
|
|
1266
|
+
children: A && /* @__PURE__ */ w(le, {
|
|
1267
|
+
widgetType: I.type,
|
|
1268
|
+
config: A.config || {},
|
|
1269
|
+
onChange: Ft
|
|
1263
1270
|
})
|
|
1264
1271
|
})
|
|
1265
1272
|
]
|
|
1266
1273
|
})]
|
|
1267
|
-
}) : /* @__PURE__ */
|
|
1274
|
+
}) : /* @__PURE__ */ w("div", {
|
|
1268
1275
|
className: "flex min-h-0 flex-1 items-center justify-center p-card-padding",
|
|
1269
|
-
children: /* @__PURE__ */
|
|
1276
|
+
children: /* @__PURE__ */ w(t, {
|
|
1270
1277
|
tone: "info",
|
|
1271
|
-
title:
|
|
1278
|
+
title: D("bigconsole.widget.properties.emptyState", "Select a widget to edit"),
|
|
1272
1279
|
headingLevel: 3,
|
|
1273
|
-
icon: /* @__PURE__ */
|
|
1280
|
+
icon: /* @__PURE__ */ w(ge, { className: "h-icon-md w-icon-md" }),
|
|
1274
1281
|
className: "w-full max-w-sm",
|
|
1275
1282
|
"data-testid": "widget-inspector-empty",
|
|
1276
|
-
children: /* @__PURE__ */
|
|
1283
|
+
children: /* @__PURE__ */ w("p", {
|
|
1277
1284
|
className: "text-sm text-text-secondary",
|
|
1278
1285
|
children: "Pick a widget on the canvas and its identity, data binding, actions and style options appear here."
|
|
1279
1286
|
})
|
|
1280
1287
|
})
|
|
1281
1288
|
}),
|
|
1282
|
-
|
|
1289
|
+
I && /* @__PURE__ */ T("div", {
|
|
1283
1290
|
style: {
|
|
1284
1291
|
padding: "var(--space-cardPadding)",
|
|
1285
1292
|
borderTop: "1px solid var(--color-border-subtle)",
|
|
@@ -1287,96 +1294,96 @@ var T = fe(function({ isOpen: fe, onClose: ge }) {
|
|
|
1287
1294
|
flexShrink: 0
|
|
1288
1295
|
},
|
|
1289
1296
|
children: [
|
|
1290
|
-
|
|
1297
|
+
M && /* @__PURE__ */ w(t, {
|
|
1291
1298
|
tone: "warning",
|
|
1292
1299
|
padding: "compact",
|
|
1293
|
-
title:
|
|
1300
|
+
title: D("bigconsole.widget.properties.footer.unsavedChanges", "You have unsaved changes"),
|
|
1294
1301
|
headingLevel: 3,
|
|
1295
1302
|
className: "mb-control-gap",
|
|
1296
1303
|
"data-testid": "widget-inspector-save-unsaved"
|
|
1297
1304
|
}),
|
|
1298
|
-
|
|
1305
|
+
O === "saved" && !M && /* @__PURE__ */ w(t, {
|
|
1299
1306
|
tone: "success",
|
|
1300
1307
|
padding: "compact",
|
|
1301
|
-
title:
|
|
1308
|
+
title: D("bigconsole.widget.properties.footer.allSaved", "All changes saved"),
|
|
1302
1309
|
headingLevel: 3,
|
|
1303
|
-
icon: /* @__PURE__ */
|
|
1310
|
+
icon: /* @__PURE__ */ w(h, { className: "h-icon-sm w-icon-sm" }),
|
|
1304
1311
|
className: "mb-control-gap",
|
|
1305
1312
|
"data-testid": "widget-inspector-save-saved"
|
|
1306
1313
|
}),
|
|
1307
|
-
|
|
1314
|
+
O === "error" && /* @__PURE__ */ w(t, {
|
|
1308
1315
|
tone: "danger",
|
|
1309
1316
|
padding: "compact",
|
|
1310
|
-
title:
|
|
1317
|
+
title: D("bigconsole.widget.properties.footer.saveFailed", "Failed to save changes"),
|
|
1311
1318
|
headingLevel: 3,
|
|
1312
|
-
icon: /* @__PURE__ */
|
|
1319
|
+
icon: /* @__PURE__ */ w(g, { className: "h-icon-sm w-icon-sm" }),
|
|
1313
1320
|
className: "mb-control-gap",
|
|
1314
1321
|
"data-testid": "widget-inspector-save-error"
|
|
1315
1322
|
}),
|
|
1316
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ T("div", {
|
|
1317
1324
|
className: "flex flex-wrap gap-control-gap",
|
|
1318
|
-
children: [/* @__PURE__ */
|
|
1319
|
-
onClick:
|
|
1320
|
-
disabled:
|
|
1325
|
+
children: [/* @__PURE__ */ w(_, {
|
|
1326
|
+
onClick: Nt,
|
|
1327
|
+
disabled: O === "saving" || !M,
|
|
1321
1328
|
style: {
|
|
1322
1329
|
flex: 1,
|
|
1323
1330
|
height: "var(--size-controlHeight-md)",
|
|
1324
|
-
backgroundColor:
|
|
1325
|
-
opacity:
|
|
1331
|
+
backgroundColor: M ? "var(--color-action-primary-bg)" : void 0,
|
|
1332
|
+
opacity: M ? 1 : .5
|
|
1326
1333
|
},
|
|
1327
|
-
children:
|
|
1334
|
+
children: O === "saving" ? /* @__PURE__ */ T("span", {
|
|
1328
1335
|
style: {
|
|
1329
1336
|
display: "flex",
|
|
1330
1337
|
alignItems: "center",
|
|
1331
1338
|
gap: "var(--space-iconGap)"
|
|
1332
1339
|
},
|
|
1333
|
-
children: [/* @__PURE__ */
|
|
1340
|
+
children: [/* @__PURE__ */ w(Me, { style: {
|
|
1334
1341
|
width: "var(--size-icon-sm)",
|
|
1335
1342
|
height: "var(--size-icon-sm)"
|
|
1336
|
-
} }),
|
|
1337
|
-
}) : /* @__PURE__ */
|
|
1343
|
+
} }), D("bigconsole.widget.properties.footer.saving", "Saving...")]
|
|
1344
|
+
}) : /* @__PURE__ */ T("span", {
|
|
1338
1345
|
style: {
|
|
1339
1346
|
display: "flex",
|
|
1340
1347
|
alignItems: "center",
|
|
1341
1348
|
gap: "var(--space-iconGap)"
|
|
1342
1349
|
},
|
|
1343
|
-
children: [/* @__PURE__ */
|
|
1350
|
+
children: [/* @__PURE__ */ w(h, { style: {
|
|
1344
1351
|
width: "var(--size-icon-sm)",
|
|
1345
1352
|
height: "var(--size-icon-sm)"
|
|
1346
|
-
} }),
|
|
1353
|
+
} }), D("bigconsole.widget.properties.footer.saveChanges", "Save Changes")]
|
|
1347
1354
|
})
|
|
1348
|
-
}), /* @__PURE__ */
|
|
1355
|
+
}), /* @__PURE__ */ T(_, {
|
|
1349
1356
|
variant: "outline",
|
|
1350
|
-
onClick:
|
|
1351
|
-
disabled:
|
|
1357
|
+
onClick: Pt,
|
|
1358
|
+
disabled: O === "saving" || !M,
|
|
1352
1359
|
style: {
|
|
1353
1360
|
height: "var(--size-controlHeight-md)",
|
|
1354
|
-
opacity:
|
|
1361
|
+
opacity: M ? 1 : .5
|
|
1355
1362
|
},
|
|
1356
|
-
children: [/* @__PURE__ */
|
|
1363
|
+
children: [/* @__PURE__ */ w(g, { style: {
|
|
1357
1364
|
width: "var(--size-icon-sm)",
|
|
1358
1365
|
height: "var(--size-icon-sm)"
|
|
1359
|
-
} }),
|
|
1366
|
+
} }), D("bigconsole.widget.properties.footer.discard", "Discard")]
|
|
1360
1367
|
})]
|
|
1361
1368
|
})
|
|
1362
1369
|
]
|
|
1363
1370
|
}),
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
isOpen:
|
|
1371
|
+
/* @__PURE__ */ w(ie, {
|
|
1372
|
+
isOpen: _t,
|
|
1366
1373
|
action: J,
|
|
1367
|
-
initialWebhook:
|
|
1368
|
-
isLoading:
|
|
1369
|
-
saveError:
|
|
1374
|
+
initialWebhook: Ct,
|
|
1375
|
+
isLoading: vt,
|
|
1376
|
+
saveError: xt,
|
|
1370
1377
|
onClose: () => {
|
|
1371
1378
|
q(!1), Y(void 0), X(void 0), Z(null);
|
|
1372
1379
|
},
|
|
1373
|
-
onSave:
|
|
1380
|
+
onSave: Dt
|
|
1374
1381
|
})
|
|
1375
1382
|
]
|
|
1376
1383
|
})
|
|
1377
1384
|
});
|
|
1378
1385
|
});
|
|
1379
1386
|
//#endregion
|
|
1380
|
-
export {
|
|
1387
|
+
export { D as default };
|
|
1381
1388
|
|
|
1382
1389
|
//# sourceMappingURL=PropertiesPanel.js.map
|