@burdenoff/microfe-bigconsole 2026.805.2 → 2026.805.3
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/DataBindingSection.js +109 -113
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -1
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +115 -113
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +71 -62
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +90 -89
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +56 -54
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +126 -125
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +151 -150
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +77 -76
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +97 -96
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +172 -191
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +75 -83
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +151 -154
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +181 -190
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js.map +1 -1
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +110 -108
- package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js +102 -103
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js.map +1 -1
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +36 -41
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +38 -37
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +113 -117
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +182 -197
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +166 -168
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js.map +1 -1
- package/dist/bigconsole/components/parser/DataSinkSelector.js +87 -86
- package/dist/bigconsole/components/parser/DataSinkSelector.js.map +1 -1
- package/dist/bigconsole/components/parser/ImportParserDialog.js +196 -211
- package/dist/bigconsole/components/parser/ImportParserDialog.js.map +1 -1
- package/dist/bigconsole/components/parser/ParserSelector.js +130 -128
- package/dist/bigconsole/components/parser/ParserSelector.js.map +1 -1
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +66 -63
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js.map +1 -1
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -91
- package/dist/bigconsole/components/preview/AiPreviewPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js +222 -215
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js.map +1 -1
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +149 -145
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +504 -470
- package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +44 -47
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +143 -142
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +101 -88
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js.map +1 -1
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +135 -134
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js.map +1 -1
- package/dist/bigconsole/components/widgets/form/FormWidget.js +167 -159
- package/dist/bigconsole/components/widgets/form/FormWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +69 -68
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +64 -72
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +60 -59
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/list/ListConfig.js +57 -56
- package/dist/bigconsole/components/widgets/list/ListConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +70 -69
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +35 -34
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +20 -19
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js.map +1 -1
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +178 -177
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +76 -75
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/table/TableConfig.js +183 -168
- package/dist/bigconsole/components/widgets/table/TableConfig.js.map +1 -1
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +187 -180
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js.map +1 -1
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +40 -38
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js.map +1 -1
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +150 -148
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js.map +1 -1
- package/dist/bigconsole/pages/DashboardBuilderPage.js +181 -176
- package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/DashboardViewPage.js +196 -192
- package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
- package/dist/bigconsole/pages/DashboardsPage.js +223 -219
- package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
- package/dist/bigconsole/pages/DataParsersPage.js +167 -170
- package/dist/bigconsole/pages/DataParsersPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +204 -189
- package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +175 -169
- package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSourcesPage.js +8 -7
- package/dist/bigconsole/pages/DataSourcesPage.js.map +1 -1
- package/dist/bigconsole/pages/InsightsPage.js +238 -208
- package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
- package/dist/bigconsole/pages/ParserBuilderPage.js +464 -412
- package/dist/bigconsole/pages/ParserBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/ParserViewPage.js +92 -90
- package/dist/bigconsole/pages/ParserViewPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelineBuilderPage.js +221 -194
- package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelineViewPage.js +181 -184
- package/dist/bigconsole/pages/PipelineViewPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelinesPage.js +128 -127
- package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
- package/dist/bigconsole/pages/SettingsPage.js +177 -172
- package/dist/bigconsole/pages/SettingsPage.js.map +1 -1
- package/dist/bigconsole/pages/WidgetDemoPage.js +121 -83
- package/dist/bigconsole/pages/WidgetDemoPage.js.map +1 -1
- package/dist/bigconsole/pages/WorkflowViewPage.js +199 -193
- package/dist/bigconsole/pages/WorkflowViewPage.js.map +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +129 -128
- package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +111 -109
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js.map +1 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +127 -126
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js.map +1 -1
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js +103 -103
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,67 +1,74 @@
|
|
|
1
1
|
import { useAppNavigate as e } from "../contexts/NavigationContext.js";
|
|
2
2
|
import "../contexts/index.js";
|
|
3
3
|
import t from "../hooks/useDashboardOperations.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { BIGCONSOLE_PERMISSIONS as
|
|
7
|
-
import
|
|
8
|
-
import { memo as
|
|
9
|
-
import { useParams as
|
|
10
|
-
import { AccessDenied as
|
|
11
|
-
import { usePermissions as
|
|
12
|
-
import { AlertCircle as
|
|
13
|
-
import {
|
|
4
|
+
import n from "../hooks/useDataSinkOperations.js";
|
|
5
|
+
import ee from "../hooks/useParserOperations.js";
|
|
6
|
+
import { BIGCONSOLE_PERMISSIONS as r } from "../../constants/permissions.js";
|
|
7
|
+
import te from "../components/datasink/CacheTTLSelector.js";
|
|
8
|
+
import { memo as i, useCallback as a, useEffect as o, useMemo as s, useRef as ne, useState as c } from "react";
|
|
9
|
+
import { useParams as re } from "react-router";
|
|
10
|
+
import { AccessDenied as ie, PermissionButton as ae } from "@burdenoff/fe-libs/shared/components";
|
|
11
|
+
import { usePermissions as oe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
|
+
import { AlertCircle as se, ArrowLeft as ce, CheckCircle2 as le, ChevronDown as ue, ChevronRight as de, Code as fe, Download as pe, Eye as me, FileCode2 as he, LayoutDashboard as ge, Loader2 as l, Play as _e, Save as ve, Settings as ye, X as be } from "lucide-react";
|
|
13
|
+
import { useI18n as xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
|
+
import { Button as u, CardContent as Se, CardHeader as Ce, CardTitle as we, GlassCard as Te, PagePurpose as Ee, Stepper as De } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
15
16
|
//#region src/bigconsole/pages/ParserBuilderPage.tsx
|
|
16
|
-
var m = 25,
|
|
17
|
+
var m = 25, Oe = "default", ke = [
|
|
17
18
|
"details",
|
|
18
19
|
"source",
|
|
19
20
|
"expression",
|
|
20
21
|
"review"
|
|
21
|
-
], h = [
|
|
22
|
-
{
|
|
23
|
-
key: "details",
|
|
24
|
-
label: "Details",
|
|
25
|
-
description: "Name & scope"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
key: "source",
|
|
29
|
-
label: "Source & Type",
|
|
30
|
-
description: "Engine & data"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
key: "expression",
|
|
34
|
-
label: "Expression & Test",
|
|
35
|
-
description: "Transform & verify"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
key: "review",
|
|
39
|
-
label: "Cache & Review",
|
|
40
|
-
description: "Finish up"
|
|
41
|
-
}
|
|
42
22
|
];
|
|
43
|
-
function
|
|
23
|
+
function Ae(e) {
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
key: "details",
|
|
27
|
+
label: e("bigconsole.parsers.builder.steps.details.label", "Details"),
|
|
28
|
+
description: e("bigconsole.parsers.builder.steps.details.description", "Name & scope")
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: "source",
|
|
32
|
+
label: e("bigconsole.parsers.builder.steps.source.label", "Source & Type"),
|
|
33
|
+
description: e("bigconsole.parsers.builder.steps.source.description", "Engine & data")
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "expression",
|
|
37
|
+
label: e("bigconsole.parsers.builder.steps.expression.label", "Expression & Test"),
|
|
38
|
+
description: e("bigconsole.parsers.builder.steps.expression.description", "Transform & verify")
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "review",
|
|
42
|
+
label: e("bigconsole.parsers.builder.steps.review.label", "Cache & Review"),
|
|
43
|
+
description: e("bigconsole.parsers.builder.steps.review.description", "Finish up")
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
function je(e) {
|
|
44
48
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").substring(0, 64);
|
|
45
49
|
}
|
|
46
|
-
function
|
|
47
|
-
let
|
|
48
|
-
return e.name.trim() ? e.name.length < 2 && (
|
|
50
|
+
function Me(e, t) {
|
|
51
|
+
let n = {};
|
|
52
|
+
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;
|
|
49
53
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
54
|
+
function Ne(e) {
|
|
55
|
+
return {
|
|
56
|
+
jq: {
|
|
57
|
+
name: e("bigconsole.parsers.builder.parserType.jq.name", "JQ"),
|
|
58
|
+
description: e("bigconsole.parsers.builder.parserType.jq.description", "Lightweight JSON processor - fast and efficient for simple transformations"),
|
|
59
|
+
placeholder: ".data | map({name: .name, value: .count})",
|
|
60
|
+
example: e("bigconsole.parsers.builder.parserType.jq.example", ".data | map(.name) - Extract names from data array")
|
|
61
|
+
},
|
|
62
|
+
jsonata: {
|
|
63
|
+
name: e("bigconsole.parsers.builder.parserType.jsonata.name", "JSONata"),
|
|
64
|
+
description: e("bigconsole.parsers.builder.parserType.jsonata.description", "Query and transformation language - supports complex queries and calculations"),
|
|
65
|
+
placeholder: "$sum(data[*].value)",
|
|
66
|
+
example: e("bigconsole.parsers.builder.parserType.jsonata.example", "$sum(data.values) - Calculate sum of values")
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
var h = "w-full px-3 py-2.5 text-sm text-text-primary bg-bg-surface border rounded-md placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg transition-all", g = i(function() {
|
|
71
|
+
let { parserId: i, consoleId: g } = re(), Pe = e(), { t: _ } = xe(), v = s(() => Ae(_), [_]), y = s(() => Ne(_), [_]), b = v.length, [x, S] = c(0), [C, Fe] = c(Oe), w = g || C || Oe, T = i !== "new" && !!i, { hasPermission: Ie, isLoading: Le } = oe(), Re = Ie(r.PARSER_READ), ze = Ie(T ? r.PARSER_UPDATE : r.PARSER_CREATE), Be = T ? r.PARSER_UPDATE : r.PARSER_CREATE, E = !g, [D, O] = c({
|
|
65
72
|
name: "",
|
|
66
73
|
outputKey: "",
|
|
67
74
|
description: "",
|
|
@@ -69,289 +76,297 @@ var g = {
|
|
|
69
76
|
expression: "",
|
|
70
77
|
inputSinkKey: "",
|
|
71
78
|
ttl: 900
|
|
72
|
-
}), [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
let [
|
|
77
|
-
consoleId:
|
|
79
|
+
}), [k, A] = c({}), [Ve, He] = c(!1), [Ue, We] = c(!1), [Ge, Ke] = c(null), [j, M] = c("{\n \"data\": [\n {\"name\": \"Item 1\", \"count\": 10},\n {\"name\": \"Item 2\", \"count\": 20}\n ]\n}"), [N, P] = c(""), [F, I] = c(null), [qe, Je] = c(!1), [L, R] = c(null), [z, B] = c(!1), [V, H] = c(null), [Ye, Xe] = c(!1), U = ne(D.inputSinkKey);
|
|
80
|
+
o(() => {
|
|
81
|
+
U.current = D.inputSinkKey;
|
|
82
|
+
}, [D.inputSinkKey]);
|
|
83
|
+
let [W, G] = c(!1), [Ze, Qe] = c(null), [$e, et] = c(!1), [tt, K] = c(null), [q, nt] = c(null), { loading: rt, error: it, parsers: at, fetchParser: ot, createParser: st, updateParser: ct, testParserExpression: lt } = ee({
|
|
84
|
+
consoleId: w || "",
|
|
78
85
|
skipFetch: !0
|
|
79
|
-
}), { dataSinks:
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
}), { dataSinks: J, fetchDataSinks: ut, getDataSinkData: Y } = n({ skipFetch: !0 }), { dashboards: dt, fetchDashboards: ft, loading: pt } = t(), X = T ? at.find((e) => e.id === i) : null;
|
|
87
|
+
o(() => {
|
|
88
|
+
ut(), T && i && ot(i), E && ft();
|
|
82
89
|
}, [
|
|
83
|
-
w,
|
|
84
|
-
r,
|
|
85
|
-
nt,
|
|
86
|
-
ot,
|
|
87
90
|
T,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
91
|
+
i,
|
|
92
|
+
ot,
|
|
93
|
+
ut,
|
|
94
|
+
E,
|
|
95
|
+
ft
|
|
96
|
+
]), o(() => {
|
|
97
|
+
X && (O({
|
|
98
|
+
name: X.name || "",
|
|
99
|
+
outputKey: X.outputKey || "",
|
|
100
|
+
description: X.description || "",
|
|
101
|
+
type: X.type,
|
|
102
|
+
expression: X.expression || "",
|
|
103
|
+
inputSinkKey: X.inputSinkKey || "",
|
|
104
|
+
ttl: X.ttl ?? null
|
|
105
|
+
}), He(!0), X.consoleId && Fe(X.consoleId));
|
|
106
|
+
}, [X]);
|
|
107
|
+
let Z = s(() => J.find((e) => e.key === D.inputSinkKey)?.name || D.inputSinkKey, [J, D.inputSinkKey]), mt = a((e) => {
|
|
101
108
|
let t = e.target.value;
|
|
102
|
-
|
|
109
|
+
O((e) => ({
|
|
103
110
|
...e,
|
|
104
111
|
name: t,
|
|
105
|
-
outputKey:
|
|
106
|
-
})),
|
|
112
|
+
outputKey: Ve ? e.outputKey : je(t)
|
|
113
|
+
})), A((e) => ({
|
|
107
114
|
...e,
|
|
108
115
|
name: void 0
|
|
109
116
|
}));
|
|
110
|
-
}, [
|
|
117
|
+
}, [Ve]), ht = a((e) => {
|
|
111
118
|
let t = e.target.value.toLowerCase().replace(/[^a-z0-9_]/g, "");
|
|
112
|
-
|
|
119
|
+
O((e) => ({
|
|
113
120
|
...e,
|
|
114
121
|
outputKey: t
|
|
115
|
-
})),
|
|
122
|
+
})), He(!0), A((e) => ({
|
|
116
123
|
...e,
|
|
117
124
|
outputKey: void 0
|
|
118
125
|
}));
|
|
119
|
-
}, []),
|
|
120
|
-
|
|
126
|
+
}, []), gt = a((e) => {
|
|
127
|
+
O((t) => ({
|
|
121
128
|
...t,
|
|
122
129
|
description: e.target.value
|
|
123
130
|
}));
|
|
124
|
-
}, []),
|
|
125
|
-
|
|
131
|
+
}, []), _t = a((e) => {
|
|
132
|
+
O((t) => ({
|
|
126
133
|
...t,
|
|
127
134
|
type: e
|
|
128
|
-
})),
|
|
129
|
-
}, []),
|
|
130
|
-
|
|
135
|
+
})), P(""), I(null);
|
|
136
|
+
}, []), vt = a((e) => {
|
|
137
|
+
O((t) => ({
|
|
131
138
|
...t,
|
|
132
139
|
expression: e.target.value
|
|
133
|
-
})),
|
|
140
|
+
})), A((e) => ({
|
|
134
141
|
...e,
|
|
135
142
|
expression: void 0
|
|
136
143
|
}));
|
|
137
|
-
}, []),
|
|
138
|
-
|
|
144
|
+
}, []), yt = a((e) => {
|
|
145
|
+
O((t) => ({
|
|
139
146
|
...t,
|
|
140
147
|
inputSinkKey: e.target.value
|
|
141
|
-
})),
|
|
148
|
+
})), A((e) => ({
|
|
142
149
|
...e,
|
|
143
150
|
inputSinkKey: void 0
|
|
144
|
-
})),
|
|
145
|
-
}, [
|
|
146
|
-
|
|
151
|
+
})), G(!1), Qe(null), nt(null), K(null), z && (M(""), B(!1)), H(null), P(""), I(null), R(null);
|
|
152
|
+
}, [z]), bt = a((e) => {
|
|
153
|
+
O((t) => ({
|
|
147
154
|
...t,
|
|
148
155
|
ttl: e
|
|
149
|
-
})),
|
|
156
|
+
})), A((e) => ({
|
|
150
157
|
...e,
|
|
151
158
|
ttl: void 0
|
|
152
159
|
}));
|
|
153
|
-
}, []),
|
|
154
|
-
|
|
155
|
-
}, []),
|
|
156
|
-
|
|
157
|
-
}, []),
|
|
158
|
-
let e =
|
|
160
|
+
}, []), xt = a((e) => {
|
|
161
|
+
Fe(e.target.value);
|
|
162
|
+
}, []), St = a((e) => {
|
|
163
|
+
M(e.target.value);
|
|
164
|
+
}, []), Ct = a(async () => {
|
|
165
|
+
let e = D.inputSinkKey;
|
|
159
166
|
if (e) {
|
|
160
|
-
|
|
167
|
+
Xe(!0);
|
|
161
168
|
try {
|
|
162
|
-
let t = await
|
|
163
|
-
if (
|
|
164
|
-
t?.raw !== void 0 && t?.raw !== null ? (
|
|
169
|
+
let t = await Y({ key: e }, { limit: m });
|
|
170
|
+
if (U.current !== e) return;
|
|
171
|
+
t?.raw !== void 0 && t?.raw !== null ? (M(JSON.stringify(t.raw, null, 2)), B(!0), H({
|
|
165
172
|
total: t.totalCount ?? null,
|
|
166
173
|
hasMore: t.hasMore ?? null,
|
|
167
|
-
sinkName:
|
|
168
|
-
}),
|
|
174
|
+
sinkName: Z
|
|
175
|
+
}), P(""), I(null), R(null)) : I(_("bigconsole.parsers.builder.errors.loadSampleFailed", "Could not load a sample from the selected DataSink."));
|
|
169
176
|
} catch (t) {
|
|
170
|
-
if (
|
|
171
|
-
|
|
177
|
+
if (U.current !== e) return;
|
|
178
|
+
I(t instanceof Error ? t.message : _("bigconsole.parsers.builder.errors.loadSampleDataFailed", "Failed to load sample data"));
|
|
172
179
|
} finally {
|
|
173
|
-
|
|
180
|
+
Xe(!1);
|
|
174
181
|
}
|
|
175
182
|
}
|
|
176
183
|
}, [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
D.inputSinkKey,
|
|
185
|
+
Y,
|
|
186
|
+
Z,
|
|
187
|
+
_
|
|
188
|
+
]), wt = a(() => {
|
|
189
|
+
M(""), B(!1), H(null), R(null), P(""), I(null);
|
|
190
|
+
}, []), Tt = a(async () => {
|
|
191
|
+
if (W) {
|
|
192
|
+
G(!1);
|
|
185
193
|
return;
|
|
186
194
|
}
|
|
187
|
-
if (!
|
|
188
|
-
|
|
195
|
+
if (!D.inputSinkKey) {
|
|
196
|
+
K(_("bigconsole.parsers.builder.errors.selectSourceFirst", "Please select a source DataSink first"));
|
|
189
197
|
return;
|
|
190
198
|
}
|
|
191
|
-
|
|
192
|
-
let e =
|
|
199
|
+
G(!0), et(!0), K(null);
|
|
200
|
+
let e = D.inputSinkKey;
|
|
193
201
|
try {
|
|
194
|
-
let t = await
|
|
195
|
-
if (
|
|
196
|
-
t?.raw !== void 0 && t?.raw !== null ? (
|
|
202
|
+
let t = await Y({ key: e }, { limit: m });
|
|
203
|
+
if (U.current !== e) return;
|
|
204
|
+
t?.raw !== void 0 && t?.raw !== null ? (Qe(t.raw), nt({
|
|
197
205
|
total: t.totalCount ?? null,
|
|
198
206
|
hasMore: t.hasMore ?? null,
|
|
199
|
-
sinkName:
|
|
200
|
-
})) :
|
|
207
|
+
sinkName: Z
|
|
208
|
+
})) : K(_("bigconsole.parsers.builder.errors.noDataInSink", "No data available in selected DataSink"));
|
|
201
209
|
} catch (t) {
|
|
202
|
-
if (
|
|
203
|
-
|
|
210
|
+
if (U.current !== e) return;
|
|
211
|
+
K(t instanceof Error ? t.message : _("bigconsole.parsers.builder.errors.loadDataFailed", "Failed to load data"));
|
|
204
212
|
} finally {
|
|
205
|
-
|
|
213
|
+
et(!1);
|
|
206
214
|
}
|
|
207
215
|
}, [
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
W,
|
|
217
|
+
D.inputSinkKey,
|
|
218
|
+
Y,
|
|
219
|
+
Z,
|
|
220
|
+
_
|
|
221
|
+
]), Et = a(async () => {
|
|
222
|
+
if (!D.expression.trim()) {
|
|
223
|
+
I(_("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required"));
|
|
215
224
|
return;
|
|
216
225
|
}
|
|
217
226
|
let e;
|
|
218
|
-
if (
|
|
219
|
-
type:
|
|
220
|
-
expression:
|
|
221
|
-
dataSinkKey:
|
|
227
|
+
if (z) e = {
|
|
228
|
+
type: D.type,
|
|
229
|
+
expression: D.expression,
|
|
230
|
+
dataSinkKey: D.inputSinkKey,
|
|
222
231
|
sampleLimit: m
|
|
223
232
|
};
|
|
224
233
|
else {
|
|
225
234
|
let t;
|
|
226
235
|
try {
|
|
227
|
-
t = JSON.parse(
|
|
236
|
+
t = JSON.parse(j);
|
|
228
237
|
} catch {
|
|
229
|
-
|
|
238
|
+
I(_("bigconsole.parsers.builder.errors.invalidInputJson", "Input JSON is not valid JSON"));
|
|
230
239
|
return;
|
|
231
240
|
}
|
|
232
241
|
e = {
|
|
233
|
-
type:
|
|
234
|
-
expression:
|
|
242
|
+
type: D.type,
|
|
243
|
+
expression: D.expression,
|
|
235
244
|
sampleData: t
|
|
236
245
|
};
|
|
237
246
|
}
|
|
238
|
-
|
|
247
|
+
Je(!0), I(null), P(""), R(null);
|
|
239
248
|
try {
|
|
240
|
-
let t = await
|
|
241
|
-
t ? t.success ? (
|
|
249
|
+
let t = await lt(e);
|
|
250
|
+
t ? t.success ? (P(JSON.stringify(t.output, null, 2)), t.sampled && R({
|
|
242
251
|
sampledRows: t.sampledRows ?? null,
|
|
243
252
|
totalRows: t.totalRows ?? null
|
|
244
|
-
})) :
|
|
253
|
+
})) : I(t.error || _("bigconsole.parsers.builder.errors.testFailed", "Test failed")) : I(_("bigconsole.parsers.builder.errors.testRequestFailed", "Test request failed — please try again."));
|
|
245
254
|
} catch (e) {
|
|
246
|
-
|
|
255
|
+
I(e instanceof Error ? e.message : _("bigconsole.parsers.builder.errors.testFailed", "Test failed"));
|
|
247
256
|
} finally {
|
|
248
|
-
|
|
257
|
+
Je(!1);
|
|
249
258
|
}
|
|
250
259
|
}, [
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
D.type,
|
|
261
|
+
D.expression,
|
|
262
|
+
D.inputSinkKey,
|
|
263
|
+
j,
|
|
264
|
+
z,
|
|
265
|
+
lt,
|
|
266
|
+
_
|
|
267
|
+
]), Q = a(() => {
|
|
268
|
+
Pe(g ? `/dashboards/${g}/parsers` : "/parsers");
|
|
269
|
+
}, [Pe, g]), Dt = a(async () => {
|
|
270
|
+
Ke(null);
|
|
271
|
+
let e = Me(D, _);
|
|
262
272
|
if (Object.keys(e).length > 0) {
|
|
263
|
-
|
|
273
|
+
A(e), e.name || e.outputKey ? S(0) : e.inputSinkKey ? S(1) : e.expression && S(2);
|
|
264
274
|
return;
|
|
265
275
|
}
|
|
266
|
-
|
|
276
|
+
We(!0);
|
|
267
277
|
try {
|
|
268
|
-
if (
|
|
269
|
-
if (!await
|
|
270
|
-
name:
|
|
271
|
-
description:
|
|
272
|
-
expression:
|
|
273
|
-
inputSinkKey:
|
|
274
|
-
outputKey:
|
|
275
|
-
ttl:
|
|
276
|
-
},
|
|
277
|
-
} else if (!await
|
|
278
|
-
consoleId:
|
|
279
|
-
name:
|
|
280
|
-
type:
|
|
281
|
-
expression:
|
|
282
|
-
inputSinkKey:
|
|
283
|
-
outputKey:
|
|
284
|
-
description:
|
|
285
|
-
ttl:
|
|
286
|
-
})) throw Error("Failed to create parser");
|
|
287
|
-
|
|
278
|
+
if (T && X) {
|
|
279
|
+
if (!await ct(X.id, {
|
|
280
|
+
name: D.name,
|
|
281
|
+
description: D.description || void 0,
|
|
282
|
+
expression: D.expression,
|
|
283
|
+
inputSinkKey: D.inputSinkKey,
|
|
284
|
+
outputKey: D.outputKey,
|
|
285
|
+
ttl: D.ttl
|
|
286
|
+
}, X.version)) throw Error(_("bigconsole.parsers.builder.errors.updateFailed", "Failed to update parser"));
|
|
287
|
+
} else if (!await st({
|
|
288
|
+
consoleId: w || "",
|
|
289
|
+
name: D.name,
|
|
290
|
+
type: D.type,
|
|
291
|
+
expression: D.expression,
|
|
292
|
+
inputSinkKey: D.inputSinkKey,
|
|
293
|
+
outputKey: D.outputKey,
|
|
294
|
+
description: D.description || void 0,
|
|
295
|
+
ttl: D.ttl ?? void 0
|
|
296
|
+
})) throw Error(_("bigconsole.parsers.builder.errors.createFailed", "Failed to create parser"));
|
|
297
|
+
Q();
|
|
288
298
|
} catch (e) {
|
|
289
|
-
|
|
299
|
+
Ke(e instanceof Error ? e.message : _("bigconsole.parsers.builder.errors.saveFailed", "Failed to save parser"));
|
|
290
300
|
} finally {
|
|
291
|
-
|
|
301
|
+
We(!1);
|
|
292
302
|
}
|
|
293
303
|
}, [
|
|
294
|
-
|
|
304
|
+
D,
|
|
305
|
+
T,
|
|
306
|
+
X,
|
|
307
|
+
st,
|
|
308
|
+
ct,
|
|
295
309
|
w,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
case "details": return E.name.trim().length >= 2 && E.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(E.outputKey);
|
|
309
|
-
case "source": return E.inputSinkKey.trim().length > 0;
|
|
310
|
-
case "expression": return E.expression.trim().length > 0;
|
|
310
|
+
Q,
|
|
311
|
+
_
|
|
312
|
+
]), Ot = s(() => D.name.trim().length >= 2 && D.expression.trim().length > 0 && D.inputSinkKey.trim().length > 0 && D.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(D.outputKey), [
|
|
313
|
+
D.name,
|
|
314
|
+
D.expression,
|
|
315
|
+
D.inputSinkKey,
|
|
316
|
+
D.outputKey
|
|
317
|
+
]), $ = a((e) => {
|
|
318
|
+
switch (ke[e]) {
|
|
319
|
+
case "details": return D.name.trim().length >= 2 && D.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(D.outputKey);
|
|
320
|
+
case "source": return D.inputSinkKey.trim().length > 0;
|
|
321
|
+
case "expression": return D.expression.trim().length > 0;
|
|
311
322
|
default: return !0;
|
|
312
323
|
}
|
|
313
324
|
}, [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
]),
|
|
319
|
-
let t = Math.max(0, Math.min(e,
|
|
320
|
-
if (t >
|
|
321
|
-
for (let e =
|
|
325
|
+
D.name,
|
|
326
|
+
D.outputKey,
|
|
327
|
+
D.inputSinkKey,
|
|
328
|
+
D.expression
|
|
329
|
+
]), kt = a((e) => {
|
|
330
|
+
let t = Math.max(0, Math.min(e, b - 1));
|
|
331
|
+
if (t > x) {
|
|
332
|
+
for (let e = x; e < t; e++) if (!$(e)) return;
|
|
322
333
|
}
|
|
323
|
-
|
|
324
|
-
}, [
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
b
|
|
334
|
+
S(t);
|
|
335
|
+
}, [
|
|
336
|
+
x,
|
|
337
|
+
$,
|
|
338
|
+
b
|
|
339
|
+
]), At = a(() => {
|
|
340
|
+
S((e) => Math.min(e + 1, b - 1));
|
|
341
|
+
}, [b]), jt = a(() => {
|
|
342
|
+
S((e) => Math.max(e - 1, 0));
|
|
328
343
|
}, []);
|
|
329
|
-
if (
|
|
344
|
+
if (rt && T || Le) return /* @__PURE__ */ f("div", {
|
|
330
345
|
className: "flex items-center justify-center min-h-[400px]",
|
|
331
346
|
children: /* @__PURE__ */ f(l, { className: "w-8 h-8 text-text-secondary animate-spin" })
|
|
332
347
|
});
|
|
333
|
-
if (
|
|
334
|
-
title: "Access Denied",
|
|
335
|
-
description: "You don't have permission to view this parser."
|
|
348
|
+
if (T && !Re) return /* @__PURE__ */ f(ie, {
|
|
349
|
+
title: _("bigconsole.parsers.builder.accessDenied.title", "Access Denied"),
|
|
350
|
+
description: _("bigconsole.parsers.builder.accessDenied.description", "You don't have permission to view this parser.")
|
|
336
351
|
});
|
|
337
|
-
if (
|
|
352
|
+
if (it) return /* @__PURE__ */ f("div", {
|
|
338
353
|
className: "flex items-center justify-center min-h-[400px] p-card-padding",
|
|
339
354
|
children: /* @__PURE__ */ p("div", {
|
|
340
355
|
className: "text-center",
|
|
341
356
|
children: [
|
|
342
|
-
/* @__PURE__ */ f(
|
|
357
|
+
/* @__PURE__ */ f(se, { className: "w-12 h-12 text-status-error-text mx-auto mb-4" }),
|
|
343
358
|
/* @__PURE__ */ f("p", {
|
|
344
359
|
className: "text-status-error-text text-body-sm font-medium mb-2",
|
|
345
|
-
children: "Failed to load Parser"
|
|
360
|
+
children: _("bigconsole.parsers.builder.errors.loadParserFailed", "Failed to load Parser")
|
|
346
361
|
}),
|
|
347
362
|
/* @__PURE__ */ f("p", {
|
|
348
363
|
className: "text-text-tertiary text-body-xs",
|
|
349
|
-
children:
|
|
364
|
+
children: it.message
|
|
350
365
|
})
|
|
351
366
|
]
|
|
352
367
|
})
|
|
353
368
|
});
|
|
354
|
-
let
|
|
369
|
+
let Mt = y[D.type], Nt = x === b - 1;
|
|
355
370
|
return /* @__PURE__ */ f("div", {
|
|
356
371
|
className: "min-h-screen bg-bg-canvas",
|
|
357
372
|
children: /* @__PURE__ */ p("div", {
|
|
@@ -361,76 +376,74 @@ var g = {
|
|
|
361
376
|
className: "mb-6",
|
|
362
377
|
children: [
|
|
363
378
|
/* @__PURE__ */ p(u, {
|
|
364
|
-
onClick:
|
|
379
|
+
onClick: Q,
|
|
365
380
|
variant: "ghost",
|
|
366
381
|
size: "sm",
|
|
367
382
|
className: "mb-4",
|
|
368
|
-
children: [/* @__PURE__ */ f(ce, { className: "w-4 h-4 mr-2" }), "Back to Parsers"]
|
|
383
|
+
children: [/* @__PURE__ */ f(ce, { className: "w-4 h-4 mr-2" }), _("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
|
|
369
384
|
}),
|
|
370
385
|
/* @__PURE__ */ f("h1", {
|
|
371
386
|
className: "text-heading-h1 font-bold text-text-primary",
|
|
372
|
-
children:
|
|
387
|
+
children: T ? _("bigconsole.parsers.builder.header.editTitle", "Edit Parser") : _("bigconsole.parsers.builder.header.createTitle", "Create Parser")
|
|
373
388
|
}),
|
|
374
389
|
/* @__PURE__ */ f("p", {
|
|
375
390
|
className: "text-body-sm text-text-secondary mt-1",
|
|
376
|
-
children: "Transform data using JQ or JSONata expressions."
|
|
391
|
+
children: _("bigconsole.parsers.builder.header.subtitle", "Transform data using JQ or JSONata expressions.")
|
|
377
392
|
})
|
|
378
393
|
]
|
|
379
394
|
}),
|
|
380
|
-
/* @__PURE__ */ f(
|
|
395
|
+
/* @__PURE__ */ f(Ee, {
|
|
381
396
|
className: "mb-6",
|
|
382
|
-
children: "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."
|
|
397
|
+
children: _("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.")
|
|
383
398
|
}),
|
|
384
399
|
/* @__PURE__ */ f("div", {
|
|
385
400
|
className: "mb-6",
|
|
386
|
-
children: /* @__PURE__ */ f(
|
|
387
|
-
steps:
|
|
388
|
-
active:
|
|
389
|
-
onStepClick:
|
|
401
|
+
children: /* @__PURE__ */ f(De, {
|
|
402
|
+
steps: v,
|
|
403
|
+
active: x,
|
|
404
|
+
onStepClick: kt
|
|
390
405
|
})
|
|
391
406
|
}),
|
|
392
|
-
|
|
407
|
+
Ge && /* @__PURE__ */ p("div", {
|
|
393
408
|
className: "mb-6 p-4 bg-status-error-bg/10 border border-status-error-border/30 rounded-lg flex items-start gap-3",
|
|
394
|
-
children: [/* @__PURE__ */ f(
|
|
409
|
+
children: [/* @__PURE__ */ f(se, { className: "w-5 h-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
395
410
|
className: "text-sm font-medium text-status-error-text",
|
|
396
|
-
children: "Failed to save Parser"
|
|
411
|
+
children: _("bigconsole.parsers.builder.errors.saveParserFailed", "Failed to save Parser")
|
|
397
412
|
}), /* @__PURE__ */ f("p", {
|
|
398
413
|
className: "text-xs text-status-error-text/80 mt-1",
|
|
399
|
-
children:
|
|
414
|
+
children: Ge
|
|
400
415
|
})] })]
|
|
401
416
|
}),
|
|
402
|
-
/* @__PURE__ */ p(
|
|
417
|
+
/* @__PURE__ */ p(Te, {
|
|
403
418
|
treatment: "glass",
|
|
404
419
|
glow: !0,
|
|
405
|
-
children: [/* @__PURE__ */ f(
|
|
420
|
+
children: [/* @__PURE__ */ f(Ce, {
|
|
406
421
|
className: "pb-4",
|
|
407
422
|
children: /* @__PURE__ */ p("div", {
|
|
408
423
|
className: "flex items-center gap-3",
|
|
409
424
|
children: [/* @__PURE__ */ p("div", {
|
|
410
425
|
className: "w-8 h-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center",
|
|
411
426
|
children: [
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
427
|
+
x === 0 && /* @__PURE__ */ f(he, { className: "w-4 h-4 text-action-primary-bg" }),
|
|
428
|
+
x === 1 && /* @__PURE__ */ f(fe, { className: "w-4 h-4 text-action-primary-bg" }),
|
|
429
|
+
x === 2 && /* @__PURE__ */ f(_e, { className: "w-4 h-4 text-action-primary-bg" }),
|
|
430
|
+
x === 3 && /* @__PURE__ */ f(ye, { className: "w-4 h-4 text-action-primary-bg" })
|
|
416
431
|
]
|
|
417
|
-
}), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
|
|
418
433
|
className: "text-xs text-text-tertiary",
|
|
419
|
-
children:
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
]
|
|
425
|
-
}), /* @__PURE__ */ f(Ce, {
|
|
434
|
+
children: _("bigconsole.parsers.builder.header.stepCounter", "Step {{current}} of {{total}}", {
|
|
435
|
+
current: x + 1,
|
|
436
|
+
total: b
|
|
437
|
+
})
|
|
438
|
+
}), /* @__PURE__ */ f(we, {
|
|
426
439
|
className: "text-base",
|
|
427
|
-
children:
|
|
440
|
+
children: v[x].label
|
|
428
441
|
})] })]
|
|
429
442
|
})
|
|
430
|
-
}), /* @__PURE__ */ p(
|
|
443
|
+
}), /* @__PURE__ */ p(Se, {
|
|
431
444
|
className: "space-y-5",
|
|
432
445
|
children: [
|
|
433
|
-
|
|
446
|
+
x === 0 && /* @__PURE__ */ p("div", {
|
|
434
447
|
className: "space-y-5",
|
|
435
448
|
children: [
|
|
436
449
|
/* @__PURE__ */ p("div", {
|
|
@@ -439,113 +452,125 @@ var g = {
|
|
|
439
452
|
/* @__PURE__ */ p("label", {
|
|
440
453
|
htmlFor: "name",
|
|
441
454
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
442
|
-
children: [
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
455
|
+
children: [
|
|
456
|
+
_("bigconsole.parsers.builder.fields.name.label", "Name"),
|
|
457
|
+
" ",
|
|
458
|
+
/* @__PURE__ */ f("span", {
|
|
459
|
+
className: "text-status-error-text",
|
|
460
|
+
children: "*"
|
|
461
|
+
})
|
|
462
|
+
]
|
|
446
463
|
}),
|
|
447
464
|
/* @__PURE__ */ f("input", {
|
|
448
465
|
id: "name",
|
|
449
466
|
type: "text",
|
|
450
|
-
value:
|
|
451
|
-
onChange:
|
|
452
|
-
placeholder: "e.g., User Analytics Parser",
|
|
453
|
-
className: `${
|
|
467
|
+
value: D.name,
|
|
468
|
+
onChange: mt,
|
|
469
|
+
placeholder: _("bigconsole.parsers.builder.fields.name.placeholder", "e.g., User Analytics Parser"),
|
|
470
|
+
className: `${h} ${k.name ? "border-status-error-border" : "border-border-default"}`
|
|
454
471
|
}),
|
|
455
|
-
|
|
472
|
+
k.name && /* @__PURE__ */ f("p", {
|
|
456
473
|
className: "text-xs text-status-error-text mt-1.5",
|
|
457
|
-
children:
|
|
474
|
+
children: k.name
|
|
458
475
|
})
|
|
459
476
|
] }), /* @__PURE__ */ p("div", { children: [
|
|
460
477
|
/* @__PURE__ */ p("label", {
|
|
461
478
|
htmlFor: "outputKey",
|
|
462
479
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
463
|
-
children: [
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
480
|
+
children: [
|
|
481
|
+
_("bigconsole.parsers.builder.fields.outputKey.label", "Output Key"),
|
|
482
|
+
" ",
|
|
483
|
+
/* @__PURE__ */ f("span", {
|
|
484
|
+
className: "text-status-error-text",
|
|
485
|
+
children: "*"
|
|
486
|
+
})
|
|
487
|
+
]
|
|
467
488
|
}),
|
|
468
489
|
/* @__PURE__ */ f("input", {
|
|
469
490
|
id: "outputKey",
|
|
470
491
|
type: "text",
|
|
471
|
-
value:
|
|
472
|
-
onChange:
|
|
492
|
+
value: D.outputKey,
|
|
493
|
+
onChange: ht,
|
|
473
494
|
placeholder: "user_analytics_parser",
|
|
474
|
-
disabled:
|
|
475
|
-
className: `${
|
|
495
|
+
disabled: T,
|
|
496
|
+
className: `${h} font-mono ${k.outputKey ? "border-status-error-border" : "border-border-default"} disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60`
|
|
476
497
|
}),
|
|
477
|
-
|
|
498
|
+
k.outputKey && /* @__PURE__ */ f("p", {
|
|
478
499
|
className: "text-xs text-status-error-text mt-1.5",
|
|
479
|
-
children:
|
|
500
|
+
children: k.outputKey
|
|
480
501
|
}),
|
|
481
|
-
!
|
|
502
|
+
!T && /* @__PURE__ */ f("p", {
|
|
482
503
|
className: "text-xs text-text-tertiary mt-1.5",
|
|
483
|
-
children: "Auto-generated from name. Customize if needed."
|
|
504
|
+
children: _("bigconsole.parsers.builder.fields.outputKey.helper", "Auto-generated from name. Customize if needed.")
|
|
484
505
|
})
|
|
485
506
|
] })]
|
|
486
507
|
}),
|
|
487
508
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
488
509
|
htmlFor: "description",
|
|
489
510
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
490
|
-
children: "Description"
|
|
511
|
+
children: _("bigconsole.parsers.builder.fields.description.label", "Description")
|
|
491
512
|
}), /* @__PURE__ */ f("textarea", {
|
|
492
513
|
id: "description",
|
|
493
|
-
value:
|
|
494
|
-
onChange:
|
|
495
|
-
placeholder: "Describe what this parser does...",
|
|
514
|
+
value: D.description,
|
|
515
|
+
onChange: gt,
|
|
516
|
+
placeholder: _("bigconsole.parsers.builder.fields.description.placeholder", "Describe what this parser does..."),
|
|
496
517
|
rows: 2,
|
|
497
|
-
className: `${
|
|
518
|
+
className: `${h} border-border-default resize-y`
|
|
498
519
|
})] }),
|
|
499
|
-
|
|
520
|
+
E && /* @__PURE__ */ p("div", { children: [
|
|
500
521
|
/* @__PURE__ */ f("label", {
|
|
501
522
|
htmlFor: "dashboard",
|
|
502
523
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
503
524
|
children: /* @__PURE__ */ p("span", {
|
|
504
525
|
className: "flex items-center gap-2",
|
|
505
|
-
children: [/* @__PURE__ */ f(ge, { className: "w-4 h-4" }), "Dashboard Scope"]
|
|
526
|
+
children: [/* @__PURE__ */ f(ge, { className: "w-4 h-4" }), _("bigconsole.parsers.builder.fields.dashboard.label", "Dashboard Scope")]
|
|
506
527
|
})
|
|
507
528
|
}),
|
|
508
529
|
/* @__PURE__ */ p("select", {
|
|
509
530
|
id: "dashboard",
|
|
510
|
-
value:
|
|
511
|
-
onChange:
|
|
512
|
-
disabled:
|
|
513
|
-
className: `${
|
|
531
|
+
value: C,
|
|
532
|
+
onChange: xt,
|
|
533
|
+
disabled: pt || T,
|
|
534
|
+
className: `${h} border-border-default disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60`,
|
|
514
535
|
children: [/* @__PURE__ */ f("option", {
|
|
515
536
|
value: "default",
|
|
516
|
-
children: "Global (available everywhere)"
|
|
517
|
-
}),
|
|
537
|
+
children: _("bigconsole.parsers.builder.fields.dashboard.globalOption", "Global (available everywhere)")
|
|
538
|
+
}), dt.map((e) => /* @__PURE__ */ f("option", {
|
|
518
539
|
value: e.id,
|
|
519
540
|
children: e.name
|
|
520
541
|
}, e.id))]
|
|
521
542
|
}),
|
|
522
543
|
/* @__PURE__ */ f("p", {
|
|
523
544
|
className: "text-xs text-text-tertiary mt-1.5",
|
|
524
|
-
children:
|
|
545
|
+
children: T ? _("bigconsole.parsers.builder.fields.dashboard.helperLocked", "Dashboard scope cannot be changed after creation.") : C === "default" ? _("bigconsole.parsers.builder.fields.dashboard.helperGlobal", "Global parsers are available across all dashboards.") : _("bigconsole.parsers.builder.fields.dashboard.helperScoped", "This parser will only be available in the selected dashboard.")
|
|
525
546
|
})
|
|
526
547
|
] })
|
|
527
548
|
]
|
|
528
549
|
}),
|
|
529
|
-
|
|
550
|
+
x === 1 && /* @__PURE__ */ p("div", {
|
|
530
551
|
className: "space-y-5",
|
|
531
552
|
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
|
|
532
553
|
className: "block text-sm font-medium text-text-primary mb-3",
|
|
533
|
-
children: [
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
554
|
+
children: [
|
|
555
|
+
_("bigconsole.parsers.builder.fields.parserType.label", "Parser Type"),
|
|
556
|
+
" ",
|
|
557
|
+
/* @__PURE__ */ f("span", {
|
|
558
|
+
className: "text-status-error-text",
|
|
559
|
+
children: "*"
|
|
560
|
+
})
|
|
561
|
+
]
|
|
537
562
|
}), /* @__PURE__ */ f("div", {
|
|
538
563
|
className: "grid gap-2 sm:grid-cols-2",
|
|
539
|
-
children: Object.keys(
|
|
540
|
-
let t =
|
|
564
|
+
children: Object.keys(y).map((e) => {
|
|
565
|
+
let t = y[e];
|
|
541
566
|
return /* @__PURE__ */ p("label", {
|
|
542
|
-
className: `flex items-start gap-3 p-3 border rounded-md cursor-pointer transition-colors ${
|
|
567
|
+
className: `flex items-start gap-3 p-3 border rounded-md cursor-pointer transition-colors ${D.type === e ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-default hover:bg-bg-sunken"}`,
|
|
543
568
|
children: [/* @__PURE__ */ f("input", {
|
|
544
569
|
type: "radio",
|
|
545
570
|
name: "parserType",
|
|
546
571
|
value: e,
|
|
547
|
-
checked:
|
|
548
|
-
onChange: () =>
|
|
572
|
+
checked: D.type === e,
|
|
573
|
+
onChange: () => _t(e),
|
|
549
574
|
className: "mt-1 w-4 h-4 text-action-primary-bg"
|
|
550
575
|
}), /* @__PURE__ */ p("span", { children: [/* @__PURE__ */ f("span", {
|
|
551
576
|
className: "text-sm font-medium text-text-primary",
|
|
@@ -560,115 +585,126 @@ var g = {
|
|
|
560
585
|
/* @__PURE__ */ p("label", {
|
|
561
586
|
htmlFor: "inputSinkKey",
|
|
562
587
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
563
|
-
children: [
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
588
|
+
children: [
|
|
589
|
+
_("bigconsole.parsers.builder.fields.sourceDataSink.label", "Source DataSink"),
|
|
590
|
+
" ",
|
|
591
|
+
/* @__PURE__ */ f("span", {
|
|
592
|
+
className: "text-status-error-text",
|
|
593
|
+
children: "*"
|
|
594
|
+
})
|
|
595
|
+
]
|
|
567
596
|
}),
|
|
568
597
|
/* @__PURE__ */ p("select", {
|
|
569
598
|
id: "inputSinkKey",
|
|
570
|
-
value:
|
|
571
|
-
onChange:
|
|
572
|
-
className: `${
|
|
599
|
+
value: D.inputSinkKey,
|
|
600
|
+
onChange: yt,
|
|
601
|
+
className: `${h} ${k.inputSinkKey ? "border-status-error-border" : "border-border-default"}`,
|
|
573
602
|
children: [/* @__PURE__ */ f("option", {
|
|
574
603
|
value: "",
|
|
575
|
-
children: "Select a DataSink..."
|
|
576
|
-
}),
|
|
604
|
+
children: _("bigconsole.parsers.builder.fields.sourceDataSink.placeholder", "Select a DataSink...")
|
|
605
|
+
}), J.map((e) => /* @__PURE__ */ f("option", {
|
|
577
606
|
value: e.key,
|
|
578
607
|
children: e.name || e.key
|
|
579
608
|
}, e.id))]
|
|
580
609
|
}),
|
|
581
|
-
|
|
610
|
+
k.inputSinkKey && /* @__PURE__ */ f("p", {
|
|
582
611
|
className: "text-xs text-status-error-text mt-1.5",
|
|
583
|
-
children:
|
|
612
|
+
children: k.inputSinkKey
|
|
584
613
|
}),
|
|
585
|
-
|
|
614
|
+
J.length === 0 && /* @__PURE__ */ f("p", {
|
|
586
615
|
className: "text-xs text-text-tertiary mt-1.5",
|
|
587
|
-
children: "No DataSinks yet — create one first, then return here to build a parser for it."
|
|
616
|
+
children: _("bigconsole.parsers.builder.fields.sourceDataSink.emptyState", "No DataSinks yet — create one first, then return here to build a parser for it.")
|
|
588
617
|
}),
|
|
589
|
-
|
|
618
|
+
D.inputSinkKey && /* @__PURE__ */ p("div", {
|
|
590
619
|
className: "mt-3",
|
|
591
620
|
children: [/* @__PURE__ */ p("button", {
|
|
592
621
|
type: "button",
|
|
593
|
-
onClick:
|
|
622
|
+
onClick: Tt,
|
|
594
623
|
className: "inline-flex items-center gap-2 text-sm text-action-primary-bg hover:text-action-primary-bgHover transition-colors",
|
|
595
624
|
children: [
|
|
596
|
-
f(
|
|
625
|
+
f(W ? ue : de, { className: "w-4 h-4" }),
|
|
597
626
|
/* @__PURE__ */ f(me, { className: "w-4 h-4" }),
|
|
598
|
-
"Show Data Preview"
|
|
627
|
+
_("bigconsole.parsers.builder.dataPreview.toggle", "Show Data Preview")
|
|
599
628
|
]
|
|
600
|
-
}),
|
|
629
|
+
}), W && /* @__PURE__ */ f("div", {
|
|
601
630
|
className: "mt-3 border border-border-default rounded-md overflow-hidden",
|
|
602
|
-
children:
|
|
631
|
+
children: $e ? /* @__PURE__ */ p("div", {
|
|
603
632
|
className: "p-4 flex items-center justify-center",
|
|
604
633
|
children: [/* @__PURE__ */ f(l, { className: "w-5 h-5 text-text-secondary animate-spin" }), /* @__PURE__ */ f("span", {
|
|
605
634
|
className: "ml-2 text-sm text-text-secondary",
|
|
606
|
-
children: "Loading sample…"
|
|
635
|
+
children: _("bigconsole.parsers.builder.dataPreview.loading", "Loading sample…")
|
|
607
636
|
})]
|
|
608
|
-
}) :
|
|
637
|
+
}) : tt ? /* @__PURE__ */ f("div", {
|
|
609
638
|
className: "p-4 bg-status-error-bg/5",
|
|
610
639
|
children: /* @__PURE__ */ f("p", {
|
|
611
640
|
className: "text-sm text-status-error-text",
|
|
612
|
-
children:
|
|
641
|
+
children: tt
|
|
613
642
|
})
|
|
614
|
-
}) :
|
|
643
|
+
}) : Ze ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("pre", {
|
|
615
644
|
className: "p-3 text-xs font-mono bg-bg-sunken text-text-primary overflow-auto max-h-48",
|
|
616
|
-
children: JSON.stringify(
|
|
617
|
-
}),
|
|
645
|
+
children: JSON.stringify(Ze, null, 2)
|
|
646
|
+
}), q && /* @__PURE__ */ p("p", {
|
|
618
647
|
className: "px-3 py-2 text-xs text-text-tertiary border-t border-border-default",
|
|
619
648
|
children: [
|
|
620
|
-
"Previewing a sample",
|
|
621
|
-
|
|
649
|
+
_("bigconsole.parsers.builder.dataPreview.previewingSample", "Previewing a sample"),
|
|
650
|
+
q.total == null ? "" : _("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
|
|
651
|
+
shown: Math.min(m, q.total),
|
|
652
|
+
total: q.total
|
|
653
|
+
}),
|
|
622
654
|
" · ",
|
|
623
|
-
|
|
655
|
+
q.sinkName
|
|
624
656
|
]
|
|
625
657
|
})] }) : /* @__PURE__ */ f("div", {
|
|
626
658
|
className: "p-4 text-sm text-text-secondary text-center",
|
|
627
|
-
children: "No data available"
|
|
659
|
+
children: _("bigconsole.parsers.builder.dataPreview.noData", "No data available")
|
|
628
660
|
})
|
|
629
661
|
})]
|
|
630
662
|
})
|
|
631
663
|
] })]
|
|
632
664
|
}),
|
|
633
|
-
|
|
665
|
+
x === 2 && /* @__PURE__ */ p("div", {
|
|
634
666
|
className: "space-y-5",
|
|
635
667
|
children: [
|
|
636
668
|
/* @__PURE__ */ p("div", { children: [
|
|
637
669
|
/* @__PURE__ */ p("label", {
|
|
638
670
|
htmlFor: "expression",
|
|
639
671
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
640
|
-
children: [
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
672
|
+
children: [
|
|
673
|
+
_("bigconsole.parsers.builder.fields.expression.label", "Expression"),
|
|
674
|
+
" ",
|
|
675
|
+
/* @__PURE__ */ f("span", {
|
|
676
|
+
className: "text-status-error-text",
|
|
677
|
+
children: "*"
|
|
678
|
+
})
|
|
679
|
+
]
|
|
644
680
|
}),
|
|
645
681
|
/* @__PURE__ */ f("textarea", {
|
|
646
682
|
id: "expression",
|
|
647
|
-
value:
|
|
648
|
-
onChange:
|
|
649
|
-
placeholder:
|
|
683
|
+
value: D.expression,
|
|
684
|
+
onChange: vt,
|
|
685
|
+
placeholder: Mt.placeholder,
|
|
650
686
|
rows: 8,
|
|
651
|
-
className: `${
|
|
687
|
+
className: `${h} font-mono resize-y ${k.expression ? "border-status-error-border" : "border-border-default"}`
|
|
652
688
|
}),
|
|
653
|
-
|
|
689
|
+
k.expression && /* @__PURE__ */ f("p", {
|
|
654
690
|
className: "text-xs text-status-error-text mt-1.5",
|
|
655
|
-
children:
|
|
691
|
+
children: k.expression
|
|
656
692
|
}),
|
|
657
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ f("p", {
|
|
658
694
|
className: "text-xs text-text-tertiary mt-1.5",
|
|
659
|
-
children:
|
|
695
|
+
children: _("bigconsole.parsers.builder.fields.expression.example", "Example: {{example}}", { example: Mt.example })
|
|
660
696
|
})
|
|
661
697
|
] }),
|
|
662
|
-
/* @__PURE__ */ f(
|
|
663
|
-
permission:
|
|
698
|
+
/* @__PURE__ */ f(ae, {
|
|
699
|
+
permission: r.PARSER_TEST,
|
|
664
700
|
deniedBehavior: "disable",
|
|
665
701
|
children: /* @__PURE__ */ f(u, {
|
|
666
702
|
type: "button",
|
|
667
|
-
onClick:
|
|
668
|
-
disabled:
|
|
703
|
+
onClick: Et,
|
|
704
|
+
disabled: qe || !D.expression.trim(),
|
|
669
705
|
variant: "default",
|
|
670
706
|
className: "w-full",
|
|
671
|
-
children:
|
|
707
|
+
children: qe ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(l, { className: "w-4 h-4 mr-2 animate-spin" }), _("bigconsole.parsers.builder.actions.testing", "Testing...")] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(_e, { className: "w-4 h-4 mr-2" }), _("bigconsole.parsers.builder.actions.runTest", "Run Test")] })
|
|
672
708
|
})
|
|
673
709
|
}),
|
|
674
710
|
/* @__PURE__ */ p("div", {
|
|
@@ -678,112 +714,128 @@ var g = {
|
|
|
678
714
|
className: "flex items-center justify-between mb-2",
|
|
679
715
|
children: [/* @__PURE__ */ p("label", {
|
|
680
716
|
className: "text-sm font-medium text-text-primary",
|
|
681
|
-
children: ["Input JSON", /* @__PURE__ */ f("span", {
|
|
682
|
-
className: `ml-2 text-[10px] font-semibold uppercase tracking-wide px-2 py-0.5 rounded border align-middle ${
|
|
683
|
-
children:
|
|
717
|
+
children: [_("bigconsole.parsers.builder.test.inputJsonLabel", "Input JSON"), /* @__PURE__ */ f("span", {
|
|
718
|
+
className: `ml-2 text-[10px] font-semibold uppercase tracking-wide px-2 py-0.5 rounded border align-middle ${z ? "text-action-primary-bg bg-action-primary-bg/10 border-action-primary-bg/30" : "text-text-secondary bg-bg-sunken border-border-default"}`,
|
|
719
|
+
children: z ? _("bigconsole.parsers.builder.test.referenceMode", "Reference mode") : _("bigconsole.parsers.builder.test.sampleMode", "Sample mode")
|
|
684
720
|
})]
|
|
685
721
|
}), /* @__PURE__ */ p("div", {
|
|
686
722
|
className: "flex items-center gap-2",
|
|
687
|
-
children: [
|
|
723
|
+
children: [D.inputSinkKey && !z && /* @__PURE__ */ p("button", {
|
|
688
724
|
type: "button",
|
|
689
|
-
onClick:
|
|
690
|
-
disabled:
|
|
725
|
+
onClick: Ct,
|
|
726
|
+
disabled: Ye,
|
|
691
727
|
className: "inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-action-primary-bg border border-action-primary-bg rounded-md hover:bg-action-primary-bg/10 transition-colors disabled:opacity-50",
|
|
692
|
-
children: [
|
|
693
|
-
}),
|
|
728
|
+
children: [Ye ? /* @__PURE__ */ f(l, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ f(pe, { className: "w-3.5 h-3.5" }), _("bigconsole.parsers.builder.actions.loadSample", "Load Sample")]
|
|
729
|
+
}), z && /* @__PURE__ */ p("button", {
|
|
694
730
|
type: "button",
|
|
695
|
-
onClick:
|
|
731
|
+
onClick: wt,
|
|
696
732
|
className: "inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-text-primary border border-border-default rounded-md hover:bg-bg-sunken transition-colors",
|
|
697
|
-
children: [/* @__PURE__ */ f(be, { className: "w-3.5 h-3.5" }), "Clear"]
|
|
733
|
+
children: [/* @__PURE__ */ f(be, { className: "w-3.5 h-3.5" }), _("bigconsole.parsers.builder.actions.clear", "Clear")]
|
|
698
734
|
})]
|
|
699
735
|
})]
|
|
700
736
|
}),
|
|
701
737
|
/* @__PURE__ */ f("textarea", {
|
|
702
|
-
value:
|
|
703
|
-
onChange:
|
|
704
|
-
readOnly:
|
|
705
|
-
placeholder: "Type sample JSON to test against it — or Load a sample from the source…",
|
|
738
|
+
value: j,
|
|
739
|
+
onChange: St,
|
|
740
|
+
readOnly: z,
|
|
741
|
+
placeholder: _("bigconsole.parsers.builder.test.inputPlaceholder", "Type sample JSON to test against it — or Load a sample from the source…"),
|
|
706
742
|
rows: 8,
|
|
707
|
-
className: `${
|
|
743
|
+
className: `${h} min-h-[220px] text-xs font-mono leading-relaxed resize-y border-border-default ${z ? "bg-bg-sunken opacity-80 cursor-not-allowed" : ""}`
|
|
708
744
|
}),
|
|
709
|
-
|
|
745
|
+
z && V ? /* @__PURE__ */ p("p", {
|
|
710
746
|
className: "text-xs text-text-tertiary mt-1.5",
|
|
711
747
|
children: [
|
|
712
|
-
"Loaded a small sample",
|
|
713
|
-
|
|
748
|
+
_("bigconsole.parsers.builder.test.loadedSample", "Loaded a small sample"),
|
|
749
|
+
V.total == null ? "" : _("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
|
|
750
|
+
shown: Math.min(m, V.total),
|
|
751
|
+
total: V.total
|
|
752
|
+
}),
|
|
714
753
|
" ",
|
|
715
|
-
"from ",
|
|
716
|
-
B.sinkName,
|
|
717
|
-
" · locked — press Clear to edit."
|
|
754
|
+
_("bigconsole.parsers.builder.test.loadedSampleFrom", "from {{sinkName}} · locked — press Clear to edit.", { sinkName: V.sinkName })
|
|
718
755
|
]
|
|
719
756
|
}) : /* @__PURE__ */ f("p", {
|
|
720
757
|
className: "text-xs text-text-tertiary mt-1.5",
|
|
721
|
-
children: "Type sample JSON to test against it, or Load a sample from the source."
|
|
758
|
+
children: _("bigconsole.parsers.builder.test.inputHelper", "Type sample JSON to test against it, or Load a sample from the source.")
|
|
722
759
|
})
|
|
723
760
|
] }), /* @__PURE__ */ p("div", { children: [
|
|
724
761
|
/* @__PURE__ */ p("div", {
|
|
725
762
|
className: "flex items-center justify-between mb-2",
|
|
726
763
|
children: [/* @__PURE__ */ f("label", {
|
|
727
764
|
className: "text-sm font-medium text-text-primary",
|
|
728
|
-
children:
|
|
729
|
-
}), (
|
|
765
|
+
children: F ? _("bigconsole.parsers.builder.test.errorOutputLabel", "Error Output") : _("bigconsole.parsers.builder.test.outputLabel", "Output")
|
|
766
|
+
}), (N || F) && (F ? /* @__PURE__ */ p("span", {
|
|
730
767
|
className: "text-xs px-2 py-1 bg-status-error-bg/10 text-status-error-text rounded flex items-center gap-1",
|
|
731
|
-
children: [
|
|
768
|
+
children: [
|
|
769
|
+
/* @__PURE__ */ f(se, { className: "w-3 h-3" }),
|
|
770
|
+
" ",
|
|
771
|
+
_("bigconsole.parsers.builder.test.failed", "Failed")
|
|
772
|
+
]
|
|
732
773
|
}) : /* @__PURE__ */ p("span", {
|
|
733
774
|
className: "text-xs px-2 py-1 bg-status-success-bg/10 text-status-success-text rounded flex items-center gap-1",
|
|
734
|
-
children: [
|
|
775
|
+
children: [
|
|
776
|
+
/* @__PURE__ */ f(le, { className: "w-3 h-3" }),
|
|
777
|
+
" ",
|
|
778
|
+
_("bigconsole.parsers.builder.test.passed", "Passed")
|
|
779
|
+
]
|
|
735
780
|
}))]
|
|
736
781
|
}),
|
|
737
|
-
|
|
738
|
-
className: `w-full px-3 py-2.5 text-xs font-mono leading-relaxed border rounded-md overflow-auto min-h-[220px] max-h-[220px] resize-y ${
|
|
739
|
-
children:
|
|
782
|
+
N || F ? /* @__PURE__ */ f("pre", {
|
|
783
|
+
className: `w-full px-3 py-2.5 text-xs font-mono leading-relaxed border rounded-md overflow-auto min-h-[220px] max-h-[220px] resize-y ${F ? "bg-status-error-bg/5 text-status-error-text border-status-error-border/30" : "bg-status-success-bg/5 text-text-primary border-status-success-border/30"}`,
|
|
784
|
+
children: F || N
|
|
740
785
|
}) : /* @__PURE__ */ f("div", {
|
|
741
786
|
className: "min-h-[220px] p-3 bg-bg-sunken rounded-md border border-border-default",
|
|
742
787
|
children: /* @__PURE__ */ p("p", {
|
|
743
788
|
className: "text-xs text-text-secondary leading-relaxed",
|
|
744
|
-
children: [
|
|
789
|
+
children: [
|
|
790
|
+
/* @__PURE__ */ f("strong", { children: _("bigconsole.parsers.builder.test.tipLabel", "Tip:") }),
|
|
791
|
+
" ",
|
|
792
|
+
_("bigconsole.parsers.builder.test.tipBody", "write your expression and click “Run Test” to see the transformation.")
|
|
793
|
+
]
|
|
745
794
|
})
|
|
746
795
|
}),
|
|
747
|
-
|
|
796
|
+
L && !F && /* @__PURE__ */ p("p", {
|
|
748
797
|
className: "text-xs text-text-tertiary mt-1.5",
|
|
749
798
|
children: [
|
|
750
|
-
"Tested a sample",
|
|
751
|
-
|
|
752
|
-
|
|
799
|
+
_("bigconsole.parsers.builder.test.testedSample", "Tested a sample"),
|
|
800
|
+
L.sampledRows != null && L.totalRows != null ? _("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
|
|
801
|
+
shown: L.sampledRows,
|
|
802
|
+
total: L.totalRows
|
|
803
|
+
}) : "",
|
|
804
|
+
_("bigconsole.parsers.builder.test.testedSampleNote", " — a saved parser runs over the full source, so results may differ.")
|
|
753
805
|
]
|
|
754
806
|
})
|
|
755
807
|
] })]
|
|
756
808
|
})
|
|
757
809
|
]
|
|
758
810
|
}),
|
|
759
|
-
|
|
811
|
+
x === 3 && /* @__PURE__ */ p("div", {
|
|
760
812
|
className: "space-y-6",
|
|
761
813
|
children: [/* @__PURE__ */ p("div", { children: [
|
|
762
814
|
/* @__PURE__ */ f("label", {
|
|
763
815
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
764
|
-
children: "Cache Duration"
|
|
816
|
+
children: _("bigconsole.parsers.builder.review.cacheDurationLabel", "Cache Duration")
|
|
765
817
|
}),
|
|
766
818
|
/* @__PURE__ */ f("p", {
|
|
767
819
|
className: "text-xs text-text-tertiary mb-3",
|
|
768
|
-
children: "How long should data be cached before refreshing?"
|
|
820
|
+
children: _("bigconsole.parsers.builder.review.cacheDurationHelper", "How long should data be cached before refreshing?")
|
|
769
821
|
}),
|
|
770
|
-
/* @__PURE__ */ f(
|
|
771
|
-
value:
|
|
772
|
-
onChange:
|
|
773
|
-
error:
|
|
822
|
+
/* @__PURE__ */ f(te, {
|
|
823
|
+
value: D.ttl,
|
|
824
|
+
onChange: bt,
|
|
825
|
+
error: k.ttl,
|
|
774
826
|
hideLabel: !0
|
|
775
827
|
})
|
|
776
828
|
] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
|
|
777
829
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
778
|
-
children: "Review"
|
|
830
|
+
children: _("bigconsole.parsers.builder.review.label", "Review")
|
|
779
831
|
}), /* @__PURE__ */ f("div", {
|
|
780
832
|
className: "border border-border-default rounded-lg overflow-hidden",
|
|
781
833
|
children: [
|
|
782
|
-
["Name",
|
|
783
|
-
["Output Key",
|
|
784
|
-
["Scope",
|
|
785
|
-
["Type",
|
|
786
|
-
["Source",
|
|
834
|
+
[_("bigconsole.parsers.builder.review.name", "Name"), D.name || "—"],
|
|
835
|
+
[_("bigconsole.parsers.builder.review.outputKey", "Output Key"), D.outputKey || "—"],
|
|
836
|
+
[_("bigconsole.parsers.builder.review.scope", "Scope"), E ? C === "default" ? _("bigconsole.parsers.builder.review.scopeGlobal", "Global") : dt.find((e) => e.id === C)?.name || C : _("bigconsole.parsers.builder.review.scopeDashboard", "Dashboard")],
|
|
837
|
+
[_("bigconsole.parsers.builder.review.type", "Type"), y[D.type].name],
|
|
838
|
+
[_("bigconsole.parsers.builder.review.source", "Source"), Z || "—"]
|
|
787
839
|
].map(([e, t]) => /* @__PURE__ */ p("div", {
|
|
788
840
|
className: "flex items-center justify-between gap-3 px-4 py-2.5 text-sm border-b border-border-default last:border-b-0",
|
|
789
841
|
children: [/* @__PURE__ */ f("span", {
|
|
@@ -801,32 +853,32 @@ var g = {
|
|
|
801
853
|
}),
|
|
802
854
|
/* @__PURE__ */ p("div", {
|
|
803
855
|
className: "flex items-center justify-between gap-4 pt-6 mt-6 border-t border-border-default",
|
|
804
|
-
children: [
|
|
856
|
+
children: [x === 0 ? /* @__PURE__ */ f(u, {
|
|
805
857
|
type: "button",
|
|
806
|
-
onClick:
|
|
858
|
+
onClick: Q,
|
|
807
859
|
variant: "secondary",
|
|
808
|
-
children: "Cancel"
|
|
860
|
+
children: _("bigconsole.parsers.builder.actions.cancel", "Cancel")
|
|
809
861
|
}) : /* @__PURE__ */ p(u, {
|
|
810
862
|
type: "button",
|
|
811
|
-
onClick:
|
|
863
|
+
onClick: jt,
|
|
812
864
|
variant: "secondary",
|
|
813
|
-
children: [/* @__PURE__ */ f(ce, { className: "w-4 h-4 mr-2" }), "Back"]
|
|
814
|
-
}),
|
|
815
|
-
permission:
|
|
865
|
+
children: [/* @__PURE__ */ f(ce, { className: "w-4 h-4 mr-2" }), _("bigconsole.parsers.builder.actions.back", "Back")]
|
|
866
|
+
}), Nt ? /* @__PURE__ */ f(ae, {
|
|
867
|
+
permission: Be,
|
|
816
868
|
deniedBehavior: "disable",
|
|
817
869
|
children: /* @__PURE__ */ f(u, {
|
|
818
870
|
type: "button",
|
|
819
|
-
onClick:
|
|
820
|
-
disabled: !
|
|
871
|
+
onClick: Dt,
|
|
872
|
+
disabled: !Ot || Ue || !ze,
|
|
821
873
|
variant: "default",
|
|
822
|
-
children:
|
|
874
|
+
children: Ue ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(l, { className: "w-4 h-4 mr-2 animate-spin" }), _("bigconsole.parsers.builder.actions.saving", "Saving...")] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(ve, { className: "w-4 h-4 mr-2" }), T ? _("bigconsole.parsers.builder.actions.saveChanges", "Save Changes") : _("bigconsole.parsers.builder.actions.createParser", "Create Parser")] })
|
|
823
875
|
})
|
|
824
876
|
}) : /* @__PURE__ */ p(u, {
|
|
825
877
|
type: "button",
|
|
826
|
-
onClick:
|
|
827
|
-
disabled:
|
|
878
|
+
onClick: At,
|
|
879
|
+
disabled: !$(x),
|
|
828
880
|
variant: "default",
|
|
829
|
-
children: ["Next", /* @__PURE__ */ f(de, { className: "w-4 h-4 ml-2" })]
|
|
881
|
+
children: [_("bigconsole.parsers.builder.actions.next", "Next"), /* @__PURE__ */ f(de, { className: "w-4 h-4 ml-2" })]
|
|
830
882
|
})]
|
|
831
883
|
})
|
|
832
884
|
]
|
|
@@ -834,6 +886,6 @@ var g = {
|
|
|
834
886
|
});
|
|
835
887
|
});
|
|
836
888
|
//#endregion
|
|
837
|
-
export {
|
|
889
|
+
export { g as ParserBuilderPage, g as default };
|
|
838
890
|
|
|
839
891
|
//# sourceMappingURL=ParserBuilderPage.js.map
|