@burdenoff/microfe-bigconsole 2026.1123.6 → 2026.1124.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/asof/AsOfControl.js +2 -2
- package/dist/bigconsole/components/dashboard/DashboardCommentsDrawer.js +107 -106
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.d.ts +34 -0
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.js +123 -0
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.js +1 -1
- package/dist/bigconsole/components/dashboard/DashboardStatusPill.js +19 -35
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +119 -116
- package/dist/bigconsole/components/dashboard/LiveCanvasToggle.js +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.d.ts +0 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +172 -170
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +210 -208
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +97 -97
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +92 -92
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +149 -149
- package/dist/bigconsole/components/datasink/AnomalyDetectorPanel.js +54 -54
- package/dist/bigconsole/components/datasink/DataSinkStatusBadge.js +30 -37
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +4 -4
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +130 -129
- package/dist/bigconsole/components/datasink/SetupStateBadge.js +24 -33
- package/dist/bigconsole/components/datasink/SinkWorkflowLinkForm.js +38 -38
- package/dist/bigconsole/components/explore/CreateQueryWidget.js +57 -56
- package/dist/bigconsole/components/explore/SqlDraftEditor.js +140 -140
- package/dist/bigconsole/components/explore/VisualBuilder.js +85 -84
- package/dist/bigconsole/components/explore/queryAccess/GrantsPanel.js +168 -167
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessAdmin.js +2 -2
- package/dist/bigconsole/components/explore/queryAccess/RelationEditor.js +118 -117
- package/dist/bigconsole/components/insights/BoardLintPanel.js +2 -2
- package/dist/bigconsole/components/insights/OutlierSpottingDialog.js +123 -123
- package/dist/bigconsole/components/kpi-change/KpiChangePanel.js +2 -2
- package/dist/bigconsole/components/narrative/NarrativePanel.js +1 -1
- package/dist/bigconsole/components/overview/DataHealthCard.js +3 -0
- package/dist/bigconsole/components/overview/RecentDashboardsPanel.js +3 -0
- package/dist/bigconsole/components/parser/ParserStatusBadge.js +25 -28
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +23 -22
- package/dist/bigconsole/components/pipeline/PipelineStatusBadge.js +15 -26
- package/dist/bigconsole/components/reconcile/KpiReconcileDialog.js +24 -24
- package/dist/bigconsole/components/settings/WidgetCatalogSection.js +1 -1
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +188 -187
- package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +1 -1
- package/dist/bigconsole/components/widgets/UnsupportedDataSourceNotice.js +1 -1
- package/dist/bigconsole/components/widgets/WidgetCompareView.js +3 -1
- package/dist/bigconsole/components/widgets/WidgetHeader.js +1 -1
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +45 -44
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +151 -147
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +48 -47
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +1 -1
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +139 -138
- package/dist/bigconsole/components/widgets/form/FormWidget.js +149 -148
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +80 -77
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +58 -56
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +75 -73
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +86 -85
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +80 -77
- package/dist/bigconsole/components/widgets/retention/RetentionView.js +1 -1
- package/dist/bigconsole/components/widgets/table/TableConfig.js +214 -211
- package/dist/bigconsole/components/widgets/table/TablePagination.js +59 -58
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +140 -138
- package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js +74 -66
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +48 -48
- package/dist/bigconsole/components/workflow/WorkflowStatusBadge.js +28 -37
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +69 -69
- package/dist/bigconsole/hooks/useDashboardListQuery.d.ts +22 -0
- package/dist/bigconsole/hooks/useDashboardListQuery.js +39 -0
- package/dist/bigconsole/pages/AdminPage.js +147 -146
- package/dist/bigconsole/pages/DashboardViewPage.js +2 -0
- package/dist/bigconsole/pages/DashboardsPage.js +638 -855
- package/dist/bigconsole/pages/DataParsersPage.js +5 -0
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +4 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +263 -261
- package/dist/bigconsole/pages/DataSinksPage.js +210 -186
- package/dist/bigconsole/pages/InsightsPage.js +386 -383
- package/dist/bigconsole/pages/ParserBuilderPage.js +413 -413
- package/dist/bigconsole/pages/ParserViewPage.js +2 -0
- package/dist/bigconsole/pages/PipelineBuilderPage.js +279 -276
- package/dist/bigconsole/pages/PipelineViewPage.js +3 -0
- package/dist/bigconsole/pages/PipelinesPage.js +198 -165
- package/dist/bigconsole/pages/SettingsPage.js +160 -160
- package/dist/bigconsole/pages/WidgetDemoPage.js +2 -0
- package/dist/bigconsole/pages/WorkflowViewPage.js +5 -0
- package/dist/bigconsole/pages/WorkflowsPage.js +144 -123
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +1 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +123 -122
- package/dist/bigconsole/utils/dashboardGallery.d.ts +84 -0
- package/dist/bigconsole/utils/dashboardGallery.js +93 -0
- package/dist/bigconsole/utils/statusTone.d.ts +17 -0
- package/dist/bigconsole/utils/statusTone.js +44 -0
- package/package.json +4 -4
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { BIGCONSOLE_PERMISSIONS as e } from "../../../constants/permissions.js";
|
|
2
2
|
import { ListDataSinksDocument as t } from "../../../generated/wspace-operations.js";
|
|
3
3
|
import { useEffect as n, useId as r, useRef as i, useState as a } from "react";
|
|
4
|
-
import { Input as o } from "@burdenoff/fe-libs/ui";
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { useApolloClient as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { useActiveContext as
|
|
9
|
-
import { usePermissions as
|
|
4
|
+
import { Input as o, ThemedSelect as s } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
6
|
+
import { useApolloClient as l } from "@apollo/client/react";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
import { useActiveContext as f } from "@burdenoff/fe-libs/shared/providers/shell/ActiveContextProvider";
|
|
9
|
+
import { usePermissions as p } from "@burdenoff/fe-libs/shared/providers/shell/PermissionProvider";
|
|
10
10
|
// src/bigconsole/components/dashboard/TemplateInstallOptions.tsx
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
let [
|
|
11
|
+
function m({ content: m, bindings: h, onBindingChange: g, inputValues: _, onInputChange: v, disabled: y }) {
|
|
12
|
+
let b = r(), { t: x } = c(), S = l(), { workspaceId: C } = f(), { hasPermission: w, isLoading: T } = p(), E = !T && w(e.DATASINK_READ), D = m.requiredDataSinks.length > 0, O = `${C}:${E}:${D}`, k = i(O);
|
|
13
|
+
k.current = O;
|
|
14
|
+
let [A, j] = a(0), [M, N] = a(null), P = M?.owner === O ? M.cursor : void 0, [F, I] = a(null);
|
|
15
15
|
n(() => {
|
|
16
|
-
|
|
17
|
-
}, [
|
|
16
|
+
N(null), I(null);
|
|
17
|
+
}, [O]), n(() => {
|
|
18
18
|
let e = !1;
|
|
19
|
-
if (
|
|
19
|
+
if (C && D && E) return I((e) => ({
|
|
20
20
|
...e,
|
|
21
|
-
owner:
|
|
21
|
+
owner: O,
|
|
22
22
|
loading: !0,
|
|
23
23
|
error: !1
|
|
24
|
-
})),
|
|
24
|
+
})), S.query({
|
|
25
25
|
query: t,
|
|
26
26
|
variables: {
|
|
27
27
|
isActive: !0,
|
|
28
28
|
first: 100,
|
|
29
|
-
...
|
|
29
|
+
...P ? { after: P } : {}
|
|
30
30
|
},
|
|
31
31
|
fetchPolicy: "network-only"
|
|
32
32
|
}).then((t) => {
|
|
33
|
-
e ||
|
|
33
|
+
e || k.current !== O || I((e) => {
|
|
34
34
|
let n = t.data;
|
|
35
35
|
if (!n) return {
|
|
36
|
-
owner:
|
|
36
|
+
owner: O,
|
|
37
37
|
error: !0,
|
|
38
38
|
loading: !1
|
|
39
39
|
};
|
|
40
|
-
let r =
|
|
40
|
+
let r = P && e?.owner === O ? e.data?.listDataSinks.edges ?? [] : [], i = [...new Map([...r, ...n.listDataSinks.edges].map((e) => [e.node.id, e])).values()];
|
|
41
41
|
return {
|
|
42
|
-
owner:
|
|
42
|
+
owner: O,
|
|
43
43
|
data: {
|
|
44
44
|
...n,
|
|
45
45
|
listDataSinks: {
|
|
@@ -51,9 +51,9 @@ function p({ content: p, bindings: m, onBindingChange: h, inputValues: g, onInpu
|
|
|
51
51
|
};
|
|
52
52
|
});
|
|
53
53
|
}).catch(() => {
|
|
54
|
-
!e &&
|
|
54
|
+
!e && k.current === O && I((e) => ({
|
|
55
55
|
...e,
|
|
56
|
-
owner:
|
|
56
|
+
owner: O,
|
|
57
57
|
error: !0,
|
|
58
58
|
loading: !1
|
|
59
59
|
}));
|
|
@@ -61,15 +61,15 @@ function p({ content: p, bindings: m, onBindingChange: h, inputValues: g, onInpu
|
|
|
61
61
|
e = !0;
|
|
62
62
|
};
|
|
63
63
|
}, [
|
|
64
|
-
x,
|
|
65
64
|
S,
|
|
66
|
-
|
|
67
|
-
T,
|
|
65
|
+
C,
|
|
68
66
|
D,
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
E,
|
|
68
|
+
O,
|
|
69
|
+
P,
|
|
70
|
+
A
|
|
71
71
|
]);
|
|
72
|
-
let
|
|
72
|
+
let L = F?.owner === O ? F : null, R = !!(C && E && D && (!L || L.loading)), z = L?.error, B = L?.data?.listDataSinks.edges.map((e) => e.node).filter((e) => e.isActive) ?? [], V = {
|
|
73
73
|
width: "100%",
|
|
74
74
|
padding: "var(--space-controlGap)",
|
|
75
75
|
background: "var(--color-bg-surface)",
|
|
@@ -77,129 +77,129 @@ function p({ content: p, bindings: m, onBindingChange: h, inputValues: g, onInpu
|
|
|
77
77
|
border: "1px solid var(--color-border-default)",
|
|
78
78
|
borderRadius: "var(--radius-control)"
|
|
79
79
|
};
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
"aria-label":
|
|
80
|
+
return /* @__PURE__ */ d("section", {
|
|
81
|
+
"aria-label": x("bigconsole.dashboards.templateSetup.title", "Template setup"),
|
|
82
82
|
className: "space-y-form-gap",
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
83
|
+
children: [m.requiredDataSinks.length > 0 && /* @__PURE__ */ d("div", { children: [
|
|
84
|
+
/* @__PURE__ */ u("h3", {
|
|
85
85
|
className: "text-sm font-medium",
|
|
86
|
-
children:
|
|
86
|
+
children: x("bigconsole.dashboards.templateSetup.connect", "Connect your data")
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ u("p", {
|
|
89
89
|
className: "text-xs text-text-muted",
|
|
90
|
-
children:
|
|
90
|
+
children: x("bigconsole.dashboards.templateSetup.connectHelp", "Choose a source for each group of widgets. You can also connect it later in the dashboard builder.")
|
|
91
91
|
}),
|
|
92
|
-
!
|
|
92
|
+
!T && !E && /* @__PURE__ */ u("p", {
|
|
93
93
|
role: "status",
|
|
94
|
-
children:
|
|
94
|
+
children: x("bigconsole.dashboards.templateSetup.noReadPermission", "You do not have access to browse data sources. You can connect a source later with help from your workspace admin.")
|
|
95
95
|
}),
|
|
96
|
-
|
|
96
|
+
z && /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
|
|
97
97
|
role: "alert",
|
|
98
|
-
children:
|
|
99
|
-
}), /* @__PURE__ */
|
|
98
|
+
children: x("bigconsole.dashboards.templateSetup.loadError", "Could not load data sources.")
|
|
99
|
+
}), /* @__PURE__ */ u("button", {
|
|
100
100
|
type: "button",
|
|
101
|
-
disabled:
|
|
102
|
-
onClick: () =>
|
|
103
|
-
children:
|
|
101
|
+
disabled: y,
|
|
102
|
+
onClick: () => j((e) => e + 1),
|
|
103
|
+
children: x("bigconsole.dashboards.templateSetup.retry", "Retry loading sources")
|
|
104
104
|
})] }),
|
|
105
|
-
|
|
105
|
+
m.requiredDataSinks.map((e, t) => /* @__PURE__ */ d("div", {
|
|
106
106
|
className: "mt-form-gap",
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
htmlFor: `${
|
|
108
|
+
/* @__PURE__ */ u("label", {
|
|
109
|
+
htmlFor: `${b}-sink-${t}`,
|
|
110
110
|
className: "text-sm font-medium",
|
|
111
111
|
children: e.label
|
|
112
112
|
}),
|
|
113
|
-
e.description && /* @__PURE__ */
|
|
113
|
+
e.description && /* @__PURE__ */ u("p", {
|
|
114
114
|
className: "text-xs text-text-muted",
|
|
115
115
|
children: e.description
|
|
116
116
|
}),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
id: `${
|
|
119
|
-
value:
|
|
120
|
-
disabled:
|
|
121
|
-
style:
|
|
122
|
-
onChange: (t) =>
|
|
123
|
-
children: [/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ d(s, {
|
|
118
|
+
id: `${b}-sink-${t}`,
|
|
119
|
+
value: h[e.slot] ?? "",
|
|
120
|
+
disabled: y || R || !C || !E,
|
|
121
|
+
style: V,
|
|
122
|
+
onChange: (t) => g(e.slot, t.target.value),
|
|
123
|
+
children: [/* @__PURE__ */ u("option", {
|
|
124
124
|
value: "",
|
|
125
|
-
children:
|
|
126
|
-
}),
|
|
125
|
+
children: x("bigconsole.dashboards.templateSetup.connectLater", "Connect later")
|
|
126
|
+
}), B.map((e) => /* @__PURE__ */ u("option", {
|
|
127
127
|
value: e.id,
|
|
128
128
|
children: e.name || e.key
|
|
129
129
|
}, e.id))]
|
|
130
130
|
}),
|
|
131
|
-
e.expectedFields.length > 0 && /* @__PURE__ */
|
|
131
|
+
e.expectedFields.length > 0 && /* @__PURE__ */ u("p", {
|
|
132
132
|
className: "text-xs text-text-muted",
|
|
133
|
-
children:
|
|
133
|
+
children: x("bigconsole.dashboards.templateSetup.expectedFields", "Expected fields: {fields}", { fields: e.expectedFields.map((e) => e.name).join(", ") })
|
|
134
134
|
}),
|
|
135
|
-
e.widgetTitles.length > 0 && /* @__PURE__ */
|
|
135
|
+
e.widgetTitles.length > 0 && /* @__PURE__ */ u("p", {
|
|
136
136
|
className: "text-xs text-text-muted",
|
|
137
|
-
children:
|
|
137
|
+
children: x("bigconsole.dashboards.templateSetup.usedBy", "Used by: {widgets}", { widgets: e.widgetTitles.join(", ") })
|
|
138
138
|
})
|
|
139
139
|
]
|
|
140
140
|
}, e.slot)),
|
|
141
|
-
|
|
141
|
+
L?.data?.listDataSinks.pageInfo.hasNextPage && /* @__PURE__ */ u("button", {
|
|
142
142
|
type: "button",
|
|
143
|
-
disabled:
|
|
144
|
-
onClick: () =>
|
|
145
|
-
owner:
|
|
146
|
-
cursor:
|
|
143
|
+
disabled: y || R,
|
|
144
|
+
onClick: () => N({
|
|
145
|
+
owner: O,
|
|
146
|
+
cursor: L.data?.listDataSinks.pageInfo.endCursor ?? void 0
|
|
147
147
|
}),
|
|
148
|
-
children:
|
|
148
|
+
children: x("bigconsole.dashboards.templateSetup.loadMore", "Load more sources")
|
|
149
149
|
})
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
htmlFor: `${
|
|
150
|
+
] }), m.requiredInputs.map((e, t) => /* @__PURE__ */ d("div", { children: [
|
|
151
|
+
/* @__PURE__ */ d("label", {
|
|
152
|
+
htmlFor: `${b}-input-${t}`,
|
|
153
153
|
className: "text-sm font-medium",
|
|
154
154
|
children: [e.label, e.required ? " *" : ""]
|
|
155
155
|
}),
|
|
156
|
-
e.type === "boolean" ? /* @__PURE__ */
|
|
157
|
-
id: `${
|
|
158
|
-
value: typeof
|
|
159
|
-
style:
|
|
160
|
-
disabled:
|
|
161
|
-
onChange: (t) =>
|
|
156
|
+
e.type === "boolean" ? /* @__PURE__ */ d(s, {
|
|
157
|
+
id: `${b}-input-${t}`,
|
|
158
|
+
value: typeof _[e.name] == "boolean" ? String(_[e.name]) : "",
|
|
159
|
+
style: V,
|
|
160
|
+
disabled: y,
|
|
161
|
+
onChange: (t) => v(e.name, t.target.value === "" ? void 0 : t.target.value === "true"),
|
|
162
162
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ u("option", {
|
|
164
164
|
value: "",
|
|
165
|
-
children:
|
|
165
|
+
children: x("bigconsole.dashboards.templateSetup.chooseValue", "Choose a value")
|
|
166
166
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ u("option", {
|
|
168
168
|
value: "true",
|
|
169
|
-
children:
|
|
169
|
+
children: x("bigconsole.dashboards.templateSetup.true", "True")
|
|
170
170
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ u("option", {
|
|
172
172
|
value: "false",
|
|
173
|
-
children:
|
|
173
|
+
children: x("bigconsole.dashboards.templateSetup.false", "False")
|
|
174
174
|
})
|
|
175
175
|
]
|
|
176
|
-
}) : e.type === "select" ? /* @__PURE__ */
|
|
177
|
-
id: `${
|
|
178
|
-
value: typeof
|
|
179
|
-
style:
|
|
180
|
-
disabled:
|
|
181
|
-
onChange: (t) =>
|
|
182
|
-
children: [/* @__PURE__ */
|
|
176
|
+
}) : e.type === "select" ? /* @__PURE__ */ d(s, {
|
|
177
|
+
id: `${b}-input-${t}`,
|
|
178
|
+
value: typeof _[e.name] == "string" ? String(_[e.name]) : "",
|
|
179
|
+
style: V,
|
|
180
|
+
disabled: y,
|
|
181
|
+
onChange: (t) => v(e.name, t.target.value),
|
|
182
|
+
children: [/* @__PURE__ */ u("option", {
|
|
183
183
|
value: "",
|
|
184
|
-
children:
|
|
185
|
-
}), e.options?.map((e) => /* @__PURE__ */
|
|
184
|
+
children: x("bigconsole.dashboards.templateSetup.chooseValue", "Choose a value")
|
|
185
|
+
}), e.options?.map((e) => /* @__PURE__ */ u("option", {
|
|
186
186
|
value: e.value,
|
|
187
187
|
children: e.label
|
|
188
188
|
}, e.value))]
|
|
189
|
-
}) : /* @__PURE__ */
|
|
190
|
-
id: `${
|
|
189
|
+
}) : /* @__PURE__ */ u(o, {
|
|
190
|
+
id: `${b}-input-${t}`,
|
|
191
191
|
type: e.type === "secret" ? "password" : e.type === "number" ? "number" : "text",
|
|
192
192
|
step: e.type === "number" ? "any" : void 0,
|
|
193
|
-
value: typeof
|
|
193
|
+
value: typeof _[e.name] == "string" || typeof _[e.name] == "number" ? String(_[e.name]) : "",
|
|
194
194
|
placeholder: e.placeholder,
|
|
195
|
-
disabled:
|
|
196
|
-
onChange: (t) =>
|
|
195
|
+
disabled: y,
|
|
196
|
+
onChange: (t) => v(e.name, e.type === "number" ? t.target.value === "" ? void 0 : Number(t.target.value) : t.target.value)
|
|
197
197
|
}),
|
|
198
|
-
e.helpText && /* @__PURE__ */
|
|
198
|
+
e.helpText && /* @__PURE__ */ u("p", {
|
|
199
199
|
className: "text-xs text-text-muted",
|
|
200
200
|
children: e.helpText
|
|
201
201
|
})
|
|
202
202
|
] }, e.name))]
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
export {
|
|
205
|
+
export { m as TemplateInstallOptions };
|
|
@@ -4,148 +4,148 @@ import "../common/index.js";
|
|
|
4
4
|
import { alertErrorMessage as n } from "../../hooks/useDataSinkAlerts.js";
|
|
5
5
|
import { useCallback as r, useEffect as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
|
|
6
6
|
import { Loader2 as c, RefreshCw as l } from "lucide-react";
|
|
7
|
-
import { Button as u } from "@burdenoff/fe-libs/ui";
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { jsx as
|
|
7
|
+
import { Button as u, ThemedSelect as d } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
10
|
// src/bigconsole/components/datasink/AlertExecutionHistory.tsx
|
|
11
|
-
var
|
|
11
|
+
var h = {
|
|
12
12
|
owner: "",
|
|
13
13
|
rows: [],
|
|
14
14
|
loading: !1,
|
|
15
15
|
hasMore: !1,
|
|
16
16
|
error: null
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
let { t:
|
|
20
|
-
a(() => (
|
|
21
|
-
|
|
22
|
-
}), [
|
|
23
|
-
let [
|
|
24
|
-
if (
|
|
18
|
+
function g({ owner: g, rules: _, load: v, refreshVersion: y }) {
|
|
19
|
+
let { t: b } = f(), [x, S] = s(""), [C, w] = s([]), T = C.at(-1), E = `${g}|${x}|${T ?? ""}`, D = o(null), O = o(null);
|
|
20
|
+
a(() => (D.current = E, () => {
|
|
21
|
+
D.current = null, O.current = null;
|
|
22
|
+
}), [E]);
|
|
23
|
+
let [k, A] = s(h), j = r(async () => {
|
|
24
|
+
if (D.current !== E || O.current) return;
|
|
25
25
|
let e = {};
|
|
26
|
-
|
|
27
|
-
...e.owner ===
|
|
28
|
-
owner:
|
|
26
|
+
O.current = e, A((e) => ({
|
|
27
|
+
...e.owner === E ? e : h,
|
|
28
|
+
owner: E,
|
|
29
29
|
loading: !0,
|
|
30
30
|
error: null
|
|
31
31
|
}));
|
|
32
32
|
try {
|
|
33
|
-
let t = await
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
owner:
|
|
33
|
+
let t = await v(x || void 0, T);
|
|
34
|
+
if (D.current !== E || O.current !== e || !t) return;
|
|
35
|
+
A({
|
|
36
|
+
owner: E,
|
|
37
37
|
rows: t.slice(0, 20),
|
|
38
38
|
loading: !1,
|
|
39
39
|
hasMore: t.length > 20,
|
|
40
40
|
error: null
|
|
41
41
|
});
|
|
42
42
|
} catch (t) {
|
|
43
|
-
|
|
43
|
+
D.current === E && O.current === e && A((e) => ({
|
|
44
44
|
...e,
|
|
45
|
-
owner:
|
|
45
|
+
owner: E,
|
|
46
46
|
loading: !1,
|
|
47
47
|
error: n(t)
|
|
48
48
|
}));
|
|
49
49
|
} finally {
|
|
50
|
-
|
|
50
|
+
O.current === e && (O.current = null);
|
|
51
51
|
}
|
|
52
52
|
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
v,
|
|
54
|
+
x,
|
|
55
|
+
T,
|
|
56
|
+
E
|
|
57
57
|
]);
|
|
58
58
|
i(() => {
|
|
59
|
-
Promise.resolve().then(() =>
|
|
59
|
+
Promise.resolve().then(() => j());
|
|
60
60
|
let e = window.setInterval(() => {
|
|
61
|
-
document.visibilityState === "visible" &&
|
|
61
|
+
document.visibilityState === "visible" && j();
|
|
62
62
|
}, 1e4);
|
|
63
63
|
return () => window.clearInterval(e);
|
|
64
|
-
}, [
|
|
65
|
-
let
|
|
66
|
-
...
|
|
64
|
+
}, [j, y]);
|
|
65
|
+
let M = k.owner === E ? k : {
|
|
66
|
+
...h,
|
|
67
67
|
loading: !0
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
title:
|
|
69
|
+
return /* @__PURE__ */ m(t, {
|
|
70
|
+
title: b("bigconsole.alerts.history.title", "Execution history"),
|
|
71
71
|
headingLevel: 2,
|
|
72
|
-
description:
|
|
73
|
-
actions: /* @__PURE__ */
|
|
72
|
+
description: b("bigconsole.alerts.history.description", "Actual evaluations and notification delivery status. Refreshes every 10 seconds while this page is visible."),
|
|
73
|
+
actions: /* @__PURE__ */ m(u, {
|
|
74
74
|
type: "button",
|
|
75
75
|
variant: "secondary",
|
|
76
76
|
size: "sm",
|
|
77
|
-
onClick: () => void
|
|
78
|
-
disabled:
|
|
79
|
-
children: [
|
|
77
|
+
onClick: () => void j(),
|
|
78
|
+
disabled: M.loading,
|
|
79
|
+
children: [M.loading ? /* @__PURE__ */ p(c, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ p(l, { className: "mr-2 h-4 w-4" }), b("bigconsole.alerts.history.refresh", "Refresh history")]
|
|
80
80
|
}),
|
|
81
81
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ p("label", {
|
|
83
83
|
htmlFor: "alert-history-filter",
|
|
84
84
|
className: "mb-1 block text-xs font-medium text-text-primary",
|
|
85
|
-
children:
|
|
85
|
+
children: b("bigconsole.alerts.history.filter", "Filter by rule")
|
|
86
86
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ m(d, {
|
|
88
88
|
id: "alert-history-filter",
|
|
89
89
|
className: `mb-4 w-full min-w-0 rounded-control border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary ${e}`,
|
|
90
|
-
value:
|
|
90
|
+
value: x,
|
|
91
91
|
onChange: (e) => {
|
|
92
|
-
|
|
92
|
+
S(e.target.value), w([]);
|
|
93
93
|
},
|
|
94
94
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ p("option", {
|
|
96
96
|
value: "",
|
|
97
|
-
children:
|
|
97
|
+
children: b("bigconsole.alerts.history.all", "All rules")
|
|
98
98
|
}),
|
|
99
|
-
|
|
100
|
-
value:
|
|
101
|
-
children:
|
|
99
|
+
x && !_.some((e) => e.id === x) && /* @__PURE__ */ p("option", {
|
|
100
|
+
value: x,
|
|
101
|
+
children: x
|
|
102
102
|
}),
|
|
103
|
-
|
|
103
|
+
_.map((e) => /* @__PURE__ */ p("option", {
|
|
104
104
|
value: e.id,
|
|
105
105
|
children: e.name
|
|
106
106
|
}, e.id))
|
|
107
107
|
]
|
|
108
108
|
}),
|
|
109
|
-
|
|
109
|
+
M.error && /* @__PURE__ */ p("p", {
|
|
110
110
|
role: "alert",
|
|
111
111
|
className: "mb-4 break-words text-sm text-status-error-text",
|
|
112
|
-
children:
|
|
112
|
+
children: M.error
|
|
113
113
|
}),
|
|
114
|
-
|
|
114
|
+
M.loading && !M.rows.length && /* @__PURE__ */ p("p", {
|
|
115
115
|
role: "status",
|
|
116
116
|
className: "text-sm text-text-secondary",
|
|
117
|
-
children:
|
|
117
|
+
children: b("bigconsole.alerts.history.loading", "Loading execution history…")
|
|
118
118
|
}),
|
|
119
|
-
!
|
|
119
|
+
!M.loading && !M.error && !M.rows.length && /* @__PURE__ */ p("p", {
|
|
120
120
|
className: "text-sm text-text-secondary",
|
|
121
|
-
children:
|
|
121
|
+
children: b("bigconsole.alerts.history.empty", "No evaluations recorded yet. Enabled rules evaluate when the sink data is updated or refreshed.")
|
|
122
122
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ p("ol", {
|
|
124
124
|
className: "divide-y divide-border-subtle",
|
|
125
|
-
children:
|
|
125
|
+
children: M.rows.map((e) => /* @__PURE__ */ m("li", {
|
|
126
126
|
className: "min-w-0 py-4 first:pt-0",
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ m("div", {
|
|
129
129
|
className: "flex flex-wrap items-start justify-between gap-2",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
130
|
+
children: [/* @__PURE__ */ m("div", {
|
|
131
131
|
className: "min-w-0",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ p("p", {
|
|
133
133
|
className: "break-words text-sm font-medium text-text-primary",
|
|
134
|
-
children:
|
|
135
|
-
}), /* @__PURE__ */
|
|
134
|
+
children: _.find((t) => t.id === e.alertId)?.name ?? e.alertId
|
|
135
|
+
}), /* @__PURE__ */ p("time", {
|
|
136
136
|
dateTime: e.createdAt,
|
|
137
137
|
className: "text-xs text-text-secondary",
|
|
138
138
|
children: new Date(e.createdAt).toLocaleString()
|
|
139
139
|
})]
|
|
140
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ p("span", {
|
|
141
141
|
className: "rounded-pill border border-border-subtle bg-bg-sunken px-2 py-1 text-xs font-medium text-text-primary",
|
|
142
|
-
children:
|
|
142
|
+
children: b(`bigconsole.alerts.history.status.${e.status}`, e.status.replaceAll("_", " "))
|
|
143
143
|
})]
|
|
144
144
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ m("p", {
|
|
146
146
|
className: "mt-2 break-words text-xs text-text-secondary",
|
|
147
147
|
children: [
|
|
148
|
-
|
|
148
|
+
b("bigconsole.alerts.history.dataVersion", "Data version"),
|
|
149
149
|
" ",
|
|
150
150
|
e.version,
|
|
151
151
|
" · ",
|
|
@@ -156,49 +156,49 @@ function h({ owner: h, rules: g, load: _, refreshVersion: v }) {
|
|
|
156
156
|
" ms"
|
|
157
157
|
]
|
|
158
158
|
}),
|
|
159
|
-
e.error && /* @__PURE__ */
|
|
159
|
+
e.error && /* @__PURE__ */ p("p", {
|
|
160
160
|
className: "mt-2 break-words text-sm text-status-error-text",
|
|
161
161
|
children: e.error
|
|
162
162
|
}),
|
|
163
|
-
e.deliveries.length > 0 && /* @__PURE__ */
|
|
163
|
+
e.deliveries.length > 0 && /* @__PURE__ */ p("ul", {
|
|
164
164
|
className: "mt-3 space-y-2",
|
|
165
|
-
children: e.deliveries.map((e, t) => /* @__PURE__ */
|
|
165
|
+
children: e.deliveries.map((e, t) => /* @__PURE__ */ m("li", {
|
|
166
166
|
className: "min-w-0 rounded-control border border-border-subtle bg-bg-sunken p-3 text-xs",
|
|
167
167
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ m("div", {
|
|
169
169
|
className: "flex flex-wrap justify-between gap-2",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ m("span", {
|
|
171
171
|
className: "break-all text-text-primary",
|
|
172
172
|
children: [
|
|
173
173
|
e.channel,
|
|
174
174
|
" · ",
|
|
175
175
|
e.recipient
|
|
176
176
|
]
|
|
177
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ p("span", {
|
|
178
178
|
className: "font-medium text-text-primary",
|
|
179
179
|
children: e.status
|
|
180
180
|
})]
|
|
181
181
|
}),
|
|
182
|
-
e.attemptedAt && /* @__PURE__ */
|
|
182
|
+
e.attemptedAt && /* @__PURE__ */ m("p", {
|
|
183
183
|
className: "mt-1 text-text-secondary",
|
|
184
184
|
children: [
|
|
185
|
-
|
|
185
|
+
b("bigconsole.alerts.history.attempted", "Attempted"),
|
|
186
186
|
" ",
|
|
187
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ p("time", {
|
|
188
188
|
dateTime: e.attemptedAt,
|
|
189
189
|
children: new Date(e.attemptedAt).toLocaleString()
|
|
190
190
|
})
|
|
191
191
|
]
|
|
192
192
|
}),
|
|
193
|
-
e.notificationId && /* @__PURE__ */
|
|
193
|
+
e.notificationId && /* @__PURE__ */ m("p", {
|
|
194
194
|
className: "mt-1 break-all text-text-muted",
|
|
195
195
|
children: [
|
|
196
|
-
|
|
196
|
+
b("bigconsole.alerts.history.notification", "Notification"),
|
|
197
197
|
" · ",
|
|
198
198
|
e.notificationId
|
|
199
199
|
]
|
|
200
200
|
}),
|
|
201
|
-
e.error && /* @__PURE__ */
|
|
201
|
+
e.error && /* @__PURE__ */ p("p", {
|
|
202
202
|
className: "mt-1 break-words text-status-error-text",
|
|
203
203
|
children: e.error
|
|
204
204
|
})
|
|
@@ -208,38 +208,38 @@ function h({ owner: h, rules: g, load: _, refreshVersion: v }) {
|
|
|
208
208
|
]
|
|
209
209
|
}, e.id))
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ m("div", {
|
|
212
212
|
className: "mt-4 flex flex-wrap items-center justify-between gap-control-gap border-t border-border-subtle pt-3",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ m("span", {
|
|
214
214
|
className: "text-xs text-text-secondary",
|
|
215
215
|
children: [
|
|
216
|
-
|
|
216
|
+
M.rows.length,
|
|
217
217
|
" ",
|
|
218
|
-
|
|
218
|
+
b("bigconsole.alerts.history.count", "executions on this page")
|
|
219
219
|
]
|
|
220
|
-
}), /* @__PURE__ */
|
|
220
|
+
}), /* @__PURE__ */ m("div", {
|
|
221
221
|
className: "flex gap-control-gap",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ p(u, {
|
|
223
223
|
type: "button",
|
|
224
224
|
variant: "secondary",
|
|
225
225
|
size: "sm",
|
|
226
|
-
onClick: () =>
|
|
227
|
-
disabled: !
|
|
228
|
-
children:
|
|
229
|
-
}), /* @__PURE__ */
|
|
226
|
+
onClick: () => w((e) => e.slice(0, -1)),
|
|
227
|
+
disabled: !C.length || M.loading,
|
|
228
|
+
children: b("bigconsole.alerts.history.newer", "Newer")
|
|
229
|
+
}), /* @__PURE__ */ p(u, {
|
|
230
230
|
type: "button",
|
|
231
231
|
variant: "secondary",
|
|
232
232
|
size: "sm",
|
|
233
233
|
onClick: () => {
|
|
234
|
-
let e =
|
|
235
|
-
e &&
|
|
234
|
+
let e = M.rows.at(-1);
|
|
235
|
+
e && w((t) => [...t, e.id]);
|
|
236
236
|
},
|
|
237
|
-
disabled: !
|
|
238
|
-
children:
|
|
237
|
+
disabled: !M.hasMore || M.loading,
|
|
238
|
+
children: b("bigconsole.alerts.history.older", "Older")
|
|
239
239
|
})]
|
|
240
240
|
})]
|
|
241
241
|
})
|
|
242
242
|
]
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
export {
|
|
245
|
+
export { g as AlertExecutionHistory };
|