@burdenoff/microfe-bigconsole 2026.1110.7 → 2026.1110.8
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/parser/ExpressionEditor.js +1 -0
- package/dist/bigconsole/components/parser/ParserCard.d.ts +12 -1
- package/dist/bigconsole/components/parser/ParserCard.js +218 -232
- package/dist/bigconsole/pages/DataParsersPage.js +153 -122
- package/dist/bigconsole/pages/ParserBuilderPage.js +559 -508
- package/dist/bigconsole/pages/ParserViewPage.js +324 -309
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.js +7 -0
- package/package.json +1 -1
|
@@ -1,456 +1,471 @@
|
|
|
1
1
|
import "../contexts/index.js";
|
|
2
2
|
import { useAppNavigate as e } from "../contexts/NavigationContext.js";
|
|
3
|
-
import { isNative as t, nativeCopyText as
|
|
3
|
+
import { isNative as t, nativeCopyText as n, nativeImpact as ee, nativeNotify as r, nativeToast as te } from "../../utils/nativeBridge.js";
|
|
4
4
|
import { Section as i, SectionStack as ne } from "../components/common/Section.js";
|
|
5
5
|
import re from "../hooks/useParserOperations.js";
|
|
6
6
|
import { useParserStore as ie } from "../store/parserStore.js";
|
|
7
7
|
import ae from "../hooks/useDataSinkOperations.js";
|
|
8
|
-
import { ParserStatusBadge as
|
|
9
|
-
import { ParserTypeBadge as
|
|
10
|
-
import { ExpressionEditor as
|
|
11
|
-
import { ExportParserDialog as
|
|
8
|
+
import { ParserStatusBadge as oe } from "../components/parser/ParserStatusBadge.js";
|
|
9
|
+
import { ParserTypeBadge as a } from "../components/parser/ParserTypeBadge.js";
|
|
10
|
+
import { ExpressionEditor as se } from "../components/parser/ExpressionEditor.js";
|
|
11
|
+
import { ExportParserDialog as ce } from "../components/parser/ExportParserDialog.js";
|
|
12
12
|
import "../components/common/index.js";
|
|
13
|
-
import { BIGCONSOLE_PERMISSIONS as
|
|
14
|
-
import { memo as
|
|
15
|
-
import { useParams as
|
|
16
|
-
import { AccessDenied as
|
|
17
|
-
import { usePermissions as
|
|
18
|
-
import { AlertCircle as
|
|
19
|
-
import { Badge as
|
|
20
|
-
import { useI18n as
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { formatDistanceToNow as
|
|
13
|
+
import { BIGCONSOLE_PERMISSIONS as o } from "../../constants/permissions.js";
|
|
14
|
+
import { memo as s, useCallback as c, useEffect as l, useRef as le, useState as u } from "react";
|
|
15
|
+
import { useParams as ue } from "react-router";
|
|
16
|
+
import { AccessDenied as de, PermissionButton as d } from "@burdenoff/fe-libs/shared/components";
|
|
17
|
+
import { usePermissions as fe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
18
|
+
import { AlertCircle as pe, AlertTriangle as me, ArrowDown as he, ArrowLeft as f, Check as ge, Clock as p, Copy as _e, Database as ve, Download as ye, Edit as be, FileCode2 as xe, KeyRound as Se, Layers as Ce, Loader2 as we, Play as Te, Tag as Ee, Timer as De, Trash2 as Oe } from "lucide-react";
|
|
19
|
+
import { Badge as m, Button as h, IllustratedEmptyState as ke, NextSteps as g, PagePurpose as _, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
21
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
22
|
+
import { formatDistanceToNow as O } from "date-fns";
|
|
23
23
|
// src/bigconsole/pages/ParserViewPage.tsx
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
var k = s(function({ icon: e, label: t, children: n }) {
|
|
25
|
+
return /* @__PURE__ */ D("div", {
|
|
26
|
+
className: "flex items-center justify-between gap-3 py-3 first:pt-0 last:pb-0",
|
|
27
|
+
children: [/* @__PURE__ */ D("dt", {
|
|
28
|
+
className: "flex shrink-0 items-center gap-2 text-text-secondary",
|
|
29
|
+
children: [/* @__PURE__ */ E(e, {
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
className: "h-4 w-4 text-text-muted"
|
|
32
|
+
}), t]
|
|
33
|
+
}), /* @__PURE__ */ E("dd", {
|
|
34
|
+
className: "flex min-w-0 justify-end text-right",
|
|
35
|
+
children: n
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
}), Ae = "default", A = s(function() {
|
|
39
|
+
let { parserId: s, consoleId: A } = ue(), j = e(), { t: M } = w(), N = A || Ae, { hasPermission: je, isLoading: Me } = fe(), Ne = je(o.PARSER_READ), [P, F] = u(!1), [Pe, I] = u(!1), [Fe, L] = u(!1), [R, z] = u(!1), [Ie, B] = u(!1), [V, H] = u(null), U = ie((e) => s ? e.parsers.get(s) : void 0), { loading: Le, error: W, fetchParser: G, deleteParser: K, executeParser: q } = re({
|
|
40
|
+
consoleId: N,
|
|
27
41
|
skipFetch: !0
|
|
28
|
-
}), { dataSinks:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
|
|
42
|
+
}), { dataSinks: Re, fetchDataSinks: J } = ae({ skipFetch: !0 });
|
|
43
|
+
l(() => {
|
|
44
|
+
s && G(s);
|
|
45
|
+
}, [s, G]), l(() => {
|
|
46
|
+
J();
|
|
47
|
+
}, [J]);
|
|
48
|
+
let Y = U?.inputSinkKey ? Re.find((e) => e.key === U.inputSinkKey) : null, X = c(() => {
|
|
49
|
+
j(A ? `/dashboards/${A}/parsers` : "/parsers");
|
|
50
|
+
}, [j, A]), Z = c(() => {
|
|
51
|
+
j(A ? `/dashboards/${A}/parsers/${s}/edit` : `/parsers/${s}/edit`);
|
|
38
52
|
}, [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]),
|
|
43
|
-
if (
|
|
44
|
-
|
|
53
|
+
j,
|
|
54
|
+
s,
|
|
55
|
+
A
|
|
56
|
+
]), ze = c(async () => {
|
|
57
|
+
if (s) {
|
|
58
|
+
F(!0);
|
|
45
59
|
try {
|
|
46
|
-
await
|
|
60
|
+
await K(s) ? (t() && r("success"), j(A ? `/dashboards/${A}/parsers` : "/parsers")) : t() && r("error");
|
|
47
61
|
} catch {
|
|
48
62
|
t() && r("error");
|
|
49
63
|
} finally {
|
|
50
|
-
|
|
64
|
+
F(!1), I(!1);
|
|
51
65
|
}
|
|
52
66
|
}
|
|
53
67
|
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
]),
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
s,
|
|
69
|
+
K,
|
|
70
|
+
j,
|
|
71
|
+
A
|
|
72
|
+
]), Q = le(null);
|
|
73
|
+
l(() => () => {
|
|
74
|
+
Q.current && clearTimeout(Q.current);
|
|
75
|
+
}, []);
|
|
76
|
+
let Be = c(async () => {
|
|
77
|
+
if (U?.expression) try {
|
|
78
|
+
await n(U.expression), L(!0), t() && te(M("bigconsole.parsers.view.expressionCopied", "Expression copied")), Q.current && clearTimeout(Q.current), Q.current = setTimeout(() => L(!1), 2e3);
|
|
61
79
|
} catch {}
|
|
62
|
-
}, [
|
|
63
|
-
if (
|
|
64
|
-
|
|
80
|
+
}, [U?.expression, M]), $ = c(async () => {
|
|
81
|
+
if (s) {
|
|
82
|
+
z(!0), H(null);
|
|
65
83
|
try {
|
|
66
|
-
let e = await
|
|
67
|
-
e &&
|
|
84
|
+
let e = await q(s);
|
|
85
|
+
e && H({
|
|
68
86
|
success: e.success,
|
|
69
87
|
output: e.output,
|
|
70
88
|
error: e.error,
|
|
71
89
|
executionTimeMs: e.executionTimeMs
|
|
72
90
|
});
|
|
73
91
|
} catch (e) {
|
|
74
|
-
|
|
92
|
+
H({
|
|
75
93
|
success: !1,
|
|
76
94
|
output: null,
|
|
77
|
-
error: e instanceof Error ? e.message :
|
|
95
|
+
error: e instanceof Error ? e.message : M("bigconsole.parsers.view.executionFailed", "Execution failed"),
|
|
78
96
|
executionTimeMs: 0
|
|
79
97
|
});
|
|
80
98
|
} finally {
|
|
81
|
-
|
|
99
|
+
z(!1);
|
|
82
100
|
}
|
|
83
101
|
}
|
|
84
102
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
]),
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
|
|
92
|
-
}, []),
|
|
93
|
-
|
|
103
|
+
s,
|
|
104
|
+
q,
|
|
105
|
+
M
|
|
106
|
+
]), Ve = c(() => {
|
|
107
|
+
Y && j(`/datasinks/${Y.id}`);
|
|
108
|
+
}, [j, Y]), He = c(() => {
|
|
109
|
+
B(!0);
|
|
110
|
+
}, []), Ue = c(() => {
|
|
111
|
+
B(!1);
|
|
94
112
|
}, []);
|
|
95
|
-
if (
|
|
113
|
+
if (Le && !U || Me) return /* @__PURE__ */ E("div", {
|
|
96
114
|
className: "flex items-center justify-center min-h-[400px]",
|
|
97
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ E(we, { className: "w-8 h-8 text-text-secondary animate-spin" })
|
|
98
116
|
});
|
|
99
|
-
if (!
|
|
100
|
-
title:
|
|
101
|
-
description:
|
|
117
|
+
if (!Ne) return /* @__PURE__ */ E(de, {
|
|
118
|
+
title: M("bigconsole.parsers.accessDenied.title", "Access Denied"),
|
|
119
|
+
description: M("bigconsole.parsers.accessDenied.view", "You don't have permission to view this parser.")
|
|
102
120
|
});
|
|
103
|
-
if (
|
|
121
|
+
if (W) return /* @__PURE__ */ E("div", {
|
|
104
122
|
className: "p-card-padding",
|
|
105
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ E(i, {
|
|
106
124
|
tone: "danger",
|
|
107
125
|
headingLevel: 2,
|
|
108
|
-
title:
|
|
126
|
+
title: M("bigconsole.parsers.errors.viewLoadFailed", "Failed to load Parser"),
|
|
109
127
|
description: "The parser could not be fetched. Go back to the list and try again.",
|
|
110
|
-
icon: /* @__PURE__ */
|
|
111
|
-
actions: /* @__PURE__ */
|
|
112
|
-
onClick:
|
|
128
|
+
icon: /* @__PURE__ */ E(pe, { className: "h-icon-md w-icon-md text-[var(--color-status-error-text)]" }),
|
|
129
|
+
actions: /* @__PURE__ */ D(h, {
|
|
130
|
+
onClick: X,
|
|
113
131
|
variant: "secondary",
|
|
114
132
|
size: "sm",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ E(f, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.goBack", "Go back")]
|
|
116
134
|
}),
|
|
117
135
|
"data-testid": "parser-load-error",
|
|
118
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ E("p", {
|
|
119
137
|
className: "font-mono text-xs break-words text-text-secondary",
|
|
120
|
-
children:
|
|
138
|
+
children: W.message
|
|
121
139
|
})
|
|
122
140
|
})
|
|
123
141
|
});
|
|
124
|
-
if (!
|
|
142
|
+
if (!U) return /* @__PURE__ */ E("div", {
|
|
125
143
|
className: "flex items-center justify-center min-h-[400px] p-card-padding",
|
|
126
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ E(ke, {
|
|
127
145
|
illustration: "empty-data",
|
|
128
|
-
title:
|
|
129
|
-
description:
|
|
130
|
-
action: /* @__PURE__ */
|
|
131
|
-
onClick:
|
|
146
|
+
title: M("bigconsole.parsers.view.notFoundTitle", "Parser not found"),
|
|
147
|
+
description: M("bigconsole.parsers.view.notFoundDescription", "The Parser you're looking for doesn't exist or has been deleted."),
|
|
148
|
+
action: /* @__PURE__ */ D(h, {
|
|
149
|
+
onClick: X,
|
|
132
150
|
variant: "default",
|
|
133
151
|
size: "default",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ E(f, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.goBackToParsers", "Go back to Parsers")]
|
|
135
153
|
})
|
|
136
154
|
})
|
|
137
155
|
});
|
|
138
|
-
let
|
|
139
|
-
return /* @__PURE__ */
|
|
156
|
+
let We = V !== null;
|
|
157
|
+
return /* @__PURE__ */ D("div", {
|
|
140
158
|
className: "p-card-padding",
|
|
141
159
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ D(ne, { children: [
|
|
161
|
+
/* @__PURE__ */ D("div", {
|
|
144
162
|
className: "flex flex-col gap-form-gap border-b border-[var(--color-border-subtle)] pb-form-gap sm:flex-row sm:items-start sm:justify-between",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ D("div", {
|
|
146
164
|
className: "min-w-0 flex-1",
|
|
147
165
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
onClick:
|
|
166
|
+
/* @__PURE__ */ D(h, {
|
|
167
|
+
onClick: X,
|
|
150
168
|
variant: "ghost",
|
|
151
169
|
size: "sm",
|
|
152
|
-
className: "mb-4",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
170
|
+
className: "mb-4 min-h-11 sm:min-h-9",
|
|
171
|
+
children: [/* @__PURE__ */ E(f, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.view.backToParsers", "Back to Parsers")]
|
|
154
172
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ D("div", {
|
|
156
174
|
className: "flex items-center gap-2 flex-wrap",
|
|
157
175
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ E("h1", {
|
|
159
177
|
className: "text-2xl font-bold text-text-primary sm:text-3xl",
|
|
160
|
-
children:
|
|
178
|
+
children: U.name || M("bigconsole.parsers.view.untitled", "Untitled")
|
|
161
179
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ E(a, { type: U.type }),
|
|
181
|
+
/* @__PURE__ */ E(oe, { status: U.status })
|
|
164
182
|
]
|
|
165
183
|
}),
|
|
166
|
-
|
|
184
|
+
U.description && /* @__PURE__ */ E("p", {
|
|
167
185
|
className: "text-sm text-text-secondary mt-2",
|
|
168
|
-
children:
|
|
186
|
+
children: U.description
|
|
169
187
|
})
|
|
170
188
|
]
|
|
171
|
-
}), /* @__PURE__ */
|
|
189
|
+
}), /* @__PURE__ */ D("div", {
|
|
172
190
|
className: "flex shrink-0 flex-wrap items-center gap-control-gap",
|
|
173
191
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
permission:
|
|
192
|
+
/* @__PURE__ */ E(d, {
|
|
193
|
+
permission: o.PARSER_EXECUTE,
|
|
176
194
|
deniedBehavior: "disable",
|
|
177
|
-
children: /* @__PURE__ */
|
|
195
|
+
children: /* @__PURE__ */ D(h, {
|
|
178
196
|
onClick: $,
|
|
179
|
-
disabled:
|
|
197
|
+
disabled: R,
|
|
180
198
|
variant: "default",
|
|
181
199
|
size: "default",
|
|
182
|
-
|
|
200
|
+
className: "min-h-11 sm:min-h-9",
|
|
201
|
+
children: [/* @__PURE__ */ E(Te, { className: "w-4 h-4 mr-2" }), R ? M("bigconsole.parsers.view.running", "Running...") : M("bigconsole.parsers.actions.execute", "Execute")]
|
|
183
202
|
})
|
|
184
203
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
onClick:
|
|
204
|
+
/* @__PURE__ */ D(h, {
|
|
205
|
+
onClick: He,
|
|
187
206
|
variant: "secondary",
|
|
188
207
|
size: "default",
|
|
189
|
-
|
|
208
|
+
className: "min-h-11 sm:min-h-9",
|
|
209
|
+
children: [/* @__PURE__ */ E(ye, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.export", "Export")]
|
|
190
210
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
permission:
|
|
211
|
+
/* @__PURE__ */ E(d, {
|
|
212
|
+
permission: o.PARSER_UPDATE,
|
|
193
213
|
deniedBehavior: "disable",
|
|
194
|
-
children: /* @__PURE__ */
|
|
195
|
-
onClick:
|
|
214
|
+
children: /* @__PURE__ */ D(h, {
|
|
215
|
+
onClick: Z,
|
|
196
216
|
variant: "secondary",
|
|
197
217
|
size: "default",
|
|
198
|
-
|
|
218
|
+
className: "min-h-11 sm:min-h-9",
|
|
219
|
+
children: [/* @__PURE__ */ E(be, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.edit", "Edit")]
|
|
199
220
|
})
|
|
200
221
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
permission:
|
|
222
|
+
/* @__PURE__ */ E(d, {
|
|
223
|
+
permission: o.PARSER_DELETE,
|
|
203
224
|
deniedBehavior: "hide",
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
onClick: () =>
|
|
206
|
-
disabled:
|
|
225
|
+
children: /* @__PURE__ */ D(h, {
|
|
226
|
+
onClick: () => I(!0),
|
|
227
|
+
disabled: P,
|
|
207
228
|
variant: "destructive",
|
|
208
229
|
size: "default",
|
|
209
|
-
|
|
230
|
+
className: "min-h-11 sm:min-h-9",
|
|
231
|
+
children: [/* @__PURE__ */ E(Oe, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.delete", "Delete")]
|
|
210
232
|
})
|
|
211
233
|
})
|
|
212
234
|
]
|
|
213
235
|
})]
|
|
214
236
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ E(_, {
|
|
216
238
|
className: "max-w-[80ch]",
|
|
217
|
-
children:
|
|
239
|
+
children: M("bigconsole.parsers.view.purpose", "A parser turns raw input into structured fields using its expression. Review or copy the expression, run it against a sample to see the output, then edit it or use it inside a pipeline to shape incoming data.")
|
|
218
240
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
className: "grid gap-section-gap md:grid-cols-2
|
|
221
|
-
children: [/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ D("div", {
|
|
242
|
+
className: "grid items-start gap-section-gap md:grid-cols-2 xl:grid-cols-3",
|
|
243
|
+
children: [/* @__PURE__ */ D("div", {
|
|
222
244
|
className: "flex min-w-0 flex-col gap-section-gap md:col-span-2",
|
|
223
|
-
children: [
|
|
245
|
+
children: [V && /* @__PURE__ */ E(i, {
|
|
224
246
|
id: "parser-execution-result",
|
|
225
247
|
emphasis: "primary",
|
|
226
|
-
tone:
|
|
248
|
+
tone: V.success ? "success" : "danger",
|
|
227
249
|
headingLevel: 2,
|
|
228
|
-
title:
|
|
229
|
-
description:
|
|
230
|
-
meta: /* @__PURE__ */
|
|
231
|
-
variant:
|
|
232
|
-
children:
|
|
250
|
+
title: M("bigconsole.parsers.view.executionResult", "Execution Result"),
|
|
251
|
+
description: V.success ? "Output produced by the latest run of this parser." : "The latest run did not complete. Fix the expression or the input and run again.",
|
|
252
|
+
meta: /* @__PURE__ */ E(m, {
|
|
253
|
+
variant: V.success ? "default" : "destructive",
|
|
254
|
+
children: V.success ? M("bigconsole.parsers.view.success", "Success") : M("bigconsole.parsers.view.failed", "Failed")
|
|
233
255
|
}),
|
|
234
|
-
actions: /* @__PURE__ */
|
|
256
|
+
actions: /* @__PURE__ */ D(m, {
|
|
235
257
|
variant: "secondary",
|
|
236
258
|
className: "text-xs",
|
|
237
|
-
children: [
|
|
259
|
+
children: [V.executionTimeMs, "ms"]
|
|
238
260
|
}),
|
|
239
261
|
"data-testid": "parser-execution-result",
|
|
240
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ E("pre", {
|
|
241
263
|
className: "max-h-[300px] min-w-0 overflow-auto rounded-md bg-bg-sunken p-4 font-mono text-sm text-text-primary",
|
|
242
|
-
children:
|
|
264
|
+
children: V.error ?? JSON.stringify(V.output, null, 2)
|
|
243
265
|
})
|
|
244
|
-
}), /* @__PURE__ */
|
|
245
|
-
emphasis:
|
|
266
|
+
}), /* @__PURE__ */ D(i, {
|
|
267
|
+
emphasis: We ? "standard" : "primary",
|
|
246
268
|
headingLevel: 2,
|
|
247
|
-
title:
|
|
269
|
+
title: M("bigconsole.parsers.view.expression", "Expression"),
|
|
248
270
|
description: "The JQ or JSONata program this parser runs against every input record.",
|
|
249
|
-
icon: /* @__PURE__ */
|
|
250
|
-
meta: /* @__PURE__ */
|
|
271
|
+
icon: /* @__PURE__ */ E(xe, { className: "h-icon-sm w-icon-sm" }),
|
|
272
|
+
meta: /* @__PURE__ */ E(m, {
|
|
251
273
|
variant: "secondary",
|
|
252
274
|
className: "text-xs uppercase",
|
|
253
|
-
children:
|
|
275
|
+
children: U.type
|
|
254
276
|
}),
|
|
255
|
-
actions: /* @__PURE__ */
|
|
256
|
-
onClick:
|
|
277
|
+
actions: /* @__PURE__ */ E(h, {
|
|
278
|
+
onClick: Be,
|
|
257
279
|
variant: "ghost",
|
|
258
280
|
size: "sm",
|
|
259
|
-
|
|
281
|
+
className: "min-h-11 shrink-0 sm:min-h-9",
|
|
282
|
+
"aria-live": "polite",
|
|
283
|
+
children: Fe ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(ge, { className: "w-3.5 h-3.5 text-status-success-text mr-2" }), M("bigconsole.parsers.view.copied", "Copied!")] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(_e, { className: "w-3.5 h-3.5 mr-2" }), M("bigconsole.parsers.actions.copy", "Copy")] })
|
|
260
284
|
}),
|
|
261
285
|
"data-testid": "parser-expression",
|
|
262
|
-
children: /* @__PURE__ */
|
|
263
|
-
value:
|
|
264
|
-
type:
|
|
286
|
+
children: [/* @__PURE__ */ E(se, {
|
|
287
|
+
value: U.expression,
|
|
288
|
+
type: U.type,
|
|
265
289
|
readOnly: !0,
|
|
266
290
|
height: "clamp(180px, 40vh, 300px)"
|
|
267
|
-
})
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
291
|
+
}), /* @__PURE__ */ D("div", {
|
|
292
|
+
className: "mt-3 flex flex-wrap items-center justify-between gap-3 border-t border-[var(--color-border-subtle)] pt-3 text-xs text-text-secondary",
|
|
293
|
+
children: [/* @__PURE__ */ D("span", {
|
|
294
|
+
className: "inline-flex min-w-0 items-center gap-1.5",
|
|
295
|
+
children: [/* @__PURE__ */ E(he, {
|
|
296
|
+
"aria-hidden": "true",
|
|
297
|
+
className: "h-3.5 w-3.5 shrink-0 -rotate-90"
|
|
298
|
+
}), /* @__PURE__ */ D("span", {
|
|
299
|
+
className: "truncate",
|
|
300
|
+
children: [
|
|
301
|
+
M("bigconsole.parsers.view.outputKey", "Output Key"),
|
|
302
|
+
":",
|
|
303
|
+
" ",
|
|
304
|
+
/* @__PURE__ */ E("span", {
|
|
305
|
+
className: "font-mono text-text-primary",
|
|
306
|
+
children: U.outputKey || M("bigconsole.parsers.view.notConfigured", "Not configured")
|
|
307
|
+
})
|
|
308
|
+
]
|
|
309
|
+
})]
|
|
310
|
+
}), /* @__PURE__ */ D("span", {
|
|
311
|
+
className: "tabular-nums",
|
|
279
312
|
children: [
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}), W.inputSinkKey ? /* @__PURE__ */ k("dd", {
|
|
284
|
-
className: "mt-1",
|
|
285
|
-
children: [/* @__PURE__ */ O("p", {
|
|
286
|
-
className: "break-words font-mono text-sm font-medium text-text-primary",
|
|
287
|
-
children: W.inputSinkKey
|
|
288
|
-
}), X && /* @__PURE__ */ k(b, {
|
|
289
|
-
onClick: Ne,
|
|
290
|
-
variant: "link",
|
|
291
|
-
size: "sm",
|
|
292
|
-
className: "mt-1 p-0 h-auto",
|
|
293
|
-
children: [/* @__PURE__ */ O(v, { className: "w-3 h-3 mr-1" }), P("bigconsole.parsers.view.viewDataSink", "View {{name}}", { name: X.name || P("bigconsole.parsers.view.dataSinkFallback", "DataSink") })]
|
|
294
|
-
})]
|
|
295
|
-
}) : /* @__PURE__ */ O("dd", {
|
|
296
|
-
className: "mt-1 text-sm text-text-muted",
|
|
297
|
-
children: P("bigconsole.parsers.view.noneConfigured", "None configured")
|
|
298
|
-
})] }),
|
|
299
|
-
/* @__PURE__ */ O("div", {
|
|
300
|
-
"aria-hidden": "true",
|
|
301
|
-
className: "flex items-center justify-center py-1",
|
|
302
|
-
children: /* @__PURE__ */ O(de, { className: "w-4 h-4 text-text-muted" })
|
|
303
|
-
}),
|
|
304
|
-
/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", {
|
|
305
|
-
className: "text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
306
|
-
children: P("bigconsole.parsers.view.outputKey", "Output Key")
|
|
307
|
-
}), /* @__PURE__ */ O("dd", {
|
|
308
|
-
className: "mt-1 break-words font-mono text-sm font-medium text-text-primary",
|
|
309
|
-
children: W.outputKey || P("bigconsole.parsers.view.notConfigured", "Not configured")
|
|
310
|
-
})] })
|
|
313
|
+
M("bigconsole.parsers.view.version", "Version"),
|
|
314
|
+
" v",
|
|
315
|
+
U.version || 1
|
|
311
316
|
]
|
|
312
|
-
})
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
})
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
className: "flex flex-wrap items-center justify-between gap-2",
|
|
337
|
-
children: [/* @__PURE__ */ O("dt", {
|
|
338
|
-
className: "text-text-secondary",
|
|
339
|
-
children: P("bigconsole.parsers.view.cacheTtl", "Cache TTL")
|
|
340
|
-
}), /* @__PURE__ */ O("dd", {
|
|
341
|
-
className: "text-text-primary font-medium",
|
|
342
|
-
children: W.ttl ? P("bigconsole.parsers.view.ttlSeconds", "{{ttl}}s", { ttl: W.ttl }) : P("bigconsole.parsers.view.noCaching", "No caching")
|
|
343
|
-
})]
|
|
344
|
-
}),
|
|
345
|
-
/* @__PURE__ */ k("div", {
|
|
346
|
-
className: "flex flex-wrap items-center justify-between gap-2",
|
|
347
|
-
children: [/* @__PURE__ */ O("dt", {
|
|
348
|
-
className: "text-text-secondary",
|
|
349
|
-
children: P("bigconsole.parsers.view.version", "Version")
|
|
350
|
-
}), /* @__PURE__ */ O("dd", {
|
|
351
|
-
className: "text-text-primary font-medium",
|
|
352
|
-
children: W.version || 1
|
|
353
|
-
})]
|
|
317
|
+
})]
|
|
318
|
+
})]
|
|
319
|
+
})]
|
|
320
|
+
}), /* @__PURE__ */ D("div", {
|
|
321
|
+
className: "grid min-w-0 items-start gap-section-gap md:col-span-2 md:grid-cols-2 xl:col-span-1 xl:grid-cols-1",
|
|
322
|
+
children: [/* @__PURE__ */ E(i, {
|
|
323
|
+
headingLevel: 2,
|
|
324
|
+
title: M("bigconsole.parsers.view.details", "Details"),
|
|
325
|
+
"data-testid": "parser-details",
|
|
326
|
+
children: /* @__PURE__ */ D("dl", {
|
|
327
|
+
className: "divide-y divide-border-subtle text-sm",
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ E(k, {
|
|
330
|
+
icon: Ee,
|
|
331
|
+
label: M("bigconsole.parsers.view.type", "Type"),
|
|
332
|
+
children: /* @__PURE__ */ E(a, { type: U.type })
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ E(k, {
|
|
335
|
+
icon: Se,
|
|
336
|
+
label: M("bigconsole.parsers.view.outputKey", "Output Key"),
|
|
337
|
+
children: /* @__PURE__ */ E("span", {
|
|
338
|
+
className: "truncate font-mono text-text-primary",
|
|
339
|
+
title: U.outputKey || void 0,
|
|
340
|
+
children: U.outputKey || M("bigconsole.parsers.view.notConfigured", "Not configured")
|
|
354
341
|
})
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
342
|
+
}),
|
|
343
|
+
/* @__PURE__ */ E(k, {
|
|
344
|
+
icon: ve,
|
|
345
|
+
label: M("bigconsole.parsers.view.sourceDataSink", "Source DataSink"),
|
|
346
|
+
children: U.inputSinkKey ? Y ? /* @__PURE__ */ E(h, {
|
|
347
|
+
onClick: Ve,
|
|
348
|
+
variant: "link",
|
|
349
|
+
size: "sm",
|
|
350
|
+
className: "h-auto min-h-11 min-w-0 max-w-full shrink p-0 font-mono sm:min-h-0",
|
|
351
|
+
title: M("bigconsole.parsers.view.viewDataSink", "View {{name}}", { name: Y.name || M("bigconsole.parsers.view.dataSinkFallback", "DataSink") }),
|
|
352
|
+
children: /* @__PURE__ */ E("span", {
|
|
353
|
+
className: "truncate",
|
|
354
|
+
children: U.inputSinkKey
|
|
355
|
+
})
|
|
356
|
+
}) : /* @__PURE__ */ E("span", {
|
|
357
|
+
className: "truncate font-mono text-text-primary",
|
|
358
|
+
title: U.inputSinkKey,
|
|
359
|
+
children: U.inputSinkKey
|
|
360
|
+
}) : /* @__PURE__ */ E("span", {
|
|
361
|
+
className: "text-text-muted",
|
|
362
|
+
children: M("bigconsole.parsers.view.noneConfigured", "None configured")
|
|
363
|
+
})
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ E(k, {
|
|
366
|
+
icon: De,
|
|
367
|
+
label: M("bigconsole.parsers.view.cacheTtl", "Cache TTL"),
|
|
368
|
+
children: /* @__PURE__ */ E("span", {
|
|
369
|
+
className: "font-medium tabular-nums text-text-primary",
|
|
370
|
+
children: U.ttl ? M("bigconsole.parsers.view.ttlSeconds", "{{ttl}}s", { ttl: U.ttl }) : M("bigconsole.parsers.view.noCaching", "No caching")
|
|
371
|
+
})
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ E(k, {
|
|
374
|
+
icon: Ce,
|
|
375
|
+
label: M("bigconsole.parsers.view.version", "Version"),
|
|
376
|
+
children: /* @__PURE__ */ D("span", {
|
|
377
|
+
className: "font-medium tabular-nums text-text-primary",
|
|
378
|
+
children: ["v", U.version || 1]
|
|
379
|
+
})
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ E(k, {
|
|
382
|
+
icon: p,
|
|
383
|
+
label: M("bigconsole.parsers.view.updated", "Updated"),
|
|
384
|
+
children: /* @__PURE__ */ E("span", {
|
|
385
|
+
className: "font-medium text-text-primary",
|
|
386
|
+
title: U.updatedAt ? new Date(U.updatedAt).toLocaleString() : void 0,
|
|
387
|
+
children: U.updatedAt ? O(new Date(U.updatedAt), { addSuffix: !0 }) : M("bigconsole.parsers.view.unknown", "Unknown")
|
|
388
|
+
})
|
|
389
|
+
}),
|
|
390
|
+
/* @__PURE__ */ E(k, {
|
|
391
|
+
icon: p,
|
|
392
|
+
label: M("bigconsole.parsers.view.created", "Created"),
|
|
393
|
+
children: /* @__PURE__ */ E("span", {
|
|
394
|
+
className: "font-medium text-text-primary",
|
|
395
|
+
title: U.createdAt ? new Date(U.createdAt).toLocaleString() : void 0,
|
|
396
|
+
children: U.createdAt ? O(new Date(U.createdAt), { addSuffix: !0 }) : M("bigconsole.parsers.view.unknown", "Unknown")
|
|
397
|
+
})
|
|
398
|
+
})
|
|
399
|
+
]
|
|
386
400
|
})
|
|
387
|
-
|
|
401
|
+
}), /* @__PURE__ */ E(g, {
|
|
402
|
+
storageKey: "bigconsole-parser-view",
|
|
403
|
+
steps: [
|
|
404
|
+
{
|
|
405
|
+
id: "execute",
|
|
406
|
+
label: M("bigconsole.parsers.view.nextSteps.executeLabel", "Run a test execution"),
|
|
407
|
+
description: M("bigconsole.parsers.view.nextSteps.executeDescription", "Check the expression produces the fields you expect."),
|
|
408
|
+
onClick: $
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
id: "edit",
|
|
412
|
+
label: M("bigconsole.parsers.view.nextSteps.editLabel", "Edit the expression"),
|
|
413
|
+
description: M("bigconsole.parsers.view.nextSteps.editDescription", "Refine how this parser maps your input."),
|
|
414
|
+
onClick: Z
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
id: "pipeline",
|
|
418
|
+
label: M("bigconsole.parsers.view.nextSteps.pipelineLabel", "Use it in a pipeline"),
|
|
419
|
+
description: M("bigconsole.parsers.view.nextSteps.pipelineDescription", "Chain this parser with a data sink to process data end to end."),
|
|
420
|
+
onClick: () => j("/pipelines")
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
})]
|
|
388
424
|
})]
|
|
389
|
-
}),
|
|
390
|
-
/* @__PURE__ */ O(ye, {
|
|
391
|
-
storageKey: "bigconsole-parser-view",
|
|
392
|
-
steps: [
|
|
393
|
-
{
|
|
394
|
-
id: "execute",
|
|
395
|
-
label: P("bigconsole.parsers.view.nextSteps.executeLabel", "Run a test execution"),
|
|
396
|
-
description: P("bigconsole.parsers.view.nextSteps.executeDescription", "Check the expression produces the fields you expect."),
|
|
397
|
-
onClick: $
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
id: "edit",
|
|
401
|
-
label: P("bigconsole.parsers.view.nextSteps.editLabel", "Edit the expression"),
|
|
402
|
-
description: P("bigconsole.parsers.view.nextSteps.editDescription", "Refine how this parser maps your input."),
|
|
403
|
-
onClick: Q
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
id: "pipeline",
|
|
407
|
-
label: P("bigconsole.parsers.view.nextSteps.pipelineLabel", "Use it in a pipeline"),
|
|
408
|
-
description: P("bigconsole.parsers.view.nextSteps.pipelineDescription", "Chain this parser with a data sink to process data end to end."),
|
|
409
|
-
onClick: () => N("/pipelines")
|
|
410
|
-
}
|
|
411
|
-
]
|
|
412
425
|
})
|
|
413
426
|
] }),
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
open:
|
|
416
|
-
onOpenChange:
|
|
417
|
-
children: /* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
|
|
427
|
+
/* @__PURE__ */ E(v, {
|
|
428
|
+
open: Pe,
|
|
429
|
+
onOpenChange: I,
|
|
430
|
+
children: /* @__PURE__ */ D(y, { children: [
|
|
431
|
+
/* @__PURE__ */ D(S, { children: [/* @__PURE__ */ E(C, { children: M("bigconsole.parsers.view.deleteDialogTitle", "Delete Parser") }), /* @__PURE__ */ D(b, { children: [
|
|
432
|
+
M("bigconsole.parsers.view.deleteConfirmPrefix", "Are you sure you want to delete"),
|
|
420
433
|
" ",
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
|
|
434
|
+
/* @__PURE__ */ E("strong", { children: U.name }),
|
|
435
|
+
M("bigconsole.parsers.view.deleteConfirmSuffix", "? This action cannot be undone.")
|
|
423
436
|
] })] }),
|
|
424
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ E(i, {
|
|
425
438
|
tone: "warning",
|
|
426
439
|
padding: "compact",
|
|
427
440
|
headingLevel: 3,
|
|
428
441
|
title: "Check dependents first",
|
|
429
|
-
description:
|
|
430
|
-
icon: /* @__PURE__ */
|
|
442
|
+
description: M("bigconsole.parsers.view.deleteWarning", "Widgets and pipelines using this parser may stop working correctly after deletion."),
|
|
443
|
+
icon: /* @__PURE__ */ E(me, { className: "h-icon-sm w-icon-sm text-[var(--color-status-warning-text)]" }),
|
|
431
444
|
"data-testid": "parser-delete-warning"
|
|
432
445
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
onClick: () =>
|
|
446
|
+
/* @__PURE__ */ D(x, { children: [/* @__PURE__ */ E(h, {
|
|
447
|
+
onClick: () => I(!1),
|
|
435
448
|
variant: "secondary",
|
|
436
|
-
|
|
437
|
-
|
|
449
|
+
className: "min-h-11 sm:min-h-9",
|
|
450
|
+
children: M("bigconsole.parsers.actions.cancel", "Cancel")
|
|
451
|
+
}), /* @__PURE__ */ E(h, {
|
|
438
452
|
onClick: () => {
|
|
439
|
-
|
|
453
|
+
ee("medium"), ze();
|
|
440
454
|
},
|
|
441
|
-
disabled:
|
|
455
|
+
disabled: P,
|
|
442
456
|
variant: "destructive",
|
|
443
|
-
|
|
457
|
+
className: "min-h-11 sm:min-h-9",
|
|
458
|
+
children: P ? M("bigconsole.parsers.view.deleting", "Deleting...") : M("bigconsole.parsers.view.deleteDialogTitle", "Delete Parser")
|
|
444
459
|
})] })
|
|
445
460
|
] })
|
|
446
461
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
isOpen:
|
|
449
|
-
parserId:
|
|
450
|
-
parserName:
|
|
451
|
-
onClose:
|
|
462
|
+
/* @__PURE__ */ E(ce, {
|
|
463
|
+
isOpen: Ie,
|
|
464
|
+
parserId: s || null,
|
|
465
|
+
parserName: U.name,
|
|
466
|
+
onClose: Ue
|
|
452
467
|
})
|
|
453
468
|
]
|
|
454
469
|
});
|
|
455
470
|
});
|
|
456
|
-
export {
|
|
471
|
+
export { A as ParserViewPage, A as default };
|