@burdenoff/microfe-bigconsole 2026.1124.4 → 2026.1124.6
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/builder/inspector/AppearanceSection.js +12 -6
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.d.ts +2 -1
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +34 -34
- package/dist/bigconsole/components/fleet/FleetBindingsDialog.js +113 -115
- package/dist/bigconsole/components/fleet/FleetCopySection.js +2 -2
- package/dist/bigconsole/components/fleet/FleetWidgetActions.js +62 -57
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +489 -474
- package/dist/bigconsole/components/widgets/chart/ChartConfig.d.ts +1 -0
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +111 -107
- package/dist/bigconsole/components/widgets/chart/ChartFieldMappings.d.ts +8 -0
- package/dist/bigconsole/components/widgets/chart/ChartFieldMappings.js +85 -0
- package/dist/bigconsole/components/widgets/chart/chartMappingFields.d.ts +9 -0
- package/dist/bigconsole/components/widgets/chart/chartMappingFields.js +30 -0
- package/dist/bigconsole/components/widgets/chart/charts/funnelData.d.ts +2 -0
- package/dist/bigconsole/components/widgets/chart/charts/funnelData.js +11 -13
- package/dist/bigconsole/utils/fleetPlural.d.ts +7 -0
- package/dist/bigconsole/utils/fleetPlural.js +11 -0
- package/dist/bigconsole/utils/widgetBinding.js +57 -44
- package/package.json +1 -1
|
@@ -26,18 +26,19 @@ import { DataBindingSection as ue } from "../builder/inspector/DataBindingSectio
|
|
|
26
26
|
import { LayoutSection as de } from "../builder/inspector/LayoutSection.js";
|
|
27
27
|
import { positionToSave as fe, positionsEqual as pe, readWidgetPosition as me } from "../../utils/widgetPanelPosition.js";
|
|
28
28
|
import "../common/index.js";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
29
|
+
import { ChartFieldMappings as he } from "./chart/ChartFieldMappings.js";
|
|
30
|
+
import { describeWidgetShape as ge, getWidgetSampleExample as _e } from "../../utils/widgetSampleShapes.js";
|
|
31
|
+
import { UnsupportedDataSourceNotice as ve } from "./UnsupportedDataSourceNotice.js";
|
|
32
|
+
import { getWidgetBinding as d, getWidgetBindingStatus as ye, parserTestOutcome as be, reconcilePanelConfig as xe, serializeWidgetBinding as Se } from "../../utils/widgetBinding.js";
|
|
33
|
+
import { memo as f, useCallback as p, useEffect as m, useMemo as Ce, useRef as h, useState as g } from "react";
|
|
34
|
+
import { Check as we, ChevronDown as Te, ChevronUp as Ee, ExternalLink as De, Info as Oe, Pencil as ke, Plus as Ae, Trash2 as je, X as Me } from "lucide-react";
|
|
35
|
+
import { Button as _, Card as Ne, CardContent as Pe, Input as v, Label as y, Select as Fe, SelectContent as Ie, SelectItem as b, SelectTrigger as Le, SelectValue as Re, Sheet as ze, SheetContent as Be, SheetDescription as Ve, SheetHeader as He, SheetTitle as Ue, Spinner as We, Tabs as Ge, TabsContent as Ke, TabsList as qe, TabsTrigger as Je, Textarea as x } from "@burdenoff/fe-libs/ui";
|
|
36
|
+
import { useUnsavedChanges as Ye } from "@burdenoff/fe-libs/shared/hooks";
|
|
37
|
+
import { useI18n as Xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
37
38
|
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
38
|
-
import { toast as
|
|
39
|
+
import { toast as Ze } from "sonner";
|
|
39
40
|
// src/bigconsole/components/widgets/PropertiesPanel.tsx
|
|
40
|
-
var
|
|
41
|
+
var Qe = [
|
|
41
42
|
{
|
|
42
43
|
value: "BIGCONSOLE",
|
|
43
44
|
labelKey: "bigconsole.widget.properties.renderer.bigconsole.label",
|
|
@@ -66,7 +67,7 @@ var Ze = [
|
|
|
66
67
|
descriptionKey: "bigconsole.widget.properties.renderer.custom.description",
|
|
67
68
|
description: "Custom React component"
|
|
68
69
|
}
|
|
69
|
-
],
|
|
70
|
+
], $e = [
|
|
70
71
|
{
|
|
71
72
|
value: "DATASINK",
|
|
72
73
|
labelKey: "bigconsole.widget.properties.dataSourceType.datasink.label",
|
|
@@ -110,23 +111,23 @@ var Ze = [
|
|
|
110
111
|
description: "Manually enter sample JSON data"
|
|
111
112
|
}
|
|
112
113
|
];
|
|
113
|
-
function
|
|
114
|
+
function et(e) {
|
|
114
115
|
return `widget:${e.toLowerCase().replace(/\s+/g, "_")}:clicked`;
|
|
115
116
|
}
|
|
116
|
-
var
|
|
117
|
+
var tt = {
|
|
117
118
|
PRIMARY: "bg-action-primary-bg",
|
|
118
119
|
SECONDARY: "bg-[var(--color-text-muted)]",
|
|
119
120
|
SUCCESS: "bg-status-success-bg",
|
|
120
121
|
WARNING: "bg-status-warning-bg",
|
|
121
122
|
DANGER: "bg-status-error-bg"
|
|
122
|
-
},
|
|
123
|
+
}, nt = "bg-[var(--color-text-muted)]", rt = {
|
|
123
124
|
fontWeight: "var(--font-weight-semibold)",
|
|
124
125
|
fontSize: "var(--font-size-body-sm)",
|
|
125
126
|
padding: "6px 10px",
|
|
126
127
|
minHeight: "var(--size-controlHeight-md)",
|
|
127
128
|
flexShrink: 0
|
|
128
129
|
};
|
|
129
|
-
function
|
|
130
|
+
function it(e) {
|
|
130
131
|
if (!e) return {};
|
|
131
132
|
let t = Array.isArray(e) ? e[0] : e;
|
|
132
133
|
if (!t || typeof t != "object") return {};
|
|
@@ -170,8 +171,8 @@ function nt(e) {
|
|
|
170
171
|
xAxisField: a
|
|
171
172
|
};
|
|
172
173
|
}
|
|
173
|
-
var
|
|
174
|
-
let { t: r } =
|
|
174
|
+
var at = f(function({ widget: e, onSave: t }) {
|
|
175
|
+
let { t: r } = Xe(), [i, a] = g(""), [o, s] = g(null), ee = h(!1);
|
|
175
176
|
m(() => {
|
|
176
177
|
try {
|
|
177
178
|
let t = e.template && typeof e.template == "object" ? JSON.stringify(e.template, null, 2) : "";
|
|
@@ -255,7 +256,7 @@ var rt = f(function({ widget: e, onSave: t }) {
|
|
|
255
256
|
alignItems: "center",
|
|
256
257
|
gap: "4px"
|
|
257
258
|
},
|
|
258
|
-
children: [/* @__PURE__ */ S(
|
|
259
|
+
children: [/* @__PURE__ */ S(we, { style: {
|
|
259
260
|
width: "12px",
|
|
260
261
|
height: "12px"
|
|
261
262
|
} }), r("bigconsole.widget.properties.template.validJson", "Valid JSON")]
|
|
@@ -281,7 +282,7 @@ var rt = f(function({ widget: e, onSave: t }) {
|
|
|
281
282
|
fontWeight: "var(--font-weight-medium)",
|
|
282
283
|
textDecoration: "none"
|
|
283
284
|
},
|
|
284
|
-
children: [r("bigconsole.widget.properties.template.designer", "Designer"), /* @__PURE__ */ S(
|
|
285
|
+
children: [r("bigconsole.widget.properties.template.designer", "Designer"), /* @__PURE__ */ S(De, { style: {
|
|
285
286
|
height: "var(--size-icon-sm)",
|
|
286
287
|
width: "var(--size-icon-sm)"
|
|
287
288
|
} })]
|
|
@@ -299,7 +300,7 @@ var rt = f(function({ widget: e, onSave: t }) {
|
|
|
299
300
|
fontWeight: "var(--font-weight-medium)",
|
|
300
301
|
textDecoration: "none"
|
|
301
302
|
},
|
|
302
|
-
children: [r("bigconsole.widget.properties.template.blockKitBuilder", "Block Kit Builder"), /* @__PURE__ */ S(
|
|
303
|
+
children: [r("bigconsole.widget.properties.template.blockKitBuilder", "Block Kit Builder"), /* @__PURE__ */ S(De, { style: {
|
|
303
304
|
height: "var(--size-icon-sm)",
|
|
304
305
|
width: "var(--size-icon-sm)"
|
|
305
306
|
} })]
|
|
@@ -309,7 +310,7 @@ var rt = f(function({ widget: e, onSave: t }) {
|
|
|
309
310
|
]
|
|
310
311
|
});
|
|
311
312
|
});
|
|
312
|
-
function
|
|
313
|
+
function ot(e) {
|
|
313
314
|
let t = e, n = d({
|
|
314
315
|
dataSinkId: t.dataSinkId,
|
|
315
316
|
parserId: t.parserId,
|
|
@@ -337,351 +338,356 @@ function it(e) {
|
|
|
337
338
|
} : void 0
|
|
338
339
|
};
|
|
339
340
|
}
|
|
340
|
-
var
|
|
341
|
-
let { t:
|
|
342
|
-
|
|
341
|
+
var w = f(function({ isOpen: f, onClose: De }) {
|
|
342
|
+
let { t: w } = Xe(), [st, ct] = g("general"), [T, E] = g("idle"), [D, O] = g(null), [k, A] = g(!1), [lt, j] = g(null);
|
|
343
|
+
Ye({
|
|
343
344
|
id: "dashboard-widget-properties",
|
|
344
|
-
label:
|
|
345
|
-
dirty: ae(
|
|
345
|
+
label: w("bigconsole.assistant.unsaved.widgetProperties", "the widget properties"),
|
|
346
|
+
dirty: ae(D, lt)
|
|
346
347
|
});
|
|
347
|
-
let
|
|
348
|
-
|
|
349
|
-
}, []),
|
|
350
|
-
|
|
348
|
+
let M = e((e) => e.selectedWidgetId), ut = e((e) => e.widgets), N = e((e) => e.updateWidget), P = e((e) => e.updateWidgetPosition), dt = t(), F = M ? ut.get(M) : void 0, ft = F ? me(F) : null, I = h(null), pt = h(null), mt = h({}), ht = h(0), L = p(() => {
|
|
349
|
+
ht.current += 1, A(!0);
|
|
350
|
+
}, []), gt = p((e) => {
|
|
351
|
+
M && (P(M, e), L());
|
|
351
352
|
}, [
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
353
|
+
M,
|
|
354
|
+
P,
|
|
355
|
+
L
|
|
355
356
|
]);
|
|
356
357
|
m(() => {
|
|
357
|
-
if (!
|
|
358
|
-
|
|
358
|
+
if (!M) {
|
|
359
|
+
pt.current = null, I.current = null, O(null), j(null), A(!1), E("idle");
|
|
359
360
|
return;
|
|
360
361
|
}
|
|
361
|
-
let e =
|
|
362
|
-
if (
|
|
363
|
-
if (
|
|
364
|
-
let t =
|
|
365
|
-
|
|
366
|
-
} else
|
|
362
|
+
let e = pt.current !== M;
|
|
363
|
+
if (pt.current = M, F) {
|
|
364
|
+
if (k && !e) return;
|
|
365
|
+
let t = ot(F);
|
|
366
|
+
O(t), j(t), mt.current = F.config || {}, I.current = me(F), A(!1), E("idle");
|
|
367
|
+
} else I.current = null, O(null), j(null), A(!1), E("idle");
|
|
367
368
|
}, [
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
M,
|
|
370
|
+
F,
|
|
371
|
+
k
|
|
371
372
|
]);
|
|
372
|
-
let { updateWidget:
|
|
373
|
-
consoleId:
|
|
373
|
+
let { updateWidget: _t } = i(F?.pageId, F?.dashboardId, { skipFetch: !0 }), { createDrilldown: vt, updateDrilldown: yt, deleteDrilldown: bt } = o(), { dataSinks: R } = u({ skipFetch: !1 }), [xt, St] = g(null), { executeParser: Ct, fetchParser: wt } = te({
|
|
374
|
+
consoleId: F?.dashboardId,
|
|
374
375
|
skipFetch: !0
|
|
375
|
-
}), [
|
|
376
|
+
}), [z, Tt] = g(null), [Et, Dt] = g(!1), B = D?.parserId;
|
|
376
377
|
m(() => {
|
|
377
378
|
let e = !1;
|
|
378
|
-
if (
|
|
379
|
-
else return
|
|
380
|
-
e || (
|
|
379
|
+
if (Tt(null), !f || !B) Dt(!1);
|
|
380
|
+
else return Dt(!0), wt(B).then((t) => {
|
|
381
|
+
e || (Tt(t), Dt(!1));
|
|
381
382
|
}), () => {
|
|
382
383
|
e = !0;
|
|
383
384
|
};
|
|
384
385
|
}, [
|
|
385
386
|
f,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
B,
|
|
388
|
+
M,
|
|
389
|
+
wt
|
|
389
390
|
]);
|
|
390
|
-
let [
|
|
391
|
+
let [Ot, V] = g(!1), [kt, H] = g(), [At, U] = g(!1), [jt, W] = g(null), G = M && B ? `${M}:${B}` : null, Mt = kt?.key === G ? kt.value : void 0, K = h(null);
|
|
391
392
|
m(() => {
|
|
392
|
-
K.current = null,
|
|
393
|
-
}, [
|
|
394
|
-
if (!f ||
|
|
395
|
-
let e =
|
|
396
|
-
if (K.current === e) return;
|
|
393
|
+
K.current = null, H(void 0), U(!1), W(null), V(!1);
|
|
394
|
+
}, [M]), m(() => {
|
|
395
|
+
if (!f || st !== "data" || !B || !G || K.current?.key === G) return;
|
|
396
|
+
let e = { key: G };
|
|
397
397
|
K.current = e;
|
|
398
|
-
let t =
|
|
399
|
-
|
|
398
|
+
let t = w("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview.");
|
|
399
|
+
V(!0), Ct(B).then((n) => {
|
|
400
400
|
if (K.current !== e) return;
|
|
401
|
-
let r =
|
|
402
|
-
|
|
401
|
+
let r = be(n, t);
|
|
402
|
+
H({
|
|
403
|
+
key: e.key,
|
|
404
|
+
value: r.preview
|
|
405
|
+
}), W(r.error), U(!0);
|
|
403
406
|
}).catch((n) => {
|
|
404
|
-
K.current === e && (
|
|
407
|
+
K.current === e && (W(n instanceof Error ? n.message : t), U(!0));
|
|
405
408
|
}).finally(() => {
|
|
406
|
-
K.current === e &&
|
|
409
|
+
K.current === e && V(!1);
|
|
407
410
|
});
|
|
408
411
|
}, [
|
|
409
412
|
f,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
st,
|
|
414
|
+
G,
|
|
415
|
+
B,
|
|
416
|
+
Ct,
|
|
417
|
+
w
|
|
415
418
|
]);
|
|
416
|
-
let { actions: q, loading:
|
|
417
|
-
widgetId:
|
|
418
|
-
skipFetch: !
|
|
419
|
-
}),
|
|
420
|
-
let n =
|
|
421
|
-
return e.find((e) => e.widgetId ===
|
|
422
|
-
}, [
|
|
423
|
-
if (!
|
|
424
|
-
if (
|
|
425
|
-
let n =
|
|
426
|
-
if (!r &&
|
|
427
|
-
let t = (await
|
|
428
|
-
r =
|
|
419
|
+
let { actions: q, loading: Nt, error: Pt, refetch: Ft, createAction: It, updateAction: Lt, deleteAction: Rt, reorderActions: zt } = a(M || void 0), { webhooks: Bt, loading: Vt, error: Ht, createWebhook: Ut, updateWebhook: Wt, deleteWebhook: Gt, refetch: Kt } = c({
|
|
420
|
+
widgetId: M || void 0,
|
|
421
|
+
skipFetch: !M
|
|
422
|
+
}), qt = p((e, t) => {
|
|
423
|
+
let n = et(t);
|
|
424
|
+
return e.find((e) => e.widgetId === M && e.eventPattern === n) ?? null;
|
|
425
|
+
}, [M]), J = p((e) => qt(Bt, e), [qt, Bt]), Jt = p(async (e, t) => {
|
|
426
|
+
if (!M || t === void 0) return !0;
|
|
427
|
+
if (Ht) return !1;
|
|
428
|
+
let n = et(e), r = J(e);
|
|
429
|
+
if (!r && Vt) {
|
|
430
|
+
let t = (await Kt())?.data?.listEventWebhookMappings ?? [];
|
|
431
|
+
r = qt(t, e);
|
|
429
432
|
}
|
|
430
|
-
return t && t.url ? r ? await
|
|
433
|
+
return t && t.url ? r ? await Wt({
|
|
431
434
|
id: r.id,
|
|
432
435
|
eventPattern: n,
|
|
433
436
|
webhookUrl: t.url,
|
|
434
437
|
method: t.method,
|
|
435
438
|
isActive: !0
|
|
436
|
-
}) !== null : await
|
|
437
|
-
widgetId:
|
|
439
|
+
}) !== null : await Ut({
|
|
440
|
+
widgetId: M,
|
|
438
441
|
eventPattern: n,
|
|
439
442
|
webhookUrl: t.url,
|
|
440
443
|
method: t.method
|
|
441
|
-
}) !== null : t === null && r ?
|
|
444
|
+
}) !== null : t === null && r ? Gt(r.id) : !0;
|
|
442
445
|
}, [
|
|
443
|
-
|
|
446
|
+
M,
|
|
444
447
|
J,
|
|
445
|
-
|
|
446
|
-
|
|
448
|
+
Vt,
|
|
449
|
+
Ht,
|
|
450
|
+
Kt,
|
|
451
|
+
qt,
|
|
447
452
|
Ut,
|
|
448
453
|
Wt,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
if (!Jt) return null;
|
|
454
|
-
let e = J(Jt.name);
|
|
454
|
+
Gt
|
|
455
|
+
]), [Yt, Xt] = g(!1), [Zt, Y] = g(void 0), [Qt, $t] = g(!1), [en, X] = g(void 0), [tn, Z] = g(null), nn = Ce(() => {
|
|
456
|
+
if (!Zt) return null;
|
|
457
|
+
let e = J(Zt.name);
|
|
455
458
|
return e ? {
|
|
456
459
|
url: e.webhookUrl,
|
|
457
460
|
method: e.method
|
|
458
461
|
} : null;
|
|
459
|
-
}, [
|
|
462
|
+
}, [Zt, J]), rn = en === void 0 ? nn : en, an = Ce(() => {
|
|
460
463
|
let e = /* @__PURE__ */ new Map();
|
|
461
464
|
for (let t of q) {
|
|
462
465
|
let n = J(t.name);
|
|
463
466
|
n && e.set(t.name, n);
|
|
464
467
|
}
|
|
465
468
|
return e;
|
|
466
|
-
}, [q, J]),
|
|
467
|
-
X(void 0), Z(null), Y(void 0),
|
|
468
|
-
}, []),
|
|
469
|
-
X(void 0), Z(null), Y(e),
|
|
470
|
-
}, []),
|
|
471
|
-
if (
|
|
472
|
-
if (
|
|
473
|
-
else if (
|
|
469
|
+
}, [q, J]), on = p(() => {
|
|
470
|
+
X(void 0), Z(null), Y(void 0), Xt(!0);
|
|
471
|
+
}, []), sn = p((e) => {
|
|
472
|
+
X(void 0), Z(null), Y(e), Xt(!0);
|
|
473
|
+
}, []), cn = p(async (e, t) => {
|
|
474
|
+
if (M) {
|
|
475
|
+
if (Pt) Z(w("bigconsole.widget.properties.actions.readFailed", "Buttons could not be verified. Retry before saving."));
|
|
476
|
+
else if (Ht) Z(w("bigconsole.widget.properties.action.webhookReadFailed", "Webhook mappings could not be verified. Retry the webhook read before saving."));
|
|
474
477
|
else {
|
|
475
|
-
|
|
478
|
+
$t(!0), Z(null);
|
|
476
479
|
try {
|
|
477
480
|
let n = "id" in e && !!e.id, r = null;
|
|
478
|
-
if (r = n ? await
|
|
481
|
+
if (r = n ? await Lt(e) : await It(e), r) {
|
|
479
482
|
let e = [...q];
|
|
480
483
|
if (n) {
|
|
481
484
|
let t = e.findIndex((e) => e.id === r?.id);
|
|
482
485
|
t >= 0 && (e[t] = r);
|
|
483
486
|
} else e.push(r);
|
|
484
487
|
let i = e.sort((e, t) => e.order - t.order);
|
|
485
|
-
if (
|
|
486
|
-
X(t), Z(t ?
|
|
488
|
+
if (N(M, { actions: i }), !await Jt(r.name, t)) {
|
|
489
|
+
X(t), Z(t ? w("bigconsole.widget.properties.action.webhookSaveFailed", "The button was saved, but its webhook could not be saved. Check the URL and try again.") : w("bigconsole.widget.properties.action.webhookRemoveFailed", "The button was saved, but its old webhook could not be removed. Try again.")), Y(r);
|
|
487
490
|
return;
|
|
488
491
|
}
|
|
489
|
-
X(void 0), Z(null),
|
|
492
|
+
X(void 0), Z(null), Xt(!1), Y(void 0);
|
|
490
493
|
}
|
|
491
494
|
} catch (e) {
|
|
492
|
-
console.warn("Failed to save widget action:", e), Z(e instanceof Error ? e.message :
|
|
495
|
+
console.warn("Failed to save widget action:", e), Z(e instanceof Error ? e.message : w("bigconsole.widget.properties.action.saveFailed", "Could not save the button. Please try again."));
|
|
493
496
|
} finally {
|
|
494
|
-
|
|
497
|
+
$t(!1);
|
|
495
498
|
}
|
|
496
499
|
}
|
|
497
500
|
}
|
|
498
501
|
}, [
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
jt,
|
|
502
|
-
q,
|
|
503
|
-
Nt,
|
|
502
|
+
M,
|
|
503
|
+
Ht,
|
|
504
504
|
Pt,
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
505
|
+
q,
|
|
506
|
+
It,
|
|
507
|
+
Lt,
|
|
508
|
+
N,
|
|
509
|
+
Jt,
|
|
510
|
+
w
|
|
511
|
+
]), ln = p(async (e) => {
|
|
512
|
+
if (M && window.confirm(w("bigconsole.widget.properties.action.deleteConfirm", "Are you sure you want to delete this action?"))) {
|
|
510
513
|
let t = q.find((t) => t.id === e);
|
|
511
|
-
if (await
|
|
514
|
+
if (await Rt(e)) {
|
|
512
515
|
let n = q.filter((t) => t.id !== e);
|
|
513
|
-
if (
|
|
516
|
+
if (N(M, { actions: n }), t) {
|
|
514
517
|
let e = J(t.name);
|
|
515
|
-
e && await
|
|
518
|
+
e && await Gt(e.id);
|
|
516
519
|
}
|
|
517
520
|
}
|
|
518
521
|
}
|
|
519
522
|
}, [
|
|
520
|
-
|
|
523
|
+
M,
|
|
521
524
|
q,
|
|
522
|
-
|
|
523
|
-
|
|
525
|
+
Rt,
|
|
526
|
+
N,
|
|
524
527
|
J,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
]),
|
|
528
|
-
if (!
|
|
528
|
+
Gt,
|
|
529
|
+
w
|
|
530
|
+
]), un = p(async (e) => {
|
|
531
|
+
if (!M || e === 0) return;
|
|
529
532
|
let t = [...q].sort((e, t) => e.order - t.order), n = t.map((e) => e.id);
|
|
530
|
-
if ([n[e - 1], n[e]] = [n[e], n[e - 1]], await
|
|
533
|
+
if ([n[e - 1], n[e]] = [n[e], n[e - 1]], await zt(n)) {
|
|
531
534
|
let e = t.map((e, t) => ({
|
|
532
535
|
...e,
|
|
533
536
|
order: n.indexOf(e.id)
|
|
534
537
|
})).sort((e, t) => e.order - t.order);
|
|
535
|
-
|
|
538
|
+
N(M, { actions: e });
|
|
536
539
|
}
|
|
537
540
|
}, [
|
|
538
|
-
|
|
541
|
+
M,
|
|
539
542
|
q,
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
]),
|
|
543
|
-
if (!
|
|
543
|
+
zt,
|
|
544
|
+
N
|
|
545
|
+
]), dn = p(async (e) => {
|
|
546
|
+
if (!M) return;
|
|
544
547
|
let t = [...q].sort((e, t) => e.order - t.order);
|
|
545
548
|
if (e === t.length - 1) return;
|
|
546
549
|
let n = t.map((e) => e.id);
|
|
547
|
-
if ([n[e], n[e + 1]] = [n[e + 1], n[e]], await
|
|
550
|
+
if ([n[e], n[e + 1]] = [n[e + 1], n[e]], await zt(n)) {
|
|
548
551
|
let e = t.map((e, t) => ({
|
|
549
552
|
...e,
|
|
550
553
|
order: n.indexOf(e.id)
|
|
551
554
|
})).sort((e, t) => e.order - t.order);
|
|
552
|
-
|
|
555
|
+
N(M, { actions: e });
|
|
553
556
|
}
|
|
554
557
|
}, [
|
|
555
|
-
|
|
558
|
+
M,
|
|
556
559
|
q,
|
|
557
|
-
|
|
558
|
-
|
|
560
|
+
zt,
|
|
561
|
+
N
|
|
559
562
|
]);
|
|
560
563
|
m(() => {
|
|
561
|
-
|
|
564
|
+
M && q.length >= 0 && !Nt && N(M, { actions: q });
|
|
562
565
|
}, [
|
|
563
|
-
|
|
566
|
+
M,
|
|
564
567
|
q,
|
|
565
|
-
|
|
566
|
-
|
|
568
|
+
Nt,
|
|
569
|
+
N
|
|
567
570
|
]);
|
|
568
571
|
let Q = p((e, t) => {
|
|
569
|
-
|
|
572
|
+
O((n) => n && {
|
|
570
573
|
...n,
|
|
571
574
|
[e]: t
|
|
572
|
-
}),
|
|
573
|
-
}, [
|
|
574
|
-
|
|
575
|
+
}), L();
|
|
576
|
+
}, [L]), $ = p((e) => {
|
|
577
|
+
O((t) => t && {
|
|
575
578
|
...t,
|
|
576
579
|
config: e
|
|
577
|
-
}),
|
|
578
|
-
}, [
|
|
580
|
+
}), L();
|
|
581
|
+
}, [L]);
|
|
579
582
|
m(() => {
|
|
580
|
-
if (!
|
|
581
|
-
|
|
583
|
+
if (!D) {
|
|
584
|
+
St(null);
|
|
582
585
|
return;
|
|
583
586
|
}
|
|
584
|
-
if (
|
|
585
|
-
|
|
587
|
+
if (D.dataSinkId) {
|
|
588
|
+
St(R.find((e) => e.id === D.dataSinkId)?.key ?? null);
|
|
586
589
|
return;
|
|
587
590
|
}
|
|
588
591
|
let e = d({
|
|
589
|
-
parserId:
|
|
590
|
-
config:
|
|
591
|
-
}), t =
|
|
592
|
-
|
|
592
|
+
parserId: D.parserId,
|
|
593
|
+
config: D.config
|
|
594
|
+
}), t = z?.id === D.parserId ? z : null, n = e.source.kind === "DATASINK" && !e.source.ref && t ? R.find((e) => e.key === t.inputSinkKey) : void 0;
|
|
595
|
+
St(n?.key ?? null), n && t && (O((e) => oe(e, t.id, n.id)), j((e) => oe(e, t.id, n.id)));
|
|
593
596
|
}, [
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
+
D,
|
|
598
|
+
R,
|
|
599
|
+
z
|
|
597
600
|
]);
|
|
598
|
-
let
|
|
599
|
-
if (
|
|
600
|
-
let t =
|
|
601
|
-
t && (Q("dataSinkId", t.id),
|
|
601
|
+
let fn = p((e) => {
|
|
602
|
+
if (K.current = null, H(void 0), U(!1), W(null), V(!1), St(e), e) {
|
|
603
|
+
let t = R.find((t) => t.key === e);
|
|
604
|
+
t && (Q("dataSinkId", t.id), O((t) => t && {
|
|
602
605
|
...t,
|
|
603
606
|
config: {
|
|
604
607
|
...t.config,
|
|
605
608
|
dataSinkKey: e
|
|
606
609
|
}
|
|
607
|
-
}),
|
|
608
|
-
} else Q("dataSinkId", void 0),
|
|
610
|
+
}), L());
|
|
611
|
+
} else Q("dataSinkId", void 0), O((e) => e && {
|
|
609
612
|
...e,
|
|
610
613
|
config: {
|
|
611
614
|
...e.config,
|
|
612
615
|
dataSinkKey: void 0
|
|
613
616
|
},
|
|
614
617
|
parserId: void 0
|
|
615
|
-
}),
|
|
618
|
+
}), L();
|
|
616
619
|
}, [
|
|
617
|
-
|
|
620
|
+
R,
|
|
618
621
|
Q,
|
|
619
|
-
|
|
620
|
-
]),
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
622
|
+
L
|
|
623
|
+
]), pn = p(async (e) => {
|
|
624
|
+
Q("parserId", e || void 0);
|
|
625
|
+
let t = e && M ? { key: `${M}:${e}` } : null;
|
|
626
|
+
if (K.current = t, H(void 0), U(!1), W(null), V(!!t), e && t) try {
|
|
627
|
+
let n = await Ct(e);
|
|
628
|
+
if (K.current !== t) return;
|
|
629
|
+
if (n?.success) {
|
|
630
|
+
H({
|
|
631
|
+
key: t.key,
|
|
632
|
+
value: n.output
|
|
633
|
+
}), U(!0);
|
|
634
|
+
let r = it(n.output);
|
|
635
|
+
(r.labelField || r.valueField) && (O((t) => {
|
|
636
|
+
if (!t || t.parserId !== e) return t;
|
|
637
|
+
let n = t.config || {}, i = { ...n };
|
|
638
|
+
return r.labelField && !n.labelField && (i.labelField = r.labelField), r.valueField && !n.valueField && (i.valueField = r.valueField), r.xAxisField && !n.xAxisField && (i.xAxisField = r.xAxisField), {
|
|
639
|
+
...t,
|
|
640
|
+
config: i
|
|
641
|
+
};
|
|
642
|
+
}), L());
|
|
643
|
+
} else U(!0), W(n?.error || w("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview."));
|
|
644
|
+
} catch (e) {
|
|
645
|
+
if (K.current !== t) return;
|
|
646
|
+
U(!0), W(e instanceof Error ? e.message : w("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview.")), console.warn("Failed to auto-detect parser fields:", e);
|
|
647
|
+
} finally {
|
|
648
|
+
K.current === t && V(!1);
|
|
642
649
|
}
|
|
643
650
|
}, [
|
|
644
651
|
Q,
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
D("saving");
|
|
652
|
+
Ct,
|
|
653
|
+
M,
|
|
654
|
+
L,
|
|
655
|
+
w
|
|
656
|
+
]), mn = p(async () => {
|
|
657
|
+
if (!F || !D) return;
|
|
658
|
+
let t = ht.current;
|
|
659
|
+
E("saving");
|
|
654
660
|
try {
|
|
655
661
|
let n = {
|
|
656
|
-
...
|
|
657
|
-
description:
|
|
658
|
-
}, r = e.getState().widgets.get(
|
|
659
|
-
dataSinkId:
|
|
660
|
-
parserId:
|
|
662
|
+
...F.metadata || {},
|
|
663
|
+
description: D.description || ""
|
|
664
|
+
}, r = e.getState().widgets.get(F.id)?.config ?? {}, i = xe(r, mt.current, D.config), a = d({
|
|
665
|
+
dataSinkId: D.dataSinkId,
|
|
666
|
+
parserId: D.parserId,
|
|
661
667
|
config: {
|
|
662
668
|
...i,
|
|
663
669
|
binding: void 0
|
|
664
670
|
}
|
|
665
|
-
}), o =
|
|
666
|
-
id:
|
|
667
|
-
title:
|
|
671
|
+
}), o = Se(a, i), s = fe(e.getState().widgets.get(F.id), I.current), ee = await _t({
|
|
672
|
+
id: F.id,
|
|
673
|
+
title: D.title,
|
|
668
674
|
position: s,
|
|
669
|
-
renderer:
|
|
670
|
-
template:
|
|
675
|
+
renderer: D.renderer,
|
|
676
|
+
template: D.template,
|
|
671
677
|
config: o.config,
|
|
672
|
-
refreshInterval:
|
|
678
|
+
refreshInterval: D.refreshInterval,
|
|
673
679
|
dataSinkId: o.dataSinkId,
|
|
674
|
-
datasetId:
|
|
680
|
+
datasetId: D.datasetId,
|
|
675
681
|
parserId: o.parserId,
|
|
676
|
-
parserRules:
|
|
682
|
+
parserRules: D.parserRules,
|
|
677
683
|
metadata: n
|
|
678
|
-
}), c =
|
|
684
|
+
}), c = F.drilldown, l = null, u = F.drilldown?.id;
|
|
679
685
|
try {
|
|
680
|
-
if (
|
|
681
|
-
let { enabled: e, targetDashboardId: t, targetPageId: n, navigationMode: r, parameterMapping: i, passGlobalFilters: a, maxDepth: o } =
|
|
682
|
-
if (u && !e) await
|
|
686
|
+
if (D.drilldownConfig) {
|
|
687
|
+
let { enabled: e, targetDashboardId: t, targetPageId: n, navigationMode: r, parameterMapping: i, passGlobalFilters: a, maxDepth: o } = D.drilldownConfig;
|
|
688
|
+
if (u && !e) await bt(u), c = void 0;
|
|
683
689
|
else if (u) {
|
|
684
|
-
let s = await
|
|
690
|
+
let s = await yt({
|
|
685
691
|
id: u,
|
|
686
692
|
targetDashboardId: t,
|
|
687
693
|
targetPageId: n,
|
|
@@ -693,8 +699,8 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
693
699
|
});
|
|
694
700
|
s && (c = s);
|
|
695
701
|
} else if (e && t) {
|
|
696
|
-
let e = await
|
|
697
|
-
sourceWidgetId:
|
|
702
|
+
let e = await vt({
|
|
703
|
+
sourceWidgetId: F.id,
|
|
698
704
|
targetDashboardId: t,
|
|
699
705
|
targetPageId: n,
|
|
700
706
|
parameterMapping: i || {},
|
|
@@ -709,63 +715,63 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
709
715
|
l = e instanceof Error ? e : Error(String(e));
|
|
710
716
|
}
|
|
711
717
|
if (ee) {
|
|
712
|
-
if (
|
|
713
|
-
title:
|
|
714
|
-
description:
|
|
715
|
-
renderer:
|
|
716
|
-
template:
|
|
718
|
+
if (N(F.id, {
|
|
719
|
+
title: D.title,
|
|
720
|
+
description: D.description,
|
|
721
|
+
renderer: D.renderer,
|
|
722
|
+
template: D.template,
|
|
717
723
|
config: o.config,
|
|
718
|
-
refreshInterval:
|
|
724
|
+
refreshInterval: D.refreshInterval,
|
|
719
725
|
dataSinkId: o.dataSinkId,
|
|
720
|
-
datasetId:
|
|
726
|
+
datasetId: D.datasetId,
|
|
721
727
|
parserId: o.parserId,
|
|
722
|
-
parserRules:
|
|
728
|
+
parserRules: D.parserRules,
|
|
723
729
|
drilldown: c,
|
|
724
730
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
725
731
|
}), l) {
|
|
726
|
-
|
|
732
|
+
E("error"), Ze.error(w("bigconsole.widget.drilldown.saveFailed", "Drilldown not saved"), { description: l.message });
|
|
727
733
|
return;
|
|
728
734
|
}
|
|
729
|
-
|
|
730
|
-
} else
|
|
735
|
+
E("saved"), j(D), ht.current === t && A(!1), setTimeout(() => E("idle"), 2e3);
|
|
736
|
+
} else E("error");
|
|
731
737
|
} catch {
|
|
732
|
-
|
|
738
|
+
E("error");
|
|
733
739
|
}
|
|
734
740
|
}, [
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
ht,
|
|
738
|
-
P,
|
|
739
|
-
gt,
|
|
741
|
+
F,
|
|
742
|
+
D,
|
|
740
743
|
_t,
|
|
744
|
+
N,
|
|
741
745
|
vt,
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
let
|
|
748
|
-
|
|
749
|
-
|
|
746
|
+
yt,
|
|
747
|
+
bt,
|
|
748
|
+
w
|
|
749
|
+
]), hn = p(() => {
|
|
750
|
+
if (!F) return;
|
|
751
|
+
let e = I.current;
|
|
752
|
+
e && !pe(me(F), e) && P(F.id, e);
|
|
753
|
+
let t = ot(F);
|
|
754
|
+
O(t), j(t), mt.current = F.config || {}, A(!1), E("idle");
|
|
755
|
+
}, [F, P]), gn = p((e) => {
|
|
750
756
|
$(e);
|
|
751
|
-
}, [$]),
|
|
752
|
-
|
|
757
|
+
}, [$]), _n = p((e) => {
|
|
758
|
+
O((t) => t && {
|
|
753
759
|
...t,
|
|
754
760
|
drilldownConfig: e
|
|
755
|
-
}),
|
|
756
|
-
}, [
|
|
761
|
+
}), L();
|
|
762
|
+
}, [L]), vn = F ? s(F.type) : null, yn = Ce(() => Qe.map((e) => ({
|
|
757
763
|
value: e.value,
|
|
758
|
-
label:
|
|
759
|
-
description:
|
|
760
|
-
})), [
|
|
764
|
+
label: w(e.labelKey, e.label),
|
|
765
|
+
description: w(e.descriptionKey, e.description)
|
|
766
|
+
})), [w]), bn = Ce(() => $e.map((e) => ({
|
|
761
767
|
value: e.value,
|
|
762
|
-
label:
|
|
763
|
-
})), [
|
|
764
|
-
return /* @__PURE__ */ S(
|
|
768
|
+
label: w(e.labelKey, e.label)
|
|
769
|
+
})), [w]);
|
|
770
|
+
return /* @__PURE__ */ S(ze, {
|
|
765
771
|
open: f,
|
|
766
|
-
onOpenChange: (e) => !e &&
|
|
772
|
+
onOpenChange: (e) => !e && De(),
|
|
767
773
|
modal: !1,
|
|
768
|
-
children: /* @__PURE__ */ C(
|
|
774
|
+
children: /* @__PURE__ */ C(Be, {
|
|
769
775
|
style: {
|
|
770
776
|
width: "min(420px, 100vw)",
|
|
771
777
|
maxWidth: "100vw",
|
|
@@ -776,7 +782,7 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
776
782
|
overflow: "hidden"
|
|
777
783
|
},
|
|
778
784
|
children: [
|
|
779
|
-
/* @__PURE__ */ S(
|
|
785
|
+
/* @__PURE__ */ S(He, {
|
|
780
786
|
style: {
|
|
781
787
|
padding: "var(--space-cardPadding)",
|
|
782
788
|
borderBottom: "1px solid var(--color-border-subtle)",
|
|
@@ -801,7 +807,7 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
801
807
|
boxShadow: "var(--shadow-elevation-2)",
|
|
802
808
|
flexShrink: 0
|
|
803
809
|
},
|
|
804
|
-
children: /* @__PURE__ */ S(
|
|
810
|
+
children: /* @__PURE__ */ S(Oe, { style: {
|
|
805
811
|
height: "var(--size-icon-md)",
|
|
806
812
|
width: "var(--size-icon-md)",
|
|
807
813
|
color: "var(--color-action-primary-text)"
|
|
@@ -818,45 +824,45 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
818
824
|
gap: "var(--space-iconGap)"
|
|
819
825
|
},
|
|
820
826
|
children: [
|
|
821
|
-
/* @__PURE__ */ S(
|
|
827
|
+
/* @__PURE__ */ S(Ue, {
|
|
822
828
|
style: {
|
|
823
829
|
fontSize: "var(--font-size-body-md)",
|
|
824
830
|
fontWeight: "var(--font-weight-bold)",
|
|
825
831
|
color: "var(--color-text-primary)",
|
|
826
832
|
margin: 0
|
|
827
833
|
},
|
|
828
|
-
children:
|
|
834
|
+
children: F ? w("bigconsole.widget.properties.header.widgetProperties", "Widget Properties") : w("bigconsole.widget.properties.header.properties", "Properties")
|
|
829
835
|
}),
|
|
830
|
-
|
|
836
|
+
T === "saving" && /* @__PURE__ */ S(We, { style: {
|
|
831
837
|
height: "var(--size-icon-sm)",
|
|
832
838
|
width: "var(--size-icon-sm)"
|
|
833
839
|
} }),
|
|
834
|
-
|
|
840
|
+
T === "saved" && /* @__PURE__ */ S(we, { style: {
|
|
835
841
|
height: "var(--size-icon-sm)",
|
|
836
842
|
width: "var(--size-icon-sm)",
|
|
837
843
|
color: "var(--color-status-success-bg)"
|
|
838
844
|
} }),
|
|
839
|
-
|
|
845
|
+
T === "error" && /* @__PURE__ */ S(Me, { style: {
|
|
840
846
|
height: "var(--size-icon-sm)",
|
|
841
847
|
width: "var(--size-icon-sm)",
|
|
842
848
|
color: "var(--color-status-error-bg)"
|
|
843
849
|
} })
|
|
844
850
|
]
|
|
845
|
-
}),
|
|
851
|
+
}), vn && /* @__PURE__ */ S(Ve, {
|
|
846
852
|
style: {
|
|
847
853
|
fontSize: "var(--font-size-body-sm)",
|
|
848
854
|
color: "var(--color-text-secondary)",
|
|
849
855
|
margin: "var(--space-controlGap) 0 0 0",
|
|
850
856
|
fontWeight: "var(--font-weight-medium)"
|
|
851
857
|
},
|
|
852
|
-
children:
|
|
858
|
+
children: vn.name
|
|
853
859
|
})]
|
|
854
860
|
})]
|
|
855
861
|
})
|
|
856
862
|
}),
|
|
857
|
-
|
|
858
|
-
value:
|
|
859
|
-
onValueChange: (e) =>
|
|
863
|
+
F ? /* @__PURE__ */ C(Ge, {
|
|
864
|
+
value: st,
|
|
865
|
+
onValueChange: (e) => ct(e),
|
|
860
866
|
style: {
|
|
861
867
|
flex: 1,
|
|
862
868
|
display: "flex",
|
|
@@ -864,7 +870,7 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
864
870
|
minHeight: 0,
|
|
865
871
|
overflow: "hidden"
|
|
866
872
|
},
|
|
867
|
-
children: [/* @__PURE__ */ C(
|
|
873
|
+
children: [/* @__PURE__ */ C(qe, {
|
|
868
874
|
style: {
|
|
869
875
|
width: "100%",
|
|
870
876
|
display: "flex",
|
|
@@ -880,25 +886,25 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
880
886
|
gap: "2px"
|
|
881
887
|
},
|
|
882
888
|
children: [
|
|
883
|
-
/* @__PURE__ */ S(
|
|
889
|
+
/* @__PURE__ */ S(Je, {
|
|
884
890
|
value: "general",
|
|
885
|
-
style:
|
|
886
|
-
children:
|
|
891
|
+
style: rt,
|
|
892
|
+
children: w("bigconsole.widget.properties.tab.general", "General")
|
|
887
893
|
}),
|
|
888
|
-
/* @__PURE__ */ S(
|
|
894
|
+
/* @__PURE__ */ S(Je, {
|
|
889
895
|
value: "data",
|
|
890
|
-
style:
|
|
891
|
-
children:
|
|
896
|
+
style: rt,
|
|
897
|
+
children: w("bigconsole.widget.properties.tab.data", "Data")
|
|
892
898
|
}),
|
|
893
|
-
/* @__PURE__ */ S(
|
|
899
|
+
/* @__PURE__ */ S(Je, {
|
|
894
900
|
value: "advanced",
|
|
895
|
-
style:
|
|
896
|
-
children:
|
|
901
|
+
style: rt,
|
|
902
|
+
children: w("bigconsole.widget.properties.tab.advanced", "Advanced")
|
|
897
903
|
}),
|
|
898
|
-
/* @__PURE__ */ S(
|
|
904
|
+
/* @__PURE__ */ S(Je, {
|
|
899
905
|
value: "appearance",
|
|
900
|
-
style:
|
|
901
|
-
children:
|
|
906
|
+
style: rt,
|
|
907
|
+
children: w("bigconsole.widget.properties.tab.style", "Style")
|
|
902
908
|
})
|
|
903
909
|
]
|
|
904
910
|
}), /* @__PURE__ */ C("div", {
|
|
@@ -909,51 +915,51 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
909
915
|
minHeight: 0
|
|
910
916
|
},
|
|
911
917
|
children: [
|
|
912
|
-
/* @__PURE__ */ S(
|
|
918
|
+
/* @__PURE__ */ S(Ke, {
|
|
913
919
|
value: "general",
|
|
914
920
|
className: "mt-0",
|
|
915
|
-
children:
|
|
921
|
+
children: D && /* @__PURE__ */ C(r, { children: [
|
|
916
922
|
/* @__PURE__ */ S(le, {
|
|
917
|
-
title:
|
|
918
|
-
description:
|
|
919
|
-
refreshInterval:
|
|
923
|
+
title: D.title,
|
|
924
|
+
description: D.description,
|
|
925
|
+
refreshInterval: D.refreshInterval,
|
|
920
926
|
onTitleChange: (e) => Q("title", e),
|
|
921
927
|
onDescriptionChange: (e) => Q("description", e),
|
|
922
928
|
onRefreshIntervalChange: (e) => Q("refreshInterval", e)
|
|
923
929
|
}),
|
|
924
930
|
/* @__PURE__ */ S(n, {
|
|
925
|
-
title:
|
|
926
|
-
description:
|
|
931
|
+
title: w("bigconsole.widget.properties.actions.heading", "Buttons"),
|
|
932
|
+
description: w("bigconsole.widget.properties.actions.subheading", "Configure buttons on this widget"),
|
|
927
933
|
headingLevel: 3,
|
|
928
934
|
meta: q.length > 0 ? /* @__PURE__ */ S("span", {
|
|
929
935
|
className: "rounded-pill bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
930
936
|
children: q.length
|
|
931
937
|
}) : void 0,
|
|
932
|
-
actions: !
|
|
938
|
+
actions: !Pt && /* @__PURE__ */ C(_, {
|
|
933
939
|
size: "sm",
|
|
934
|
-
onClick:
|
|
935
|
-
children: [/* @__PURE__ */ S(
|
|
940
|
+
onClick: on,
|
|
941
|
+
children: [/* @__PURE__ */ S(Ae, { className: "size-4" }), w("bigconsole.widget.properties.actions.add", "Add button")]
|
|
936
942
|
}),
|
|
937
943
|
"data-testid": "widget-inspector-actions",
|
|
938
|
-
children:
|
|
944
|
+
children: Pt ? /* @__PURE__ */ C("div", {
|
|
939
945
|
role: "alert",
|
|
940
|
-
children: [/* @__PURE__ */ S("p", { children:
|
|
946
|
+
children: [/* @__PURE__ */ S("p", { children: w("bigconsole.widget.properties.actions.readFailed", "Buttons could not be verified. Retry before saving.") }), /* @__PURE__ */ S(_, {
|
|
941
947
|
size: "sm",
|
|
942
|
-
disabled:
|
|
943
|
-
onClick: () => void Promise.resolve(
|
|
944
|
-
children:
|
|
948
|
+
disabled: Nt,
|
|
949
|
+
onClick: () => void Promise.resolve(Ft()).catch(() => {}),
|
|
950
|
+
children: w("bigconsole.widget.properties.actions.retry", "Retry")
|
|
945
951
|
})]
|
|
946
|
-
}) :
|
|
952
|
+
}) : Nt ? /* @__PURE__ */ S("div", {
|
|
947
953
|
className: "flex justify-center py-8",
|
|
948
|
-
children: /* @__PURE__ */ S(
|
|
954
|
+
children: /* @__PURE__ */ S(We, { className: "size-6" })
|
|
949
955
|
}) : q.length === 0 ? /* @__PURE__ */ S("p", {
|
|
950
956
|
className: "text-sm text-text-secondary",
|
|
951
|
-
children:
|
|
957
|
+
children: w("bigconsole.widget.properties.actions.empty", "No buttons yet — add one to let viewers take an action.")
|
|
952
958
|
}) : /* @__PURE__ */ S("div", {
|
|
953
959
|
className: "space-y-2",
|
|
954
|
-
children: [...q].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ S(
|
|
960
|
+
children: [...q].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ S(Ne, {
|
|
955
961
|
className: e.disabled ? "opacity-60" : "",
|
|
956
|
-
children: /* @__PURE__ */ C(
|
|
962
|
+
children: /* @__PURE__ */ C(Pe, {
|
|
957
963
|
className: "p-3 flex items-center gap-2",
|
|
958
964
|
children: [
|
|
959
965
|
/* @__PURE__ */ C("div", {
|
|
@@ -961,17 +967,17 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
961
967
|
children: [/* @__PURE__ */ S(_, {
|
|
962
968
|
variant: "ghost",
|
|
963
969
|
size: "icon-sm",
|
|
964
|
-
onClick: () =>
|
|
970
|
+
onClick: () => un(t),
|
|
965
971
|
disabled: t === 0,
|
|
966
972
|
className: "h-5 w-5",
|
|
967
|
-
children: /* @__PURE__ */ S(
|
|
973
|
+
children: /* @__PURE__ */ S(Ee, { className: "size-3" })
|
|
968
974
|
}), /* @__PURE__ */ S(_, {
|
|
969
975
|
variant: "ghost",
|
|
970
976
|
size: "icon-sm",
|
|
971
|
-
onClick: () =>
|
|
977
|
+
onClick: () => dn(t),
|
|
972
978
|
disabled: t === q.length - 1,
|
|
973
979
|
className: "h-5 w-5",
|
|
974
|
-
children: /* @__PURE__ */ S(
|
|
980
|
+
children: /* @__PURE__ */ S(Te, { className: "size-3" })
|
|
975
981
|
})]
|
|
976
982
|
}),
|
|
977
983
|
/* @__PURE__ */ C("div", {
|
|
@@ -980,17 +986,17 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
980
986
|
className: "flex items-center gap-2",
|
|
981
987
|
children: [/* @__PURE__ */ S("span", {
|
|
982
988
|
"aria-hidden": "true",
|
|
983
|
-
className: `size-2 shrink-0 rounded-full ${
|
|
989
|
+
className: `size-2 shrink-0 rounded-full ${tt[e.style] || nt}`
|
|
984
990
|
}), /* @__PURE__ */ S("span", {
|
|
985
991
|
className: "text-sm font-medium truncate",
|
|
986
992
|
children: e.label
|
|
987
993
|
})]
|
|
988
994
|
}), /* @__PURE__ */ S("p", {
|
|
989
995
|
className: "text-xs text-text-secondary truncate",
|
|
990
|
-
children:
|
|
991
|
-
method:
|
|
992
|
-
url:
|
|
993
|
-
}) :
|
|
996
|
+
children: an.has(e.name) ? w("bigconsole.widget.properties.actions.webhookSummary", "→ {{method}} {{url}}", {
|
|
997
|
+
method: an.get(e.name)?.method ?? "",
|
|
998
|
+
url: an.get(e.name)?.webhookUrl ?? ""
|
|
999
|
+
}) : w("bigconsole.widget.properties.actions.emitsEvent", "Emits an event")
|
|
994
1000
|
})]
|
|
995
1001
|
}),
|
|
996
1002
|
/* @__PURE__ */ C("div", {
|
|
@@ -999,14 +1005,14 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
999
1005
|
variant: "ghost",
|
|
1000
1006
|
size: "icon-sm",
|
|
1001
1007
|
"aria-label": `Edit ${e.label}`,
|
|
1002
|
-
onClick: () =>
|
|
1003
|
-
children: /* @__PURE__ */ S(
|
|
1008
|
+
onClick: () => sn(e),
|
|
1009
|
+
children: /* @__PURE__ */ S(ke, { className: "size-4" })
|
|
1004
1010
|
}), /* @__PURE__ */ S(_, {
|
|
1005
1011
|
variant: "ghost",
|
|
1006
1012
|
size: "icon-sm",
|
|
1007
1013
|
"aria-label": `Delete ${e.label}`,
|
|
1008
|
-
onClick: () =>
|
|
1009
|
-
children: /* @__PURE__ */ S(
|
|
1014
|
+
onClick: () => ln(e.id),
|
|
1015
|
+
children: /* @__PURE__ */ S(je, { className: "size-4" })
|
|
1010
1016
|
})]
|
|
1011
1017
|
})
|
|
1012
1018
|
]
|
|
@@ -1014,56 +1020,65 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1014
1020
|
}, e.id))
|
|
1015
1021
|
})
|
|
1016
1022
|
}),
|
|
1017
|
-
|
|
1018
|
-
position:
|
|
1023
|
+
dt && ft && /* @__PURE__ */ S(de, {
|
|
1024
|
+
position: ft,
|
|
1019
1025
|
columns: ie.cols,
|
|
1020
|
-
onChange:
|
|
1026
|
+
onChange: gt
|
|
1021
1027
|
})
|
|
1022
1028
|
] })
|
|
1023
1029
|
}),
|
|
1024
|
-
/* @__PURE__ */ S(
|
|
1030
|
+
/* @__PURE__ */ S(Ke, {
|
|
1025
1031
|
value: "data",
|
|
1026
1032
|
className: "mt-0",
|
|
1027
|
-
children:
|
|
1033
|
+
children: D && /* @__PURE__ */ C(r, { children: [(() => {
|
|
1028
1034
|
let e = d({
|
|
1029
|
-
dataSinkId:
|
|
1030
|
-
parserId:
|
|
1035
|
+
dataSinkId: D.dataSinkId,
|
|
1036
|
+
parserId: D.parserId,
|
|
1031
1037
|
config: {
|
|
1032
|
-
...
|
|
1038
|
+
...D.config,
|
|
1033
1039
|
binding: void 0
|
|
1034
1040
|
}
|
|
1035
|
-
}), t =
|
|
1041
|
+
}), t = ye({
|
|
1036
1042
|
binding: e,
|
|
1037
|
-
loading:
|
|
1038
|
-
error:
|
|
1039
|
-
preview:
|
|
1040
|
-
previewComplete:
|
|
1041
|
-
widgetType:
|
|
1042
|
-
mockData:
|
|
1043
|
-
hasParser: !!
|
|
1044
|
-
config:
|
|
1045
|
-
});
|
|
1043
|
+
loading: Ot || Et,
|
|
1044
|
+
error: jt,
|
|
1045
|
+
preview: Mt,
|
|
1046
|
+
previewComplete: At,
|
|
1047
|
+
widgetType: F?.type,
|
|
1048
|
+
mockData: D.config?.mockData,
|
|
1049
|
+
hasParser: !!D.parserId,
|
|
1050
|
+
config: D.config
|
|
1051
|
+
}), n = z && z.id === D.parserId && (!xt || z.inputSinkKey === xt) && At && !Ot && !jt ? Mt : void 0;
|
|
1046
1052
|
return /* @__PURE__ */ S(ue, {
|
|
1047
|
-
consoleId:
|
|
1053
|
+
consoleId: F?.dashboardId || "",
|
|
1048
1054
|
binding: e,
|
|
1049
|
-
resolvedParser:
|
|
1050
|
-
dataSinkKey:
|
|
1051
|
-
dataPath: typeof
|
|
1055
|
+
resolvedParser: z ?? void 0,
|
|
1056
|
+
dataSinkKey: xt,
|
|
1057
|
+
dataPath: typeof D.config.dataPath == "string" ? D.config.dataPath : void 0,
|
|
1052
1058
|
status: t.status,
|
|
1053
|
-
resolving:
|
|
1059
|
+
resolving: Et,
|
|
1054
1060
|
missingFields: t.missingFields,
|
|
1055
|
-
preview:
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1061
|
+
preview: Mt,
|
|
1062
|
+
fieldMappings: F?.type === "chart" || F?.type === "funnel_chart" ? /* @__PURE__ */ S(he, {
|
|
1063
|
+
config: D.config,
|
|
1064
|
+
funnel: F.type === "funnel_chart",
|
|
1065
|
+
preview: n,
|
|
1066
|
+
onChange: (e, t) => $({
|
|
1067
|
+
...D.config,
|
|
1068
|
+
[e]: t
|
|
1069
|
+
})
|
|
1070
|
+
}, M) : void 0,
|
|
1071
|
+
error: jt,
|
|
1072
|
+
onDataSinkChange: fn,
|
|
1073
|
+
onParserChange: pn,
|
|
1059
1074
|
onDataPathChange: (e) => $({
|
|
1060
|
-
...
|
|
1075
|
+
...D.config,
|
|
1061
1076
|
dataPath: e
|
|
1062
1077
|
})
|
|
1063
1078
|
});
|
|
1064
1079
|
})(), /* @__PURE__ */ S(n, {
|
|
1065
1080
|
emphasis: "muted",
|
|
1066
|
-
title:
|
|
1081
|
+
title: w("bigconsole.widget.properties.data.alternativeSources", "Alternative Data Sources"),
|
|
1067
1082
|
description: "Skip the DataSink pipeline and fetch straight from an API, a GraphQL endpoint or sample JSON.",
|
|
1068
1083
|
headingLevel: 3,
|
|
1069
1084
|
"data-testid": "widget-inspector-alt-sources",
|
|
@@ -1072,19 +1087,19 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1072
1087
|
children: [
|
|
1073
1088
|
/* @__PURE__ */ C("div", {
|
|
1074
1089
|
className: "space-y-2",
|
|
1075
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1076
|
-
value:
|
|
1090
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.data.sourceTypeLabel", "Data Source Type") }), /* @__PURE__ */ C(Fe, {
|
|
1091
|
+
value: D.config?.dataSourceType || "",
|
|
1077
1092
|
onValueChange: (e) => $({
|
|
1078
|
-
...
|
|
1093
|
+
...D.config,
|
|
1079
1094
|
dataSourceType: e || void 0
|
|
1080
1095
|
}),
|
|
1081
|
-
children: [/* @__PURE__ */ S(
|
|
1096
|
+
children: [/* @__PURE__ */ S(Le, {
|
|
1082
1097
|
style: {
|
|
1083
1098
|
height: "var(--size-controlHeight-md)",
|
|
1084
1099
|
fontSize: "var(--font-size-body-sm)"
|
|
1085
1100
|
},
|
|
1086
|
-
children: /* @__PURE__ */ S(
|
|
1087
|
-
}), /* @__PURE__ */ S(
|
|
1101
|
+
children: /* @__PURE__ */ S(Re, { placeholder: w("bigconsole.widget.properties.data.selectTypePlaceholder", "Select type...") })
|
|
1102
|
+
}), /* @__PURE__ */ S(Ie, {
|
|
1088
1103
|
position: "popper",
|
|
1089
1104
|
side: "bottom",
|
|
1090
1105
|
sideOffset: 4,
|
|
@@ -1097,26 +1112,26 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1097
1112
|
boxShadow: "var(--shadow-elevation-3)",
|
|
1098
1113
|
borderRadius: "var(--radius-button)"
|
|
1099
1114
|
},
|
|
1100
|
-
children:
|
|
1115
|
+
children: bn.map((e) => /* @__PURE__ */ S(b, {
|
|
1101
1116
|
value: e.value,
|
|
1102
1117
|
children: e.label
|
|
1103
1118
|
}, e.value))
|
|
1104
1119
|
})]
|
|
1105
1120
|
})]
|
|
1106
1121
|
}),
|
|
1107
|
-
/* @__PURE__ */ S(
|
|
1108
|
-
dataSourceType:
|
|
1109
|
-
t:
|
|
1122
|
+
/* @__PURE__ */ S(ve, {
|
|
1123
|
+
dataSourceType: D.config?.dataSourceType,
|
|
1124
|
+
t: w
|
|
1110
1125
|
}),
|
|
1111
|
-
|
|
1126
|
+
D.config?.dataSourceType === "REST_API" && /* @__PURE__ */ C("div", {
|
|
1112
1127
|
className: "space-y-3",
|
|
1113
1128
|
children: [
|
|
1114
1129
|
/* @__PURE__ */ C("div", {
|
|
1115
1130
|
className: "space-y-2",
|
|
1116
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1117
|
-
value:
|
|
1131
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.endpointUrlLabel", "Endpoint URL *") }), /* @__PURE__ */ S(v, {
|
|
1132
|
+
value: D.config?.endpointUrl || "",
|
|
1118
1133
|
onChange: (e) => $({
|
|
1119
|
-
...
|
|
1134
|
+
...D.config,
|
|
1120
1135
|
endpointUrl: e.target.value || void 0
|
|
1121
1136
|
}),
|
|
1122
1137
|
placeholder: "https://api.example.com/data"
|
|
@@ -1124,16 +1139,16 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1124
1139
|
}),
|
|
1125
1140
|
/* @__PURE__ */ C("div", {
|
|
1126
1141
|
className: "space-y-2",
|
|
1127
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1128
|
-
value:
|
|
1142
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.httpMethodLabel", "HTTP Method") }), /* @__PURE__ */ C(Fe, {
|
|
1143
|
+
value: D.config?.httpMethod || "GET",
|
|
1129
1144
|
onValueChange: (e) => $({
|
|
1130
|
-
...
|
|
1145
|
+
...D.config,
|
|
1131
1146
|
httpMethod: e
|
|
1132
1147
|
}),
|
|
1133
|
-
children: [/* @__PURE__ */ S(
|
|
1148
|
+
children: [/* @__PURE__ */ S(Le, {
|
|
1134
1149
|
style: { height: "var(--size-controlHeight-md)" },
|
|
1135
|
-
children: /* @__PURE__ */ S(
|
|
1136
|
-
}), /* @__PURE__ */ C(
|
|
1150
|
+
children: /* @__PURE__ */ S(Re, {})
|
|
1151
|
+
}), /* @__PURE__ */ C(Ie, {
|
|
1137
1152
|
position: "popper",
|
|
1138
1153
|
side: "bottom",
|
|
1139
1154
|
sideOffset: 4,
|
|
@@ -1160,10 +1175,10 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1160
1175
|
}),
|
|
1161
1176
|
/* @__PURE__ */ C("div", {
|
|
1162
1177
|
className: "space-y-2",
|
|
1163
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1164
|
-
value:
|
|
1178
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.headersLabel", "Headers (JSON)") }), /* @__PURE__ */ S(x, {
|
|
1179
|
+
value: D.config?.headers || "",
|
|
1165
1180
|
onChange: (e) => $({
|
|
1166
|
-
...
|
|
1181
|
+
...D.config,
|
|
1167
1182
|
headers: e.target.value || void 0
|
|
1168
1183
|
}),
|
|
1169
1184
|
rows: 3,
|
|
@@ -1173,58 +1188,58 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1173
1188
|
}),
|
|
1174
1189
|
/* @__PURE__ */ C("div", {
|
|
1175
1190
|
className: "space-y-2",
|
|
1176
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1177
|
-
value:
|
|
1191
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.authenticationLabel", "Authentication") }), /* @__PURE__ */ C(Fe, {
|
|
1192
|
+
value: D.config?.authType || "none",
|
|
1178
1193
|
onValueChange: (e) => $({
|
|
1179
|
-
...
|
|
1194
|
+
...D.config,
|
|
1180
1195
|
authType: e
|
|
1181
1196
|
}),
|
|
1182
|
-
children: [/* @__PURE__ */ S(
|
|
1197
|
+
children: [/* @__PURE__ */ S(Le, {
|
|
1183
1198
|
style: { height: "var(--size-controlHeight-md)" },
|
|
1184
|
-
children: /* @__PURE__ */ S(
|
|
1185
|
-
}), /* @__PURE__ */ C(
|
|
1199
|
+
children: /* @__PURE__ */ S(Re, {})
|
|
1200
|
+
}), /* @__PURE__ */ C(Ie, {
|
|
1186
1201
|
position: "popper",
|
|
1187
1202
|
side: "bottom",
|
|
1188
1203
|
sideOffset: 4,
|
|
1189
1204
|
children: [
|
|
1190
1205
|
/* @__PURE__ */ S(b, {
|
|
1191
1206
|
value: "none",
|
|
1192
|
-
children:
|
|
1207
|
+
children: w("bigconsole.widget.properties.rest.authNone", "None")
|
|
1193
1208
|
}),
|
|
1194
1209
|
/* @__PURE__ */ S(b, {
|
|
1195
1210
|
value: "api_key",
|
|
1196
|
-
children:
|
|
1211
|
+
children: w("bigconsole.widget.properties.rest.authApiKey", "API Key")
|
|
1197
1212
|
}),
|
|
1198
1213
|
/* @__PURE__ */ S(b, {
|
|
1199
1214
|
value: "bearer",
|
|
1200
|
-
children:
|
|
1215
|
+
children: w("bigconsole.widget.properties.rest.authBearer", "Bearer Token")
|
|
1201
1216
|
}),
|
|
1202
1217
|
/* @__PURE__ */ S(b, {
|
|
1203
1218
|
value: "basic",
|
|
1204
|
-
children:
|
|
1219
|
+
children: w("bigconsole.widget.properties.rest.authBasic", "Basic Auth")
|
|
1205
1220
|
})
|
|
1206
1221
|
]
|
|
1207
1222
|
})]
|
|
1208
1223
|
})]
|
|
1209
1224
|
}),
|
|
1210
|
-
!!(
|
|
1225
|
+
!!(D.config?.authType && D.config.authType !== "none") && /* @__PURE__ */ C("div", {
|
|
1211
1226
|
className: "space-y-2",
|
|
1212
|
-
children: [/* @__PURE__ */ S(y, { children: String(
|
|
1227
|
+
children: [/* @__PURE__ */ S(y, { children: String(D.config.authType) === "basic" ? w("bigconsole.widget.properties.rest.credentialsLabel", "Credentials (user:pass)") : w("bigconsole.widget.properties.rest.tokenKeyLabel", "Token/Key") }), /* @__PURE__ */ S(v, {
|
|
1213
1228
|
type: "password",
|
|
1214
|
-
value:
|
|
1229
|
+
value: D.config?.authValue || "",
|
|
1215
1230
|
onChange: (e) => $({
|
|
1216
|
-
...
|
|
1231
|
+
...D.config,
|
|
1217
1232
|
authValue: e.target.value || void 0
|
|
1218
1233
|
}),
|
|
1219
|
-
placeholder:
|
|
1234
|
+
placeholder: D.config.authType === "basic" ? w("bigconsole.widget.properties.rest.credentialsPlaceholder", "username:password") : w("bigconsole.widget.properties.rest.tokenKeyPlaceholder", "Enter token or API key")
|
|
1220
1235
|
})]
|
|
1221
1236
|
}),
|
|
1222
|
-
(
|
|
1237
|
+
(D.config?.httpMethod === "POST" || D.config?.httpMethod === "PUT") && /* @__PURE__ */ C("div", {
|
|
1223
1238
|
className: "space-y-2",
|
|
1224
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1225
|
-
value:
|
|
1239
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.requestBodyLabel", "Request Body (JSON)") }), /* @__PURE__ */ S(x, {
|
|
1240
|
+
value: D.config?.requestBody || "",
|
|
1226
1241
|
onChange: (e) => $({
|
|
1227
|
-
...
|
|
1242
|
+
...D.config,
|
|
1228
1243
|
requestBody: e.target.value || void 0
|
|
1229
1244
|
}),
|
|
1230
1245
|
rows: 4,
|
|
@@ -1235,32 +1250,32 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1235
1250
|
/* @__PURE__ */ C("div", {
|
|
1236
1251
|
className: "space-y-2",
|
|
1237
1252
|
children: [
|
|
1238
|
-
/* @__PURE__ */ S(y, { children:
|
|
1253
|
+
/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
|
|
1239
1254
|
/* @__PURE__ */ S(v, {
|
|
1240
|
-
value:
|
|
1255
|
+
value: D.config?.dataPath || "",
|
|
1241
1256
|
onChange: (e) => $({
|
|
1242
|
-
...
|
|
1257
|
+
...D.config,
|
|
1243
1258
|
dataPath: e.target.value || void 0
|
|
1244
1259
|
}),
|
|
1245
1260
|
placeholder: "$.data.items or .data.items"
|
|
1246
1261
|
}),
|
|
1247
1262
|
/* @__PURE__ */ S("p", {
|
|
1248
1263
|
className: "text-xs text-text-secondary",
|
|
1249
|
-
children:
|
|
1264
|
+
children: w("bigconsole.widget.properties.dataPath.restHelp", "JSONPath or dot notation to extract data from response")
|
|
1250
1265
|
})
|
|
1251
1266
|
]
|
|
1252
1267
|
})
|
|
1253
1268
|
]
|
|
1254
1269
|
}),
|
|
1255
|
-
|
|
1270
|
+
D.config?.dataSourceType === "GRAPHQL" && /* @__PURE__ */ C("div", {
|
|
1256
1271
|
className: "space-y-3",
|
|
1257
1272
|
children: [
|
|
1258
1273
|
/* @__PURE__ */ C("div", {
|
|
1259
1274
|
className: "space-y-2",
|
|
1260
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1261
|
-
value:
|
|
1275
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.endpointLabel", "GraphQL Endpoint *") }), /* @__PURE__ */ S(v, {
|
|
1276
|
+
value: D.config?.graphqlEndpoint || "",
|
|
1262
1277
|
onChange: (e) => $({
|
|
1263
|
-
...
|
|
1278
|
+
...D.config,
|
|
1264
1279
|
graphqlEndpoint: e.target.value || void 0
|
|
1265
1280
|
}),
|
|
1266
1281
|
placeholder: "https://api.example.com/graphql"
|
|
@@ -1268,10 +1283,10 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1268
1283
|
}),
|
|
1269
1284
|
/* @__PURE__ */ C("div", {
|
|
1270
1285
|
className: "space-y-2",
|
|
1271
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1272
|
-
value:
|
|
1286
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.queryLabel", "Query *") }), /* @__PURE__ */ S(x, {
|
|
1287
|
+
value: D.config?.graphqlQuery || "",
|
|
1273
1288
|
onChange: (e) => $({
|
|
1274
|
-
...
|
|
1289
|
+
...D.config,
|
|
1275
1290
|
graphqlQuery: e.target.value || void 0
|
|
1276
1291
|
}),
|
|
1277
1292
|
rows: 6,
|
|
@@ -1281,10 +1296,10 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1281
1296
|
}),
|
|
1282
1297
|
/* @__PURE__ */ C("div", {
|
|
1283
1298
|
className: "space-y-2",
|
|
1284
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1285
|
-
value:
|
|
1299
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.variablesLabel", "Variables (JSON, optional)") }), /* @__PURE__ */ S(x, {
|
|
1300
|
+
value: D.config?.graphqlVariables || "",
|
|
1286
1301
|
onChange: (e) => $({
|
|
1287
|
-
...
|
|
1302
|
+
...D.config,
|
|
1288
1303
|
graphqlVariables: e.target.value || void 0
|
|
1289
1304
|
}),
|
|
1290
1305
|
rows: 3,
|
|
@@ -1294,10 +1309,10 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1294
1309
|
}),
|
|
1295
1310
|
/* @__PURE__ */ C("div", {
|
|
1296
1311
|
className: "space-y-2",
|
|
1297
|
-
children: [/* @__PURE__ */ S(y, { children:
|
|
1298
|
-
value:
|
|
1312
|
+
children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.headersLabel", "Headers (JSON, optional)") }), /* @__PURE__ */ S(x, {
|
|
1313
|
+
value: D.config?.headers || "",
|
|
1299
1314
|
onChange: (e) => $({
|
|
1300
|
-
...
|
|
1315
|
+
...D.config,
|
|
1301
1316
|
headers: e.target.value || void 0
|
|
1302
1317
|
}),
|
|
1303
1318
|
rows: 2,
|
|
@@ -1308,40 +1323,40 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1308
1323
|
/* @__PURE__ */ C("div", {
|
|
1309
1324
|
className: "space-y-2",
|
|
1310
1325
|
children: [
|
|
1311
|
-
/* @__PURE__ */ S(y, { children:
|
|
1326
|
+
/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
|
|
1312
1327
|
/* @__PURE__ */ S(v, {
|
|
1313
|
-
value:
|
|
1328
|
+
value: D.config?.dataPath || "",
|
|
1314
1329
|
onChange: (e) => $({
|
|
1315
|
-
...
|
|
1330
|
+
...D.config,
|
|
1316
1331
|
dataPath: e.target.value || void 0
|
|
1317
1332
|
}),
|
|
1318
1333
|
placeholder: ".data.items"
|
|
1319
1334
|
}),
|
|
1320
1335
|
/* @__PURE__ */ S("p", {
|
|
1321
1336
|
className: "text-xs text-text-secondary",
|
|
1322
|
-
children:
|
|
1337
|
+
children: w("bigconsole.widget.properties.dataPath.graphqlHelp", "Path to extract data from GraphQL response")
|
|
1323
1338
|
})
|
|
1324
1339
|
]
|
|
1325
1340
|
})
|
|
1326
1341
|
]
|
|
1327
1342
|
}),
|
|
1328
|
-
|
|
1343
|
+
D.config?.dataSourceType === "MOCK" && /* @__PURE__ */ C("div", {
|
|
1329
1344
|
className: "space-y-2",
|
|
1330
1345
|
children: [
|
|
1331
|
-
/* @__PURE__ */ S(y, { children:
|
|
1346
|
+
/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.mock.sampleDataLabel", "Sample Data (JSON)") }),
|
|
1332
1347
|
/* @__PURE__ */ S(x, {
|
|
1333
|
-
value:
|
|
1348
|
+
value: D.config?.mockData || "",
|
|
1334
1349
|
onChange: (e) => $({
|
|
1335
|
-
...
|
|
1350
|
+
...D.config,
|
|
1336
1351
|
mockData: e.target.value || void 0
|
|
1337
1352
|
}),
|
|
1338
1353
|
rows: 6,
|
|
1339
|
-
placeholder: JSON.stringify(
|
|
1354
|
+
placeholder: JSON.stringify(_e(F?.type) ?? { value: 100 }, null, 2),
|
|
1340
1355
|
className: "font-mono text-sm"
|
|
1341
1356
|
}),
|
|
1342
|
-
|
|
1357
|
+
ge(F?.type) && /* @__PURE__ */ S("p", {
|
|
1343
1358
|
className: "text-xs text-text-secondary",
|
|
1344
|
-
children:
|
|
1359
|
+
children: w("bigconsole.widget.properties.mock.shapeHelp", "This widget needs {{shape}}.", { shape: ge(F?.type) ?? "" })
|
|
1345
1360
|
})
|
|
1346
1361
|
]
|
|
1347
1362
|
})
|
|
@@ -1349,66 +1364,66 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1349
1364
|
})
|
|
1350
1365
|
})] })
|
|
1351
1366
|
}),
|
|
1352
|
-
/* @__PURE__ */ S(
|
|
1367
|
+
/* @__PURE__ */ S(Ke, {
|
|
1353
1368
|
value: "advanced",
|
|
1354
1369
|
className: "mt-0",
|
|
1355
1370
|
children: /* @__PURE__ */ C(r, { children: [
|
|
1356
|
-
|
|
1357
|
-
renderer:
|
|
1358
|
-
rendererOptions:
|
|
1371
|
+
D && /* @__PURE__ */ S(se, {
|
|
1372
|
+
renderer: D.renderer,
|
|
1373
|
+
rendererOptions: yn,
|
|
1359
1374
|
onRendererChange: (e) => {
|
|
1360
1375
|
Q("renderer", e), e === "BIGCONSOLE" && Q("template", void 0);
|
|
1361
1376
|
},
|
|
1362
|
-
templateEditor:
|
|
1377
|
+
templateEditor: D.renderer === "BIGCONSOLE" ? void 0 : /* @__PURE__ */ S(at, {
|
|
1363
1378
|
widget: {
|
|
1364
|
-
...
|
|
1365
|
-
template:
|
|
1366
|
-
renderer:
|
|
1379
|
+
...F,
|
|
1380
|
+
template: D.template,
|
|
1381
|
+
renderer: D.renderer
|
|
1367
1382
|
},
|
|
1368
1383
|
onSave: (e) => Q("template", e)
|
|
1369
1384
|
})
|
|
1370
1385
|
}),
|
|
1371
1386
|
/* @__PURE__ */ S(n, {
|
|
1372
|
-
title:
|
|
1387
|
+
title: w("bigconsole.widget.properties.section.drilldown", "Drilldown"),
|
|
1373
1388
|
description: "Where a click on this widget's data takes the viewer.",
|
|
1374
1389
|
headingLevel: 3,
|
|
1375
1390
|
"data-testid": "widget-inspector-drilldown",
|
|
1376
1391
|
children: /* @__PURE__ */ S(l, {
|
|
1377
|
-
widget:
|
|
1378
|
-
onChange:
|
|
1392
|
+
widget: F,
|
|
1393
|
+
onChange: _n
|
|
1379
1394
|
})
|
|
1380
1395
|
}),
|
|
1381
1396
|
/* @__PURE__ */ S(n, {
|
|
1382
|
-
title:
|
|
1397
|
+
title: w("bigconsole.widget.properties.section.webhooks", "Webhooks"),
|
|
1383
1398
|
description: "HTTP endpoints called when this widget emits an event.",
|
|
1384
1399
|
headingLevel: 3,
|
|
1385
1400
|
"data-testid": "widget-inspector-webhooks",
|
|
1386
1401
|
children: /* @__PURE__ */ S(ne, {
|
|
1387
|
-
dashboardId:
|
|
1388
|
-
widgetId:
|
|
1402
|
+
dashboardId: F.dashboardId,
|
|
1403
|
+
widgetId: F.id
|
|
1389
1404
|
})
|
|
1390
1405
|
}),
|
|
1391
1406
|
/* @__PURE__ */ S(n, {
|
|
1392
1407
|
emphasis: "muted",
|
|
1393
|
-
title:
|
|
1408
|
+
title: w("bigconsole.widget.properties.section.events", "Events"),
|
|
1394
1409
|
description: "Recent deliveries for this widget, newest first. Supporting detail — nothing here changes the widget.",
|
|
1395
1410
|
headingLevel: 3,
|
|
1396
1411
|
"data-testid": "widget-inspector-events",
|
|
1397
1412
|
children: /* @__PURE__ */ S(re, {
|
|
1398
|
-
dashboardId:
|
|
1399
|
-
widgetId:
|
|
1413
|
+
dashboardId: F.dashboardId,
|
|
1414
|
+
widgetId: F.id,
|
|
1400
1415
|
maxHeight: "min(50vh, 360px)"
|
|
1401
1416
|
})
|
|
1402
1417
|
})
|
|
1403
1418
|
] })
|
|
1404
1419
|
}),
|
|
1405
|
-
/* @__PURE__ */ S(
|
|
1420
|
+
/* @__PURE__ */ S(Ke, {
|
|
1406
1421
|
value: "appearance",
|
|
1407
1422
|
className: "mt-0",
|
|
1408
|
-
children:
|
|
1409
|
-
widgetType:
|
|
1410
|
-
config:
|
|
1411
|
-
onChange:
|
|
1423
|
+
children: D && /* @__PURE__ */ S(ce, {
|
|
1424
|
+
widgetType: F.type,
|
|
1425
|
+
config: D.config || {},
|
|
1426
|
+
onChange: gn
|
|
1412
1427
|
})
|
|
1413
1428
|
})
|
|
1414
1429
|
]
|
|
@@ -1417,9 +1432,9 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1417
1432
|
className: "flex min-h-0 flex-1 items-center justify-center p-card-padding",
|
|
1418
1433
|
children: /* @__PURE__ */ S(n, {
|
|
1419
1434
|
tone: "info",
|
|
1420
|
-
title:
|
|
1435
|
+
title: w("bigconsole.widget.properties.emptyState", "Select a widget to edit"),
|
|
1421
1436
|
headingLevel: 3,
|
|
1422
|
-
icon: /* @__PURE__ */ S(
|
|
1437
|
+
icon: /* @__PURE__ */ S(Oe, { className: "h-icon-md w-icon-md" }),
|
|
1423
1438
|
className: "w-full max-w-sm",
|
|
1424
1439
|
"data-testid": "widget-inspector-empty",
|
|
1425
1440
|
children: /* @__PURE__ */ S("p", {
|
|
@@ -1428,7 +1443,7 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1428
1443
|
})
|
|
1429
1444
|
})
|
|
1430
1445
|
}),
|
|
1431
|
-
|
|
1446
|
+
F && /* @__PURE__ */ C("div", {
|
|
1432
1447
|
style: {
|
|
1433
1448
|
padding: "var(--space-cardPadding)",
|
|
1434
1449
|
borderTop: "1px solid var(--color-border-subtle)",
|
|
@@ -1436,93 +1451,93 @@ var T = f(function({ isOpen: f, onClose: Ee }) {
|
|
|
1436
1451
|
flexShrink: 0
|
|
1437
1452
|
},
|
|
1438
1453
|
children: [
|
|
1439
|
-
|
|
1454
|
+
k && /* @__PURE__ */ S(n, {
|
|
1440
1455
|
tone: "warning",
|
|
1441
1456
|
padding: "compact",
|
|
1442
|
-
title:
|
|
1457
|
+
title: w("bigconsole.widget.properties.footer.unsavedChanges", "You have unsaved changes"),
|
|
1443
1458
|
headingLevel: 3,
|
|
1444
1459
|
className: "mb-control-gap",
|
|
1445
1460
|
"data-testid": "widget-inspector-save-unsaved"
|
|
1446
1461
|
}),
|
|
1447
|
-
|
|
1462
|
+
T === "saved" && !k && /* @__PURE__ */ S(n, {
|
|
1448
1463
|
tone: "success",
|
|
1449
1464
|
padding: "compact",
|
|
1450
|
-
title:
|
|
1465
|
+
title: w("bigconsole.widget.properties.footer.allSaved", "All changes saved"),
|
|
1451
1466
|
headingLevel: 3,
|
|
1452
|
-
icon: /* @__PURE__ */ S(
|
|
1467
|
+
icon: /* @__PURE__ */ S(we, { className: "h-icon-sm w-icon-sm" }),
|
|
1453
1468
|
className: "mb-control-gap",
|
|
1454
1469
|
"data-testid": "widget-inspector-save-saved"
|
|
1455
1470
|
}),
|
|
1456
|
-
|
|
1471
|
+
T === "error" && /* @__PURE__ */ S(n, {
|
|
1457
1472
|
tone: "danger",
|
|
1458
1473
|
padding: "compact",
|
|
1459
|
-
title:
|
|
1474
|
+
title: w("bigconsole.widget.properties.footer.saveFailed", "Failed to save changes"),
|
|
1460
1475
|
headingLevel: 3,
|
|
1461
|
-
icon: /* @__PURE__ */ S(
|
|
1476
|
+
icon: /* @__PURE__ */ S(Me, { className: "h-icon-sm w-icon-sm" }),
|
|
1462
1477
|
className: "mb-control-gap",
|
|
1463
1478
|
"data-testid": "widget-inspector-save-error"
|
|
1464
1479
|
}),
|
|
1465
1480
|
/* @__PURE__ */ C("div", {
|
|
1466
1481
|
className: "flex flex-wrap gap-control-gap",
|
|
1467
1482
|
children: [/* @__PURE__ */ S(_, {
|
|
1468
|
-
onClick:
|
|
1469
|
-
disabled:
|
|
1483
|
+
onClick: mn,
|
|
1484
|
+
disabled: T === "saving" || !k,
|
|
1470
1485
|
style: {
|
|
1471
1486
|
flex: 1,
|
|
1472
1487
|
height: "var(--size-controlHeight-md)",
|
|
1473
|
-
backgroundColor:
|
|
1474
|
-
opacity:
|
|
1488
|
+
backgroundColor: k ? "var(--color-action-primary-bg)" : void 0,
|
|
1489
|
+
opacity: k ? 1 : .5
|
|
1475
1490
|
},
|
|
1476
|
-
children:
|
|
1491
|
+
children: T === "saving" ? /* @__PURE__ */ C("span", {
|
|
1477
1492
|
style: {
|
|
1478
1493
|
display: "flex",
|
|
1479
1494
|
alignItems: "center",
|
|
1480
1495
|
gap: "var(--space-iconGap)"
|
|
1481
1496
|
},
|
|
1482
|
-
children: [/* @__PURE__ */ S(
|
|
1497
|
+
children: [/* @__PURE__ */ S(We, { style: {
|
|
1483
1498
|
width: "var(--size-icon-sm)",
|
|
1484
1499
|
height: "var(--size-icon-sm)"
|
|
1485
|
-
} }),
|
|
1500
|
+
} }), w("bigconsole.widget.properties.footer.saving", "Saving...")]
|
|
1486
1501
|
}) : /* @__PURE__ */ C("span", {
|
|
1487
1502
|
style: {
|
|
1488
1503
|
display: "flex",
|
|
1489
1504
|
alignItems: "center",
|
|
1490
1505
|
gap: "var(--space-iconGap)"
|
|
1491
1506
|
},
|
|
1492
|
-
children: [/* @__PURE__ */ S(
|
|
1507
|
+
children: [/* @__PURE__ */ S(we, { style: {
|
|
1493
1508
|
width: "var(--size-icon-sm)",
|
|
1494
1509
|
height: "var(--size-icon-sm)"
|
|
1495
|
-
} }),
|
|
1510
|
+
} }), w("bigconsole.widget.properties.footer.saveChanges", "Save Changes")]
|
|
1496
1511
|
})
|
|
1497
1512
|
}), /* @__PURE__ */ C(_, {
|
|
1498
1513
|
variant: "outline",
|
|
1499
|
-
onClick:
|
|
1500
|
-
disabled:
|
|
1514
|
+
onClick: hn,
|
|
1515
|
+
disabled: T === "saving" || !k,
|
|
1501
1516
|
style: {
|
|
1502
1517
|
height: "var(--size-controlHeight-md)",
|
|
1503
|
-
opacity:
|
|
1518
|
+
opacity: k ? 1 : .5
|
|
1504
1519
|
},
|
|
1505
|
-
children: [/* @__PURE__ */ S(
|
|
1520
|
+
children: [/* @__PURE__ */ S(Me, { style: {
|
|
1506
1521
|
width: "var(--size-icon-sm)",
|
|
1507
1522
|
height: "var(--size-icon-sm)"
|
|
1508
|
-
} }),
|
|
1523
|
+
} }), w("bigconsole.widget.properties.footer.discard", "Discard")]
|
|
1509
1524
|
})]
|
|
1510
1525
|
})
|
|
1511
1526
|
]
|
|
1512
1527
|
}),
|
|
1513
1528
|
/* @__PURE__ */ S(ee, {
|
|
1514
|
-
isOpen:
|
|
1515
|
-
action:
|
|
1516
|
-
initialWebhook:
|
|
1517
|
-
isLoading:
|
|
1518
|
-
saveError:
|
|
1529
|
+
isOpen: Yt,
|
|
1530
|
+
action: Zt,
|
|
1531
|
+
initialWebhook: rn,
|
|
1532
|
+
isLoading: Qt,
|
|
1533
|
+
saveError: tn,
|
|
1519
1534
|
onClose: () => {
|
|
1520
|
-
|
|
1535
|
+
Xt(!1), Y(void 0), X(void 0), Z(null);
|
|
1521
1536
|
},
|
|
1522
|
-
onSave:
|
|
1537
|
+
onSave: cn
|
|
1523
1538
|
})
|
|
1524
1539
|
]
|
|
1525
1540
|
})
|
|
1526
1541
|
});
|
|
1527
1542
|
});
|
|
1528
|
-
export {
|
|
1543
|
+
export { w as PropertiesPanel, w as default };
|