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