@burdenoff/microfe-bigconsole 2026.1123.7 → 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
|
@@ -3,204 +3,204 @@ import { Section as t } from "../common/Section.js";
|
|
|
3
3
|
import "../common/index.js";
|
|
4
4
|
import { AlertSeverity as n, DataSinkAlertChannel as r, DataSinkAlertConditionType as i } from "../../../generated/wspace-types.js";
|
|
5
5
|
import { Loader2 as a, Play as o, Plus as s, Save as c, Trash2 as l } from "lucide-react";
|
|
6
|
-
import { Button as u } from "@burdenoff/fe-libs/ui";
|
|
7
|
-
import { useI18n as
|
|
8
|
-
import { jsx as
|
|
6
|
+
import { Button as u, ThemedSelect as d } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
9
|
// src/bigconsole/components/datasink/AlertRuleEditor.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let { t:
|
|
13
|
-
...
|
|
10
|
+
var h = `w-full min-w-0 rounded-control border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary ${e}`;
|
|
11
|
+
function g(g) {
|
|
12
|
+
let { t: _ } = f(), { draft: v, channels: y, channelError: b, canUpdate: x, pending: S, previewing: C, preview: w, previewError: T, previewStale: E, error: D, onChange: O, onSave: k, onCancel: A, onPreview: j, onReloadChannels: M } = g, N = S || !x, P = y.filter((e) => e.status.toUpperCase() === "ACTIVE"), F = (e) => O({
|
|
13
|
+
...v,
|
|
14
14
|
...e
|
|
15
15
|
});
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
title:
|
|
16
|
+
return /* @__PURE__ */ p(t, {
|
|
17
|
+
title: _("bigconsole.alerts.rule.title", "Alert rule"),
|
|
18
18
|
headingLevel: 2,
|
|
19
19
|
emphasis: "primary",
|
|
20
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ m("form", {
|
|
21
21
|
onSubmit: (e) => {
|
|
22
|
-
e.preventDefault(),
|
|
22
|
+
e.preventDefault(), k();
|
|
23
23
|
},
|
|
24
24
|
className: "flex min-w-0 flex-col gap-form-gap",
|
|
25
|
-
"aria-label":
|
|
25
|
+
"aria-label": _("bigconsole.alerts.rule.form", "Alert rule editor"),
|
|
26
26
|
children: [
|
|
27
|
-
!
|
|
27
|
+
!x && /* @__PURE__ */ p("p", {
|
|
28
28
|
className: "text-sm text-text-secondary",
|
|
29
|
-
children:
|
|
29
|
+
children: _("bigconsole.alerts.rule.readOnly", "You have read-only access to these alert rules.")
|
|
30
30
|
}),
|
|
31
|
-
|
|
31
|
+
D && /* @__PURE__ */ p("p", {
|
|
32
32
|
role: "alert",
|
|
33
33
|
className: "break-words text-sm text-status-error-text",
|
|
34
|
-
children:
|
|
34
|
+
children: D
|
|
35
35
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
37
37
|
htmlFor: "alert-name",
|
|
38
38
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
39
|
-
children:
|
|
40
|
-
}), /* @__PURE__ */
|
|
39
|
+
children: _("bigconsole.alerts.rule.name", "Name")
|
|
40
|
+
}), /* @__PURE__ */ p("input", {
|
|
41
41
|
id: "alert-name",
|
|
42
|
-
className:
|
|
43
|
-
value:
|
|
44
|
-
onChange: (e) =>
|
|
42
|
+
className: h,
|
|
43
|
+
value: v.name,
|
|
44
|
+
onChange: (e) => F({ name: e.target.value }),
|
|
45
45
|
required: !0,
|
|
46
46
|
maxLength: 200,
|
|
47
|
-
disabled:
|
|
47
|
+
disabled: N
|
|
48
48
|
})] }),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ m("div", {
|
|
50
50
|
className: "grid min-w-0 gap-form-gap sm:grid-cols-2",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
52
52
|
htmlFor: "alert-condition-type",
|
|
53
53
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
54
|
-
children:
|
|
55
|
-
}), /* @__PURE__ */
|
|
54
|
+
children: _("bigconsole.alerts.rule.language", "Condition language")
|
|
55
|
+
}), /* @__PURE__ */ m(d, {
|
|
56
56
|
id: "alert-condition-type",
|
|
57
|
-
className:
|
|
58
|
-
value:
|
|
59
|
-
onChange: (e) =>
|
|
60
|
-
disabled:
|
|
61
|
-
children: [/* @__PURE__ */
|
|
57
|
+
className: h,
|
|
58
|
+
value: v.conditionType,
|
|
59
|
+
onChange: (e) => F({ conditionType: e.target.value === i.Jsonata ? i.Jsonata : i.Jq }),
|
|
60
|
+
disabled: N,
|
|
61
|
+
children: [/* @__PURE__ */ p("option", {
|
|
62
62
|
value: i.Jq,
|
|
63
63
|
children: "JQ"
|
|
64
|
-
}), /* @__PURE__ */
|
|
64
|
+
}), /* @__PURE__ */ p("option", {
|
|
65
65
|
value: i.Jsonata,
|
|
66
66
|
children: "JSONata"
|
|
67
67
|
})]
|
|
68
|
-
})] }), /* @__PURE__ */
|
|
68
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
69
69
|
htmlFor: "alert-severity",
|
|
70
70
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
71
|
-
children:
|
|
72
|
-
}), /* @__PURE__ */
|
|
71
|
+
children: _("bigconsole.alerts.rule.severity", "Severity")
|
|
72
|
+
}), /* @__PURE__ */ p(d, {
|
|
73
73
|
id: "alert-severity",
|
|
74
|
-
className:
|
|
75
|
-
value:
|
|
76
|
-
onChange: (e) =>
|
|
77
|
-
disabled:
|
|
78
|
-
children: Object.values(n).map((e) => /* @__PURE__ */
|
|
74
|
+
className: h,
|
|
75
|
+
value: v.severity,
|
|
76
|
+
onChange: (e) => F({ severity: Object.values(n).find((t) => t === e.target.value) ?? n.Medium }),
|
|
77
|
+
disabled: N,
|
|
78
|
+
children: Object.values(n).map((e) => /* @__PURE__ */ p("option", {
|
|
79
79
|
value: e,
|
|
80
|
-
children:
|
|
80
|
+
children: _(`bigconsole.alerts.severity.${e}`, e.charAt(0).toUpperCase() + e.slice(1))
|
|
81
81
|
}, e))
|
|
82
82
|
})] })]
|
|
83
83
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ m("div", { children: [
|
|
85
|
+
/* @__PURE__ */ p("label", {
|
|
86
86
|
htmlFor: "alert-condition",
|
|
87
87
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
88
|
-
children:
|
|
88
|
+
children: _("bigconsole.alerts.rule.condition", "Condition")
|
|
89
89
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ p("textarea", {
|
|
91
91
|
id: "alert-condition",
|
|
92
|
-
className: `${
|
|
93
|
-
value:
|
|
94
|
-
onChange: (e) =>
|
|
92
|
+
className: `${h} min-h-32 font-mono`,
|
|
93
|
+
value: v.condition,
|
|
94
|
+
onChange: (e) => F({ condition: e.target.value }),
|
|
95
95
|
rows: 5,
|
|
96
96
|
required: !0,
|
|
97
|
-
disabled:
|
|
97
|
+
disabled: N,
|
|
98
98
|
"aria-describedby": "alert-condition-help"
|
|
99
99
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ p("p", {
|
|
101
101
|
id: "alert-condition-help",
|
|
102
102
|
className: "mt-2 text-xs text-text-secondary",
|
|
103
|
-
children:
|
|
103
|
+
children: _("bigconsole.alerts.rule.conditionHelp", "Evaluates the entire current sink payload and must return one boolean. Preview does not send notifications.")
|
|
104
104
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ p("p", {
|
|
106
106
|
className: "mt-1 break-words text-xs text-text-muted",
|
|
107
|
-
children:
|
|
107
|
+
children: v.conditionType === i.Jq ? "JQ: any(.[]; .boarding_minutes > 240)" : "JSONata: $count($[boarding_minutes > 240]) > 0"
|
|
108
108
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ m(u, {
|
|
110
110
|
type: "button",
|
|
111
111
|
variant: "secondary",
|
|
112
112
|
size: "sm",
|
|
113
|
-
onClick:
|
|
114
|
-
disabled:
|
|
113
|
+
onClick: j,
|
|
114
|
+
disabled: S || C || !v.condition.trim(),
|
|
115
115
|
className: "mt-3",
|
|
116
|
-
children: [
|
|
116
|
+
children: [C ? /* @__PURE__ */ p(a, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ p(o, { className: "mr-2 h-4 w-4" }), C ? _("bigconsole.alerts.rule.previewing", "Evaluating…") : _("bigconsole.alerts.rule.preview", "Preview condition")]
|
|
117
117
|
}),
|
|
118
|
-
|
|
118
|
+
T && /* @__PURE__ */ p("p", {
|
|
119
119
|
role: "alert",
|
|
120
120
|
className: "mt-2 break-words text-sm text-status-error-text",
|
|
121
|
-
children:
|
|
121
|
+
children: T
|
|
122
122
|
}),
|
|
123
|
-
|
|
123
|
+
E && /* @__PURE__ */ p("p", {
|
|
124
124
|
role: "status",
|
|
125
125
|
className: "mt-2 text-xs text-text-secondary",
|
|
126
|
-
children:
|
|
126
|
+
children: _("bigconsole.alerts.rule.previewStale", "The condition or data changed. Preview again to see the current result.")
|
|
127
127
|
}),
|
|
128
|
-
|
|
128
|
+
w && !E && /* @__PURE__ */ m("div", {
|
|
129
129
|
role: "status",
|
|
130
130
|
className: "mt-3 rounded-control border border-border-subtle bg-bg-sunken p-3 text-sm",
|
|
131
|
-
children: [
|
|
131
|
+
children: [w.error ? /* @__PURE__ */ p("p", {
|
|
132
132
|
className: "break-words text-status-error-text",
|
|
133
|
-
children:
|
|
134
|
-
}) : /* @__PURE__ */
|
|
133
|
+
children: w.error
|
|
134
|
+
}) : /* @__PURE__ */ p("p", {
|
|
135
135
|
className: "font-medium text-text-primary",
|
|
136
|
-
children:
|
|
137
|
-
}), /* @__PURE__ */
|
|
136
|
+
children: w.matched ? _("bigconsole.alerts.rule.matched", "Condition matched") : _("bigconsole.alerts.rule.noMatch", "Condition did not match")
|
|
137
|
+
}), /* @__PURE__ */ m("p", {
|
|
138
138
|
className: "mt-1 text-xs text-text-secondary",
|
|
139
139
|
children: [
|
|
140
|
-
|
|
140
|
+
_("bigconsole.alerts.rule.previewMetadata", "Evaluated data version"),
|
|
141
141
|
" ",
|
|
142
|
-
|
|
142
|
+
w.version,
|
|
143
143
|
" ·",
|
|
144
144
|
" ",
|
|
145
|
-
|
|
145
|
+
w.durationMs,
|
|
146
146
|
" ms"
|
|
147
147
|
]
|
|
148
148
|
})]
|
|
149
149
|
})
|
|
150
150
|
] }),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
disabled:
|
|
151
|
+
/* @__PURE__ */ m("fieldset", {
|
|
152
|
+
disabled: N,
|
|
153
153
|
className: "min-w-0",
|
|
154
154
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ p("legend", {
|
|
156
156
|
className: "mb-2 text-sm font-medium text-text-primary",
|
|
157
|
-
children:
|
|
157
|
+
children: _("bigconsole.alerts.rule.destinations", "Delivery destinations")
|
|
158
158
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ p("p", {
|
|
160
160
|
className: "mb-3 text-xs text-text-secondary",
|
|
161
|
-
children:
|
|
161
|
+
children: _("bigconsole.alerts.rule.destinationHelp", "Choose an available active delivery channel and its actual recipient.")
|
|
162
162
|
}),
|
|
163
|
-
|
|
163
|
+
b && /* @__PURE__ */ m("div", {
|
|
164
164
|
className: "mb-3 text-sm",
|
|
165
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ p("p", {
|
|
166
166
|
role: "alert",
|
|
167
167
|
className: "break-words text-status-error-text",
|
|
168
|
-
children:
|
|
169
|
-
}), /* @__PURE__ */
|
|
168
|
+
children: b
|
|
169
|
+
}), /* @__PURE__ */ p(u, {
|
|
170
170
|
type: "button",
|
|
171
171
|
variant: "secondary",
|
|
172
172
|
size: "sm",
|
|
173
|
-
onClick:
|
|
174
|
-
children:
|
|
173
|
+
onClick: M,
|
|
174
|
+
children: _("bigconsole.alerts.rule.reloadChannels", "Reload channels")
|
|
175
175
|
})]
|
|
176
176
|
}),
|
|
177
|
-
!
|
|
177
|
+
!b && P.length === 0 && /* @__PURE__ */ p("p", {
|
|
178
178
|
className: "mb-3 text-sm text-text-secondary",
|
|
179
|
-
children:
|
|
179
|
+
children: _("bigconsole.alerts.rule.noChannels", "No active delivery channels are available to BigConsole in this organization. You can save this rule disabled.")
|
|
180
180
|
}),
|
|
181
|
-
!
|
|
181
|
+
!v.deliveries.length && /* @__PURE__ */ p("p", {
|
|
182
182
|
className: "mb-3 text-xs text-text-muted",
|
|
183
|
-
children:
|
|
183
|
+
children: _("bigconsole.alerts.rule.noDestinations", "No delivery destinations selected.")
|
|
184
184
|
}),
|
|
185
|
-
|
|
185
|
+
v.deliveries.map((e, t) => /* @__PURE__ */ m("div", {
|
|
186
186
|
className: "mb-3 min-w-0 rounded-control border border-border-subtle p-3",
|
|
187
187
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ m("label", {
|
|
189
189
|
htmlFor: `alert-channel-${e.key}`,
|
|
190
190
|
className: "mb-1 block text-xs font-medium text-text-primary",
|
|
191
191
|
children: [
|
|
192
|
-
|
|
192
|
+
_("bigconsole.alerts.rule.channel", "Configured channel"),
|
|
193
193
|
" ",
|
|
194
194
|
t + 1
|
|
195
195
|
]
|
|
196
196
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ m(d, {
|
|
198
198
|
id: `alert-channel-${e.key}`,
|
|
199
|
-
className:
|
|
199
|
+
className: h,
|
|
200
200
|
value: e.channelId,
|
|
201
201
|
onChange: (t) => {
|
|
202
|
-
let n =
|
|
203
|
-
|
|
202
|
+
let n = y.find((e) => e.id === t.target.value);
|
|
203
|
+
F({ deliveries: v.deliveries.map((t) => t.key === e.key ? {
|
|
204
204
|
...t,
|
|
205
205
|
channelId: n?.id ?? "",
|
|
206
206
|
channel: n?.platform ?? r.Email,
|
|
@@ -208,19 +208,19 @@ function h(h) {
|
|
|
208
208
|
} : t) });
|
|
209
209
|
},
|
|
210
210
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ p("option", {
|
|
212
212
|
value: "",
|
|
213
|
-
children:
|
|
213
|
+
children: _("bigconsole.alerts.rule.chooseChannel", "Choose a configured channel")
|
|
214
214
|
}),
|
|
215
|
-
e.channelId && !
|
|
215
|
+
e.channelId && !P.some((t) => t.id === e.channelId) && /* @__PURE__ */ m("option", {
|
|
216
216
|
value: e.channelId,
|
|
217
217
|
children: [
|
|
218
|
-
|
|
218
|
+
_("bigconsole.alerts.rule.unavailableChannel", "Unavailable channel"),
|
|
219
219
|
" · ",
|
|
220
220
|
e.channelId
|
|
221
221
|
]
|
|
222
222
|
}),
|
|
223
|
-
|
|
223
|
+
P.map((e) => /* @__PURE__ */ m("option", {
|
|
224
224
|
value: e.id,
|
|
225
225
|
children: [
|
|
226
226
|
e.name,
|
|
@@ -230,125 +230,125 @@ function h(h) {
|
|
|
230
230
|
}, e.id))
|
|
231
231
|
]
|
|
232
232
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ p("label", {
|
|
234
234
|
htmlFor: `alert-recipient-${e.key}`,
|
|
235
235
|
className: "mb-1 mt-3 block text-xs font-medium text-text-primary",
|
|
236
|
-
children: e.channel === r.Email ?
|
|
236
|
+
children: e.channel === r.Email ? _("bigconsole.alerts.rule.emailRecipient", "Email address") : e.channel === r.Slack ? _("bigconsole.alerts.rule.slackRecipient", "Slack recipient ID") : _("bigconsole.alerts.rule.webhookRecipient", "HTTPS webhook URL")
|
|
237
237
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ p("input", {
|
|
239
239
|
id: `alert-recipient-${e.key}`,
|
|
240
|
-
className:
|
|
240
|
+
className: h,
|
|
241
241
|
type: e.channel === r.Email ? "email" : e.channel === r.Webhook ? "url" : "text",
|
|
242
242
|
value: e.recipient,
|
|
243
|
-
onChange: (t) =>
|
|
243
|
+
onChange: (t) => F({ deliveries: v.deliveries.map((n) => n.key === e.key ? {
|
|
244
244
|
...n,
|
|
245
245
|
recipient: t.target.value
|
|
246
246
|
} : n) }),
|
|
247
247
|
required: !0
|
|
248
248
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ m(u, {
|
|
250
250
|
type: "button",
|
|
251
251
|
variant: "ghost",
|
|
252
252
|
size: "sm",
|
|
253
|
-
onClick: () =>
|
|
253
|
+
onClick: () => F({ deliveries: v.deliveries.filter((t) => t.key !== e.key) }),
|
|
254
254
|
className: "mt-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ p(l, { className: "mr-2 h-4 w-4" }), _("bigconsole.alerts.rule.removeDestination", "Remove destination")]
|
|
256
256
|
})
|
|
257
257
|
]
|
|
258
258
|
}, e.key)),
|
|
259
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ m(u, {
|
|
260
260
|
type: "button",
|
|
261
261
|
variant: "secondary",
|
|
262
262
|
size: "sm",
|
|
263
|
-
onClick: () =>
|
|
263
|
+
onClick: () => F({ deliveries: [...v.deliveries, {
|
|
264
264
|
key: crypto.randomUUID(),
|
|
265
265
|
channel: r.Email,
|
|
266
266
|
channelId: "",
|
|
267
267
|
recipient: ""
|
|
268
268
|
}] }),
|
|
269
|
-
disabled:
|
|
270
|
-
children: [/* @__PURE__ */
|
|
269
|
+
disabled: P.length === 0,
|
|
270
|
+
children: [/* @__PURE__ */ p(s, { className: "mr-2 h-4 w-4" }), _("bigconsole.alerts.rule.addDestination", "Add destination")]
|
|
271
271
|
})
|
|
272
272
|
]
|
|
273
273
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
disabled:
|
|
274
|
+
/* @__PURE__ */ m("fieldset", {
|
|
275
|
+
disabled: N,
|
|
276
276
|
className: "min-w-0",
|
|
277
277
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ p("legend", {
|
|
279
279
|
className: "mb-2 text-sm font-medium text-text-primary",
|
|
280
|
-
children:
|
|
280
|
+
children: _("bigconsole.alerts.rule.throttle", "Throttle")
|
|
281
281
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ m("label", {
|
|
283
283
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
284
|
-
children: [/* @__PURE__ */
|
|
284
|
+
children: [/* @__PURE__ */ p("input", {
|
|
285
285
|
type: "checkbox",
|
|
286
|
-
checked:
|
|
287
|
-
onChange: (e) =>
|
|
286
|
+
checked: v.throttleEnabled,
|
|
287
|
+
onChange: (e) => F({ throttleEnabled: e.target.checked }),
|
|
288
288
|
className: e
|
|
289
|
-
}),
|
|
289
|
+
}), _("bigconsole.alerts.rule.limitFrequency", "Limit alert frequency")]
|
|
290
290
|
}),
|
|
291
|
-
|
|
291
|
+
v.throttleEnabled && /* @__PURE__ */ m("div", {
|
|
292
292
|
className: "mt-3 grid gap-form-gap sm:grid-cols-2",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
294
294
|
htmlFor: "alert-window",
|
|
295
295
|
className: "mb-1 block text-xs font-medium text-text-primary",
|
|
296
|
-
children:
|
|
297
|
-
}), /* @__PURE__ */
|
|
296
|
+
children: _("bigconsole.alerts.rule.window", "Time window (minutes)")
|
|
297
|
+
}), /* @__PURE__ */ p("input", {
|
|
298
298
|
id: "alert-window",
|
|
299
299
|
type: "number",
|
|
300
300
|
min: 1,
|
|
301
301
|
step: 1,
|
|
302
|
-
className:
|
|
303
|
-
value:
|
|
304
|
-
onChange: (e) =>
|
|
302
|
+
className: h,
|
|
303
|
+
value: v.windowMinutes,
|
|
304
|
+
onChange: (e) => F({ windowMinutes: e.target.value }),
|
|
305
305
|
required: !0
|
|
306
|
-
})] }), /* @__PURE__ */
|
|
306
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
307
307
|
htmlFor: "alert-max",
|
|
308
308
|
className: "mb-1 block text-xs font-medium text-text-primary",
|
|
309
|
-
children:
|
|
310
|
-
}), /* @__PURE__ */
|
|
309
|
+
children: _("bigconsole.alerts.rule.maxAlerts", "Maximum alerts per window")
|
|
310
|
+
}), /* @__PURE__ */ p("input", {
|
|
311
311
|
id: "alert-max",
|
|
312
312
|
type: "number",
|
|
313
313
|
min: 1,
|
|
314
314
|
step: 1,
|
|
315
|
-
className:
|
|
316
|
-
value:
|
|
317
|
-
onChange: (e) =>
|
|
315
|
+
className: h,
|
|
316
|
+
value: v.maxAlerts,
|
|
317
|
+
onChange: (e) => F({ maxAlerts: e.target.value }),
|
|
318
318
|
required: !0
|
|
319
319
|
})] })]
|
|
320
320
|
})
|
|
321
321
|
]
|
|
322
322
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ m("label", {
|
|
324
324
|
className: "flex items-start gap-2 text-sm text-text-primary",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ p("input", {
|
|
326
326
|
type: "checkbox",
|
|
327
|
-
checked:
|
|
328
|
-
onChange: (e) =>
|
|
329
|
-
disabled:
|
|
327
|
+
checked: v.enabled,
|
|
328
|
+
onChange: (e) => F({ enabled: e.target.checked }),
|
|
329
|
+
disabled: N,
|
|
330
330
|
className: `mt-1 ${e}`
|
|
331
|
-
}), /* @__PURE__ */
|
|
331
|
+
}), /* @__PURE__ */ m("span", { children: [_("bigconsole.alerts.rule.enabled", "Rule enabled"), /* @__PURE__ */ p("span", {
|
|
332
332
|
className: "mt-1 block text-xs text-text-secondary",
|
|
333
|
-
children:
|
|
333
|
+
children: _("bigconsole.alerts.rule.enabledHelp", "Enabled rules evaluate when this sink is updated or refreshed. Saving a disabled rule does not send notifications.")
|
|
334
334
|
})] })]
|
|
335
335
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ m("div", {
|
|
337
337
|
className: "flex flex-wrap justify-end gap-control-gap border-t border-border-subtle pt-4",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ p(u, {
|
|
339
339
|
type: "button",
|
|
340
340
|
variant: "secondary",
|
|
341
|
-
onClick:
|
|
342
|
-
disabled:
|
|
343
|
-
children:
|
|
344
|
-
}), /* @__PURE__ */
|
|
341
|
+
onClick: A,
|
|
342
|
+
disabled: S,
|
|
343
|
+
children: _("bigconsole.alerts.rule.cancel", "Cancel")
|
|
344
|
+
}), /* @__PURE__ */ m(u, {
|
|
345
345
|
type: "submit",
|
|
346
|
-
disabled:
|
|
347
|
-
children: [
|
|
346
|
+
disabled: N,
|
|
347
|
+
children: [S ? /* @__PURE__ */ p(a, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ p(c, { className: "mr-2 h-4 w-4" }), S ? _("bigconsole.alerts.rule.saving", "Saving…") : _("bigconsole.alerts.rule.save", "Save rule")]
|
|
348
348
|
})]
|
|
349
349
|
})
|
|
350
350
|
]
|
|
351
351
|
})
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
export {
|
|
354
|
+
export { g as AlertRuleEditor };
|