@burdenoff/microfe-semanticfed 2026.1117.1 → 2026.1201.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/semanticfed/SemanticFedRoot.js +66 -94
- package/dist/semanticfed/SemanticFedRoot.js.map +1 -1
- package/dist/semanticfed/SemanticFedRoutes.js +24 -37
- package/dist/semanticfed/SemanticFedRoutes.js.map +1 -1
- package/dist/semanticfed/api/clientAnalytics.d.ts +5 -1
- package/dist/semanticfed/api/clientAnalytics.js +65 -26
- package/dist/semanticfed/api/clientAnalytics.js.map +1 -1
- package/dist/semanticfed/components/OnboardingChecklist.js +87 -80
- package/dist/semanticfed/components/OnboardingChecklist.js.map +1 -1
- package/dist/semanticfed/components/TableHeaders.js +2 -11
- package/dist/semanticfed/components/TableHeaders.js.map +1 -1
- package/dist/semanticfed/hooks/useClientAnalytics.d.ts +4 -0
- package/dist/semanticfed/hooks/useClientAnalytics.js +1 -1
- package/dist/semanticfed/hooks/useClientAnalytics.js.map +1 -1
- package/dist/semanticfed/hooks/useExperiment.d.ts +14 -0
- package/dist/semanticfed/hooks/useExperiment.js +39 -0
- package/dist/semanticfed/hooks/useExperiment.js.map +1 -0
- package/dist/semanticfed/hooks/useNlQuery.js +37 -33
- package/dist/semanticfed/hooks/useNlQuery.js.map +1 -1
- package/dist/semanticfed/hooks/useQueryAnalytics.d.ts +214 -0
- package/dist/semanticfed/hooks/useQueryAnalytics.js +57 -3
- package/dist/semanticfed/hooks/useQueryAnalytics.js.map +1 -1
- package/dist/semanticfed/pages/AnalyticsPage.js +294 -89
- package/dist/semanticfed/pages/AnalyticsPage.js.map +1 -1
- package/dist/semanticfed/pages/LineagePage.js +75 -62
- package/dist/semanticfed/pages/LineagePage.js.map +1 -1
- package/dist/semanticfed/pages/MonitoringPage.js +91 -230
- package/dist/semanticfed/pages/MonitoringPage.js.map +1 -1
- package/dist/semanticfed/pages/RegistryPage.js +97 -91
- package/dist/semanticfed/pages/RegistryPage.js.map +1 -1
- package/dist/semanticfed/store/semanticfedStore.d.ts +1 -13
- package/dist/semanticfed/store/semanticfedStore.js +0 -378
- package/dist/semanticfed/store/semanticfedStore.js.map +1 -1
- package/dist/semanticfed/translations/english.js +40 -132
- package/dist/semanticfed/translations/english.js.map +1 -1
- package/dist/semanticfed/translations/english.json.d.ts +40 -132
- package/dist/semanticfed/types/index.d.ts +0 -53
- package/package.json +6 -2
- package/dist/semanticfed/pages/AgentsPage.d.ts +0 -2
- package/dist/semanticfed/pages/AgentsPage.js +0 -207
- package/dist/semanticfed/pages/AgentsPage.js.map +0 -1
- package/dist/semanticfed/pages/KnowledgeGraphPage.d.ts +0 -1
- package/dist/semanticfed/pages/KnowledgeGraphPage.js +0 -245
- package/dist/semanticfed/pages/KnowledgeGraphPage.js.map +0 -1
- package/dist/semanticfed/pages/OntologyPage.d.ts +0 -1
- package/dist/semanticfed/pages/OntologyPage.js +0 -144
- package/dist/semanticfed/pages/OntologyPage.js.map +0 -1
- package/dist/semanticfed/pages/TopologyPage.d.ts +0 -2
- package/dist/semanticfed/pages/TopologyPage.js +0 -146
- package/dist/semanticfed/pages/TopologyPage.js.map +0 -1
- package/dist/semanticfed/pages/VisualizationPage.d.ts +0 -2
- package/dist/semanticfed/pages/VisualizationPage.js +0 -276
- package/dist/semanticfed/pages/VisualizationPage.js.map +0 -1
|
@@ -4,39 +4,40 @@ import { LineageToolbar as n } from "../components/lineage/LineageToolbar.js";
|
|
|
4
4
|
import { LineageWarnings as r } from "../components/lineage/LineageWarnings.js";
|
|
5
5
|
import { KIND_ICON as i, KIND_LABEL as a, kindLabel as o } from "../components/lineage/lineageModel.js";
|
|
6
6
|
import { useLineageTrace as s } from "../components/lineage/useLineageTrace.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import { useClientAnalytics as c } from "../hooks/useClientAnalytics.js";
|
|
8
|
+
import { lineageErrorMessage as l } from "../hooks/useLineage.js";
|
|
9
|
+
import { useTr as u } from "../hooks/useTr.js";
|
|
10
|
+
import { useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
11
|
+
import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
import { AlertTriangle as g, GitBranch as _, Loader2 as v } from "lucide-react";
|
|
13
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { Badge as S, Card as C, CardContent as w } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
// src/semanticfed/pages/LineagePage.tsx
|
|
15
|
-
function
|
|
16
|
-
let n =
|
|
16
|
+
function T({ graph: e, tx: t }) {
|
|
17
|
+
let n = f(() => {
|
|
17
18
|
let t = {};
|
|
18
19
|
for (let n of e?.nodes ?? []) t[n.kind] = (t[n.kind] ?? 0) + 1;
|
|
19
20
|
return t;
|
|
20
21
|
}, [e]);
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ x("div", {
|
|
22
23
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
23
24
|
"data-tour": "semanticfed-lineage-header",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
25
|
+
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h1", {
|
|
25
26
|
className: "text-2xl font-semibold",
|
|
26
27
|
children: t("semanticfed.lineage.title", "Lineage")
|
|
27
|
-
}), /* @__PURE__ */
|
|
28
|
+
}), /* @__PURE__ */ b("p", {
|
|
28
29
|
className: "text-sm text-muted-foreground",
|
|
29
30
|
children: t("semanticfed.lineage.description", "End-to-end lineage from connectors and data sources through tables, entities and fields to the models and saved queries that use them. Select anything to trace where its data comes from and what depends on it.")
|
|
30
|
-
})] }), /* @__PURE__ */
|
|
31
|
+
})] }), /* @__PURE__ */ b("div", {
|
|
31
32
|
className: "flex flex-wrap gap-2",
|
|
32
33
|
"data-testid": "lineage-counts",
|
|
33
34
|
children: Object.keys(a).filter((e) => n[e]).map((e) => {
|
|
34
35
|
let r = i[e];
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ x(S, {
|
|
36
37
|
variant: "outline",
|
|
37
38
|
className: "gap-1",
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ b(r, { className: "h-3 w-3" }),
|
|
40
41
|
n[e],
|
|
41
42
|
" ",
|
|
42
43
|
o(t, e)
|
|
@@ -46,81 +47,93 @@ function S({ graph: e, tx: t }) {
|
|
|
46
47
|
})]
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
return e ? /* @__PURE__ */
|
|
50
|
+
function E({ pending: e, error: t, empty: n, tx: r }) {
|
|
51
|
+
return e ? /* @__PURE__ */ b(C, { children: /* @__PURE__ */ x(w, {
|
|
51
52
|
className: "flex items-center gap-3 p-6 text-sm text-muted-foreground",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
53
|
-
}) }) : t ? /* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ b(v, { className: "h-5 w-5 animate-spin" }), r("semanticfed.lineage.loading", "Computing lineage…")]
|
|
54
|
+
}) }) : t ? /* @__PURE__ */ b(C, { children: /* @__PURE__ */ x(w, {
|
|
54
55
|
className: "flex items-center gap-3 p-6 text-sm text-destructive",
|
|
55
56
|
"data-testid": "lineage-error",
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
}) }) : n ? /* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ b(g, { className: "h-5 w-5" }), l(t, r)]
|
|
58
|
+
}) }) : n ? /* @__PURE__ */ b(C, { children: /* @__PURE__ */ x(w, {
|
|
58
59
|
className: "flex items-center gap-3 p-6 text-sm text-muted-foreground",
|
|
59
60
|
"data-testid": "lineage-empty",
|
|
60
|
-
children: [/* @__PURE__ */ _
|
|
61
|
+
children: [/* @__PURE__ */ b(_, { className: "h-5 w-5" }), r("semanticfed.lineage.empty", "No lineage yet. Connect a data source and model an entity on it; lineage appears here as soon as records exist.")]
|
|
61
62
|
}) }) : null;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
let i =
|
|
65
|
-
|
|
64
|
+
function D() {
|
|
65
|
+
let i = u(), { locale: a } = h(), l = c(), f = p(null), [g, _] = m(null), [v, S] = m("BOTH"), [C, w] = m(null), [D, O] = m(""), k = s(g, v, C), { workspace: A, graph: j, nodesById: M, selected: N } = k;
|
|
66
|
+
d(() => {
|
|
67
|
+
if (!A.isSuccess || !j) return;
|
|
68
|
+
let e = `${v}:${!!g}:${j.nodes.length}`;
|
|
69
|
+
f.current !== e && (f.current = e, l.lineageInspected(v, !!g, j.nodes.length));
|
|
70
|
+
}, [
|
|
71
|
+
l,
|
|
72
|
+
A.isSuccess,
|
|
73
|
+
j,
|
|
74
|
+
v,
|
|
75
|
+
g
|
|
76
|
+
]);
|
|
77
|
+
let P = (e) => M.get(e)?.label ?? e;
|
|
78
|
+
return /* @__PURE__ */ x("div", {
|
|
66
79
|
className: "space-y-6 p-4 sm:p-6",
|
|
67
80
|
"data-testid": "semanticfed-lineage-page",
|
|
68
81
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
graph:
|
|
82
|
+
/* @__PURE__ */ b(T, {
|
|
83
|
+
graph: j,
|
|
71
84
|
tx: i
|
|
72
85
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
pending:
|
|
75
|
-
error:
|
|
76
|
-
empty:
|
|
86
|
+
/* @__PURE__ */ b(E, {
|
|
87
|
+
pending: A.isPending,
|
|
88
|
+
error: A.isError ? A.error : null,
|
|
89
|
+
empty: A.isSuccess && (j?.nodes.length ?? 0) === 0,
|
|
77
90
|
tx: i
|
|
78
91
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
warnings:
|
|
81
|
-
truncated:
|
|
82
|
-
nodeLabel:
|
|
83
|
-
onSelect:
|
|
92
|
+
/* @__PURE__ */ b(r, {
|
|
93
|
+
warnings: j?.warnings ?? [],
|
|
94
|
+
truncated: k.truncated,
|
|
95
|
+
nodeLabel: P,
|
|
96
|
+
onSelect: _,
|
|
84
97
|
tx: i
|
|
85
98
|
}),
|
|
86
|
-
|
|
87
|
-
search:
|
|
88
|
-
onSearchChange:
|
|
89
|
-
direction:
|
|
90
|
-
onDirectionChange:
|
|
91
|
-
depth:
|
|
92
|
-
onDepthChange:
|
|
93
|
-
hasSelection:
|
|
94
|
-
onClearSelection: () =>
|
|
99
|
+
j && j.nodes.length > 0 && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(n, {
|
|
100
|
+
search: D,
|
|
101
|
+
onSearchChange: O,
|
|
102
|
+
direction: v,
|
|
103
|
+
onDirectionChange: S,
|
|
104
|
+
depth: C,
|
|
105
|
+
onDepthChange: w,
|
|
106
|
+
hasSelection: N !== null,
|
|
107
|
+
onClearSelection: () => _(null),
|
|
95
108
|
tx: i
|
|
96
|
-
}), /* @__PURE__ */
|
|
109
|
+
}), /* @__PURE__ */ x("div", {
|
|
97
110
|
className: "grid gap-4 xl:grid-cols-[minmax(0,1fr)_22rem]",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
-
graph:
|
|
100
|
-
search:
|
|
101
|
-
selectedId:
|
|
102
|
-
highlighted:
|
|
103
|
-
onSelect:
|
|
111
|
+
children: [/* @__PURE__ */ b(t, {
|
|
112
|
+
graph: j,
|
|
113
|
+
search: D,
|
|
114
|
+
selectedId: g,
|
|
115
|
+
highlighted: k.highlighted,
|
|
116
|
+
onSelect: _,
|
|
104
117
|
tx: i
|
|
105
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ b(e, {
|
|
106
119
|
locale: a,
|
|
107
|
-
selected:
|
|
108
|
-
tracing:
|
|
109
|
-
traceError:
|
|
110
|
-
highlighted:
|
|
111
|
-
edges:
|
|
112
|
-
nodeLabel:
|
|
120
|
+
selected: N,
|
|
121
|
+
tracing: k.tracing,
|
|
122
|
+
traceError: k.traceError,
|
|
123
|
+
highlighted: k.highlighted,
|
|
124
|
+
edges: k.edges,
|
|
125
|
+
nodeLabel: P,
|
|
113
126
|
nodeKindLabel: (e) => {
|
|
114
|
-
let t =
|
|
127
|
+
let t = M.get(e);
|
|
115
128
|
return t ? o(i, t.kind) : "";
|
|
116
129
|
},
|
|
117
|
-
onSelect:
|
|
130
|
+
onSelect: _,
|
|
118
131
|
tx: i
|
|
119
132
|
})]
|
|
120
133
|
})] })
|
|
121
134
|
]
|
|
122
135
|
});
|
|
123
136
|
}
|
|
124
|
-
export {
|
|
137
|
+
export { D as LineagePage };
|
|
125
138
|
|
|
126
139
|
//# sourceMappingURL=LineagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineagePage.js","names":["_Fragment","LineageHeader","counts","useMemo","byKind","node","graph","tx","KIND_LABEL","kind","Icon","KIND_ICON","Badge","kindLabel","LineageStatus","pending","Card","CardContent","Loader2","error","AlertTriangle","lineageErrorMessage","empty","GitBranch","LineagePage","useTr","useI18n","selectedId","setSelectedId","useState","direction","setDirection","depth","setDepth","search","setSearch","trace","useLineageTrace","nodeLabel","nodesById","id","workspace","LineageWarnings","Fragment","LineageToolbar","selected","LineageLanes","LineageDetails"],"sources":["../../../src/semanticfed/pages/LineagePage.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n/**\n * Lineage page (BOFF-4279) — end-to-end lineage of the workspace's semantic\n * layer, read from the `semLineage` API.\n *\n * The workspace graph is laid out in lanes in the direction data flows\n * (sources → tables → entities → fields → models → queries). Selecting a node\n * asks the API for that record's upstream / downstream lineage and highlights\n * it; tables and unregistered columns (which have no SemanticFed record to\n * start a traversal from) are traced over the workspace graph instead.\n */\nimport { useMemo, useState } from 'react';\nimport { Badge, Card, CardContent } from '@burdenoff/fe-libs/ui';\nimport { AlertTriangle, GitBranch, Loader2 } from 'lucide-react';\n\nimport { LineageDetails } from '../components/lineage/LineageDetails';\nimport { LineageLanes } from '../components/lineage/LineageLanes';\nimport { LineageToolbar } from '../components/lineage/LineageToolbar';\nimport { LineageWarnings } from '../components/lineage/LineageWarnings';\nimport {\n KIND_ICON,\n KIND_LABEL,\n kindLabel,\n type LineageTx,\n} from '../components/lineage/lineageModel';\nimport { useLineageTrace } from '../components/lineage/useLineageTrace';\nimport {\n type SemLineageDirection,\n type SemLineageGraph,\n type SemLineageNodeKind,\n lineageErrorMessage,\n} from '../hooks/useLineage';\nimport { useTr } from '../hooks/useTr';\n\n/** Header with the number of nodes of each kind in the workspace graph. */\nfunction LineageHeader({ graph, tx }: { graph: SemLineageGraph | undefined; tx: LineageTx }) {\n const counts = useMemo(() => {\n const byKind: Partial<Record<SemLineageNodeKind, number>> = {};\n for (const node of graph?.nodes ?? []) byKind[node.kind] = (byKind[node.kind] ?? 0) + 1;\n return byKind;\n }, [graph]);\n return (\n <div\n className=\"flex flex-wrap items-center justify-between gap-3\"\n data-tour=\"semanticfed-lineage-header\"\n >\n <div>\n <h1 className=\"text-2xl font-semibold\">{tx('semanticfed.lineage.title', 'Lineage')}</h1>\n <p className=\"text-sm text-muted-foreground\">\n {tx(\n 'semanticfed.lineage.description',\n 'End-to-end lineage from connectors and data sources through tables, entities and fields to the models and saved queries that use them. Select anything to trace where its data comes from and what depends on it.'\n )}\n </p>\n </div>\n <div className=\"flex flex-wrap gap-2\" data-testid=\"lineage-counts\">\n {(Object.keys(KIND_LABEL) as SemLineageNodeKind[])\n .filter((kind) => counts[kind])\n .map((kind) => {\n const Icon = KIND_ICON[kind];\n return (\n <Badge key={kind} variant=\"outline\" className=\"gap-1\">\n <Icon className=\"h-3 w-3\" />\n {counts[kind]} {kindLabel(tx, kind)}\n </Badge>\n );\n })}\n </div>\n </div>\n );\n}\n\n/** Loading, failed and empty states of the workspace graph. */\nfunction LineageStatus({\n pending,\n error,\n empty,\n tx,\n}: {\n pending: boolean;\n error: unknown;\n empty: boolean;\n tx: LineageTx;\n}) {\n if (pending) {\n return (\n <Card>\n <CardContent className=\"flex items-center gap-3 p-6 text-sm text-muted-foreground\">\n <Loader2 className=\"h-5 w-5 animate-spin\" />\n {tx('semanticfed.lineage.loading', 'Computing lineage…')}\n </CardContent>\n </Card>\n );\n }\n if (error) {\n return (\n <Card>\n <CardContent\n className=\"flex items-center gap-3 p-6 text-sm text-destructive\"\n data-testid=\"lineage-error\"\n >\n <AlertTriangle className=\"h-5 w-5\" />\n {lineageErrorMessage(error, tx)}\n </CardContent>\n </Card>\n );\n }\n if (empty) {\n return (\n <Card>\n <CardContent\n className=\"flex items-center gap-3 p-6 text-sm text-muted-foreground\"\n data-testid=\"lineage-empty\"\n >\n <GitBranch className=\"h-5 w-5\" />\n {tx(\n 'semanticfed.lineage.empty',\n 'No lineage yet. Connect a data source and model an entity on it; lineage appears here as soon as records exist.'\n )}\n </CardContent>\n </Card>\n );\n }\n return null;\n}\n\nexport function LineagePage() {\n const tx = useTr();\n const { locale } = useI18n();\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [direction, setDirection] = useState<SemLineageDirection>('BOTH');\n const [depth, setDepth] = useState<number | null>(null);\n const [search, setSearch] = useState('');\n const trace = useLineageTrace(selectedId, direction, depth);\n const { workspace, graph, nodesById, selected } = trace;\n\n const nodeLabel = (id: string) => nodesById.get(id)?.label ?? id;\n const nodeKindLabel = (id: string) => {\n const node = nodesById.get(id);\n return node ? kindLabel(tx, node.kind) : '';\n };\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\" data-testid=\"semanticfed-lineage-page\">\n <LineageHeader graph={graph} tx={tx} />\n\n <LineageStatus\n pending={workspace.isPending}\n error={workspace.isError ? workspace.error : null}\n empty={workspace.isSuccess && (graph?.nodes.length ?? 0) === 0}\n tx={tx}\n />\n\n <LineageWarnings\n warnings={graph?.warnings ?? []}\n truncated={trace.truncated}\n nodeLabel={nodeLabel}\n onSelect={setSelectedId}\n tx={tx}\n />\n\n {graph && graph.nodes.length > 0 && (\n <>\n <LineageToolbar\n search={search}\n onSearchChange={setSearch}\n direction={direction}\n onDirectionChange={setDirection}\n depth={depth}\n onDepthChange={setDepth}\n hasSelection={selected !== null}\n onClearSelection={() => setSelectedId(null)}\n tx={tx}\n />\n\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1fr)_22rem]\">\n <LineageLanes\n graph={graph}\n search={search}\n selectedId={selectedId}\n highlighted={trace.highlighted}\n onSelect={setSelectedId}\n tx={tx}\n />\n <LineageDetails\n locale={locale}\n selected={selected}\n tracing={trace.tracing}\n traceError={trace.traceError}\n highlighted={trace.highlighted}\n edges={trace.edges}\n nodeLabel={nodeLabel}\n nodeKindLabel={nodeKindLabel}\n onSelect={setSelectedId}\n tx={tx}\n />\n </div>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,SAASC,EAAc,EAAE,UAAO,SAA6D;CAC3F,IAAMC,IAASC,QAAc;EAC3B,IAAMC,IAAsD,CAAC;EAC7D,KAAK,IAAMC,KAAQC,GAAO,SAAS,CAAC,GAAG,EAAOD,EAAK,SAASD,EAAOC,EAAK,SAAS,KAAK;EACtF,OAAOD;CACT,GAAG,CAACE,CAAK,CAAC;CACV,OACE,kBAAC,OAAD;EACE,WAAU;EACV,aAAU;EAFZ,UAAA,CAIE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;GAA0B,UAAAC,EAAG,6BAA6B,SAAS;EAAM,CAAA,GACvF,kBAAC,KAAD;GAAG,WAAU;GACV,UAAAA,EACC,mCACA,mNACF;EACC,CAAA,CACA,EAAA,CAAA,GACL,kBAAC,OAAD;GAAK,WAAU;GAAuB,eAAY;GAC9C,UAAA,OAAO,KAAKC,CAAU,CAAC,CACtB,QAAQ,MAASN,EAAOO,EAAK,CAAC,CAC9B,KAAK,MAAS;IACb,IAAMC,IAAOC,EAAUF;IACvB,OACE,kBAACG,GAAD;KAAkB,SAAQ;K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;GACE,kBAACvC,GAAD;IAAsB;IAAW;GAAK,CAAA;GAEtC,kBAACa,GAAD;IACE,SAAS2B,EAAU;IACnB,OAAOA,EAAU,UAAUA,EAAU,QAAQ;IAC7C,OAAOA,EAAU,cAAcnC,GAAO,MAAM,UAAU,OAAO;IACzD;GACL,CAAA;GAED,kBAACoC,GAAD;IACE,UAAUpC,GAAO,YAAY,CAAC;IAC9B,WAAW8B,EAAM;IACN;IACX,UAAUR;IACN;GACL,CAAA;GAEAtB,KAASA,EAAM,MAAM,SAAS,KAC7B,kBAAAN,GAAA,EAAA,UAAA,CACE,kBAAC4C,GAAD;IACU;IACR,gBAAgBT;IACL;IACX,mBAAmBJ;IACZ;IACP,eAAeE;IACf,cAAcY,MAAa;IAC3B,wBAAwBjB,EAAc,IAAI;IACtC;GACL,CAAA,GAED,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACkB,GAAD;KACS;KACC;KACI;KACZ,aAAaV,EAAM;KACnB,UAAUR;KACN;IACL,CAAA,GACD,kBAACmB,GAAD;KACU;KACE;KACV,SAASX,EAAM;KACf,YAAYA,EAAM;KAClB,aAAaA,EAAM;KACnB,OAAOA,EAAM;KACF;KACI,gBAvDJ,MAAe;MACpC,IAAM/B,IAAOkC,EAAU,IAAIC,CAAE;MAC7B,OAAOnC,IAAOQ,EAAUN,GAAIF,EAAK,IAAI,IAAI;KAC3C;KAqDY,UAAUuB;KACN;IACL,CAAA,CACE;GACL,CAAA,CAAA,EAAA,CAAA;EAED;;AAET"}
|
|
1
|
+
{"version":3,"file":"LineagePage.js","names":["_Fragment","LineageHeader","counts","useMemo","byKind","node","graph","tx","KIND_LABEL","kind","Icon","KIND_ICON","Badge","kindLabel","LineageStatus","pending","Card","CardContent","Loader2","error","AlertTriangle","lineageErrorMessage","empty","GitBranch","LineagePage","useTr","useI18n","analytics","useClientAnalytics","lastTrackedRef","useRef","selectedId","setSelectedId","useState","direction","setDirection","depth","setDepth","search","setSearch","trace","useLineageTrace","workspace","key","nodeLabel","nodesById","id","LineageWarnings","Fragment","LineageToolbar","selected","LineageLanes","LineageDetails"],"sources":["../../../src/semanticfed/pages/LineagePage.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n/**\n * Lineage page (BOFF-4279) — end-to-end lineage of the workspace's semantic\n * layer, read from the `semLineage` API.\n *\n * The workspace graph is laid out in lanes in the direction data flows\n * (sources → tables → entities → fields → models → queries). Selecting a node\n * asks the API for that record's upstream / downstream lineage and highlights\n * it; tables and unregistered columns (which have no SemanticFed record to\n * start a traversal from) are traced over the workspace graph instead.\n */\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { Badge, Card, CardContent } from '@burdenoff/fe-libs/ui';\nimport { AlertTriangle, GitBranch, Loader2 } from 'lucide-react';\n\nimport { LineageDetails } from '../components/lineage/LineageDetails';\nimport { LineageLanes } from '../components/lineage/LineageLanes';\nimport { LineageToolbar } from '../components/lineage/LineageToolbar';\nimport { LineageWarnings } from '../components/lineage/LineageWarnings';\nimport {\n KIND_ICON,\n KIND_LABEL,\n kindLabel,\n type LineageTx,\n} from '../components/lineage/lineageModel';\nimport { useLineageTrace } from '../components/lineage/useLineageTrace';\nimport { useClientAnalytics } from '../hooks/useClientAnalytics';\nimport {\n type SemLineageDirection,\n type SemLineageGraph,\n type SemLineageNodeKind,\n lineageErrorMessage,\n} from '../hooks/useLineage';\nimport { useTr } from '../hooks/useTr';\n\n/** Header with the number of nodes of each kind in the workspace graph. */\nfunction LineageHeader({ graph, tx }: { graph: SemLineageGraph | undefined; tx: LineageTx }) {\n const counts = useMemo(() => {\n const byKind: Partial<Record<SemLineageNodeKind, number>> = {};\n for (const node of graph?.nodes ?? []) byKind[node.kind] = (byKind[node.kind] ?? 0) + 1;\n return byKind;\n }, [graph]);\n return (\n <div\n className=\"flex flex-wrap items-center justify-between gap-3\"\n data-tour=\"semanticfed-lineage-header\"\n >\n <div>\n <h1 className=\"text-2xl font-semibold\">{tx('semanticfed.lineage.title', 'Lineage')}</h1>\n <p className=\"text-sm text-muted-foreground\">\n {tx(\n 'semanticfed.lineage.description',\n 'End-to-end lineage from connectors and data sources through tables, entities and fields to the models and saved queries that use them. Select anything to trace where its data comes from and what depends on it.'\n )}\n </p>\n </div>\n <div className=\"flex flex-wrap gap-2\" data-testid=\"lineage-counts\">\n {(Object.keys(KIND_LABEL) as SemLineageNodeKind[])\n .filter((kind) => counts[kind])\n .map((kind) => {\n const Icon = KIND_ICON[kind];\n return (\n <Badge key={kind} variant=\"outline\" className=\"gap-1\">\n <Icon className=\"h-3 w-3\" />\n {counts[kind]} {kindLabel(tx, kind)}\n </Badge>\n );\n })}\n </div>\n </div>\n );\n}\n\n/** Loading, failed and empty states of the workspace graph. */\nfunction LineageStatus({\n pending,\n error,\n empty,\n tx,\n}: {\n pending: boolean;\n error: unknown;\n empty: boolean;\n tx: LineageTx;\n}) {\n if (pending) {\n return (\n <Card>\n <CardContent className=\"flex items-center gap-3 p-6 text-sm text-muted-foreground\">\n <Loader2 className=\"h-5 w-5 animate-spin\" />\n {tx('semanticfed.lineage.loading', 'Computing lineage…')}\n </CardContent>\n </Card>\n );\n }\n if (error) {\n return (\n <Card>\n <CardContent\n className=\"flex items-center gap-3 p-6 text-sm text-destructive\"\n data-testid=\"lineage-error\"\n >\n <AlertTriangle className=\"h-5 w-5\" />\n {lineageErrorMessage(error, tx)}\n </CardContent>\n </Card>\n );\n }\n if (empty) {\n return (\n <Card>\n <CardContent\n className=\"flex items-center gap-3 p-6 text-sm text-muted-foreground\"\n data-testid=\"lineage-empty\"\n >\n <GitBranch className=\"h-5 w-5\" />\n {tx(\n 'semanticfed.lineage.empty',\n 'No lineage yet. Connect a data source and model an entity on it; lineage appears here as soon as records exist.'\n )}\n </CardContent>\n </Card>\n );\n }\n return null;\n}\n\nexport function LineagePage() {\n const tx = useTr();\n const { locale } = useI18n();\n const analytics = useClientAnalytics();\n const lastTrackedRef = useRef<string | null>(null);\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [direction, setDirection] = useState<SemLineageDirection>('BOTH');\n const [depth, setDepth] = useState<number | null>(null);\n const [search, setSearch] = useState('');\n const trace = useLineageTrace(selectedId, direction, depth);\n const { workspace, graph, nodesById, selected } = trace;\n\n useEffect(() => {\n if (!workspace.isSuccess || !graph) return;\n const key = `${direction}:${Boolean(selectedId)}:${graph.nodes.length}`;\n if (lastTrackedRef.current === key) return;\n lastTrackedRef.current = key;\n analytics.lineageInspected(direction, Boolean(selectedId), graph.nodes.length);\n }, [analytics, workspace.isSuccess, graph, direction, selectedId]);\n\n const nodeLabel = (id: string) => nodesById.get(id)?.label ?? id;\n const nodeKindLabel = (id: string) => {\n const node = nodesById.get(id);\n return node ? kindLabel(tx, node.kind) : '';\n };\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\" data-testid=\"semanticfed-lineage-page\">\n <LineageHeader graph={graph} tx={tx} />\n\n <LineageStatus\n pending={workspace.isPending}\n error={workspace.isError ? workspace.error : null}\n empty={workspace.isSuccess && (graph?.nodes.length ?? 0) === 0}\n tx={tx}\n />\n\n <LineageWarnings\n warnings={graph?.warnings ?? []}\n truncated={trace.truncated}\n nodeLabel={nodeLabel}\n onSelect={setSelectedId}\n tx={tx}\n />\n\n {graph && graph.nodes.length > 0 && (\n <>\n <LineageToolbar\n search={search}\n onSearchChange={setSearch}\n direction={direction}\n onDirectionChange={setDirection}\n depth={depth}\n onDepthChange={setDepth}\n hasSelection={selected !== null}\n onClearSelection={() => setSelectedId(null)}\n tx={tx}\n />\n\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1fr)_22rem]\">\n <LineageLanes\n graph={graph}\n search={search}\n selectedId={selectedId}\n highlighted={trace.highlighted}\n onSelect={setSelectedId}\n tx={tx}\n />\n <LineageDetails\n locale={locale}\n selected={selected}\n tracing={trace.tracing}\n traceError={trace.traceError}\n highlighted={trace.highlighted}\n edges={trace.edges}\n nodeLabel={nodeLabel}\n nodeKindLabel={nodeKindLabel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AU;IACnB,OAAOA,EAAU,UAAUA,EAAU,QAAQ;IAC7C,OAAOA,EAAU,cAAcpC,GAAO,MAAM,UAAU,OAAO;IACzD;GACL,CAAA;GAED,kBAACyC,GAAD;IACE,UAAUzC,GAAO,YAAY,CAAC;IAC9B,WAAWkC,EAAM;IACN;IACX,UAAUR;IACN;GACL,CAAA;GAEA1B,KAASA,EAAM,MAAM,SAAS,KAC7B,kBAAAN,GAAA,EAAA,UAAA,CACE,kBAACiD,GAAD;IACU;IACR,gBAAgBV;IACL;IACX,mBAAmBJ;IACZ;IACP,eAAeE;IACf,cAAca,MAAa;IAC3B,wBAAwBlB,EAAc,IAAI;IACtC;GACL,CAAA,GAED,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACmB,GAAD;KACS;KACC;KACI;KACZ,aAAaX,EAAM;KACnB,UAAUR;KACN;IACL,CAAA,GACD,kBAACoB,GAAD;KACU;KACE;KACV,SAASZ,EAAM;KACf,YAAYA,EAAM;KAClB,aAAaA,EAAM;KACnB,OAAOA,EAAM;KACF;KACI,gBAvDJ,MAAe;MACpC,IAAMnC,IAAOwC,EAAU,IAAIC,CAAE;MAC7B,OAAOzC,IAAOQ,EAAUN,GAAIF,EAAK,IAAI,IAAI;KAC3C;KAqDY,UAAU2B;KACN;IACL,CAAA,CACE;GACL,CAAA,CAAA,EAAA,CAAA;EAED;;AAET"}
|
|
@@ -1,236 +1,97 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { clearGraphqlReadCaches as e } from "../api/semanticfedGraphql.js";
|
|
2
|
+
import { useSemRequest as t } from "../hooks/useSemRequest.js";
|
|
3
|
+
import { useTr as n } from "../hooks/useTr.js";
|
|
4
|
+
import { useSemanticFed as r } from "../providers/SemanticFedProvider.js";
|
|
5
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Pagination as m } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { usePagination as h } from "@burdenoff/fe-libs/shared/hooks";
|
|
7
9
|
// src/semanticfed/pages/MonitoringPage.tsx
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
children:
|
|
56
|
-
}), /* @__PURE__ */ p("p", {
|
|
57
|
-
className: "text-sm text-muted-foreground",
|
|
58
|
-
children: C("semanticfed.monitoring.description", "Real-time metrics for SPARQL throughput, triple ingestion, reasoning queues, and endpoint health.")
|
|
59
|
-
})] }), /* @__PURE__ */ m("div", {
|
|
60
|
-
className: "flex gap-2",
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ m(h, {
|
|
63
|
-
variant: "default",
|
|
64
|
-
className: "gap-1",
|
|
65
|
-
children: [/* @__PURE__ */ p(a, { className: "h-3 w-3" }), C("semanticfed.monitoring.badges.healthyCount", "{count} healthy", { count: D })]
|
|
66
|
-
}),
|
|
67
|
-
O > 0 && /* @__PURE__ */ m(h, {
|
|
68
|
-
variant: "secondary",
|
|
69
|
-
className: "gap-1",
|
|
70
|
-
children: [/* @__PURE__ */ p(i, { className: "h-3 w-3" }), C("semanticfed.monitoring.badges.warningCount", "{count} warning", { count: O })]
|
|
71
|
-
}),
|
|
72
|
-
k > 0 && /* @__PURE__ */ m(h, {
|
|
73
|
-
variant: "destructive",
|
|
74
|
-
className: "gap-1",
|
|
75
|
-
children: [/* @__PURE__ */ p(f, { className: "h-3 w-3" }), C("semanticfed.monitoring.badges.criticalCount", "{count} critical", { count: k })]
|
|
76
|
-
})
|
|
77
|
-
]
|
|
10
|
+
var g = 20, _ = "\n query SemanticFedDataSourceStatus($pagination: PaginationInput!) {\n semListDataSources(pagination: $pagination) {\n items { id name status }\n pageInfo { hasMore }\n }\n }\n";
|
|
11
|
+
function v() {
|
|
12
|
+
let u = n(), { request: d } = t(), { currentUser: f, organizationId: p, workspaceId: v, projectId: y, tenantId: b, apiGatewayUrl: x } = r(), S = h({ initialPageSize: g }), C = i({
|
|
13
|
+
queryKey: [
|
|
14
|
+
"semanticfed",
|
|
15
|
+
"sourceStatus",
|
|
16
|
+
f?.id,
|
|
17
|
+
p,
|
|
18
|
+
v,
|
|
19
|
+
y,
|
|
20
|
+
b,
|
|
21
|
+
x,
|
|
22
|
+
S.offset
|
|
23
|
+
],
|
|
24
|
+
retry: !1,
|
|
25
|
+
queryFn: ({ signal: e }) => d(_, { pagination: S.pagination }, e)
|
|
26
|
+
}), w = {
|
|
27
|
+
CONNECTED: u("semanticfed.sourceStatus.connected", "Connected"),
|
|
28
|
+
DEGRADED: u("semanticfed.sourceStatus.degraded", "Degraded"),
|
|
29
|
+
DISABLED: u("semanticfed.sourceStatus.disabled", "Disabled"),
|
|
30
|
+
DISCONNECTED: u("semanticfed.sourceStatus.disconnected", "Disconnected"),
|
|
31
|
+
DRAFT: u("semanticfed.sourceStatus.draft", "Draft")
|
|
32
|
+
}, T = C.data?.semListDataSources;
|
|
33
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
34
|
+
/* @__PURE__ */ o("div", {
|
|
35
|
+
className: "flex justify-end",
|
|
36
|
+
children: /* @__PURE__ */ o(l, {
|
|
37
|
+
variant: "outline",
|
|
38
|
+
disabled: C.isFetching,
|
|
39
|
+
onClick: () => {
|
|
40
|
+
e(), C.refetch();
|
|
41
|
+
},
|
|
42
|
+
children: u("semanticfed.sourceStatus.refresh", "Refresh")
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
C.isError ? /* @__PURE__ */ o("p", {
|
|
46
|
+
role: "alert",
|
|
47
|
+
children: u("semanticfed.sourceStatus.error", "Data source status could not be loaded. Check your read permission and refresh.")
|
|
48
|
+
}) : T ? T.items.length ? /* @__PURE__ */ o("ul", {
|
|
49
|
+
className: "divide-y rounded-md border",
|
|
50
|
+
children: T.items.map((e) => /* @__PURE__ */ s("li", {
|
|
51
|
+
className: "flex flex-wrap items-center justify-between gap-2 p-3",
|
|
52
|
+
children: [/* @__PURE__ */ o("span", {
|
|
53
|
+
className: "min-w-0 break-words font-medium",
|
|
54
|
+
children: e.name
|
|
55
|
+
}), /* @__PURE__ */ o(c, {
|
|
56
|
+
variant: "outline",
|
|
57
|
+
children: w[e.status] ?? u("semanticfed.sourceStatus.unknown", "Unknown")
|
|
78
58
|
})]
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}), /* @__PURE__ */ p("p", {
|
|
114
|
-
className: "text-xs text-muted-foreground",
|
|
115
|
-
children: C("semanticfed.monitoring.kpis.agentUptime.subtitle", "agents running")
|
|
116
|
-
})] })] }),
|
|
117
|
-
/* @__PURE__ */ m(g, { children: [/* @__PURE__ */ m(v, {
|
|
118
|
-
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
119
|
-
children: [/* @__PURE__ */ p(y, {
|
|
120
|
-
className: "text-sm font-medium",
|
|
121
|
-
children: C("semanticfed.monitoring.kpis.totalTriplesServed.title", "Total Triples Served")
|
|
122
|
-
}), /* @__PURE__ */ p(s, { className: "h-4 w-4 text-muted-foreground" })]
|
|
123
|
-
}), /* @__PURE__ */ m(_, { children: [/* @__PURE__ */ m("div", {
|
|
124
|
-
className: "text-2xl font-bold",
|
|
125
|
-
children: [(d.reduce((e, t) => e + t.triplesServed, 0) / 1e6).toFixed(1), "M"]
|
|
126
|
-
}), /* @__PURE__ */ p("p", {
|
|
127
|
-
className: "text-xs text-muted-foreground",
|
|
128
|
-
children: C("semanticfed.monitoring.kpis.totalTriplesServed.subtitle", "across all endpoints")
|
|
129
|
-
})] })] }),
|
|
130
|
-
/* @__PURE__ */ m(g, { children: [/* @__PURE__ */ m(v, {
|
|
131
|
-
className: "flex flex-row items-center justify-between space-y-0 pb-2",
|
|
132
|
-
children: [/* @__PURE__ */ p(y, {
|
|
133
|
-
className: "text-sm font-medium",
|
|
134
|
-
children: C("semanticfed.monitoring.kpis.avgLatency.title", "Avg Latency")
|
|
135
|
-
}), /* @__PURE__ */ p(c, { className: "h-4 w-4 text-muted-foreground" })]
|
|
136
|
-
}), /* @__PURE__ */ m(_, { children: [/* @__PURE__ */ m("div", {
|
|
137
|
-
className: "text-2xl font-bold",
|
|
138
|
-
children: [Math.round(d.filter((e) => e.status === "online").reduce((e, t) => e + t.latencyMs, 0) / Math.max(d.filter((e) => e.status === "online").length, 1)), "ms"]
|
|
139
|
-
}), /* @__PURE__ */ p("p", {
|
|
140
|
-
className: "text-xs text-muted-foreground",
|
|
141
|
-
children: C("semanticfed.monitoring.kpis.avgLatency.subtitle", "p50 response time")
|
|
142
|
-
})] })] })
|
|
143
|
-
]
|
|
144
|
-
}),
|
|
145
|
-
/* @__PURE__ */ m(g, { children: [/* @__PURE__ */ p(v, { children: /* @__PURE__ */ p(y, {
|
|
146
|
-
className: "text-base",
|
|
147
|
-
children: C("semanticfed.monitoring.systemMetrics.title", "System Metrics")
|
|
148
|
-
}) }), /* @__PURE__ */ p(_, { children: /* @__PURE__ */ p("div", {
|
|
149
|
-
className: "grid gap-4 md:grid-cols-2",
|
|
150
|
-
children: u.map((e) => {
|
|
151
|
-
let t = x[e.status], n = Math.min(e.value / e.threshold * 100, 100);
|
|
152
|
-
return /* @__PURE__ */ m("div", {
|
|
153
|
-
className: "flex items-center gap-4 rounded border p-4",
|
|
154
|
-
children: [t.icon, /* @__PURE__ */ m("div", {
|
|
155
|
-
className: "min-w-0 flex-1",
|
|
156
|
-
children: [
|
|
157
|
-
/* @__PURE__ */ m("div", {
|
|
158
|
-
className: "flex items-center justify-between",
|
|
159
|
-
children: [/* @__PURE__ */ p("p", {
|
|
160
|
-
className: "text-sm font-medium",
|
|
161
|
-
children: w[e.name] ?? e.name
|
|
162
|
-
}), /* @__PURE__ */ p(h, {
|
|
163
|
-
variant: t.badge,
|
|
164
|
-
className: "text-xs",
|
|
165
|
-
children: T[e.status] ?? e.status
|
|
166
|
-
})]
|
|
167
|
-
}),
|
|
168
|
-
/* @__PURE__ */ m("div", {
|
|
169
|
-
className: "mt-2 flex items-center gap-2",
|
|
170
|
-
children: [/* @__PURE__ */ p("div", {
|
|
171
|
-
className: "h-2 flex-1 rounded-full bg-muted",
|
|
172
|
-
children: /* @__PURE__ */ p("div", {
|
|
173
|
-
className: `h-2 rounded-full ${e.status === "healthy" ? "bg-status-success-bg" : e.status === "warning" ? "bg-status-warning-bg" : "bg-status-error-bg"}`,
|
|
174
|
-
style: { width: `${n}%` }
|
|
175
|
-
})
|
|
176
|
-
}), /* @__PURE__ */ m("span", {
|
|
177
|
-
className: `text-sm font-mono font-medium ${t.color}`,
|
|
178
|
-
children: [e.value, e.unit]
|
|
179
|
-
})]
|
|
180
|
-
}),
|
|
181
|
-
/* @__PURE__ */ m("div", {
|
|
182
|
-
className: "mt-1 flex items-center gap-2 text-xs text-muted-foreground",
|
|
183
|
-
children: [/* @__PURE__ */ m("span", {
|
|
184
|
-
className: "flex items-center gap-1",
|
|
185
|
-
children: [
|
|
186
|
-
b[e.trend],
|
|
187
|
-
" ",
|
|
188
|
-
E[e.trend] ?? e.trend
|
|
189
|
-
]
|
|
190
|
-
}), /* @__PURE__ */ p("span", { children: C("semanticfed.monitoring.systemMetrics.threshold", "Threshold: {value}{unit}", {
|
|
191
|
-
value: e.threshold,
|
|
192
|
-
unit: e.unit
|
|
193
|
-
}) })]
|
|
194
|
-
})
|
|
195
|
-
]
|
|
196
|
-
})]
|
|
197
|
-
}, e.id);
|
|
198
|
-
})
|
|
199
|
-
}) })] }),
|
|
200
|
-
/* @__PURE__ */ m(g, { children: [/* @__PURE__ */ p(v, { children: /* @__PURE__ */ p(y, {
|
|
201
|
-
className: "text-base",
|
|
202
|
-
children: C("semanticfed.monitoring.endpointLatency.title", "Endpoint Latency Breakdown")
|
|
203
|
-
}) }), /* @__PURE__ */ p(_, {
|
|
204
|
-
className: "space-y-2",
|
|
205
|
-
children: d.map((e) => /* @__PURE__ */ m("div", {
|
|
206
|
-
className: "flex items-center gap-3",
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ p("span", { className: `h-2 w-2 rounded-full ${e.status === "online" ? "bg-status-success-bg" : e.status === "degraded" ? "bg-status-warning-bg" : "bg-status-error-bg"}` }),
|
|
209
|
-
/* @__PURE__ */ p("span", {
|
|
210
|
-
className: "w-48 truncate text-sm",
|
|
211
|
-
children: e.name
|
|
212
|
-
}),
|
|
213
|
-
/* @__PURE__ */ p("div", {
|
|
214
|
-
className: "h-3 flex-1 overflow-hidden rounded bg-muted",
|
|
215
|
-
children: /* @__PURE__ */ p("div", {
|
|
216
|
-
className: `h-3 rounded ${e.latencyMs < 100 ? "bg-status-success-bg" : e.latencyMs < 300 ? "bg-status-warning-bg" : "bg-status-error-bg"}`,
|
|
217
|
-
style: { width: `${Math.min(e.latencyMs / 500 * 100, 100)}%` }
|
|
218
|
-
})
|
|
219
|
-
}),
|
|
220
|
-
/* @__PURE__ */ m("span", {
|
|
221
|
-
className: "w-16 text-end text-sm font-mono",
|
|
222
|
-
children: [e.latencyMs, "ms"]
|
|
223
|
-
}),
|
|
224
|
-
/* @__PURE__ */ p("span", {
|
|
225
|
-
className: "w-20 text-end text-xs text-muted-foreground",
|
|
226
|
-
children: e.lastSyncAt
|
|
227
|
-
})
|
|
228
|
-
]
|
|
229
|
-
}, e.id))
|
|
230
|
-
})] })
|
|
231
|
-
]
|
|
59
|
+
}, e.id))
|
|
60
|
+
}) : /* @__PURE__ */ o("p", {
|
|
61
|
+
role: "status",
|
|
62
|
+
children: u("semanticfed.sourceStatus.empty", "No data sources on this page.")
|
|
63
|
+
}) : /* @__PURE__ */ o("p", {
|
|
64
|
+
role: "status",
|
|
65
|
+
children: u("semanticfed.sourceStatus.loading", "Loading data sources…")
|
|
66
|
+
}),
|
|
67
|
+
S.page > 1 || T?.pageInfo.hasMore ? /* @__PURE__ */ o(m, {
|
|
68
|
+
page: S.page,
|
|
69
|
+
pageSize: S.pageSize,
|
|
70
|
+
hasNextPage: T?.pageInfo.hasMore ?? !1,
|
|
71
|
+
loading: C.isFetching,
|
|
72
|
+
onPageChange: S.setPage
|
|
73
|
+
}) : null
|
|
74
|
+
] });
|
|
75
|
+
}
|
|
76
|
+
function y() {
|
|
77
|
+
let e = n(), { ready: i } = t(), { organizationId: a } = r();
|
|
78
|
+
return /* @__PURE__ */ s("section", {
|
|
79
|
+
className: "space-y-6 p-4 md:p-6",
|
|
80
|
+
children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h1", {
|
|
81
|
+
className: "text-2xl font-semibold",
|
|
82
|
+
children: e("semanticfed.sourceStatus.monitoring", "Monitoring")
|
|
83
|
+
}), /* @__PURE__ */ o("p", {
|
|
84
|
+
className: "text-sm text-muted-foreground",
|
|
85
|
+
children: e("semanticfed.sourceStatus.description", "Review the connection statuses recorded for your workspace data sources.")
|
|
86
|
+
})] }), /* @__PURE__ */ s(u, { children: [/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(p, { children: e("semanticfed.sourceStatus.title", "Data source status") }) }), /* @__PURE__ */ o(d, {
|
|
87
|
+
className: "space-y-4",
|
|
88
|
+
children: i && a ? /* @__PURE__ */ o(v, {}) : /* @__PURE__ */ o("p", {
|
|
89
|
+
role: "status",
|
|
90
|
+
children: e("semanticfed.sourceStatus.contextRequired", "Select a workspace to view data sources.")
|
|
91
|
+
})
|
|
92
|
+
})] })]
|
|
232
93
|
});
|
|
233
94
|
}
|
|
234
|
-
export {
|
|
95
|
+
export { y as MonitoringPage };
|
|
235
96
|
|
|
236
97
|
//# sourceMappingURL=MonitoringPage.js.map
|