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