@burdenoff/microfe-bigconsole 2026.1123.7 → 2026.1124.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/asof/AsOfControl.js +2 -2
- package/dist/bigconsole/components/dashboard/DashboardCommentsDrawer.js +107 -106
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.d.ts +34 -0
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.js +123 -0
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.js +1 -1
- package/dist/bigconsole/components/dashboard/DashboardStatusPill.js +19 -35
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +119 -116
- package/dist/bigconsole/components/dashboard/LiveCanvasToggle.js +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.d.ts +0 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +172 -170
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +210 -208
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +97 -97
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +92 -92
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +149 -149
- package/dist/bigconsole/components/datasink/AnomalyDetectorPanel.js +54 -54
- package/dist/bigconsole/components/datasink/DataSinkStatusBadge.js +30 -37
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +4 -4
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +130 -129
- package/dist/bigconsole/components/datasink/SetupStateBadge.js +24 -33
- package/dist/bigconsole/components/datasink/SinkWorkflowLinkForm.js +38 -38
- package/dist/bigconsole/components/explore/CreateQueryWidget.js +57 -56
- package/dist/bigconsole/components/explore/SqlDraftEditor.js +140 -140
- package/dist/bigconsole/components/explore/VisualBuilder.js +85 -84
- package/dist/bigconsole/components/explore/queryAccess/GrantsPanel.js +168 -167
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessAdmin.js +2 -2
- package/dist/bigconsole/components/explore/queryAccess/RelationEditor.js +118 -117
- package/dist/bigconsole/components/insights/BoardLintPanel.js +2 -2
- package/dist/bigconsole/components/insights/OutlierSpottingDialog.js +123 -123
- package/dist/bigconsole/components/kpi-change/KpiChangePanel.js +2 -2
- package/dist/bigconsole/components/narrative/NarrativePanel.js +1 -1
- package/dist/bigconsole/components/overview/DataHealthCard.js +3 -0
- package/dist/bigconsole/components/overview/RecentDashboardsPanel.js +3 -0
- package/dist/bigconsole/components/parser/ParserStatusBadge.js +25 -28
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +23 -22
- package/dist/bigconsole/components/pipeline/PipelineStatusBadge.js +15 -26
- package/dist/bigconsole/components/reconcile/KpiReconcileDialog.js +24 -24
- package/dist/bigconsole/components/settings/WidgetCatalogSection.js +1 -1
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +188 -187
- package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +1 -1
- package/dist/bigconsole/components/widgets/UnsupportedDataSourceNotice.js +1 -1
- package/dist/bigconsole/components/widgets/WidgetCompareView.js +3 -1
- package/dist/bigconsole/components/widgets/WidgetHeader.js +1 -1
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +45 -44
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +151 -147
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +48 -47
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +1 -1
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +139 -138
- package/dist/bigconsole/components/widgets/form/FormWidget.js +149 -148
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +80 -77
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +58 -56
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +75 -73
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +86 -85
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +80 -77
- package/dist/bigconsole/components/widgets/retention/RetentionView.js +1 -1
- package/dist/bigconsole/components/widgets/table/TableConfig.js +214 -211
- package/dist/bigconsole/components/widgets/table/TablePagination.js +59 -58
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +140 -138
- package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js +74 -66
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +48 -48
- package/dist/bigconsole/components/workflow/WorkflowStatusBadge.js +28 -37
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +69 -69
- package/dist/bigconsole/hooks/useDashboardListQuery.d.ts +22 -0
- package/dist/bigconsole/hooks/useDashboardListQuery.js +39 -0
- package/dist/bigconsole/pages/AdminPage.js +147 -146
- package/dist/bigconsole/pages/DashboardViewPage.js +2 -0
- package/dist/bigconsole/pages/DashboardsPage.js +638 -855
- package/dist/bigconsole/pages/DataParsersPage.js +5 -0
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +4 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +263 -261
- package/dist/bigconsole/pages/DataSinksPage.js +210 -186
- package/dist/bigconsole/pages/InsightsPage.js +386 -383
- package/dist/bigconsole/pages/ParserBuilderPage.js +413 -413
- package/dist/bigconsole/pages/ParserViewPage.js +2 -0
- package/dist/bigconsole/pages/PipelineBuilderPage.js +279 -276
- package/dist/bigconsole/pages/PipelineViewPage.js +3 -0
- package/dist/bigconsole/pages/PipelinesPage.js +198 -165
- package/dist/bigconsole/pages/SettingsPage.js +160 -160
- package/dist/bigconsole/pages/WidgetDemoPage.js +2 -0
- package/dist/bigconsole/pages/WorkflowViewPage.js +5 -0
- package/dist/bigconsole/pages/WorkflowsPage.js +144 -123
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +1 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +123 -122
- package/dist/bigconsole/utils/dashboardGallery.d.ts +84 -0
- package/dist/bigconsole/utils/dashboardGallery.js +93 -0
- package/dist/bigconsole/utils/statusTone.d.ts +17 -0
- package/dist/bigconsole/utils/statusTone.js +44 -0
- package/package.json +4 -4
|
@@ -13,28 +13,28 @@ import { CacheTTLSelector as ue } from "../components/datasink/CacheTTLSelector.
|
|
|
13
13
|
import { ExpressionEditor as de } from "../components/parser/ExpressionEditor.js";
|
|
14
14
|
import "../components/common/index.js";
|
|
15
15
|
import { BIGCONSOLE_PERMISSIONS as i } from "../../constants/permissions.js";
|
|
16
|
-
import { memo as a, useCallback as o, useEffect as
|
|
17
|
-
import { useParams as
|
|
18
|
-
import { AccessDenied as
|
|
19
|
-
import { usePermissions as
|
|
20
|
-
import { AlertCircle as
|
|
21
|
-
import { Button as
|
|
22
|
-
import { useUnsavedChanges as
|
|
23
|
-
import { useI18n as
|
|
24
|
-
import { useQuery as
|
|
25
|
-
import { Fragment as
|
|
16
|
+
import { memo as a, useCallback as o, useEffect as fe, useMemo as s, useRef as pe, useState as c } from "react";
|
|
17
|
+
import { useParams as me } from "react-router";
|
|
18
|
+
import { AccessDenied as he, PermissionButton as ge } from "@burdenoff/fe-libs/shared/components";
|
|
19
|
+
import { usePermissions as _e } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
20
|
+
import { AlertCircle as l, ArrowLeft as ve, CheckCircle2 as ye, ChevronDown as be, ChevronRight as xe, Code as Se, Download as Ce, Eye as we, FileCode2 as Te, LayoutDashboard as Ee, Loader2 as u, Play as De, Save as Oe, Settings as ke, Timer as Ae, X as je } from "lucide-react";
|
|
21
|
+
import { Button as d, PagePurpose as Me, Stepper as Ne, ThemedSelect as Pe } from "@burdenoff/fe-libs/ui";
|
|
22
|
+
import { useUnsavedChanges as Fe } from "@burdenoff/fe-libs/shared/hooks";
|
|
23
|
+
import { useI18n as Ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
24
|
+
import { useQuery as Le } from "@apollo/client/react";
|
|
25
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
26
26
|
// src/bigconsole/pages/ParserBuilderPage.tsx
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return `${
|
|
27
|
+
var h = "w-full min-w-0 min-h-[44px] rounded-md border bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-action-primary-bg motion-safe:transition-colors disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60";
|
|
28
|
+
function g(e = !1, t = "") {
|
|
29
|
+
return `${h} ${e ? "border-status-error-border" : "border-[var(--color-border-default)]"} ${t}`.trim();
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var _ = "block text-sm font-medium text-text-primary mb-2", v = "text-xs text-text-muted mt-1.5", Re = "text-xs text-status-error-text mt-1.5", ze = 1e3, Be = "220px", y = 25, Ve = "default", He = [
|
|
32
32
|
"details",
|
|
33
33
|
"source",
|
|
34
34
|
"expression",
|
|
35
35
|
"review"
|
|
36
36
|
];
|
|
37
|
-
function
|
|
37
|
+
function Ue(e) {
|
|
38
38
|
return [
|
|
39
39
|
{
|
|
40
40
|
key: "details",
|
|
@@ -58,14 +58,14 @@ function Ve(e) {
|
|
|
58
58
|
}
|
|
59
59
|
];
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function We(e) {
|
|
62
62
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").substring(0, 64);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Ge(e, t) {
|
|
65
65
|
let n = {};
|
|
66
66
|
return e.name.trim() ? e.name.length < 2 && (n.name = t("bigconsole.parsers.builder.validation.nameMinLength", "Name must be at least 2 characters")) : n.name = t("bigconsole.parsers.builder.validation.nameRequired", "Name is required"), e.outputKey.trim() ? /^[a-z0-9_]+$/.test(e.outputKey) || (n.outputKey = t("bigconsole.parsers.builder.validation.outputKeyInvalid", "Output key can only contain lowercase letters, numbers, and underscores")) : n.outputKey = t("bigconsole.parsers.builder.validation.outputKeyRequired", "Output key is required"), e.expression.trim() || (n.expression = t("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required")), e.inputSinkKey.trim() || (n.inputSinkKey = t("bigconsole.parsers.builder.validation.inputSinkRequired", "Source DataSink is required")), e.ttl != null && e.ttl > 0 && (e.ttl < 30 || e.ttl > 86400) && (n.ttl = t("bigconsole.parsers.builder.validation.cacheDurationRange", "Cache duration must be between 30 and 86400 seconds")), n;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Ke(e) {
|
|
69
69
|
return {
|
|
70
70
|
jq: {
|
|
71
71
|
name: e("bigconsole.parsers.builder.parserType.jq.name", "JQ"),
|
|
@@ -81,11 +81,11 @@ function We(e) {
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
var
|
|
85
|
-
let { parserId: a, consoleId:
|
|
86
|
-
variables: { id:
|
|
87
|
-
skip: !
|
|
88
|
-
}), k =
|
|
84
|
+
var b = a(function() {
|
|
85
|
+
let { parserId: a, consoleId: h } = me(), b = n(), { t: x } = Ie(), qe = s(() => Ue(x), [x]), S = s(() => Ke(x), [x]), C = qe.length, [w, T] = c(0), [E, Je] = c(Ve), Ye = h || E || Ve, D = a !== "new" && !!a, { hasPermission: Xe, isLoading: Ze } = _e(), Qe = Xe(i.PARSER_READ), $e = Xe(D ? i.PARSER_UPDATE : i.PARSER_CREATE), et = D ? i.PARSER_UPDATE : i.PARSER_CREATE, tt = Xe(i.PARSER_TEST), O = !h, nt = h && h !== "default" ? h : null, { data: rt } = Le(se, {
|
|
86
|
+
variables: { id: nt ?? "" },
|
|
87
|
+
skip: !nt
|
|
88
|
+
}), k = rt?.getDashboard?.name ?? null, [A, j] = c({
|
|
89
89
|
name: "",
|
|
90
90
|
outputKey: "",
|
|
91
91
|
description: "",
|
|
@@ -93,36 +93,36 @@ var x = a(function() {
|
|
|
93
93
|
expression: "",
|
|
94
94
|
inputSinkKey: "",
|
|
95
95
|
ttl: 900
|
|
96
|
-
}), [
|
|
97
|
-
|
|
96
|
+
}), [it, at] = c(() => D ? null : A);
|
|
97
|
+
Fe({
|
|
98
98
|
id: "parser-editor",
|
|
99
|
-
label:
|
|
100
|
-
dirty: e(A,
|
|
99
|
+
label: x("bigconsole.assistant.unsaved.parserEditor", "the parser editor"),
|
|
100
|
+
dirty: e(A, it)
|
|
101
101
|
});
|
|
102
|
-
let [
|
|
103
|
-
|
|
102
|
+
let [M, N] = c({}), [ot, st] = c(!1), [ct, lt] = c(!1), [ut, dt] = c(null), [ft, P] = c("{\n \"data\": [\n {\"name\": \"Item 1\", \"count\": 10},\n {\"name\": \"Item 2\", \"count\": 20}\n ]\n}"), [pt, F] = c(""), [mt, I] = c(null), [L, R] = c(null), [z, ht] = c(!1), [B, V] = c(null), [gt, _t] = c(null), [vt, yt] = c(null), [bt, H] = c(!1), [U, xt] = c(!1), [W, St] = c(null), [Ct, wt] = c(!1), G = pe(A.inputSinkKey);
|
|
103
|
+
fe(() => {
|
|
104
104
|
G.current = A.inputSinkKey;
|
|
105
105
|
}, [A.inputSinkKey]);
|
|
106
|
-
let [K,
|
|
107
|
-
consoleId:
|
|
106
|
+
let [K, Tt] = c(!1), [Et, Dt] = c(null), [Ot, kt] = c(!1), [At, q] = c(null), [J, jt] = c(null), { loading: Mt, error: Nt, fetchParser: Pt, createParser: Ft, updateParser: It, testParserExpression: Lt } = ie({
|
|
107
|
+
consoleId: Ye || "",
|
|
108
108
|
skipFetch: !0
|
|
109
|
-
}), { dataSinks:
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
}), { dataSinks: Rt, fetchDataSinks: zt, getDataSinkData: Bt } = ce({ skipFetch: !0 }), { dashboards: Vt, fetchDashboards: Ht, loading: Ut } = le(), Y = oe((e) => D && a ? e.parsers.get(a) : void 0) ?? null;
|
|
110
|
+
fe(() => {
|
|
111
|
+
zt(), D && a && Pt(a), O && Ht();
|
|
112
112
|
}, [
|
|
113
113
|
D,
|
|
114
114
|
a,
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
Pt,
|
|
116
|
+
zt,
|
|
117
117
|
O,
|
|
118
|
-
|
|
118
|
+
Ht
|
|
119
119
|
]);
|
|
120
|
-
let
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}, [A,
|
|
124
|
-
if (Y && t(
|
|
125
|
-
|
|
120
|
+
let Wt = pe(null), Gt = pe(A), Kt = pe(it);
|
|
121
|
+
fe(() => {
|
|
122
|
+
Gt.current = A, Kt.current = it;
|
|
123
|
+
}, [A, it]), fe(() => {
|
|
124
|
+
if (Y && t(Wt.current, Y.id, Gt.current, Kt.current)) {
|
|
125
|
+
Wt.current = Y.id;
|
|
126
126
|
let e = {
|
|
127
127
|
name: Y.name || "",
|
|
128
128
|
outputKey: Y.outputKey || "",
|
|
@@ -132,130 +132,130 @@ var x = a(function() {
|
|
|
132
132
|
inputSinkKey: Y.inputSinkKey || "",
|
|
133
133
|
ttl: Y.ttl ?? null
|
|
134
134
|
};
|
|
135
|
-
j(e),
|
|
135
|
+
j(e), at(e), st(!0), _t(e.expression.trim() ? re(e.type, e.expression) : null), Y.consoleId && Je(Y.consoleId);
|
|
136
136
|
}
|
|
137
137
|
}, [Y]);
|
|
138
|
-
let X =
|
|
138
|
+
let X = s(() => Rt.find((e) => e.key === A.inputSinkKey)?.name || A.inputSinkKey, [Rt, A.inputSinkKey]), qt = o((e) => {
|
|
139
139
|
let t = e.target.value;
|
|
140
140
|
j((e) => ({
|
|
141
141
|
...e,
|
|
142
142
|
name: t,
|
|
143
|
-
outputKey:
|
|
144
|
-
})),
|
|
143
|
+
outputKey: ot ? e.outputKey : We(t)
|
|
144
|
+
})), N((e) => ({
|
|
145
145
|
...e,
|
|
146
146
|
name: void 0
|
|
147
147
|
}));
|
|
148
|
-
}, [
|
|
148
|
+
}, [ot]), Jt = o((e) => {
|
|
149
149
|
let t = e.target.value.toLowerCase().replace(/[^a-z0-9_]/g, "");
|
|
150
150
|
j((e) => ({
|
|
151
151
|
...e,
|
|
152
152
|
outputKey: t
|
|
153
|
-
})),
|
|
153
|
+
})), st(!0), N((e) => ({
|
|
154
154
|
...e,
|
|
155
155
|
outputKey: void 0
|
|
156
156
|
}));
|
|
157
|
-
}, []),
|
|
157
|
+
}, []), Yt = o((e) => {
|
|
158
158
|
j((t) => ({
|
|
159
159
|
...t,
|
|
160
160
|
description: e.target.value
|
|
161
161
|
}));
|
|
162
|
-
}, []),
|
|
162
|
+
}, []), Xt = o((e) => {
|
|
163
163
|
j((t) => ({
|
|
164
164
|
...t,
|
|
165
165
|
type: e
|
|
166
|
-
})),
|
|
167
|
-
}, []),
|
|
166
|
+
})), F(""), R(null), I(null), yt(null);
|
|
167
|
+
}, []), Zt = o((e) => {
|
|
168
168
|
j((t) => ({
|
|
169
169
|
...t,
|
|
170
170
|
expression: e
|
|
171
|
-
})),
|
|
171
|
+
})), N((e) => ({
|
|
172
172
|
...e,
|
|
173
173
|
expression: void 0
|
|
174
174
|
}));
|
|
175
|
-
}, []),
|
|
175
|
+
}, []), Qt = o((e) => {
|
|
176
176
|
j((t) => ({
|
|
177
177
|
...t,
|
|
178
178
|
inputSinkKey: e.target.value
|
|
179
|
-
})),
|
|
179
|
+
})), N((e) => ({
|
|
180
180
|
...e,
|
|
181
181
|
inputSinkKey: void 0
|
|
182
|
-
})),
|
|
183
|
-
}, [U]),
|
|
182
|
+
})), Tt(!1), Dt(null), jt(null), q(null), U && (P(""), xt(!1), H(!1)), St(null), F(""), R(null), V(null), I(null);
|
|
183
|
+
}, [U]), $t = o((e) => {
|
|
184
184
|
j((t) => ({
|
|
185
185
|
...t,
|
|
186
186
|
ttl: e
|
|
187
|
-
})),
|
|
187
|
+
})), N((e) => ({
|
|
188
188
|
...e,
|
|
189
189
|
ttl: void 0
|
|
190
190
|
}));
|
|
191
|
-
}, []), $t = o((e) => {
|
|
192
|
-
qe(e.target.value);
|
|
193
191
|
}, []), en = o((e) => {
|
|
194
|
-
|
|
192
|
+
Je(e.target.value);
|
|
195
193
|
}, []), tn = o((e) => {
|
|
194
|
+
P(e);
|
|
195
|
+
}, []), nn = o((e) => {
|
|
196
196
|
U && ne(e) && H(!0);
|
|
197
|
-
}, [U]),
|
|
197
|
+
}, [U]), rn = o(() => {
|
|
198
198
|
U && H(!0);
|
|
199
|
-
}, [U]),
|
|
199
|
+
}, [U]), an = o(async () => {
|
|
200
200
|
let e = A.inputSinkKey;
|
|
201
201
|
if (e) {
|
|
202
|
-
|
|
202
|
+
wt(!0);
|
|
203
203
|
try {
|
|
204
|
-
let t = await
|
|
204
|
+
let t = await Bt({ key: e }, { limit: y });
|
|
205
205
|
if (G.current !== e) return;
|
|
206
|
-
t?.raw !== void 0 && t?.raw !== null ? (
|
|
206
|
+
t?.raw !== void 0 && t?.raw !== null ? (P(JSON.stringify(t.raw, null, 2)), xt(!0), H(!1), St({
|
|
207
207
|
total: t.totalCount ?? null,
|
|
208
208
|
hasMore: t.hasMore ?? null,
|
|
209
209
|
sinkName: X
|
|
210
|
-
}),
|
|
210
|
+
}), F(""), R(null), V(null), I(null)) : R(x("bigconsole.parsers.builder.errors.loadSampleFailed", "Could not load a sample from the selected DataSink."));
|
|
211
211
|
} catch (t) {
|
|
212
212
|
if (G.current !== e) return;
|
|
213
|
-
|
|
213
|
+
R(t instanceof Error ? t.message : x("bigconsole.parsers.builder.errors.loadSampleDataFailed", "Failed to load sample data"));
|
|
214
214
|
} finally {
|
|
215
|
-
|
|
215
|
+
wt(!1);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
}, [
|
|
219
219
|
A.inputSinkKey,
|
|
220
|
-
|
|
220
|
+
Bt,
|
|
221
221
|
X,
|
|
222
|
-
|
|
223
|
-
]),
|
|
224
|
-
|
|
225
|
-
}, []),
|
|
222
|
+
x
|
|
223
|
+
]), on = o(() => {
|
|
224
|
+
P(""), xt(!1), H(!1), St(null), V(null), F(""), R(null), I(null);
|
|
225
|
+
}, []), sn = o(async () => {
|
|
226
226
|
if (K) {
|
|
227
|
-
|
|
227
|
+
Tt(!1);
|
|
228
228
|
return;
|
|
229
229
|
}
|
|
230
230
|
if (!A.inputSinkKey) {
|
|
231
|
-
q(
|
|
231
|
+
q(x("bigconsole.parsers.builder.errors.selectSourceFirst", "Please select a source DataSink first"));
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
|
-
|
|
234
|
+
Tt(!0), kt(!0), q(null);
|
|
235
235
|
let e = A.inputSinkKey;
|
|
236
236
|
try {
|
|
237
|
-
let t = await
|
|
237
|
+
let t = await Bt({ key: e }, { limit: y });
|
|
238
238
|
if (G.current !== e) return;
|
|
239
|
-
t?.raw !== void 0 && t?.raw !== null ? (
|
|
239
|
+
t?.raw !== void 0 && t?.raw !== null ? (Dt(t.raw), jt({
|
|
240
240
|
total: t.totalCount ?? null,
|
|
241
241
|
hasMore: t.hasMore ?? null,
|
|
242
242
|
sinkName: X
|
|
243
|
-
})) : q(
|
|
243
|
+
})) : q(x("bigconsole.parsers.builder.errors.noDataInSink", "No data available in selected DataSink"));
|
|
244
244
|
} catch (t) {
|
|
245
245
|
if (G.current !== e) return;
|
|
246
|
-
q(t instanceof Error ? t.message :
|
|
246
|
+
q(t instanceof Error ? t.message : x("bigconsole.parsers.builder.errors.loadDataFailed", "Failed to load data"));
|
|
247
247
|
} finally {
|
|
248
|
-
|
|
248
|
+
kt(!1);
|
|
249
249
|
}
|
|
250
250
|
}, [
|
|
251
251
|
K,
|
|
252
252
|
A.inputSinkKey,
|
|
253
|
-
|
|
253
|
+
Bt,
|
|
254
254
|
X,
|
|
255
|
-
|
|
256
|
-
]),
|
|
257
|
-
if (
|
|
258
|
-
|
|
255
|
+
x
|
|
256
|
+
]), cn = o(async () => {
|
|
257
|
+
if (I(null), !A.expression.trim()) {
|
|
258
|
+
R(x("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required"));
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
261
|
let e;
|
|
@@ -263,14 +263,14 @@ var x = a(function() {
|
|
|
263
263
|
type: A.type,
|
|
264
264
|
expression: A.expression,
|
|
265
265
|
dataSinkKey: A.inputSinkKey,
|
|
266
|
-
sampleLimit:
|
|
266
|
+
sampleLimit: y
|
|
267
267
|
};
|
|
268
268
|
else {
|
|
269
269
|
let t;
|
|
270
270
|
try {
|
|
271
|
-
t = JSON.parse(
|
|
271
|
+
t = JSON.parse(ft);
|
|
272
272
|
} catch {
|
|
273
|
-
|
|
273
|
+
R(x("bigconsole.parsers.builder.errors.invalidInputJson", "Input JSON is not valid JSON"));
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
e = {
|
|
@@ -280,52 +280,52 @@ var x = a(function() {
|
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
let t = re(A.type, A.expression);
|
|
283
|
-
|
|
283
|
+
ht(!0), R(null), F(""), V(null), _t(null), yt(t);
|
|
284
284
|
try {
|
|
285
|
-
let n = await
|
|
286
|
-
n ? (
|
|
285
|
+
let n = await Lt(e);
|
|
286
|
+
n ? (I(n.executionTimeMs), n.success ? (F(JSON.stringify(n.output, null, 2)), _t(t), n.sampled && V({
|
|
287
287
|
sampledRows: n.sampledRows ?? null,
|
|
288
288
|
totalRows: n.totalRows ?? null
|
|
289
|
-
})) :
|
|
289
|
+
})) : R(n.error || x("bigconsole.parsers.builder.errors.testFailed", "Test failed"))) : R(x("bigconsole.parsers.builder.errors.testRequestFailed", "Test request failed — please try again."));
|
|
290
290
|
} catch (e) {
|
|
291
|
-
|
|
291
|
+
R(e instanceof Error ? e.message : x("bigconsole.parsers.builder.errors.testFailed", "Test failed"));
|
|
292
292
|
} finally {
|
|
293
|
-
|
|
293
|
+
ht(!1);
|
|
294
294
|
}
|
|
295
295
|
}, [
|
|
296
296
|
A.type,
|
|
297
297
|
A.expression,
|
|
298
298
|
A.inputSinkKey,
|
|
299
|
-
|
|
299
|
+
ft,
|
|
300
300
|
U,
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
Lt,
|
|
302
|
+
x
|
|
303
303
|
]), Z = o(() => {
|
|
304
|
-
|
|
305
|
-
}, [
|
|
304
|
+
b(h ? `/dashboards/${h}/parsers` : "/parsers");
|
|
305
|
+
}, [b, h]), ln = te({
|
|
306
306
|
type: A.type,
|
|
307
307
|
expression: A.expression,
|
|
308
|
-
passedSignature:
|
|
309
|
-
canTest:
|
|
310
|
-
}), Q = ee(
|
|
311
|
-
|
|
312
|
-
let e =
|
|
313
|
-
if (Object.keys(e).length > 0)
|
|
308
|
+
passedSignature: gt,
|
|
309
|
+
canTest: tt
|
|
310
|
+
}), Q = ee(ln), un = vt !== null && vt !== re(A.type, A.expression), dn = o(async () => {
|
|
311
|
+
dt(null);
|
|
312
|
+
let e = Ge(A, x);
|
|
313
|
+
if (Object.keys(e).length > 0) N(e), e.name || e.outputKey ? T(0) : e.inputSinkKey ? T(1) : e.expression && T(2);
|
|
314
314
|
else if (!Q) T(2);
|
|
315
315
|
else {
|
|
316
|
-
|
|
316
|
+
lt(!0);
|
|
317
317
|
try {
|
|
318
318
|
if (D && Y) {
|
|
319
|
-
if (!await
|
|
319
|
+
if (!await It(Y.id, {
|
|
320
320
|
name: A.name,
|
|
321
321
|
description: A.description || void 0,
|
|
322
322
|
expression: A.expression,
|
|
323
323
|
inputSinkKey: A.inputSinkKey,
|
|
324
324
|
outputKey: A.outputKey,
|
|
325
325
|
ttl: A.ttl
|
|
326
|
-
}, Y.version)) throw Error(
|
|
327
|
-
} else if (!await
|
|
328
|
-
consoleId:
|
|
326
|
+
}, Y.version)) throw Error(x("bigconsole.parsers.builder.errors.updateFailed", "Failed to update parser"));
|
|
327
|
+
} else if (!await Ft({
|
|
328
|
+
consoleId: Ye || "",
|
|
329
329
|
name: A.name,
|
|
330
330
|
type: A.type,
|
|
331
331
|
expression: A.expression,
|
|
@@ -333,12 +333,12 @@ var x = a(function() {
|
|
|
333
333
|
outputKey: A.outputKey,
|
|
334
334
|
description: A.description || void 0,
|
|
335
335
|
ttl: A.ttl ?? void 0
|
|
336
|
-
})) throw Error(
|
|
337
|
-
|
|
336
|
+
})) throw Error(x("bigconsole.parsers.builder.errors.createFailed", "Failed to create parser"));
|
|
337
|
+
at(A), Z();
|
|
338
338
|
} catch (e) {
|
|
339
|
-
|
|
339
|
+
dt(e instanceof Error ? e.message : x("bigconsole.parsers.builder.errors.saveFailed", "Failed to save parser"));
|
|
340
340
|
} finally {
|
|
341
|
-
|
|
341
|
+
lt(!1);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}, [
|
|
@@ -346,19 +346,19 @@ var x = a(function() {
|
|
|
346
346
|
Q,
|
|
347
347
|
D,
|
|
348
348
|
Y,
|
|
349
|
-
Pt,
|
|
350
349
|
Ft,
|
|
351
|
-
|
|
350
|
+
It,
|
|
351
|
+
Ye,
|
|
352
352
|
Z,
|
|
353
|
-
|
|
354
|
-
]),
|
|
353
|
+
x
|
|
354
|
+
]), fn = s(() => A.name.trim().length >= 2 && A.expression.trim().length > 0 && Q && A.inputSinkKey.trim().length > 0 && A.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(A.outputKey), [
|
|
355
355
|
A.name,
|
|
356
356
|
A.expression,
|
|
357
357
|
Q,
|
|
358
358
|
A.inputSinkKey,
|
|
359
359
|
A.outputKey
|
|
360
360
|
]), $ = o((e) => {
|
|
361
|
-
switch (
|
|
361
|
+
switch (He[e]) {
|
|
362
362
|
case "details": return A.name.trim().length >= 2 && A.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(A.outputKey);
|
|
363
363
|
case "source": return A.inputSinkKey.trim().length > 0;
|
|
364
364
|
case "expression": return Q;
|
|
@@ -369,7 +369,7 @@ var x = a(function() {
|
|
|
369
369
|
A.outputKey,
|
|
370
370
|
A.inputSinkKey,
|
|
371
371
|
Q
|
|
372
|
-
]),
|
|
372
|
+
]), pn = o((e) => {
|
|
373
373
|
let t = Math.max(0, Math.min(e, C - 1));
|
|
374
374
|
if (t > w) {
|
|
375
375
|
for (let e = w; e < t; e++) if (!$(e)) return;
|
|
@@ -379,278 +379,278 @@ var x = a(function() {
|
|
|
379
379
|
w,
|
|
380
380
|
$,
|
|
381
381
|
C
|
|
382
|
-
]),
|
|
382
|
+
]), mn = o(() => {
|
|
383
383
|
$(w) && T(Math.min(w + 1, C - 1));
|
|
384
384
|
}, [
|
|
385
385
|
w,
|
|
386
386
|
$,
|
|
387
387
|
C
|
|
388
|
-
]),
|
|
388
|
+
]), hn = o(() => {
|
|
389
389
|
T((e) => Math.max(e - 1, 0));
|
|
390
390
|
}, []);
|
|
391
|
-
if (
|
|
391
|
+
if (Mt && D || Ze) return /* @__PURE__ */ p("div", {
|
|
392
392
|
className: "flex items-center justify-center min-h-[400px]",
|
|
393
|
-
children: /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ p(u, { className: "w-8 h-8 text-text-secondary animate-spin" })
|
|
394
394
|
});
|
|
395
|
-
if (D && !
|
|
396
|
-
title:
|
|
397
|
-
description:
|
|
395
|
+
if (D && !Qe) return /* @__PURE__ */ p(he, {
|
|
396
|
+
title: x("bigconsole.parsers.builder.accessDenied.title", "Access Denied"),
|
|
397
|
+
description: x("bigconsole.parsers.builder.accessDenied.description", "You don't have permission to view this parser.")
|
|
398
398
|
});
|
|
399
|
-
if (
|
|
399
|
+
if (Nt) return /* @__PURE__ */ p("div", {
|
|
400
400
|
className: "p-card-padding",
|
|
401
|
-
children: /* @__PURE__ */
|
|
401
|
+
children: /* @__PURE__ */ p(r, {
|
|
402
402
|
tone: "danger",
|
|
403
403
|
headingLevel: 2,
|
|
404
|
-
title:
|
|
404
|
+
title: x("bigconsole.parsers.builder.errors.loadParserFailed", "Failed to load Parser"),
|
|
405
405
|
description: "The parser could not be fetched, so the form cannot be filled in.",
|
|
406
|
-
icon: /* @__PURE__ */
|
|
407
|
-
actions: /* @__PURE__ */
|
|
406
|
+
icon: /* @__PURE__ */ p(l, { className: "h-icon-md w-icon-md text-[var(--color-status-error-text)]" }),
|
|
407
|
+
actions: /* @__PURE__ */ m(d, {
|
|
408
408
|
onClick: Z,
|
|
409
409
|
variant: "secondary",
|
|
410
410
|
size: "sm",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ p(ve, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
|
|
412
412
|
}),
|
|
413
413
|
"data-testid": "parser-builder-load-error",
|
|
414
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ p("p", {
|
|
415
415
|
className: "font-mono text-xs break-words text-text-secondary",
|
|
416
|
-
children:
|
|
416
|
+
children: Nt.message
|
|
417
417
|
})
|
|
418
418
|
})
|
|
419
419
|
});
|
|
420
|
-
let
|
|
420
|
+
let gn = S[A.type], _n = w === C - 1, vn = /* @__PURE__ */ p("span", {
|
|
421
421
|
className: "text-xs font-medium text-text-muted",
|
|
422
|
-
children:
|
|
422
|
+
children: x("bigconsole.parsers.builder.header.stepCounter", "Step {{current}} of {{total}}", {
|
|
423
423
|
current: w + 1,
|
|
424
424
|
total: C
|
|
425
425
|
})
|
|
426
426
|
});
|
|
427
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ p("div", {
|
|
428
428
|
"data-tour": "bigconsole-parser-builder",
|
|
429
429
|
className: "min-h-screen bg-bg-canvas",
|
|
430
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ p("div", {
|
|
431
431
|
className: "max-w-4xl mx-auto p-card-padding pb-10",
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ m(ae, { children: [
|
|
433
|
+
/* @__PURE__ */ m("div", {
|
|
434
434
|
className: "border-b border-[var(--color-border-subtle)] pb-form-gap",
|
|
435
435
|
children: [
|
|
436
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ m(d, {
|
|
437
437
|
onClick: Z,
|
|
438
438
|
variant: "ghost",
|
|
439
439
|
size: "sm",
|
|
440
440
|
className: "mb-4",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ p(ve, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
|
|
442
442
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ p("h1", {
|
|
444
444
|
className: "text-2xl font-bold text-text-primary sm:text-3xl",
|
|
445
|
-
children: D ?
|
|
445
|
+
children: D ? x("bigconsole.parsers.builder.header.editTitle", "Edit Parser") : x("bigconsole.parsers.builder.header.createTitle", "Create Parser")
|
|
446
446
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ p("p", {
|
|
448
448
|
className: "text-sm text-text-secondary mt-1",
|
|
449
|
-
children:
|
|
449
|
+
children: x("bigconsole.parsers.builder.header.subtitle", "Transform data using JQ or JSONata expressions.")
|
|
450
450
|
})
|
|
451
451
|
]
|
|
452
452
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ p(Me, {
|
|
454
454
|
className: "max-w-[80ch]",
|
|
455
|
-
children:
|
|
455
|
+
children: x("bigconsole.parsers.builder.header.purpose", "A parser maps raw input into structured fields using a JQ or JSONata expression. Write the expression, run it against a sample to confirm the output, and save it once it produces the shape you need — then reuse it across pipelines to normalise any source.")
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ p("div", {
|
|
458
458
|
className: "min-w-0 overflow-x-auto",
|
|
459
|
-
children: /* @__PURE__ */
|
|
460
|
-
steps:
|
|
459
|
+
children: /* @__PURE__ */ p(Ne, {
|
|
460
|
+
steps: qe,
|
|
461
461
|
active: w,
|
|
462
|
-
onStepClick:
|
|
462
|
+
onStepClick: pn
|
|
463
463
|
})
|
|
464
464
|
}),
|
|
465
|
-
|
|
465
|
+
nt && /* @__PURE__ */ p(r, {
|
|
466
466
|
tone: "info",
|
|
467
467
|
padding: "compact",
|
|
468
468
|
headingLevel: 2,
|
|
469
|
-
title: D ? k ?
|
|
470
|
-
icon: /* @__PURE__ */
|
|
469
|
+
title: D ? k ? x("bigconsole.parsers.builder.scopeBanner.editTitleNamed", "This parser is only available in dashboard \"{{name}}\"", { name: k }) : x("bigconsole.parsers.builder.scopeBanner.editTitle", "This parser is only available in this dashboard") : k ? x("bigconsole.parsers.builder.scopeBanner.titleNamed", "This parser will only be available in dashboard \"{{name}}\"", { name: k }) : x("bigconsole.parsers.builder.scopeBanner.title", "This parser will only be available in this dashboard"),
|
|
470
|
+
icon: /* @__PURE__ */ p(Ee, {
|
|
471
471
|
"aria-hidden": "true",
|
|
472
472
|
className: "h-icon-sm w-icon-sm"
|
|
473
473
|
}),
|
|
474
474
|
"data-testid": "parser-scope-banner",
|
|
475
|
-
children: /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ p("p", {
|
|
476
476
|
className: "m-0 text-sm text-text-secondary",
|
|
477
|
-
children:
|
|
477
|
+
children: x("bigconsole.parsers.builder.scopeBanner.description", "Other dashboards cannot use it, and the scope cannot be changed after creation. To reuse a parser everywhere, create it from Data → Parsers with the Global scope.")
|
|
478
478
|
})
|
|
479
479
|
}),
|
|
480
|
-
|
|
480
|
+
ut && /* @__PURE__ */ p(r, {
|
|
481
481
|
tone: "danger",
|
|
482
482
|
headingLevel: 2,
|
|
483
|
-
title:
|
|
484
|
-
icon: /* @__PURE__ */
|
|
483
|
+
title: x("bigconsole.parsers.builder.errors.saveParserFailed", "Failed to save Parser"),
|
|
484
|
+
icon: /* @__PURE__ */ p(l, { className: "h-icon-sm w-icon-sm text-[var(--color-status-error-text)]" }),
|
|
485
485
|
"data-testid": "parser-submit-error",
|
|
486
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ p("p", {
|
|
487
487
|
className: "font-mono text-xs break-words text-text-secondary",
|
|
488
|
-
children:
|
|
488
|
+
children: ut
|
|
489
489
|
})
|
|
490
490
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ m("form", {
|
|
492
492
|
className: "flex flex-col gap-section-gap",
|
|
493
493
|
onSubmit: (e) => {
|
|
494
|
-
e.preventDefault(),
|
|
494
|
+
e.preventDefault(), _n && dn();
|
|
495
495
|
},
|
|
496
496
|
children: [
|
|
497
|
-
w === 0 && /* @__PURE__ */
|
|
497
|
+
w === 0 && /* @__PURE__ */ m(r, {
|
|
498
498
|
emphasis: "primary",
|
|
499
499
|
headingLevel: 2,
|
|
500
500
|
title: "Basic information",
|
|
501
501
|
description: "Essential details for your parser.",
|
|
502
|
-
icon: /* @__PURE__ */
|
|
503
|
-
meta:
|
|
502
|
+
icon: /* @__PURE__ */ p(Te, { className: "h-icon-sm w-icon-sm" }),
|
|
503
|
+
meta: vn,
|
|
504
504
|
bodyClassName: "space-y-5",
|
|
505
505
|
"data-testid": "parser-basic-information",
|
|
506
506
|
children: [
|
|
507
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ m("div", {
|
|
508
508
|
className: "grid gap-5 sm:grid-cols-2",
|
|
509
|
-
children: [/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ m("div", { children: [
|
|
510
|
+
/* @__PURE__ */ m("label", {
|
|
511
511
|
htmlFor: "name",
|
|
512
|
-
className:
|
|
512
|
+
className: _,
|
|
513
513
|
children: [
|
|
514
|
-
|
|
514
|
+
x("bigconsole.parsers.builder.fields.name.label", "Name"),
|
|
515
515
|
" ",
|
|
516
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ p("span", {
|
|
517
517
|
className: "text-status-error-text",
|
|
518
518
|
children: "*"
|
|
519
519
|
})
|
|
520
520
|
]
|
|
521
521
|
}),
|
|
522
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ p("input", {
|
|
523
523
|
id: "name",
|
|
524
524
|
type: "text",
|
|
525
525
|
value: A.name,
|
|
526
|
-
onChange:
|
|
527
|
-
placeholder:
|
|
528
|
-
"aria-invalid": !!
|
|
529
|
-
"aria-describedby":
|
|
530
|
-
className:
|
|
526
|
+
onChange: qt,
|
|
527
|
+
placeholder: x("bigconsole.parsers.builder.fields.name.placeholder", "e.g., User Analytics Parser"),
|
|
528
|
+
"aria-invalid": !!M.name,
|
|
529
|
+
"aria-describedby": M.name ? "name-error" : void 0,
|
|
530
|
+
className: g(!!M.name)
|
|
531
531
|
}),
|
|
532
|
-
|
|
532
|
+
M.name && /* @__PURE__ */ p("p", {
|
|
533
533
|
id: "name-error",
|
|
534
|
-
className:
|
|
535
|
-
children:
|
|
534
|
+
className: Re,
|
|
535
|
+
children: M.name
|
|
536
536
|
})
|
|
537
|
-
] }), /* @__PURE__ */
|
|
538
|
-
/* @__PURE__ */
|
|
537
|
+
] }), /* @__PURE__ */ m("div", { children: [
|
|
538
|
+
/* @__PURE__ */ m("label", {
|
|
539
539
|
htmlFor: "outputKey",
|
|
540
|
-
className:
|
|
540
|
+
className: _,
|
|
541
541
|
children: [
|
|
542
|
-
|
|
542
|
+
x("bigconsole.parsers.builder.fields.outputKey.label", "Output Key"),
|
|
543
543
|
" ",
|
|
544
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ p("span", {
|
|
545
545
|
className: "text-status-error-text",
|
|
546
546
|
children: "*"
|
|
547
547
|
})
|
|
548
548
|
]
|
|
549
549
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ p("input", {
|
|
551
551
|
id: "outputKey",
|
|
552
552
|
type: "text",
|
|
553
553
|
value: A.outputKey,
|
|
554
|
-
onChange:
|
|
554
|
+
onChange: Jt,
|
|
555
555
|
placeholder: "user_analytics_parser",
|
|
556
556
|
disabled: D,
|
|
557
|
-
"aria-invalid": !!
|
|
558
|
-
"aria-describedby": [
|
|
559
|
-
className:
|
|
557
|
+
"aria-invalid": !!M.outputKey,
|
|
558
|
+
"aria-describedby": [M.outputKey ? "outputKey-error" : "", D ? "" : "outputKey-hint"].filter(Boolean).join(" ") || void 0,
|
|
559
|
+
className: g(!!M.outputKey, "font-mono")
|
|
560
560
|
}),
|
|
561
|
-
|
|
561
|
+
M.outputKey && /* @__PURE__ */ p("p", {
|
|
562
562
|
id: "outputKey-error",
|
|
563
|
-
className:
|
|
564
|
-
children:
|
|
563
|
+
className: Re,
|
|
564
|
+
children: M.outputKey
|
|
565
565
|
}),
|
|
566
|
-
!D && /* @__PURE__ */
|
|
566
|
+
!D && /* @__PURE__ */ p("p", {
|
|
567
567
|
id: "outputKey-hint",
|
|
568
|
-
className:
|
|
569
|
-
children:
|
|
568
|
+
className: v,
|
|
569
|
+
children: x("bigconsole.parsers.builder.fields.outputKey.helper", "Auto-generated from name. Customize if needed.")
|
|
570
570
|
})
|
|
571
571
|
] })]
|
|
572
572
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ m("div", { children: [
|
|
574
|
+
/* @__PURE__ */ p("label", {
|
|
575
575
|
htmlFor: "description",
|
|
576
|
-
className:
|
|
577
|
-
children:
|
|
576
|
+
className: _,
|
|
577
|
+
children: x("bigconsole.parsers.builder.fields.description.label", "Description")
|
|
578
578
|
}),
|
|
579
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ p("textarea", {
|
|
580
580
|
id: "description",
|
|
581
581
|
value: A.description,
|
|
582
|
-
onChange:
|
|
583
|
-
placeholder:
|
|
582
|
+
onChange: Yt,
|
|
583
|
+
placeholder: x("bigconsole.parsers.builder.fields.description.placeholder", "Describe what this parser does..."),
|
|
584
584
|
rows: 3,
|
|
585
|
-
maxLength:
|
|
585
|
+
maxLength: ze,
|
|
586
586
|
"aria-describedby": "description-count",
|
|
587
|
-
className:
|
|
587
|
+
className: g(!1, "resize-y")
|
|
588
588
|
}),
|
|
589
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ p("p", {
|
|
590
590
|
id: "description-count",
|
|
591
|
-
className: `${
|
|
592
|
-
children:
|
|
591
|
+
className: `${v} text-right tabular-nums`,
|
|
592
|
+
children: x("bigconsole.parsers.builder.fields.description.characterCount", "{{current}} / {{max}} characters", {
|
|
593
593
|
current: A.description.length,
|
|
594
|
-
max:
|
|
594
|
+
max: ze
|
|
595
595
|
})
|
|
596
596
|
})
|
|
597
597
|
] }),
|
|
598
|
-
O && /* @__PURE__ */
|
|
599
|
-
/* @__PURE__ */
|
|
598
|
+
O && /* @__PURE__ */ m("div", { children: [
|
|
599
|
+
/* @__PURE__ */ m("label", {
|
|
600
600
|
htmlFor: "dashboard",
|
|
601
|
-
className: `${
|
|
602
|
-
children: [/* @__PURE__ */
|
|
601
|
+
className: `${_} flex items-center gap-2`,
|
|
602
|
+
children: [/* @__PURE__ */ p(Ee, {
|
|
603
603
|
"aria-hidden": "true",
|
|
604
604
|
className: "w-4 h-4"
|
|
605
|
-
}),
|
|
605
|
+
}), x("bigconsole.parsers.builder.fields.dashboard.label", "Dashboard Scope")]
|
|
606
606
|
}),
|
|
607
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ m(Pe, {
|
|
608
608
|
id: "dashboard",
|
|
609
609
|
value: E,
|
|
610
|
-
onChange:
|
|
611
|
-
disabled:
|
|
612
|
-
className:
|
|
613
|
-
children: [/* @__PURE__ */
|
|
610
|
+
onChange: en,
|
|
611
|
+
disabled: Ut || D,
|
|
612
|
+
className: g(),
|
|
613
|
+
children: [/* @__PURE__ */ p("option", {
|
|
614
614
|
value: "default",
|
|
615
|
-
children:
|
|
616
|
-
}),
|
|
615
|
+
children: x("bigconsole.parsers.builder.fields.dashboard.globalOption", "Global (available everywhere)")
|
|
616
|
+
}), Vt.map((e) => /* @__PURE__ */ p("option", {
|
|
617
617
|
value: e.id,
|
|
618
618
|
children: e.name
|
|
619
619
|
}, e.id))]
|
|
620
620
|
}),
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
className:
|
|
623
|
-
children: D ?
|
|
621
|
+
/* @__PURE__ */ p("p", {
|
|
622
|
+
className: v,
|
|
623
|
+
children: D ? x("bigconsole.parsers.builder.fields.dashboard.helperLocked", "Dashboard scope cannot be changed after creation.") : E === "default" ? x("bigconsole.parsers.builder.fields.dashboard.helperGlobal", "Global parsers are available across all dashboards.") : x("bigconsole.parsers.builder.fields.dashboard.helperScoped", "This parser will only be available in the selected dashboard.")
|
|
624
624
|
})
|
|
625
625
|
] })
|
|
626
626
|
]
|
|
627
627
|
}),
|
|
628
|
-
w === 1 && /* @__PURE__ */
|
|
628
|
+
w === 1 && /* @__PURE__ */ m(r, {
|
|
629
629
|
emphasis: "primary",
|
|
630
630
|
headingLevel: 2,
|
|
631
631
|
title: "Parser configuration",
|
|
632
632
|
description: "Pick the language and point it at a source.",
|
|
633
|
-
icon: /* @__PURE__ */
|
|
634
|
-
meta:
|
|
633
|
+
icon: /* @__PURE__ */ p(Se, { className: "h-icon-sm w-icon-sm" }),
|
|
634
|
+
meta: vn,
|
|
635
635
|
bodyClassName: "space-y-5",
|
|
636
636
|
"data-testid": "parser-configuration",
|
|
637
|
-
children: [/* @__PURE__ */
|
|
637
|
+
children: [/* @__PURE__ */ m("fieldset", {
|
|
638
638
|
className: "min-w-0 border-0 p-0 m-0",
|
|
639
|
-
children: [/* @__PURE__ */
|
|
639
|
+
children: [/* @__PURE__ */ m("legend", {
|
|
640
640
|
className: "mb-3 text-sm font-medium text-text-primary",
|
|
641
641
|
children: [
|
|
642
|
-
|
|
642
|
+
x("bigconsole.parsers.builder.fields.parserType.label", "Parser Type"),
|
|
643
643
|
" ",
|
|
644
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ p("span", {
|
|
645
645
|
className: "text-status-error-text",
|
|
646
646
|
children: "*"
|
|
647
647
|
})
|
|
648
648
|
]
|
|
649
|
-
}), /* @__PURE__ */
|
|
649
|
+
}), /* @__PURE__ */ p("div", {
|
|
650
650
|
className: "space-y-2",
|
|
651
|
-
children: Object.keys(
|
|
652
|
-
let t =
|
|
653
|
-
return /* @__PURE__ */
|
|
651
|
+
children: Object.keys(S).map((e) => {
|
|
652
|
+
let t = S[e];
|
|
653
|
+
return /* @__PURE__ */ m("label", {
|
|
654
654
|
className: `
|
|
655
655
|
flex items-start gap-3 p-3
|
|
656
656
|
rounded-md border
|
|
@@ -658,19 +658,19 @@ var x = a(function() {
|
|
|
658
658
|
motion-safe:transition-colors
|
|
659
659
|
${A.type === e ? "border-action-primary-bg bg-action-primary-bg/5" : "border-transparent bg-bg-sunken hover:border-[var(--color-border-subtle)]"}
|
|
660
660
|
`,
|
|
661
|
-
children: [/* @__PURE__ */
|
|
661
|
+
children: [/* @__PURE__ */ p("input", {
|
|
662
662
|
type: "radio",
|
|
663
663
|
name: "parserType",
|
|
664
664
|
value: e,
|
|
665
665
|
checked: A.type === e,
|
|
666
|
-
onChange: () =>
|
|
666
|
+
onChange: () => Xt(e),
|
|
667
667
|
className: "mt-1 w-4 h-4 text-action-primary-bg"
|
|
668
|
-
}), /* @__PURE__ */
|
|
668
|
+
}), /* @__PURE__ */ m("span", {
|
|
669
669
|
className: "min-w-0",
|
|
670
|
-
children: [/* @__PURE__ */
|
|
670
|
+
children: [/* @__PURE__ */ p("span", {
|
|
671
671
|
className: "block text-sm font-medium text-text-primary",
|
|
672
672
|
children: t.name
|
|
673
|
-
}), /* @__PURE__ */
|
|
673
|
+
}), /* @__PURE__ */ p("span", {
|
|
674
674
|
className: "mt-0.5 block text-xs text-text-secondary",
|
|
675
675
|
children: t.description
|
|
676
676
|
})]
|
|
@@ -678,60 +678,60 @@ var x = a(function() {
|
|
|
678
678
|
}, e);
|
|
679
679
|
})
|
|
680
680
|
})]
|
|
681
|
-
}), /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
681
|
+
}), /* @__PURE__ */ m("div", { children: [
|
|
682
|
+
/* @__PURE__ */ m("label", {
|
|
683
683
|
htmlFor: "inputSinkKey",
|
|
684
|
-
className:
|
|
684
|
+
className: _,
|
|
685
685
|
children: [
|
|
686
|
-
|
|
686
|
+
x("bigconsole.parsers.builder.fields.sourceDataSink.label", "Source DataSink"),
|
|
687
687
|
" ",
|
|
688
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ p("span", {
|
|
689
689
|
className: "text-status-error-text",
|
|
690
690
|
children: "*"
|
|
691
691
|
})
|
|
692
692
|
]
|
|
693
693
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ m(Pe, {
|
|
695
695
|
id: "inputSinkKey",
|
|
696
696
|
value: A.inputSinkKey,
|
|
697
|
-
onChange:
|
|
698
|
-
"aria-invalid": !!
|
|
699
|
-
"aria-describedby":
|
|
700
|
-
className:
|
|
701
|
-
children: [/* @__PURE__ */
|
|
697
|
+
onChange: Qt,
|
|
698
|
+
"aria-invalid": !!M.inputSinkKey,
|
|
699
|
+
"aria-describedby": M.inputSinkKey ? "inputSinkKey-error" : void 0,
|
|
700
|
+
className: g(!!M.inputSinkKey),
|
|
701
|
+
children: [/* @__PURE__ */ p("option", {
|
|
702
702
|
value: "",
|
|
703
|
-
children:
|
|
704
|
-
}),
|
|
703
|
+
children: x("bigconsole.parsers.builder.fields.sourceDataSink.placeholder", "Select a DataSink...")
|
|
704
|
+
}), Rt.map((e) => /* @__PURE__ */ p("option", {
|
|
705
705
|
value: e.key,
|
|
706
706
|
children: e.name || e.key
|
|
707
707
|
}, e.id))]
|
|
708
708
|
}),
|
|
709
|
-
|
|
709
|
+
M.inputSinkKey && /* @__PURE__ */ p("p", {
|
|
710
710
|
id: "inputSinkKey-error",
|
|
711
|
-
className:
|
|
712
|
-
children:
|
|
711
|
+
className: Re,
|
|
712
|
+
children: M.inputSinkKey
|
|
713
713
|
}),
|
|
714
|
-
|
|
715
|
-
className:
|
|
716
|
-
children:
|
|
717
|
-
}) : /* @__PURE__ */
|
|
718
|
-
className:
|
|
714
|
+
Rt.length === 0 ? /* @__PURE__ */ p("p", {
|
|
715
|
+
className: v,
|
|
716
|
+
children: x("bigconsole.parsers.builder.fields.sourceDataSink.emptyState", "No DataSinks yet — create one first, then return here to build a parser for it.")
|
|
717
|
+
}) : /* @__PURE__ */ p("p", {
|
|
718
|
+
className: v,
|
|
719
719
|
children: "Select the data source for this parser to transform."
|
|
720
720
|
}),
|
|
721
|
-
A.inputSinkKey && /* @__PURE__ */
|
|
721
|
+
A.inputSinkKey && /* @__PURE__ */ m("div", {
|
|
722
722
|
className: "mt-3",
|
|
723
|
-
children: [/* @__PURE__ */
|
|
723
|
+
children: [/* @__PURE__ */ m("button", {
|
|
724
724
|
type: "button",
|
|
725
|
-
onClick:
|
|
725
|
+
onClick: sn,
|
|
726
726
|
"aria-expanded": K,
|
|
727
727
|
"aria-controls": "parser-data-preview",
|
|
728
728
|
className: "inline-flex min-h-[44px] items-center gap-2 rounded-md text-sm text-action-primary-bg hover:text-action-primary-bgHover motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
729
729
|
children: [
|
|
730
|
-
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
|
|
730
|
+
p(K ? be : xe, { className: "w-4 h-4" }),
|
|
731
|
+
/* @__PURE__ */ p(we, { className: "w-4 h-4" }),
|
|
732
|
+
x("bigconsole.parsers.builder.dataPreview.toggle", "Show Data Preview")
|
|
733
733
|
]
|
|
734
|
-
}), K && /* @__PURE__ */
|
|
734
|
+
}), K && /* @__PURE__ */ p(r, {
|
|
735
735
|
id: "parser-data-preview",
|
|
736
736
|
emphasis: "muted",
|
|
737
737
|
padding: "compact",
|
|
@@ -740,324 +740,324 @@ var x = a(function() {
|
|
|
740
740
|
description: "A slice of the payload stored on the selected DataSink.",
|
|
741
741
|
className: "mt-3",
|
|
742
742
|
"data-testid": "parser-data-preview",
|
|
743
|
-
children:
|
|
743
|
+
children: Ot ? /* @__PURE__ */ m("div", {
|
|
744
744
|
className: "flex items-center justify-center p-4",
|
|
745
|
-
children: [/* @__PURE__ */
|
|
745
|
+
children: [/* @__PURE__ */ p(u, { className: "w-5 h-5 text-text-secondary animate-spin" }), /* @__PURE__ */ p("span", {
|
|
746
746
|
className: "ml-2 text-sm text-text-secondary",
|
|
747
|
-
children:
|
|
747
|
+
children: x("bigconsole.parsers.builder.dataPreview.loading", "Loading sample…")
|
|
748
748
|
})]
|
|
749
|
-
}) :
|
|
749
|
+
}) : At ? /* @__PURE__ */ p("p", {
|
|
750
750
|
className: "text-sm text-status-error-text",
|
|
751
|
-
children:
|
|
752
|
-
}) :
|
|
751
|
+
children: At
|
|
752
|
+
}) : Et ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("pre", {
|
|
753
753
|
className: "max-h-48 min-w-0 overflow-auto rounded-md bg-bg-canvas p-3 font-mono text-xs text-text-primary",
|
|
754
|
-
children: JSON.stringify(
|
|
755
|
-
}), J && /* @__PURE__ */
|
|
756
|
-
className:
|
|
754
|
+
children: JSON.stringify(Et, null, 2)
|
|
755
|
+
}), J && /* @__PURE__ */ m("p", {
|
|
756
|
+
className: v,
|
|
757
757
|
children: [
|
|
758
|
-
|
|
759
|
-
J.total == null ? "" :
|
|
760
|
-
shown: Math.min(
|
|
758
|
+
x("bigconsole.parsers.builder.dataPreview.previewingSample", "Previewing a sample"),
|
|
759
|
+
J.total == null ? "" : x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
|
|
760
|
+
shown: Math.min(y, J.total),
|
|
761
761
|
total: J.total
|
|
762
762
|
}),
|
|
763
763
|
" · ",
|
|
764
764
|
J.sinkName
|
|
765
765
|
]
|
|
766
|
-
})] }) : /* @__PURE__ */
|
|
766
|
+
})] }) : /* @__PURE__ */ p("p", {
|
|
767
767
|
className: "text-center text-sm text-text-secondary",
|
|
768
|
-
children:
|
|
768
|
+
children: x("bigconsole.parsers.builder.dataPreview.noData", "No data available")
|
|
769
769
|
})
|
|
770
770
|
})]
|
|
771
771
|
})
|
|
772
772
|
] })]
|
|
773
773
|
}),
|
|
774
|
-
w === 2 && /* @__PURE__ */
|
|
774
|
+
w === 2 && /* @__PURE__ */ m(r, {
|
|
775
775
|
emphasis: "primary",
|
|
776
776
|
headingLevel: 2,
|
|
777
777
|
title: "Test expression",
|
|
778
778
|
description: "Write the expression, then run it against sample data before you save.",
|
|
779
|
-
icon: /* @__PURE__ */
|
|
780
|
-
meta:
|
|
779
|
+
icon: /* @__PURE__ */ p(De, { className: "h-icon-sm w-icon-sm" }),
|
|
780
|
+
meta: vn,
|
|
781
781
|
bodyClassName: "space-y-5",
|
|
782
782
|
"data-testid": "parser-test-expression",
|
|
783
783
|
children: [
|
|
784
|
-
/* @__PURE__ */
|
|
785
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ m("div", { children: [
|
|
785
|
+
/* @__PURE__ */ m("p", {
|
|
786
786
|
id: "expression-label",
|
|
787
|
-
className:
|
|
787
|
+
className: _,
|
|
788
788
|
children: [
|
|
789
|
-
|
|
789
|
+
x("bigconsole.parsers.builder.fields.expression.label", "Expression"),
|
|
790
790
|
" ",
|
|
791
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ p("span", {
|
|
792
792
|
className: "text-status-error-text",
|
|
793
793
|
children: "*"
|
|
794
794
|
})
|
|
795
795
|
]
|
|
796
796
|
}),
|
|
797
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ p("div", {
|
|
798
798
|
role: "group",
|
|
799
799
|
"aria-labelledby": "expression-label",
|
|
800
800
|
"aria-describedby": "expression-hint",
|
|
801
|
-
children: /* @__PURE__ */
|
|
801
|
+
children: /* @__PURE__ */ p(de, {
|
|
802
802
|
value: A.expression,
|
|
803
803
|
type: A.type,
|
|
804
|
-
onChange:
|
|
805
|
-
height:
|
|
806
|
-
error:
|
|
804
|
+
onChange: Zt,
|
|
805
|
+
height: Be,
|
|
806
|
+
error: M.expression ?? null
|
|
807
807
|
})
|
|
808
808
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ p("p", {
|
|
810
810
|
id: "expression-hint",
|
|
811
|
-
className:
|
|
812
|
-
children:
|
|
811
|
+
className: v,
|
|
812
|
+
children: x("bigconsole.parsers.builder.fields.expression.example", "Example: {{example}}", { example: gn.example })
|
|
813
813
|
})
|
|
814
814
|
] }),
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ m("div", { children: [
|
|
816
|
+
/* @__PURE__ */ m("div", {
|
|
817
817
|
className: "mb-2 flex flex-wrap items-center justify-between gap-control-gap",
|
|
818
|
-
children: [/* @__PURE__ */
|
|
818
|
+
children: [/* @__PURE__ */ m("p", {
|
|
819
819
|
id: "test-input-label",
|
|
820
|
-
className: `${
|
|
821
|
-
children: [
|
|
820
|
+
className: `${_} mb-0 flex flex-wrap items-center gap-2`,
|
|
821
|
+
children: [x("bigconsole.parsers.builder.test.inputJsonLabel", "Input JSON"), /* @__PURE__ */ p("span", {
|
|
822
822
|
className: `rounded border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${U ? "text-action-primary-bg bg-action-primary-bg/10 border-action-primary-bg/30" : "text-text-secondary bg-bg-sunken border-[var(--color-border-subtle)]"}`,
|
|
823
|
-
children: U ?
|
|
823
|
+
children: U ? x("bigconsole.parsers.builder.test.referenceMode", "Reference mode") : x("bigconsole.parsers.builder.test.sampleMode", "Sample mode")
|
|
824
824
|
})]
|
|
825
|
-
}), /* @__PURE__ */
|
|
825
|
+
}), /* @__PURE__ */ m("div", {
|
|
826
826
|
className: "flex flex-wrap items-center gap-2",
|
|
827
|
-
children: [A.inputSinkKey && !U && /* @__PURE__ */
|
|
827
|
+
children: [A.inputSinkKey && !U && /* @__PURE__ */ m("button", {
|
|
828
828
|
type: "button",
|
|
829
|
-
onClick:
|
|
830
|
-
disabled:
|
|
829
|
+
onClick: an,
|
|
830
|
+
disabled: Ct,
|
|
831
831
|
className: "inline-flex min-h-[44px] items-center gap-1.5 whitespace-nowrap rounded-md border border-action-primary-bg px-2.5 py-1.5 text-xs font-semibold text-action-primary-bg hover:bg-action-primary-bg/10 motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface disabled:opacity-50 disabled:cursor-not-allowed",
|
|
832
|
-
children: [
|
|
833
|
-
}), U && /* @__PURE__ */
|
|
832
|
+
children: [Ct ? /* @__PURE__ */ p(u, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ p(Ce, { className: "w-3.5 h-3.5" }), x("bigconsole.parsers.builder.actions.loadSample", "Load Sample")]
|
|
833
|
+
}), U && /* @__PURE__ */ m("button", {
|
|
834
834
|
type: "button",
|
|
835
|
-
onClick:
|
|
835
|
+
onClick: on,
|
|
836
836
|
className: "inline-flex min-h-[44px] items-center gap-1.5 whitespace-nowrap rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-semibold text-text-primary hover:bg-bg-sunken motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
837
|
-
children: [/* @__PURE__ */
|
|
837
|
+
children: [/* @__PURE__ */ p(je, { className: "w-3.5 h-3.5" }), x("bigconsole.parsers.builder.actions.clear", "Clear")]
|
|
838
838
|
})]
|
|
839
839
|
})]
|
|
840
840
|
}),
|
|
841
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ p("div", {
|
|
842
842
|
role: "group",
|
|
843
843
|
"aria-labelledby": "test-input-label",
|
|
844
844
|
"aria-describedby": "test-input-hint",
|
|
845
|
-
onKeyDownCapture:
|
|
846
|
-
onPasteCapture:
|
|
845
|
+
onKeyDownCapture: nn,
|
|
846
|
+
onPasteCapture: rn,
|
|
847
847
|
className: U ? "opacity-80" : void 0,
|
|
848
|
-
children: /* @__PURE__ */
|
|
849
|
-
value:
|
|
848
|
+
children: /* @__PURE__ */ p(de, {
|
|
849
|
+
value: ft,
|
|
850
850
|
language: "json",
|
|
851
|
-
onChange:
|
|
851
|
+
onChange: tn,
|
|
852
852
|
readOnly: U,
|
|
853
|
-
height:
|
|
853
|
+
height: Be
|
|
854
854
|
})
|
|
855
855
|
}),
|
|
856
|
-
U &&
|
|
856
|
+
U && bt && /* @__PURE__ */ m("p", {
|
|
857
857
|
role: "status",
|
|
858
858
|
"data-testid": "parser-test-input-locked-notice",
|
|
859
859
|
className: "mt-2 flex items-start gap-1.5 rounded-md border border-[var(--color-status-warning-border)] bg-[var(--color-status-warning-bgSubtle)] px-2.5 py-1.5 text-xs text-[var(--color-status-warning-text)]",
|
|
860
|
-
children: [/* @__PURE__ */
|
|
860
|
+
children: [/* @__PURE__ */ p(l, {
|
|
861
861
|
className: "mt-0.5 h-3.5 w-3.5 shrink-0",
|
|
862
862
|
"aria-hidden": "true"
|
|
863
|
-
}),
|
|
863
|
+
}), x("bigconsole.parsers.builder.test.lockedNotice", "This sample is read-only in Reference mode — tests run against the source sink. Press Clear to type your own test input.")]
|
|
864
864
|
}),
|
|
865
|
-
U && W ? /* @__PURE__ */
|
|
865
|
+
U && W ? /* @__PURE__ */ m("p", {
|
|
866
866
|
id: "test-input-hint",
|
|
867
|
-
className:
|
|
867
|
+
className: v,
|
|
868
868
|
children: [
|
|
869
|
-
|
|
870
|
-
W.total == null ? "" :
|
|
871
|
-
shown: Math.min(
|
|
869
|
+
x("bigconsole.parsers.builder.test.loadedSample", "Loaded a small sample"),
|
|
870
|
+
W.total == null ? "" : x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
|
|
871
|
+
shown: Math.min(y, W.total),
|
|
872
872
|
total: W.total
|
|
873
873
|
}),
|
|
874
874
|
" ",
|
|
875
|
-
|
|
875
|
+
x("bigconsole.parsers.builder.test.loadedSampleFrom", "from {{sinkName}} · locked — press Clear to edit.", { sinkName: W.sinkName })
|
|
876
876
|
]
|
|
877
|
-
}) : /* @__PURE__ */
|
|
877
|
+
}) : /* @__PURE__ */ p("p", {
|
|
878
878
|
id: "test-input-hint",
|
|
879
|
-
className:
|
|
880
|
-
children:
|
|
879
|
+
className: v,
|
|
880
|
+
children: x("bigconsole.parsers.builder.test.inputHelper", "Type sample JSON to test against it, or Load a sample from the source.")
|
|
881
881
|
})
|
|
882
882
|
] }),
|
|
883
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ m("div", {
|
|
884
884
|
className: "flex items-center gap-3",
|
|
885
|
-
children: [/* @__PURE__ */
|
|
885
|
+
children: [/* @__PURE__ */ p("div", {
|
|
886
886
|
className: "min-w-0 flex-1",
|
|
887
|
-
children: /* @__PURE__ */
|
|
887
|
+
children: /* @__PURE__ */ p(ge, {
|
|
888
888
|
permission: i.PARSER_TEST,
|
|
889
889
|
deniedBehavior: "disable",
|
|
890
|
-
children: /* @__PURE__ */
|
|
890
|
+
children: /* @__PURE__ */ p(d, {
|
|
891
891
|
type: "button",
|
|
892
|
-
onClick:
|
|
893
|
-
disabled:
|
|
892
|
+
onClick: cn,
|
|
893
|
+
disabled: z || !A.expression.trim(),
|
|
894
894
|
variant: "default",
|
|
895
895
|
className: "w-full min-h-[44px]",
|
|
896
|
-
children:
|
|
896
|
+
children: z ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(u, { className: "w-4 h-4 mr-2 animate-spin" }), x("bigconsole.parsers.builder.actions.testing", "Testing...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(De, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.actions.runTest", "Run Test")] })
|
|
897
897
|
})
|
|
898
898
|
})
|
|
899
|
-
}),
|
|
899
|
+
}), mt !== null && !z && /* @__PURE__ */ m("span", {
|
|
900
900
|
className: "inline-flex items-center gap-1.5 whitespace-nowrap text-xs text-text-muted tabular-nums",
|
|
901
901
|
"data-testid": "parser-test-duration",
|
|
902
|
-
children: [/* @__PURE__ */
|
|
902
|
+
children: [/* @__PURE__ */ p(Ae, {
|
|
903
903
|
className: "w-3.5 h-3.5",
|
|
904
904
|
"aria-hidden": "true"
|
|
905
|
-
}),
|
|
905
|
+
}), x("bigconsole.parsers.testPanel.executedIn", "Executed in {{ms}}ms", { ms: mt })]
|
|
906
906
|
})]
|
|
907
907
|
}),
|
|
908
|
-
|
|
909
|
-
className:
|
|
908
|
+
ln === "untested" && !z && /* @__PURE__ */ p("p", {
|
|
909
|
+
className: v,
|
|
910
910
|
role: "status",
|
|
911
911
|
"data-testid": "parser-test-gate",
|
|
912
|
-
children:
|
|
912
|
+
children: L && !un ? x("bigconsole.parsers.builder.test.gateFailed", "The test failed. Fix the expression and run the test again to continue.") : x("bigconsole.parsers.builder.test.gateUntested", "Run a passing test of this expression to continue.")
|
|
913
913
|
}),
|
|
914
|
-
|
|
914
|
+
ln === "untestable" && /* @__PURE__ */ m("p", {
|
|
915
915
|
role: "status",
|
|
916
916
|
"data-testid": "parser-test-gate",
|
|
917
917
|
className: "flex items-start gap-1.5 rounded-md border border-[var(--color-status-warning-border)] bg-[var(--color-status-warning-bgSubtle)] px-2.5 py-1.5 text-xs text-[var(--color-status-warning-text)]",
|
|
918
|
-
children: [/* @__PURE__ */
|
|
918
|
+
children: [/* @__PURE__ */ p(l, {
|
|
919
919
|
className: "mt-0.5 h-3.5 w-3.5 shrink-0",
|
|
920
920
|
"aria-hidden": "true"
|
|
921
|
-
}),
|
|
921
|
+
}), x("bigconsole.parsers.builder.test.gateUntestable", "You don’t have permission to run tests, so this expression has not been tested. Ask someone who can to test it before dashboards rely on it.")]
|
|
922
922
|
}),
|
|
923
|
-
(
|
|
923
|
+
(pt || L) && /* @__PURE__ */ m(r, {
|
|
924
924
|
emphasis: "muted",
|
|
925
925
|
padding: "compact",
|
|
926
926
|
headingLevel: 3,
|
|
927
|
-
tone:
|
|
928
|
-
title:
|
|
929
|
-
meta:
|
|
927
|
+
tone: L ? "danger" : "success",
|
|
928
|
+
title: L ? x("bigconsole.parsers.builder.test.errorOutputLabel", "Error Output") : x("bigconsole.parsers.builder.test.outputLabel", "Output"),
|
|
929
|
+
meta: L ? /* @__PURE__ */ m("span", {
|
|
930
930
|
className: "inline-flex items-center gap-1 text-xs text-[var(--color-status-error-text)]",
|
|
931
931
|
children: [
|
|
932
|
-
/* @__PURE__ */
|
|
932
|
+
/* @__PURE__ */ p(l, { className: "w-3 h-3" }),
|
|
933
933
|
" ",
|
|
934
|
-
|
|
934
|
+
x("bigconsole.parsers.builder.test.failed", "Failed")
|
|
935
935
|
]
|
|
936
|
-
}) : /* @__PURE__ */
|
|
936
|
+
}) : /* @__PURE__ */ m("span", {
|
|
937
937
|
className: "inline-flex items-center gap-1 text-xs text-status-success-text",
|
|
938
938
|
children: [
|
|
939
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ p(ye, { className: "w-3 h-3" }),
|
|
940
940
|
" ",
|
|
941
|
-
|
|
941
|
+
x("bigconsole.parsers.builder.test.passed", "Passed")
|
|
942
942
|
]
|
|
943
943
|
}),
|
|
944
944
|
"data-testid": "parser-test-output",
|
|
945
945
|
children: [
|
|
946
|
-
|
|
947
|
-
className: `${
|
|
946
|
+
un && /* @__PURE__ */ p("p", {
|
|
947
|
+
className: `${v} mb-2`,
|
|
948
948
|
"data-testid": "parser-test-output-stale",
|
|
949
|
-
children:
|
|
949
|
+
children: x("bigconsole.parsers.builder.test.staleResult", "This result is from an earlier version of the expression. Run the test again.")
|
|
950
950
|
}),
|
|
951
|
-
|
|
951
|
+
L ? /* @__PURE__ */ p("pre", {
|
|
952
952
|
className: "max-h-[150px] min-w-0 overflow-auto whitespace-pre-wrap break-words rounded-md bg-bg-canvas px-3 py-2.5 font-mono text-xs leading-relaxed text-text-primary",
|
|
953
|
-
children:
|
|
954
|
-
}) : /* @__PURE__ */
|
|
955
|
-
value:
|
|
953
|
+
children: L
|
|
954
|
+
}) : /* @__PURE__ */ p(de, {
|
|
955
|
+
value: pt,
|
|
956
956
|
language: "json",
|
|
957
957
|
readOnly: !0,
|
|
958
|
-
height:
|
|
958
|
+
height: Be
|
|
959
959
|
}),
|
|
960
|
-
B && !
|
|
961
|
-
className:
|
|
960
|
+
B && !L && /* @__PURE__ */ m("p", {
|
|
961
|
+
className: v,
|
|
962
962
|
children: [
|
|
963
|
-
|
|
964
|
-
B.sampledRows != null && B.totalRows != null ?
|
|
963
|
+
x("bigconsole.parsers.builder.test.testedSample", "Tested a sample"),
|
|
964
|
+
B.sampledRows != null && B.totalRows != null ? x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
|
|
965
965
|
shown: B.sampledRows,
|
|
966
966
|
total: B.totalRows
|
|
967
967
|
}) : "",
|
|
968
|
-
|
|
968
|
+
x("bigconsole.parsers.builder.test.testedSampleNote", " — a saved parser runs over the full source, so results may differ.")
|
|
969
969
|
]
|
|
970
970
|
})
|
|
971
971
|
]
|
|
972
972
|
}),
|
|
973
|
-
!
|
|
973
|
+
!pt && !L && /* @__PURE__ */ p(r, {
|
|
974
974
|
emphasis: "muted",
|
|
975
975
|
padding: "compact",
|
|
976
976
|
headingLevel: 3,
|
|
977
977
|
title: "No run yet",
|
|
978
978
|
"data-testid": "parser-test-empty",
|
|
979
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ m("p", {
|
|
980
980
|
className: "text-xs leading-relaxed text-text-secondary",
|
|
981
981
|
children: [
|
|
982
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ p("strong", { children: x("bigconsole.parsers.builder.test.tipLabel", "Tip:") }),
|
|
983
983
|
" ",
|
|
984
|
-
|
|
984
|
+
x("bigconsole.parsers.builder.test.tipBody", "write your expression and click “Run Test” to see the transformation.")
|
|
985
985
|
]
|
|
986
986
|
})
|
|
987
987
|
})
|
|
988
988
|
]
|
|
989
989
|
}),
|
|
990
|
-
w === 3 && /* @__PURE__ */
|
|
990
|
+
w === 3 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(r, {
|
|
991
991
|
emphasis: "primary",
|
|
992
992
|
headingLevel: 2,
|
|
993
|
-
title:
|
|
994
|
-
description:
|
|
995
|
-
icon: /* @__PURE__ */
|
|
996
|
-
meta:
|
|
993
|
+
title: x("bigconsole.parsers.builder.review.cacheDurationLabel", "Cache Duration"),
|
|
994
|
+
description: x("bigconsole.parsers.builder.review.cacheDurationHelper", "How long should data be cached before refreshing?"),
|
|
995
|
+
icon: /* @__PURE__ */ p(ke, { className: "h-icon-sm w-icon-sm" }),
|
|
996
|
+
meta: vn,
|
|
997
997
|
"data-testid": "parser-advanced-settings",
|
|
998
|
-
children: /* @__PURE__ */
|
|
998
|
+
children: /* @__PURE__ */ p(ue, {
|
|
999
999
|
value: A.ttl,
|
|
1000
|
-
onChange:
|
|
1001
|
-
error:
|
|
1000
|
+
onChange: $t,
|
|
1001
|
+
error: M.ttl,
|
|
1002
1002
|
hideLabel: !0
|
|
1003
1003
|
})
|
|
1004
|
-
}), /* @__PURE__ */
|
|
1004
|
+
}), /* @__PURE__ */ p(r, {
|
|
1005
1005
|
emphasis: "muted",
|
|
1006
1006
|
headingLevel: 2,
|
|
1007
|
-
title:
|
|
1007
|
+
title: x("bigconsole.parsers.builder.review.label", "Review"),
|
|
1008
1008
|
description: "Check these details before you save.",
|
|
1009
1009
|
"data-testid": "parser-review",
|
|
1010
|
-
children: /* @__PURE__ */
|
|
1010
|
+
children: /* @__PURE__ */ p("div", {
|
|
1011
1011
|
className: "overflow-hidden rounded-lg border border-[var(--color-border-subtle)]",
|
|
1012
1012
|
children: [
|
|
1013
|
-
[
|
|
1014
|
-
[
|
|
1015
|
-
[
|
|
1016
|
-
[
|
|
1017
|
-
[
|
|
1018
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
1013
|
+
[x("bigconsole.parsers.builder.review.name", "Name"), A.name || "—"],
|
|
1014
|
+
[x("bigconsole.parsers.builder.review.outputKey", "Output Key"), A.outputKey || "—"],
|
|
1015
|
+
[x("bigconsole.parsers.builder.review.scope", "Scope"), O ? E === "default" ? x("bigconsole.parsers.builder.review.scopeGlobal", "Global") : Vt.find((e) => e.id === E)?.name || E : k ?? x("bigconsole.parsers.builder.review.scopeDashboard", "Dashboard")],
|
|
1016
|
+
[x("bigconsole.parsers.builder.review.type", "Type"), S[A.type].name],
|
|
1017
|
+
[x("bigconsole.parsers.builder.review.source", "Source"), X || "—"]
|
|
1018
|
+
].map(([e, t]) => /* @__PURE__ */ m("div", {
|
|
1019
1019
|
className: "flex flex-wrap items-center justify-between gap-3 border-b border-[var(--color-border-subtle)] px-4 py-2.5 text-sm last:border-b-0",
|
|
1020
|
-
children: [/* @__PURE__ */
|
|
1020
|
+
children: [/* @__PURE__ */ p("span", {
|
|
1021
1021
|
className: "text-text-secondary",
|
|
1022
1022
|
children: e
|
|
1023
|
-
}), /* @__PURE__ */
|
|
1023
|
+
}), /* @__PURE__ */ p("span", {
|
|
1024
1024
|
className: "min-w-0 break-words text-right font-medium text-text-primary",
|
|
1025
1025
|
children: t
|
|
1026
1026
|
})]
|
|
1027
1027
|
}, e))
|
|
1028
1028
|
})
|
|
1029
1029
|
})] }),
|
|
1030
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ m("div", {
|
|
1031
1031
|
className: "sticky bottom-0 z-10 flex flex-col-reverse gap-control-gap border-t border-[var(--color-border-subtle)] bg-bg-canvas py-form-gap sm:flex-row sm:items-center sm:justify-between",
|
|
1032
|
-
children: [w === 0 ? /* @__PURE__ */
|
|
1032
|
+
children: [w === 0 ? /* @__PURE__ */ p(d, {
|
|
1033
1033
|
type: "button",
|
|
1034
1034
|
onClick: Z,
|
|
1035
1035
|
variant: "secondary",
|
|
1036
1036
|
className: "w-full sm:w-auto",
|
|
1037
|
-
children:
|
|
1038
|
-
}) : /* @__PURE__ */
|
|
1037
|
+
children: x("bigconsole.parsers.builder.actions.cancel", "Cancel")
|
|
1038
|
+
}) : /* @__PURE__ */ m(d, {
|
|
1039
1039
|
type: "button",
|
|
1040
|
-
onClick:
|
|
1040
|
+
onClick: hn,
|
|
1041
1041
|
variant: "secondary",
|
|
1042
1042
|
className: "w-full sm:w-auto",
|
|
1043
|
-
children: [/* @__PURE__ */
|
|
1044
|
-
}),
|
|
1045
|
-
permission:
|
|
1043
|
+
children: [/* @__PURE__ */ p(ve, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.actions.back", "Back")]
|
|
1044
|
+
}), _n ? /* @__PURE__ */ p(ge, {
|
|
1045
|
+
permission: et,
|
|
1046
1046
|
deniedBehavior: "disable",
|
|
1047
|
-
children: /* @__PURE__ */
|
|
1047
|
+
children: /* @__PURE__ */ p(d, {
|
|
1048
1048
|
type: "submit",
|
|
1049
|
-
disabled: !
|
|
1049
|
+
disabled: !fn || ct || !$e,
|
|
1050
1050
|
variant: "default",
|
|
1051
1051
|
className: "w-full sm:w-auto",
|
|
1052
|
-
children:
|
|
1052
|
+
children: ct ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(u, { className: "w-4 h-4 mr-2 animate-spin" }), x("bigconsole.parsers.builder.actions.saving", "Saving...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Oe, { className: "w-4 h-4 mr-2" }), D ? x("bigconsole.parsers.builder.actions.saveChanges", "Save Changes") : x("bigconsole.parsers.builder.actions.createParser", "Create Parser")] })
|
|
1053
1053
|
})
|
|
1054
|
-
}) : /* @__PURE__ */
|
|
1054
|
+
}) : /* @__PURE__ */ m(d, {
|
|
1055
1055
|
type: "button",
|
|
1056
|
-
onClick:
|
|
1056
|
+
onClick: mn,
|
|
1057
1057
|
disabled: !$(w),
|
|
1058
1058
|
variant: "default",
|
|
1059
1059
|
className: "w-full sm:w-auto",
|
|
1060
|
-
children: [
|
|
1060
|
+
children: [x("bigconsole.parsers.builder.actions.next", "Next"), /* @__PURE__ */ p(xe, { className: "w-4 h-4 ml-2" })]
|
|
1061
1061
|
})]
|
|
1062
1062
|
})
|
|
1063
1063
|
]
|
|
@@ -1066,4 +1066,4 @@ var x = a(function() {
|
|
|
1066
1066
|
})
|
|
1067
1067
|
});
|
|
1068
1068
|
});
|
|
1069
|
-
export {
|
|
1069
|
+
export { b as ParserBuilderPage, b as default };
|