@burdenoff/microfe-bigconsole 2026.1012.3 → 2026.1012.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/BigConsoleRoutes.js +149 -140
- package/dist/bigconsole/assistant/assistantApi.js +5 -5
- package/dist/bigconsole/assistant/assistantProduct.js +4 -1
- package/dist/bigconsole/assistant/displayCopy.d.ts +32 -0
- package/dist/bigconsole/assistant/pageContext.d.ts +14 -0
- package/dist/bigconsole/assistant/pageContext.js +6 -1
- package/dist/bigconsole/assistant/pageControls.d.ts +81 -0
- package/dist/bigconsole/assistant/pageControls.js +169 -0
- package/dist/bigconsole/assistant/previewControl.d.ts +16 -0
- package/dist/bigconsole/assistant/previewControl.js +10 -0
- package/dist/bigconsole/assistant/recordAdapters.js +27 -26
- package/dist/bigconsole/assistant/usePreviewControl.d.ts +2 -0
- package/dist/bigconsole/assistant/usePreviewControl.js +20 -0
- package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +33 -18
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
- package/dist/bigconsole/components/common/SortBySelect.d.ts +11 -0
- package/dist/bigconsole/components/common/SortBySelect.js +29 -0
- package/dist/bigconsole/components/common/index.d.ts +1 -0
- package/dist/bigconsole/components/common/index.js +1 -0
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +15 -15
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +153 -153
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +134 -134
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +154 -150
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
- package/dist/bigconsole/components/datasink/DataSinkCard.js +51 -50
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
- package/dist/bigconsole/components/embed/renderer-manifest.js +12 -0
- package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
- package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
- package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +77 -76
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +96 -95
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +507 -499
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +122 -1
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -224
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +113 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.js +187 -0
- package/dist/bigconsole/components/widgets/advanced/boxPlotDescription.d.ts +7 -0
- package/dist/bigconsole/components/widgets/advanced/boxPlotDescription.js +12 -0
- package/dist/bigconsole/components/widgets/advanced/data.d.ts +36 -0
- package/dist/bigconsole/components/widgets/advanced/data.js +113 -0
- package/dist/bigconsole/components/widgets/advanced/mapData.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/mapData.js +22 -0
- package/dist/bigconsole/components/widgets/advanced/waterfallData.d.ts +15 -0
- package/dist/bigconsole/components/widgets/advanced/waterfallData.js +28 -0
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
- package/dist/bigconsole/components/widgets/chart/charts/WaterfallChart.js +34 -37
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
- package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
- package/dist/bigconsole/components/widgets/index.js +1 -1
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
- package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
- package/dist/bigconsole/components/widgets/map-widget/MapWidget.d.ts +2 -0
- package/dist/bigconsole/components/widgets/map-widget/MapWidget.js +64 -63
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
- package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
- package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
- package/dist/bigconsole/constants/backendErrors.js +94 -0
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +10 -10
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +67 -67
- package/dist/bigconsole/graphql/widgetCapabilities.d.ts +7 -0
- package/dist/bigconsole/graphql/widgetCapabilities.js +37 -0
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +14 -0
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +32 -0
- package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +23 -0
- package/dist/bigconsole/hooks/useDataSinkAlerts.js +138 -113
- package/dist/bigconsole/hooks/useDrilldown.js +3 -3
- package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
- package/dist/bigconsole/hooks/useWidgetCatalog.js +46 -41
- package/dist/bigconsole/hooks/useWidgetOperations.js +113 -88
- package/dist/bigconsole/pages/AdminPage.js +130 -130
- package/dist/bigconsole/pages/DashboardBuilderPage.js +72 -60
- package/dist/bigconsole/pages/DashboardViewPage.js +244 -221
- package/dist/bigconsole/pages/DashboardsPage.js +269 -221
- package/dist/bigconsole/pages/DataParsersPage.js +180 -157
- package/dist/bigconsole/pages/DataSinkAlertsPage.js +62 -55
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +252 -234
- package/dist/bigconsole/pages/DataSinkViewPage.js +1 -1
- package/dist/bigconsole/pages/DataSinksPage.js +335 -299
- package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
- package/dist/bigconsole/pages/InsightsPage.js +279 -265
- package/dist/bigconsole/pages/OverviewPage.js +47 -47
- package/dist/bigconsole/pages/ParserBuilderPage.js +229 -213
- package/dist/bigconsole/pages/ParserViewPage.js +97 -97
- package/dist/bigconsole/pages/PipelineBuilderPage.js +256 -214
- package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
- package/dist/bigconsole/pages/PipelinesPage.js +107 -88
- package/dist/bigconsole/pages/SettingsPage.js +179 -173
- package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
- package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +34 -34
- package/dist/bigconsole/renderers/adapters/BigConsoleRenderer.js +8 -5
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +69 -69
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
- package/dist/bigconsole/store/widgetStore.d.ts +12 -0
- package/dist/bigconsole/store/widgetStore.js +3 -1
- package/dist/bigconsole/types/index.d.ts +1 -1
- package/dist/bigconsole/utils/advancedWidgetCapabilities.d.ts +14 -0
- package/dist/bigconsole/utils/advancedWidgetCapabilities.js +36 -0
- package/dist/bigconsole/utils/backendError.d.ts +18 -0
- package/dist/bigconsole/utils/backendError.js +42 -0
- package/dist/bigconsole/utils/dashboardList.d.ts +28 -0
- package/dist/bigconsole/utils/dashboardList.js +15 -0
- package/dist/bigconsole/utils/dataSinkList.d.ts +15 -0
- package/dist/bigconsole/utils/dataSinkList.js +15 -0
- package/dist/bigconsole/utils/formDirty.d.ts +82 -0
- package/dist/bigconsole/utils/formDirty.js +21 -0
- package/dist/bigconsole/utils/insightsDraft.d.ts +29 -0
- package/dist/bigconsole/utils/insightsDraft.js +8 -0
- package/dist/bigconsole/utils/layoutBaseline.d.ts +130 -0
- package/dist/bigconsole/utils/layoutBaseline.js +96 -0
- package/dist/bigconsole/utils/listSort.d.ts +80 -0
- package/dist/bigconsole/utils/listSort.js +85 -0
- package/dist/bigconsole/utils/widgetFormDirty.d.ts +16 -0
- package/dist/bigconsole/utils/widgetFormDirty.js +13 -0
- package/dist/bigconsole/utils/widgetTypeMapping.d.ts +1 -1
- package/dist/bigconsole/utils/widgetTypeMapping.js +13 -2
- package/dist/bigconsole/workflowOpen.js +15 -14
- package/dist/generated/wspace-operations.d.ts +61 -2
- package/dist/generated/wspace-operations.js +44 -18
- package/dist/generated/wspace-types.d.ts +34 -3
- package/package.json +3 -3
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { useWidgetStore as e } from "../store/widgetStore.js";
|
|
2
2
|
import "../store/index.js";
|
|
3
3
|
import { BatchUpdateWidgetPositionsDocument as t, CreateWidgetDocument as n, DeleteWidgetDocument as r, DuplicateWidgetDocument as i, ListWidgetsByDashboardDocument as a, ListWidgetsForPageDocument as o, RefreshWidgetDataDocument as s, UpdateWidgetDocument as c } from "../../generated/wspace-operations.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useBigConsole as l } from "../context/BigConsoleContext.js";
|
|
5
|
+
import "../context/index.js";
|
|
6
|
+
import { loadNativeWidgetCatalog as u } from "../graphql/widgetCapabilities.js";
|
|
7
|
+
import { mapFromFederationWidgetType as d } from "../utils/widgetTypeMapping.js";
|
|
8
|
+
import { nativeFederationTypes as f, widgetTypeForCapabilities as p } from "../utils/advancedWidgetCapabilities.js";
|
|
9
|
+
import m from "./useBigConsoleAnalytics.js";
|
|
10
|
+
import { useCallback as h, useEffect as g, useLayoutEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
11
|
+
import { useApolloClient as x } from "@apollo/client/react";
|
|
8
12
|
//#region src/bigconsole/hooks/useWidgetOperations.ts
|
|
9
|
-
function
|
|
13
|
+
function S(e) {
|
|
10
14
|
let t = e.actions, n = e.metadata, r = e.positionResponsive, i = e.position || {
|
|
11
15
|
x: e.positionX ?? 0,
|
|
12
16
|
y: e.positionY ?? 0,
|
|
@@ -23,7 +27,7 @@ function _(e) {
|
|
|
23
27
|
id: e.id,
|
|
24
28
|
pageId: e.pageId || "local",
|
|
25
29
|
dashboardId: e.dashboardId,
|
|
26
|
-
type: c ||
|
|
30
|
+
type: c || d(e.type || "KPI"),
|
|
27
31
|
title: e.title || "Untitled Widget",
|
|
28
32
|
description: o,
|
|
29
33
|
renderer: e.renderer || "BIGCONSOLE",
|
|
@@ -53,44 +57,59 @@ function _(e) {
|
|
|
53
57
|
updatedAt: e.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
54
58
|
};
|
|
55
59
|
}
|
|
56
|
-
function
|
|
57
|
-
let { skipFetch:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
function C(d, C, w = {}) {
|
|
61
|
+
let { skipFetch: T = !1 } = w, [E, D] = b(!1), [O, k] = b(null), A = x(), { workspaceId: j } = l(), M = y(j);
|
|
62
|
+
_(() => (M.current = j, () => {
|
|
63
|
+
M.current = void 0;
|
|
64
|
+
}), [j]);
|
|
65
|
+
let N = m(), P = e((e) => e.widgets), F = e((e) => e.setWidgets), I = e((e) => e.addWidget), L = e((e) => e.updateWidget), R = e((e) => e.removeWidget), z = v(() => Array.from(P.values()), [P]), B = h(async () => {
|
|
66
|
+
if (!(!d && !C)) try {
|
|
67
|
+
D(!0), k(null), C ? F(((await A.query({
|
|
60
68
|
query: a,
|
|
61
|
-
variables: { dashboardId:
|
|
69
|
+
variables: { dashboardId: C },
|
|
62
70
|
fetchPolicy: "network-only"
|
|
63
|
-
})).data?.listWidgetsByDashboard || []).map(
|
|
71
|
+
})).data?.listWidgetsByDashboard || []).map(S)) : d && F(((await A.query({
|
|
64
72
|
query: o,
|
|
65
|
-
variables: { pageId:
|
|
73
|
+
variables: { pageId: d },
|
|
66
74
|
fetchPolicy: "network-only"
|
|
67
|
-
})).data?.listWidgets?.edges || []).map((e) => e.node).map(
|
|
75
|
+
})).data?.listWidgets?.edges || []).map((e) => e.node).map(S));
|
|
68
76
|
} catch (e) {
|
|
69
|
-
|
|
77
|
+
k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch widgets"));
|
|
70
78
|
} finally {
|
|
71
|
-
|
|
79
|
+
D(!1);
|
|
72
80
|
}
|
|
73
81
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
A,
|
|
83
|
+
d,
|
|
84
|
+
C,
|
|
85
|
+
F
|
|
78
86
|
]);
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
loading:
|
|
83
|
-
error:
|
|
84
|
-
widgets:
|
|
85
|
-
createWidget:
|
|
87
|
+
return g(() => {
|
|
88
|
+
T || B();
|
|
89
|
+
}, [B, T]), {
|
|
90
|
+
loading: E,
|
|
91
|
+
error: O,
|
|
92
|
+
widgets: z,
|
|
93
|
+
createWidget: h(async (e) => {
|
|
86
94
|
try {
|
|
87
|
-
|
|
88
|
-
let t =
|
|
95
|
+
D(!0), k(null);
|
|
96
|
+
let t = [];
|
|
97
|
+
if ([
|
|
98
|
+
"map",
|
|
99
|
+
"waterfall",
|
|
100
|
+
"sankey",
|
|
101
|
+
"box_plot"
|
|
102
|
+
].includes(e.type)) {
|
|
103
|
+
if (!j || M.current !== j) throw Error("Widget workspace changed.");
|
|
104
|
+
t = f((await u(A, j)).getWidgetTypes);
|
|
105
|
+
}
|
|
106
|
+
if (!j || M.current !== j) throw Error("Widget workspace changed.");
|
|
107
|
+
let r = p(e.type, t), i = {
|
|
89
108
|
...e.config || {},
|
|
90
109
|
_internalWidgetType: e.type
|
|
91
|
-
},
|
|
110
|
+
}, a = {
|
|
92
111
|
pageId: e.pageId,
|
|
93
|
-
type:
|
|
112
|
+
type: r,
|
|
94
113
|
title: e.title,
|
|
95
114
|
renderer: e.renderer || "BIGCONSOLE",
|
|
96
115
|
template: e.template || null,
|
|
@@ -98,7 +117,7 @@ function v(l, v, y = {}) {
|
|
|
98
117
|
datasetId: e.datasetId,
|
|
99
118
|
parserId: e.parserId,
|
|
100
119
|
parserRules: e.parserRules,
|
|
101
|
-
config:
|
|
120
|
+
config: i,
|
|
102
121
|
position: {
|
|
103
122
|
x: e.position.x,
|
|
104
123
|
y: e.position.y,
|
|
@@ -108,24 +127,29 @@ function v(l, v, y = {}) {
|
|
|
108
127
|
refreshInterval: e.refreshInterval,
|
|
109
128
|
metadata: e.metadata
|
|
110
129
|
};
|
|
111
|
-
e.positionResponsive && (
|
|
130
|
+
e.positionResponsive && (a.positionResponsive = {
|
|
112
131
|
xs: e.positionResponsive.xs ?? 12,
|
|
113
132
|
sm: e.positionResponsive.sm ?? 6,
|
|
114
133
|
md: e.positionResponsive.md ?? 4,
|
|
115
134
|
lg: e.positionResponsive.lg ?? 3
|
|
116
|
-
}), e.rowOrder !== void 0 && (
|
|
117
|
-
dashboardId: e.dashboardId ||
|
|
135
|
+
}), e.rowOrder !== void 0 && (a.rowOrder = e.rowOrder), N("bigconsole.widget.create_clicked", {
|
|
136
|
+
dashboardId: e.dashboardId || C,
|
|
118
137
|
pageId: e.pageId,
|
|
119
138
|
widgetType: e.type
|
|
120
139
|
});
|
|
121
|
-
let
|
|
140
|
+
let o = (await A.mutate({
|
|
122
141
|
mutation: n,
|
|
123
|
-
variables: { input:
|
|
142
|
+
variables: { input: a },
|
|
143
|
+
context: {
|
|
144
|
+
requiredWorkspaceAuth: !0,
|
|
145
|
+
requiredWorkspaceId: j,
|
|
146
|
+
queryDeduplication: !1
|
|
147
|
+
}
|
|
124
148
|
})).data?.createBigConsoleWidget;
|
|
125
|
-
if (
|
|
126
|
-
let t =
|
|
127
|
-
return
|
|
128
|
-
dashboardId: t.dashboardId || e.dashboardId ||
|
|
149
|
+
if (o) {
|
|
150
|
+
let t = S(o);
|
|
151
|
+
return I(t), N("bigconsole.widget.created", {
|
|
152
|
+
dashboardId: t.dashboardId || e.dashboardId || C,
|
|
129
153
|
pageId: t.pageId,
|
|
130
154
|
widgetId: t.id,
|
|
131
155
|
widgetType: t.type
|
|
@@ -133,19 +157,20 @@ function v(l, v, y = {}) {
|
|
|
133
157
|
}
|
|
134
158
|
return null;
|
|
135
159
|
} catch (e) {
|
|
136
|
-
return
|
|
160
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create widget")), null;
|
|
137
161
|
} finally {
|
|
138
|
-
|
|
162
|
+
D(!1);
|
|
139
163
|
}
|
|
140
164
|
}, [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
A,
|
|
166
|
+
I,
|
|
167
|
+
C,
|
|
168
|
+
N,
|
|
169
|
+
j
|
|
145
170
|
]),
|
|
146
|
-
updateWidget:
|
|
171
|
+
updateWidget: h(async (t) => {
|
|
147
172
|
try {
|
|
148
|
-
if (
|
|
173
|
+
if (D(!0), k(null), !e.getState().widgets.get(t.id)) throw Error(`Widget not found: ${t.id}`);
|
|
149
174
|
let n = { id: t.id };
|
|
150
175
|
t.title !== void 0 && (n.title = t.title), t.renderer !== void 0 && (n.renderer = t.renderer), t.template !== void 0 && (n.template = t.template), t.dataSinkId !== void 0 && (n.dataSinkId = t.dataSinkId), t.datasetId !== void 0 && (n.datasetId = t.datasetId), t.parserId !== void 0 && (n.parserId = t.parserId), t.parserRules !== void 0 && (n.parserRules = t.parserRules), t.config !== void 0 && (n.config = t.config), t.refreshInterval !== void 0 && (n.refreshInterval = t.refreshInterval), t.metadata !== void 0 && (n.metadata = t.metadata), t.position && (n.position = {
|
|
151
176
|
x: t.position.x,
|
|
@@ -158,47 +183,47 @@ function v(l, v, y = {}) {
|
|
|
158
183
|
md: t.positionResponsive.md,
|
|
159
184
|
lg: t.positionResponsive.lg
|
|
160
185
|
}), t.rowOrder !== void 0 && (n.rowOrder = t.rowOrder);
|
|
161
|
-
let r = await
|
|
186
|
+
let r = await A.mutate({
|
|
162
187
|
mutation: c,
|
|
163
188
|
variables: { input: n }
|
|
164
189
|
});
|
|
165
190
|
if (r.error) throw r.error;
|
|
166
191
|
let i = r.data?.updateBigConsoleWidget;
|
|
167
192
|
if (i) {
|
|
168
|
-
let e =
|
|
169
|
-
return
|
|
193
|
+
let e = S(i);
|
|
194
|
+
return L(t.id, e), e;
|
|
170
195
|
}
|
|
171
196
|
return null;
|
|
172
197
|
} catch (e) {
|
|
173
|
-
return
|
|
198
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to update widget")), null;
|
|
174
199
|
} finally {
|
|
175
|
-
|
|
200
|
+
D(!1);
|
|
176
201
|
}
|
|
177
|
-
}, [
|
|
178
|
-
deleteWidget:
|
|
202
|
+
}, [A, L]),
|
|
203
|
+
deleteWidget: h(async (e) => {
|
|
179
204
|
try {
|
|
180
|
-
return
|
|
205
|
+
return D(!0), k(null), (await A.mutate({
|
|
181
206
|
mutation: r,
|
|
182
207
|
variables: { id: e }
|
|
183
|
-
})).data?.deleteBigConsoleWidget ? (
|
|
208
|
+
})).data?.deleteBigConsoleWidget ? (R(e), !0) : !1;
|
|
184
209
|
} catch (e) {
|
|
185
|
-
return
|
|
210
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to delete widget")), !1;
|
|
186
211
|
} finally {
|
|
187
|
-
|
|
212
|
+
D(!1);
|
|
188
213
|
}
|
|
189
|
-
}, [
|
|
190
|
-
duplicateWidget:
|
|
214
|
+
}, [A, R]),
|
|
215
|
+
duplicateWidget: h(async (t, n, r) => {
|
|
191
216
|
try {
|
|
192
|
-
|
|
217
|
+
D(!0), k(null);
|
|
193
218
|
let a = e.getState().widgets.get(t);
|
|
194
219
|
if (!a) throw Error(`Widget not found: ${t}`);
|
|
195
|
-
|
|
196
|
-
dashboardId: a.dashboardId ||
|
|
220
|
+
N("bigconsole.widget.duplicate_clicked", {
|
|
221
|
+
dashboardId: a.dashboardId || C,
|
|
197
222
|
pageId: a.pageId,
|
|
198
223
|
sourceWidgetId: t,
|
|
199
224
|
widgetType: a.type
|
|
200
225
|
});
|
|
201
|
-
let o = await
|
|
226
|
+
let o = await A.mutate({
|
|
202
227
|
mutation: i,
|
|
203
228
|
variables: {
|
|
204
229
|
id: t,
|
|
@@ -214,9 +239,9 @@ function v(l, v, y = {}) {
|
|
|
214
239
|
if (o.error) throw o.error;
|
|
215
240
|
let s = o.data?.duplicateWidget;
|
|
216
241
|
if (s) {
|
|
217
|
-
let e =
|
|
218
|
-
return
|
|
219
|
-
dashboardId: e.dashboardId || a.dashboardId ||
|
|
242
|
+
let e = S(s);
|
|
243
|
+
return I(e), N("bigconsole.widget.duplicated", {
|
|
244
|
+
dashboardId: e.dashboardId || a.dashboardId || C,
|
|
220
245
|
pageId: e.pageId,
|
|
221
246
|
widgetId: e.id,
|
|
222
247
|
sourceWidgetId: t,
|
|
@@ -225,19 +250,19 @@ function v(l, v, y = {}) {
|
|
|
225
250
|
}
|
|
226
251
|
return null;
|
|
227
252
|
} catch (e) {
|
|
228
|
-
return
|
|
253
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to duplicate widget")), null;
|
|
229
254
|
} finally {
|
|
230
|
-
|
|
255
|
+
D(!1);
|
|
231
256
|
}
|
|
232
257
|
}, [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
258
|
+
A,
|
|
259
|
+
I,
|
|
260
|
+
C,
|
|
261
|
+
N
|
|
237
262
|
]),
|
|
238
|
-
batchUpdatePositions:
|
|
263
|
+
batchUpdatePositions: h(async (e) => {
|
|
239
264
|
try {
|
|
240
|
-
return
|
|
265
|
+
return D(!0), k(null), (await A.mutate({
|
|
241
266
|
mutation: t,
|
|
242
267
|
variables: { updates: e.map((e) => ({
|
|
243
268
|
id: e.id,
|
|
@@ -249,7 +274,7 @@ function v(l, v, y = {}) {
|
|
|
249
274
|
}
|
|
250
275
|
})) }
|
|
251
276
|
})).data?.batchUpdateWidgetPositions ? (e.forEach((e) => {
|
|
252
|
-
|
|
277
|
+
L(e.id, {
|
|
253
278
|
position: e.position,
|
|
254
279
|
positionX: e.position.x,
|
|
255
280
|
positionY: e.position.y,
|
|
@@ -259,23 +284,23 @@ function v(l, v, y = {}) {
|
|
|
259
284
|
});
|
|
260
285
|
}), !0) : !1;
|
|
261
286
|
} catch (e) {
|
|
262
|
-
return
|
|
287
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to batch update positions")), !1;
|
|
263
288
|
} finally {
|
|
264
|
-
|
|
289
|
+
D(!1);
|
|
265
290
|
}
|
|
266
|
-
}, [
|
|
267
|
-
refreshWidgetData:
|
|
291
|
+
}, [A, L]),
|
|
292
|
+
refreshWidgetData: h(async (e) => {
|
|
268
293
|
try {
|
|
269
|
-
await
|
|
294
|
+
await A.mutate({
|
|
270
295
|
mutation: s,
|
|
271
296
|
variables: { widgetId: e }
|
|
272
297
|
});
|
|
273
298
|
} catch {}
|
|
274
|
-
}, [
|
|
275
|
-
refetch:
|
|
276
|
-
await
|
|
277
|
-
}, [
|
|
299
|
+
}, [A]),
|
|
300
|
+
refetch: h(async () => {
|
|
301
|
+
await B();
|
|
302
|
+
}, [B])
|
|
278
303
|
};
|
|
279
304
|
}
|
|
280
305
|
//#endregion
|
|
281
|
-
export {
|
|
306
|
+
export { C as default, S as normalizeWidget };
|