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