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