@burdenoff/microfe-semanticfed 2026.1031.3 → 2026.1031.5
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/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1716 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/semanticfed/SemanticFedRoutes.js +24 -20
- package/dist/semanticfed/SemanticFedRoutes.js.map +1 -1
- package/dist/semanticfed/api/quotaRefusal.js +2 -1
- package/dist/semanticfed/api/quotaRefusal.js.map +1 -1
- package/dist/semanticfed/components/AskQuestionPanel.js +161 -0
- package/dist/semanticfed/components/AskQuestionPanel.js.map +1 -0
- package/dist/semanticfed/hooks/useLineage.js +62 -0
- package/dist/semanticfed/hooks/useLineage.js.map +1 -0
- package/dist/semanticfed/hooks/useNlQuery.js +52 -0
- package/dist/semanticfed/hooks/useNlQuery.js.map +1 -0
- package/dist/semanticfed/pages/LineagePage.js +441 -0
- package/dist/semanticfed/pages/LineagePage.js.map +1 -0
- package/dist/semanticfed/pages/QueryConsolePage.js +139 -116
- package/dist/semanticfed/pages/QueryConsolePage.js.map +1 -1
- package/dist/semanticfed/utils/cn.js +10 -0
- package/dist/semanticfed/utils/cn.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { translateWithFallback as e } from "../utils/i18n.js";
|
|
2
2
|
import { sqlErrorMessage as t, useSemExecuteSql as n, useSemSqlCatalog as r, useSemSqlModels as i } from "../hooks/useSqlConsole.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { AskQuestionPanel as a } from "../components/AskQuestionPanel.js";
|
|
4
|
+
import { useMemo as o, useState as s } from "react";
|
|
5
|
+
import { AlertTriangle as c, CheckCircle2 as l, Clock as u, Database as d, EyeOff as f, Loader2 as p, Play as m, Plug as h, Table2 as g, Terminal as _, XCircle as v } from "lucide-react";
|
|
6
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
7
|
+
import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
|
+
import { Badge as C, Button as w, Card as T, CardContent as E, CardHeader as D, CardTitle as O } from "@burdenoff/fe-libs/ui";
|
|
8
9
|
//#region src/semanticfed/pages/QueryConsolePage.tsx
|
|
9
|
-
var
|
|
10
|
+
var k = [
|
|
10
11
|
100,
|
|
11
12
|
1e3,
|
|
12
13
|
1e4
|
|
13
|
-
],
|
|
14
|
-
function
|
|
14
|
+
], A = 10;
|
|
15
|
+
function j(e) {
|
|
15
16
|
if (!e) return "";
|
|
16
17
|
let t = e.columns.find((e) => e.kind === "DIMENSION"), n = e.columns.find((e) => e.kind === "METRIC"), r = (e) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(e) ? e : `"${e.replace(/"/g, "\"\"")}"`, i = r(e.name);
|
|
17
18
|
if (t && n) {
|
|
@@ -26,11 +27,11 @@ function A(e) {
|
|
|
26
27
|
}
|
|
27
28
|
return `SELECT *\nFROM ${i}\nLIMIT 100;`;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function M(e) {
|
|
30
31
|
return e == null ? "NULL" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
let { t:
|
|
33
|
+
function N() {
|
|
34
|
+
let { t: N } = S(), P = (t, n, r) => e(N, t, n, r), F = i(), [ee, I] = s(null), L = ee ?? F.data?.[0]?.id ?? null, R = r(L), z = n(), [B, V] = s(null), H = B ?? j(R.data?.tables[0]), U = (e) => V(e), [W, G] = s(1e3), [K, q] = s(null), [J, Y] = s(null), [X, Z] = s([]), Q = o(() => F.data?.find((e) => e.id === L)?.name ?? "", [F.data, L]), $ = async () => {
|
|
34
35
|
if (!L || H.trim() === "" || z.isPending) return;
|
|
35
36
|
Y(null);
|
|
36
37
|
let e = H, n = {
|
|
@@ -51,7 +52,7 @@ function M() {
|
|
|
51
52
|
rowCount: t.rowCount,
|
|
52
53
|
durationMs: Math.round(t.durationMs),
|
|
53
54
|
message: null
|
|
54
|
-
}, ...e].slice(0,
|
|
55
|
+
}, ...e].slice(0, A));
|
|
55
56
|
} catch (e) {
|
|
56
57
|
let r = t(e);
|
|
57
58
|
q(null), Y(r), Z((e) => [{
|
|
@@ -60,57 +61,72 @@ function M() {
|
|
|
60
61
|
rowCount: 0,
|
|
61
62
|
durationMs: 0,
|
|
62
63
|
message: r
|
|
63
|
-
}, ...e].slice(0,
|
|
64
|
+
}, ...e].slice(0, A));
|
|
64
65
|
}
|
|
65
|
-
},
|
|
66
|
-
|
|
66
|
+
}, te = (e) => {
|
|
67
|
+
Y(null), q(e.result);
|
|
68
|
+
let { translation: t, result: n } = e;
|
|
69
|
+
!n || !t.sql || Z((e) => [{
|
|
70
|
+
id: Date.now(),
|
|
71
|
+
sql: t.sql ?? "",
|
|
72
|
+
modelName: t.modelName,
|
|
73
|
+
executedAt: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
|
|
74
|
+
ok: !0,
|
|
75
|
+
rowCount: n.rowCount,
|
|
76
|
+
durationMs: Math.round(n.durationMs),
|
|
77
|
+
message: null
|
|
78
|
+
}, ...e].slice(0, A));
|
|
79
|
+
}, ne = (e) => {
|
|
80
|
+
q(null), Y(e);
|
|
81
|
+
}, re = (e) => U(H.trim() === "" ? e : `${H}${e}`), ie = F.isSuccess && F.data.length === 0;
|
|
82
|
+
return /* @__PURE__ */ x("div", {
|
|
67
83
|
className: "space-y-6 p-6",
|
|
68
84
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ x("div", {
|
|
70
86
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
71
87
|
"data-tour": "semanticfed-query-console-header",
|
|
72
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h1", {
|
|
73
89
|
className: "text-2xl font-semibold",
|
|
74
|
-
children:
|
|
75
|
-
}), /* @__PURE__ */
|
|
90
|
+
children: P("semanticfed.queryConsole.title", "Query Console")
|
|
91
|
+
}), /* @__PURE__ */ b("p", {
|
|
76
92
|
className: "text-sm text-muted-foreground",
|
|
77
|
-
children:
|
|
78
|
-
})] }), /* @__PURE__ */
|
|
93
|
+
children: P("semanticfed.queryConsole.askDescription", "Ask a question in plain English or run read-only SQL against a semantic model. Every query is federated across its data sources with your access policies applied.")
|
|
94
|
+
})] }), /* @__PURE__ */ x("div", {
|
|
79
95
|
className: "flex gap-2",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ x(C, {
|
|
81
97
|
variant: "outline",
|
|
82
98
|
className: "gap-1",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
84
|
-
}), /* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ b(_, { className: "h-3 w-3" }), " SQL SELECT"]
|
|
100
|
+
}), /* @__PURE__ */ x(C, {
|
|
85
101
|
variant: "outline",
|
|
86
102
|
className: "gap-1",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ b(h, { className: "h-3 w-3" }), P("semanticfed.queryConsole.badges.httpApi", "HTTP SQL API")]
|
|
88
104
|
})]
|
|
89
105
|
})]
|
|
90
106
|
}),
|
|
91
|
-
|
|
107
|
+
ie && /* @__PURE__ */ b(T, { children: /* @__PURE__ */ x(E, {
|
|
92
108
|
className: "flex items-center gap-3 p-6 text-sm text-muted-foreground",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ b(d, { className: "h-5 w-5" }), P("semanticfed.queryConsole.noModels", "No semantic model yet. Create a model with entities, dimensions and metrics, then query it here with SQL.")]
|
|
94
110
|
}) }),
|
|
95
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ x("div", {
|
|
96
112
|
className: "grid gap-4 lg:grid-cols-[18rem_minmax(0,1fr)]",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ x(T, {
|
|
98
114
|
className: "min-w-0",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ b(D, {
|
|
100
116
|
className: "pb-3",
|
|
101
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ x(O, {
|
|
102
118
|
className: "flex items-center gap-2 text-base",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ b(g, { className: "h-4 w-4" }), P("semanticfed.queryConsole.schema.title", "Tables")]
|
|
104
120
|
})
|
|
105
|
-
}), /* @__PURE__ */
|
|
121
|
+
}), /* @__PURE__ */ x(E, {
|
|
106
122
|
className: "space-y-3",
|
|
107
123
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ b("label", {
|
|
109
125
|
className: "block text-xs font-medium text-muted-foreground",
|
|
110
126
|
htmlFor: "sql-console-model",
|
|
111
|
-
children:
|
|
127
|
+
children: P("semanticfed.queryConsole.schema.model", "Semantic model")
|
|
112
128
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ b("select", {
|
|
114
130
|
id: "sql-console-model",
|
|
115
131
|
"data-testid": "sql-console-model",
|
|
116
132
|
className: "w-full rounded border bg-background p-2 text-sm",
|
|
@@ -118,93 +134,100 @@ function M() {
|
|
|
118
134
|
onChange: (e) => {
|
|
119
135
|
I(e.target.value || null), V(null), q(null), Y(null);
|
|
120
136
|
},
|
|
121
|
-
disabled: !
|
|
122
|
-
children: (
|
|
137
|
+
disabled: !F.data || F.data.length === 0,
|
|
138
|
+
children: (F.data ?? []).map((e) => /* @__PURE__ */ b("option", {
|
|
123
139
|
value: e.id,
|
|
124
140
|
children: e.name
|
|
125
141
|
}, e.id))
|
|
126
142
|
}),
|
|
127
|
-
|
|
143
|
+
F.isError && /* @__PURE__ */ b("p", {
|
|
128
144
|
className: "text-xs text-destructive",
|
|
129
|
-
children: t(
|
|
145
|
+
children: t(F.error)
|
|
130
146
|
}),
|
|
131
|
-
R.isLoading && /* @__PURE__ */
|
|
132
|
-
R.isError && /* @__PURE__ */
|
|
147
|
+
R.isLoading && /* @__PURE__ */ b(p, { className: "h-4 w-4 animate-spin text-muted-foreground" }),
|
|
148
|
+
R.isError && /* @__PURE__ */ b("p", {
|
|
133
149
|
className: "text-xs text-destructive",
|
|
134
150
|
children: t(R.error)
|
|
135
151
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ b("div", {
|
|
137
153
|
className: "max-h-96 space-y-2 overflow-y-auto",
|
|
138
154
|
"data-testid": "sql-console-tables",
|
|
139
|
-
children: (R.data?.tables ?? []).map((e) => /* @__PURE__ */
|
|
155
|
+
children: (R.data?.tables ?? []).map((e) => /* @__PURE__ */ x("details", {
|
|
140
156
|
className: "rounded border p-2",
|
|
141
157
|
open: R.data?.tables.length === 1,
|
|
142
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ b("summary", {
|
|
143
159
|
className: "cursor-pointer truncate font-mono text-xs font-medium",
|
|
144
160
|
children: e.name
|
|
145
|
-
}), /* @__PURE__ */
|
|
161
|
+
}), /* @__PURE__ */ x("ul", {
|
|
146
162
|
className: "mt-2 space-y-1",
|
|
147
|
-
children: [e.columns.map((e) => /* @__PURE__ */
|
|
163
|
+
children: [e.columns.map((e) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
|
|
148
164
|
type: "button",
|
|
149
165
|
className: "flex w-full items-center justify-between gap-2 rounded px-1 text-left font-mono text-xs hover:bg-muted",
|
|
150
|
-
onClick: () =>
|
|
166
|
+
onClick: () => re(e.name),
|
|
151
167
|
title: e.description ?? void 0,
|
|
152
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ b("span", {
|
|
153
169
|
className: "truncate",
|
|
154
170
|
children: e.name
|
|
155
|
-
}), /* @__PURE__ */
|
|
171
|
+
}), /* @__PURE__ */ b("span", {
|
|
156
172
|
className: "shrink-0 text-[10px] text-muted-foreground",
|
|
157
173
|
children: e.kind === "METRIC" ? e.aggregation ?? "METRIC" : e.dataType
|
|
158
174
|
})]
|
|
159
|
-
}) }, e.name)), e.columns.length === 0 && /* @__PURE__ */
|
|
175
|
+
}) }, e.name)), e.columns.length === 0 && /* @__PURE__ */ b("li", {
|
|
160
176
|
className: "text-xs text-muted-foreground",
|
|
161
|
-
children:
|
|
177
|
+
children: P("semanticfed.queryConsole.schema.noColumns", "No dimensions or metrics registered")
|
|
162
178
|
})]
|
|
163
179
|
})]
|
|
164
180
|
}, e.name))
|
|
165
181
|
})
|
|
166
182
|
]
|
|
167
183
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
184
|
+
}), /* @__PURE__ */ x("div", {
|
|
169
185
|
className: "min-w-0 space-y-4",
|
|
170
186
|
children: [
|
|
171
|
-
/* @__PURE__ */ b(
|
|
187
|
+
/* @__PURE__ */ b(a, {
|
|
188
|
+
modelId: L,
|
|
189
|
+
maxRows: W,
|
|
190
|
+
onAnswer: te,
|
|
191
|
+
onError: ne,
|
|
192
|
+
onOpenInEditor: (e) => U(e)
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ x(T, { children: [/* @__PURE__ */ b(D, {
|
|
172
195
|
className: "pb-3",
|
|
173
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ x("div", {
|
|
174
197
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ b(O, {
|
|
176
199
|
className: "text-base",
|
|
177
|
-
children:
|
|
178
|
-
}), /* @__PURE__ */
|
|
200
|
+
children: P("semanticfed.queryConsole.editor.title", "Query Editor")
|
|
201
|
+
}), /* @__PURE__ */ x("div", {
|
|
179
202
|
className: "flex items-center gap-2",
|
|
180
203
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ b("label", {
|
|
182
205
|
className: "sr-only",
|
|
183
206
|
htmlFor: "sql-console-max-rows",
|
|
184
|
-
children:
|
|
207
|
+
children: P("semanticfed.queryConsole.editor.maxRowsLabel", "Maximum rows")
|
|
185
208
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ b("select", {
|
|
187
210
|
id: "sql-console-max-rows",
|
|
188
211
|
className: "rounded border bg-background p-1 text-xs",
|
|
189
212
|
value: W,
|
|
190
213
|
onChange: (e) => G(Number(e.target.value)),
|
|
191
|
-
children:
|
|
214
|
+
children: k.map((e) => /* @__PURE__ */ b("option", {
|
|
192
215
|
value: e,
|
|
193
|
-
children:
|
|
216
|
+
children: P("semanticfed.queryConsole.editor.maxRowsOption", "Max {count} rows", { count: e.toLocaleString() })
|
|
194
217
|
}, e))
|
|
195
218
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ x(w, {
|
|
197
220
|
size: "sm",
|
|
198
221
|
onClick: () => void $(),
|
|
199
222
|
disabled: !L || H.trim() === "" || z.isPending,
|
|
200
223
|
"data-testid": "sql-console-run",
|
|
201
|
-
children: [z.isPending ? /* @__PURE__ */
|
|
224
|
+
children: [z.isPending ? /* @__PURE__ */ b(p, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(m, { className: "mr-2 h-4 w-4" }), P("semanticfed.queryConsole.actions.execute", "Execute")]
|
|
202
225
|
})
|
|
203
226
|
]
|
|
204
227
|
})]
|
|
205
228
|
})
|
|
206
|
-
}), /* @__PURE__ */
|
|
207
|
-
"aria-label":
|
|
229
|
+
}), /* @__PURE__ */ x(E, { children: [/* @__PURE__ */ b("textarea", {
|
|
230
|
+
"aria-label": P("semanticfed.queryConsole.editor.ariaLabel", "SQL statement"),
|
|
208
231
|
"data-testid": "sql-console-editor",
|
|
209
232
|
className: "w-full rounded border bg-muted/30 p-4 font-mono text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-primary",
|
|
210
233
|
rows: 8,
|
|
@@ -215,125 +238,125 @@ function M() {
|
|
|
215
238
|
},
|
|
216
239
|
spellCheck: !1,
|
|
217
240
|
placeholder: "SELECT region, SUM(revenue) FROM orders GROUP BY region"
|
|
218
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ x("div", {
|
|
219
242
|
className: "mt-2 flex flex-wrap items-center gap-4 text-xs text-muted-foreground",
|
|
220
243
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.editor.shortcut", "Ctrl/Cmd + Enter to run") }),
|
|
245
|
+
/* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.editor.timeout", "Timeout: 30s") }),
|
|
246
|
+
/* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.editor.supported", "SELECT, JOIN … ON, WHERE … AND, GROUP BY, ORDER BY, LIMIT/OFFSET") })
|
|
224
247
|
]
|
|
225
248
|
})] })] }),
|
|
226
|
-
J && /* @__PURE__ */
|
|
249
|
+
J && /* @__PURE__ */ b(T, {
|
|
227
250
|
"data-testid": "sql-console-error",
|
|
228
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ x(E, {
|
|
229
252
|
className: "flex items-start gap-3 p-4 text-sm text-destructive",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ b(v, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ b("span", {
|
|
231
254
|
className: "break-words",
|
|
232
255
|
children: J
|
|
233
256
|
})]
|
|
234
257
|
})
|
|
235
258
|
}),
|
|
236
|
-
K && /* @__PURE__ */
|
|
259
|
+
K && /* @__PURE__ */ x(T, {
|
|
237
260
|
"data-testid": "sql-console-result",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ b(D, {
|
|
239
262
|
className: "pb-3",
|
|
240
|
-
children: /* @__PURE__ */
|
|
263
|
+
children: /* @__PURE__ */ x("div", {
|
|
241
264
|
className: "flex flex-wrap items-center gap-3 text-sm",
|
|
242
265
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ b(l, { className: "h-4 w-4 text-primary" }),
|
|
267
|
+
/* @__PURE__ */ b("span", {
|
|
245
268
|
className: "font-medium",
|
|
246
269
|
"data-testid": "sql-console-row-count",
|
|
247
|
-
children:
|
|
270
|
+
children: P("semanticfed.queryConsole.result.rows", "{count} rows", { count: K.rowCount.toLocaleString() })
|
|
248
271
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ x("span", {
|
|
250
273
|
className: "text-muted-foreground",
|
|
251
274
|
children: [Math.round(K.durationMs), "ms"]
|
|
252
275
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ b("span", {
|
|
254
277
|
className: "text-muted-foreground",
|
|
255
|
-
children:
|
|
278
|
+
children: P("semanticfed.queryConsole.result.sources", "{count} sources", { count: K.sourcesTouched })
|
|
256
279
|
}),
|
|
257
|
-
K.truncated && /* @__PURE__ */
|
|
280
|
+
K.truncated && /* @__PURE__ */ x(C, {
|
|
258
281
|
variant: "outline",
|
|
259
282
|
className: "gap-1",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ b(c, { className: "h-3 w-3" }), P("semanticfed.queryConsole.result.truncated", "Truncated — more rows matched")]
|
|
261
284
|
})
|
|
262
285
|
]
|
|
263
286
|
})
|
|
264
|
-
}), /* @__PURE__ */
|
|
287
|
+
}), /* @__PURE__ */ b(E, { children: /* @__PURE__ */ b("div", {
|
|
265
288
|
className: "max-h-[28rem] overflow-auto rounded border",
|
|
266
|
-
children: /* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ x("table", {
|
|
267
290
|
className: "w-full text-left text-xs",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ b("thead", {
|
|
269
292
|
className: "sticky top-0 bg-muted",
|
|
270
|
-
children: /* @__PURE__ */
|
|
293
|
+
children: /* @__PURE__ */ b("tr", { children: K.columns.map((e) => /* @__PURE__ */ x("th", {
|
|
271
294
|
className: "whitespace-nowrap px-3 py-2 font-medium",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ x("span", {
|
|
273
296
|
className: "inline-flex items-center gap-1",
|
|
274
|
-
children: [e.name, e.masked && /* @__PURE__ */
|
|
297
|
+
children: [e.name, e.masked && /* @__PURE__ */ b(f, {
|
|
275
298
|
className: "h-3 w-3 text-muted-foreground",
|
|
276
|
-
"aria-label":
|
|
299
|
+
"aria-label": P("semanticfed.queryConsole.result.masked", "Masked by policy ({mask})", { mask: e.mask ?? "" })
|
|
277
300
|
})]
|
|
278
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ b("span", {
|
|
279
302
|
className: "block text-[10px] font-normal text-muted-foreground",
|
|
280
303
|
children: e.aggregation ?? e.dataType
|
|
281
304
|
})]
|
|
282
305
|
}, e.name)) })
|
|
283
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ x("tbody", { children: [K.rows.map((e, t) => /* @__PURE__ */ b("tr", {
|
|
284
307
|
className: "border-t",
|
|
285
|
-
children: K.columns.map((t) => /* @__PURE__ */
|
|
308
|
+
children: K.columns.map((t) => /* @__PURE__ */ b("td", {
|
|
286
309
|
className: "whitespace-nowrap px-3 py-1.5 font-mono",
|
|
287
|
-
children:
|
|
310
|
+
children: M(e[t.name])
|
|
288
311
|
}, t.name))
|
|
289
|
-
}, t)), K.rows.length === 0 && /* @__PURE__ */
|
|
312
|
+
}, t)), K.rows.length === 0 && /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
|
|
290
313
|
colSpan: K.columns.length,
|
|
291
314
|
className: "px-3 py-4 text-center text-muted-foreground",
|
|
292
|
-
children:
|
|
315
|
+
children: P("semanticfed.queryConsole.result.empty", "No rows matched")
|
|
293
316
|
}) })] })]
|
|
294
317
|
})
|
|
295
318
|
}) })]
|
|
296
319
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ x(T, { children: [/* @__PURE__ */ b(D, { children: /* @__PURE__ */ x(O, {
|
|
298
321
|
className: "flex items-center gap-2 text-base",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
300
|
-
}) }), /* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ b(u, { className: "h-4 w-4" }), P("semanticfed.queryConsole.history.title", "Query History")]
|
|
323
|
+
}) }), /* @__PURE__ */ b(E, { children: X.length === 0 ? /* @__PURE__ */ b("p", {
|
|
301
324
|
className: "text-xs text-muted-foreground",
|
|
302
|
-
children:
|
|
303
|
-
}) : /* @__PURE__ */
|
|
325
|
+
children: P("semanticfed.queryConsole.history.empty", "Statements you run in this session appear here.")
|
|
326
|
+
}) : /* @__PURE__ */ b("div", {
|
|
304
327
|
className: "space-y-2",
|
|
305
|
-
children: X.map((e) => /* @__PURE__ */
|
|
328
|
+
children: X.map((e) => /* @__PURE__ */ x("button", {
|
|
306
329
|
type: "button",
|
|
307
330
|
className: "flex w-full items-start gap-3 rounded border p-3 text-left hover:bg-muted",
|
|
308
331
|
onClick: () => U(e.sql),
|
|
309
|
-
children: [e.ok ? /* @__PURE__ */
|
|
332
|
+
children: [e.ok ? /* @__PURE__ */ b(l, { className: "mt-0.5 h-4 w-4 shrink-0 text-primary" }) : /* @__PURE__ */ b(v, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }), /* @__PURE__ */ x("div", {
|
|
310
333
|
className: "min-w-0 flex-1",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ b("p", {
|
|
312
335
|
className: "truncate font-mono text-xs",
|
|
313
336
|
children: e.sql
|
|
314
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ x("div", {
|
|
315
338
|
className: "mt-1 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",
|
|
316
339
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
e.ok ? /* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ b("span", { children: e.modelName }),
|
|
341
|
+
e.ok ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.history.results", "{count} results", { count: e.rowCount.toLocaleString() }) }), /* @__PURE__ */ x("span", { children: [e.durationMs, "ms"] })] }) : /* @__PURE__ */ b("span", {
|
|
319
342
|
className: "truncate",
|
|
320
343
|
children: e.message
|
|
321
344
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ b("span", { children: e.executedAt })
|
|
323
346
|
]
|
|
324
347
|
})]
|
|
325
348
|
})]
|
|
326
349
|
}, e.id))
|
|
327
350
|
}) })] }),
|
|
328
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ x(T, { children: [/* @__PURE__ */ b(D, {
|
|
329
352
|
className: "pb-2",
|
|
330
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ x(O, {
|
|
331
354
|
className: "flex items-center gap-2 text-base",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ b(h, { className: "h-4 w-4" }), P("semanticfed.queryConsole.connect.title", "Connect BI tools and notebooks")]
|
|
333
356
|
})
|
|
334
|
-
}), /* @__PURE__ */
|
|
357
|
+
}), /* @__PURE__ */ x(E, {
|
|
335
358
|
className: "space-y-2 text-xs text-muted-foreground",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ b("p", { children: P("semanticfed.queryConsole.connect.body", "The same SQL runs over HTTPS: POST the semExecuteSql operation to the workspace API with a workspace token. Power BI (Web connector), Tableau (Web Data Connector), Python/pandas, Jupyter and reverse-ETL HTTP sources can all call it; see the SQL endpoint guide in the SemanticFed docs.") }), /* @__PURE__ */ b("pre", {
|
|
337
360
|
className: "overflow-x-auto rounded bg-muted p-3 font-mono text-[11px] text-foreground",
|
|
338
361
|
children: `mutation { semExecuteSql(input: { modelId: "${L ?? "<model-id>"}", sql: "SELECT ..." }) { columns { name dataType } rows truncated } }`
|
|
339
362
|
})]
|
|
@@ -345,6 +368,6 @@ function M() {
|
|
|
345
368
|
});
|
|
346
369
|
}
|
|
347
370
|
//#endregion
|
|
348
|
-
export {
|
|
371
|
+
export { N as QueryConsolePage };
|
|
349
372
|
|
|
350
373
|
//# sourceMappingURL=QueryConsolePage.js.map
|