@burdenoff/microfe-bigconsole 2026.1123.1 → 2026.1123.3
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/compare/compareEngine.js +79 -66
- package/dist/bigconsole/components/fleet/FleetBadge.d.ts +12 -0
- package/dist/bigconsole/components/fleet/FleetBadge.js +61 -0
- package/dist/bigconsole/components/fleet/FleetBreadcrumb.d.ts +14 -0
- package/dist/bigconsole/components/fleet/FleetBreadcrumb.js +46 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.d.ts +17 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.js +78 -0
- package/dist/bigconsole/components/fleet/LinkToMasterDialog.d.ts +24 -0
- package/dist/bigconsole/components/fleet/LinkToMasterDialog.js +108 -0
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +144 -148
- package/dist/bigconsole/hooks/useDashboardOperations.d.ts +8 -0
- package/dist/bigconsole/hooks/useDashboardOperations.js +2 -0
- package/dist/bigconsole/hooks/useFleetBoardActions.d.ts +18 -0
- package/dist/bigconsole/hooks/useFleetBoardActions.js +54 -0
- package/dist/bigconsole/hooks/useFleetBreadcrumb.d.ts +13 -0
- package/dist/bigconsole/hooks/useFleetBreadcrumb.js +52 -0
- package/dist/bigconsole/hooks/useFleetCopyTotals.d.ts +11 -0
- package/dist/bigconsole/hooks/useFleetCopyTotals.js +52 -0
- package/dist/bigconsole/hooks/useFleetLinks.d.ts +19 -0
- package/dist/bigconsole/hooks/useFleetLinks.js +74 -0
- package/dist/bigconsole/hooks/useFleetMasterSearch.d.ts +13 -0
- package/dist/bigconsole/hooks/useFleetMasterSearch.js +62 -0
- package/dist/bigconsole/pages/DashboardViewPage.js +313 -303
- package/dist/bigconsole/pages/DashboardsPage.js +733 -435
- package/dist/bigconsole/utils/fleetTree.d.ts +50 -0
- package/dist/bigconsole/utils/fleetTree.js +64 -0
- package/dist/bigconsole/utils/legacyChartRows.d.ts +2 -0
- package/dist/bigconsole/utils/legacyChartRows.js +19 -0
- package/dist/generated/global-types.d.ts +39 -7
- package/dist/generated/wspace-operations.d.ts +86 -0
- package/dist/generated/wspace-operations.js +602 -147
- package/dist/generated/wspace-types.d.ts +3847 -23
- package/package.json +1 -1
|
@@ -5,58 +5,60 @@ import "../context/index.js";
|
|
|
5
5
|
import { useBigConsole as r, useBigConsoleBasePath as i, useBigConsoleNavigate as a } from "../context/BigConsoleContext.js";
|
|
6
6
|
import "../asof/index.js";
|
|
7
7
|
import { Section as o } from "../components/common/Section.js";
|
|
8
|
+
import { useFleetBreadcrumb as s } from "../hooks/useFleetBreadcrumb.js";
|
|
9
|
+
import ee from "../hooks/useWidgetOperations.js";
|
|
10
|
+
import te from "../hooks/useDashboardOperations.js";
|
|
11
|
+
import { FleetBreadcrumb as ne } from "../components/fleet/FleetBreadcrumb.js";
|
|
8
12
|
import "../components/dashboard/index.js";
|
|
9
|
-
import
|
|
10
|
-
import ee from "../hooks/useDashboardOperations.js";
|
|
13
|
+
import re from "../hooks/usePageOperations.js";
|
|
11
14
|
import { useReconcileAgentTool as c } from "../components/reconcile/useReconcileAgentTool.js";
|
|
15
|
+
import { AsOfProvider as ie, HideWhenAsOf as l, useAsOf as ae } from "../asof/AsOfProvider.js";
|
|
12
16
|
import "../components/common/index.js";
|
|
13
|
-
import te from "../hooks/usePageOperations.js";
|
|
14
17
|
import "../components/narrative/index.js";
|
|
15
|
-
import { AsOfProvider as l, HideWhenAsOf as u, useAsOf as ne } from "../asof/AsOfProvider.js";
|
|
16
18
|
import "../store/index.js";
|
|
17
19
|
import "../hooks/index.js";
|
|
18
|
-
import re, { parseUrlToGlobalFilterValues as ie } from "../hooks/useFilterUrlSync.js";
|
|
19
|
-
import ae from "../hooks/useActivePage.js";
|
|
20
20
|
import { DashboardCanvas as oe } from "../components/dashboard/DashboardCanvas.js";
|
|
21
|
-
import {
|
|
22
|
-
import { LiveCanvasToggle as
|
|
23
|
-
import { ExportDashboardDialog as
|
|
24
|
-
import { DrilldownBreadcrumb as
|
|
25
|
-
import { PublishToStoreDialog as
|
|
26
|
-
import { DashboardReviewDialog as
|
|
27
|
-
import { DashboardPresenceBar as
|
|
28
|
-
import { DashboardCommentsDrawer as
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
21
|
+
import se, { parseUrlToGlobalFilterValues as ce } from "../hooks/useFilterUrlSync.js";
|
|
22
|
+
import { LiveCanvasToggle as le } from "../components/dashboard/LiveCanvasToggle.js";
|
|
23
|
+
import { ExportDashboardDialog as ue } from "../components/dashboard/ExportDashboardDialog.js";
|
|
24
|
+
import { DrilldownBreadcrumb as de } from "../components/dashboard/DrilldownBreadcrumb.js";
|
|
25
|
+
import { PublishToStoreDialog as fe } from "../components/dashboard/PublishToStoreDialog.js";
|
|
26
|
+
import { DashboardReviewDialog as pe } from "../components/dashboard/DashboardReviewDialog.js";
|
|
27
|
+
import { DashboardPresenceBar as me } from "../components/dashboard/DashboardPresenceBar.js";
|
|
28
|
+
import { DashboardCommentsDrawer as he } from "../components/dashboard/DashboardCommentsDrawer.js";
|
|
29
|
+
import ge from "../hooks/useActivePage.js";
|
|
30
|
+
import { dashboardPageTabs as _e } from "../assistant/pageControls.js";
|
|
31
|
+
import { loadBigConsoleSettings as ve } from "../hooks/useBigConsoleSettings.js";
|
|
32
|
+
import { LIVE_STRUCTURE_POLL_MS as ye, isLiveDataRefreshDue as be } from "../utils/liveBoardRefresh.js";
|
|
33
|
+
import { registerBreadcrumbName as xe, unregisterBreadcrumbName as Se } from "../utils/breadcrumbRegistry.js";
|
|
34
|
+
import { DigestPanel as Ce } from "../components/narrative/DigestPanel.js";
|
|
35
|
+
import { GetWidgetDocument as we } from "../../generated/wspace-operations.js";
|
|
36
|
+
import { dashboardSuggestAnchorProps as Te } from "../proactive/entities.js";
|
|
37
|
+
import { memo as u, useCallback as d, useEffect as f, useMemo as p, useRef as Ee, useState as m } from "react";
|
|
38
|
+
import { useLocation as De, useParams as Oe } from "react-router";
|
|
39
|
+
import { AccessDenied as ke } from "@burdenoff/fe-libs/shared/components";
|
|
40
|
+
import { usePermissions as Ae } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
41
|
+
import { ArrowLeft as je, MessageSquare as Me, Sparkles as Ne } from "lucide-react";
|
|
42
|
+
import { Button as h, IllustratedEmptyState as Pe } from "@burdenoff/fe-libs/ui";
|
|
43
|
+
import { useI18n as Fe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
44
|
+
import { useApolloClient as Ie } from "@apollo/client/react";
|
|
45
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
46
|
+
import { useAssistantPageControls as Le } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
|
|
45
47
|
// src/bigconsole/pages/DashboardViewPage.tsx
|
|
46
|
-
var
|
|
47
|
-
let { dashboardId: r } =
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
var y = u(function() {
|
|
49
|
+
let { dashboardId: r } = Oe(), c = a(), ie = i(), { t: u } = Fe(), y = ae().asOf !== null, b = Ie(), { hasPermission: x, isLoading: S } = Ae(), C = x(n.DASHBOARD_READ), w = x(n.DASHBOARD_UPDATE), ze = x(n.DASHBOARD_EXPORT), Be = x(n.DASHBOARD_PUBLISH), [Ve, He] = m(!1), [T, E] = m(!1), [Ue, We] = m(!1), [D, Ge] = m(!1), [Ke, qe] = m(!1), [O, Je] = m(!1), { isInDrilldown: k, getContextFromUrl: A, getDrilldownMetadata: j } = se(), M = t((e) => e.currentDashboard), N = t((e) => e.setCurrentDashboard), P = t((e) => e.setGlobalFilterValue), F = t((e) => e.viewMode), I = t((e) => e.setViewMode);
|
|
50
|
+
f(() => {
|
|
51
|
+
y && F === "edit" && I("view");
|
|
50
52
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
y,
|
|
54
|
+
F,
|
|
55
|
+
I
|
|
54
56
|
]);
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
let
|
|
57
|
+
let L = e((e) => e.closeConfigPanel);
|
|
58
|
+
f(() => {
|
|
59
|
+
y && L();
|
|
60
|
+
}, [y, L]);
|
|
61
|
+
let R = t((e) => e.clearAllGlobalFilters), Ye = t((e) => e.setGlobalFilterValues), z = e((e) => e.widgets), Xe = De(), { activePageId: B, setActivePage: V } = ge(M?.id === r ? M?.pages : void 0), H = e((e) => e.clipboardWidgetId), U = e((e) => e.clipboardAction), W = e((e) => e.clearClipboard), G = e((e) => e.selectWidget), { loading: K, error: q, fetchDashboard: J, updateDashboard: Ze } = te(), { createWidget: Qe, deleteWidget: $e, duplicateWidget: et, batchUpdatePositions: tt, refetch: nt } = ee(B || void 0, r), { createPage: rt, updatePage: it, deletePage: at, duplicatePage: ot, reorderPages: st } = re(), ct = d((e) => {
|
|
60
62
|
let t = e?.parentElement;
|
|
61
63
|
if (!e || !t) return;
|
|
62
64
|
let n = t;
|
|
@@ -75,46 +77,46 @@ var b = d(function() {
|
|
|
75
77
|
a.disconnect(), s.disconnect();
|
|
76
78
|
};
|
|
77
79
|
}, []);
|
|
78
|
-
|
|
80
|
+
f(() => {
|
|
79
81
|
if (!r) c("/dashboards");
|
|
80
|
-
else return
|
|
82
|
+
else return Ye(ce(window.location.search, "filter_")), E(!1), J(r).then((e) => {
|
|
81
83
|
e || E(!0);
|
|
82
84
|
}), () => {
|
|
83
|
-
|
|
85
|
+
N(null), R(), E(!1);
|
|
84
86
|
};
|
|
85
87
|
}, [
|
|
86
88
|
r,
|
|
87
89
|
c,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
]),
|
|
93
|
-
if (!
|
|
94
|
-
let e =
|
|
90
|
+
J,
|
|
91
|
+
N,
|
|
92
|
+
R,
|
|
93
|
+
Ye
|
|
94
|
+
]), f(() => {
|
|
95
|
+
if (!k) return;
|
|
96
|
+
let e = A(), t = j();
|
|
95
97
|
Object.entries(e).forEach(([e, t]) => {
|
|
96
|
-
|
|
97
|
-
}), t.depth > 0 && (
|
|
98
|
+
P(`ctx_${e}`, t);
|
|
99
|
+
}), t.depth > 0 && (P("__drilldown_depth", t.depth), P("__drilldown_parent", t.parent), P("__drilldown_path", t.path)), Object.keys(e).length;
|
|
98
100
|
}, [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
k,
|
|
102
|
+
A,
|
|
103
|
+
j,
|
|
104
|
+
P,
|
|
105
|
+
Xe.search
|
|
104
106
|
]);
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
if (!D || !r ||
|
|
107
|
+
let lt = Ee(nt);
|
|
108
|
+
lt.current = nt, f(() => {
|
|
109
|
+
if (!D || !r || y) return;
|
|
108
110
|
let e = null, n = () => {
|
|
109
111
|
if (typeof document < "u" && document.visibilityState !== "visible" || t.getState().viewMode === "edit") return;
|
|
110
|
-
|
|
112
|
+
J(r, { silent: !0 }), lt.current();
|
|
111
113
|
let n = Date.now();
|
|
112
|
-
|
|
114
|
+
be(e, n) && (e = n, b.refetchQueries({ include: [we] }).catch((e) => {
|
|
113
115
|
console.warn("[DashboardViewPage] Live widget data refresh failed", e);
|
|
114
116
|
}));
|
|
115
117
|
};
|
|
116
118
|
n();
|
|
117
|
-
let i = window.setInterval(n,
|
|
119
|
+
let i = window.setInterval(n, ye), a = () => {
|
|
118
120
|
document.visibilityState === "visible" && (e = null, n());
|
|
119
121
|
};
|
|
120
122
|
return document.addEventListener("visibilitychange", a), () => {
|
|
@@ -123,92 +125,92 @@ var b = d(function() {
|
|
|
123
125
|
}, [
|
|
124
126
|
D,
|
|
125
127
|
r,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
y,
|
|
129
|
+
J,
|
|
130
|
+
b
|
|
129
131
|
]);
|
|
130
|
-
let
|
|
131
|
-
if (r && !
|
|
132
|
-
|
|
132
|
+
let ut = d(async () => {
|
|
133
|
+
if (r && !y) {
|
|
134
|
+
He(!0);
|
|
133
135
|
try {
|
|
134
|
-
let e = Array.from(
|
|
136
|
+
let e = Array.from(z.values());
|
|
135
137
|
if (e.length > 0) {
|
|
136
138
|
let t = e.map((e) => ({
|
|
137
139
|
id: e.id,
|
|
138
140
|
position: e.position
|
|
139
141
|
}));
|
|
140
|
-
await
|
|
142
|
+
await tt(t);
|
|
141
143
|
}
|
|
142
|
-
|
|
144
|
+
M && await Ze({
|
|
143
145
|
id: r,
|
|
144
|
-
name:
|
|
145
|
-
description:
|
|
146
|
+
name: M.name,
|
|
147
|
+
description: M.description
|
|
146
148
|
});
|
|
147
149
|
} catch {} finally {
|
|
148
|
-
|
|
150
|
+
He(!1);
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
}, [
|
|
152
154
|
r,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
]),
|
|
155
|
+
y,
|
|
156
|
+
z,
|
|
157
|
+
M,
|
|
158
|
+
tt,
|
|
159
|
+
Ze
|
|
160
|
+
]), dt = d(() => {
|
|
159
161
|
c("/dashboards");
|
|
160
|
-
}, [c]),
|
|
161
|
-
|
|
162
|
-
}, [
|
|
162
|
+
}, [c]), ft = s(y ? void 0 : r), pt = d((e) => c(`/dashboards/${e}`), [c]), Y = d((e) => {
|
|
163
|
+
V(e);
|
|
164
|
+
}, [V]), X = p(() => (M?.pages || []).map((e, t) => ({
|
|
163
165
|
id: e.id,
|
|
164
|
-
name: e.name ||
|
|
166
|
+
name: e.name || u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: t + 1 }),
|
|
165
167
|
order: e.order ?? 0
|
|
166
|
-
})), [
|
|
167
|
-
|
|
168
|
-
if (r &&
|
|
169
|
-
}, [r,
|
|
170
|
-
let
|
|
171
|
-
dashboardName:
|
|
172
|
-
tabs:
|
|
168
|
+
})), [M?.pages, u]), Z = M && M.id === r ? M.name : null, Q = B || M?.pages?.[0]?.id || null;
|
|
169
|
+
f(() => {
|
|
170
|
+
if (r && Z) return xe(r, Z), () => Se(r);
|
|
171
|
+
}, [r, Z]);
|
|
172
|
+
let mt = p(() => !S && C && !q && !T && !K && Z !== null ? _e({
|
|
173
|
+
dashboardName: Z || u("bigconsole.dashboards.title", "Dashboards"),
|
|
174
|
+
tabs: X.map((e) => ({
|
|
173
175
|
id: e.id,
|
|
174
176
|
label: e.name
|
|
175
177
|
})),
|
|
176
|
-
current:
|
|
177
|
-
select:
|
|
178
|
+
current: Q,
|
|
179
|
+
select: Y
|
|
178
180
|
}) : null, [
|
|
181
|
+
S,
|
|
179
182
|
C,
|
|
180
|
-
w,
|
|
181
|
-
J,
|
|
182
|
-
T,
|
|
183
183
|
q,
|
|
184
|
-
|
|
184
|
+
T,
|
|
185
|
+
K,
|
|
185
186
|
Z,
|
|
186
|
-
$,
|
|
187
187
|
X,
|
|
188
|
-
|
|
188
|
+
Q,
|
|
189
|
+
Y,
|
|
190
|
+
u
|
|
189
191
|
]);
|
|
190
|
-
|
|
191
|
-
let
|
|
192
|
-
let e =
|
|
193
|
-
if (!
|
|
194
|
-
let t =
|
|
192
|
+
Le(mt);
|
|
193
|
+
let ht = d(async () => {
|
|
194
|
+
let e = B || M?.pages?.[0]?.id;
|
|
195
|
+
if (!H || !r || !e) return;
|
|
196
|
+
let t = z.get(H);
|
|
195
197
|
if (!t) {
|
|
196
|
-
|
|
198
|
+
W();
|
|
197
199
|
return;
|
|
198
200
|
}
|
|
199
201
|
let n = {
|
|
200
202
|
x: 0,
|
|
201
|
-
y: Array.from(
|
|
203
|
+
y: Array.from(z.values()).reduce((e, t) => {
|
|
202
204
|
let n = (t.positionY ?? 0) + (t.positionHeight ?? 4);
|
|
203
205
|
return Math.max(e, n);
|
|
204
206
|
}, 0),
|
|
205
|
-
width: Math.min(t.positionWidth ?? 4,
|
|
207
|
+
width: Math.min(t.positionWidth ?? 4, M?.pages.find((t) => t.id === e)?.gridColumns ?? 12),
|
|
206
208
|
height: t.positionHeight ?? 4
|
|
207
|
-
}, i =
|
|
209
|
+
}, i = U === "copy" ? u("bigconsole.dashboards.view.widgetCopyTitle", "{{title}} (Copy)", { title: t.title }) : t.title, a = null;
|
|
208
210
|
try {
|
|
209
|
-
a = await
|
|
211
|
+
a = await et(H, n, i);
|
|
210
212
|
} catch {}
|
|
211
|
-
a ||= await
|
|
213
|
+
a ||= await Qe({
|
|
212
214
|
pageId: e,
|
|
213
215
|
dashboardId: r,
|
|
214
216
|
type: t.type,
|
|
@@ -222,317 +224,325 @@ var b = d(function() {
|
|
|
222
224
|
position: n,
|
|
223
225
|
refreshInterval: t.refreshInterval ?? void 0,
|
|
224
226
|
metadata: t.metadata
|
|
225
|
-
}), a && (
|
|
227
|
+
}), a && (G(a.id), U === "cut" && await $e(H)), W();
|
|
226
228
|
}, [
|
|
229
|
+
H,
|
|
227
230
|
U,
|
|
228
|
-
W,
|
|
229
231
|
r,
|
|
230
|
-
V,
|
|
231
|
-
P,
|
|
232
232
|
B,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
M,
|
|
234
|
+
z,
|
|
235
|
+
et,
|
|
236
|
+
Qe,
|
|
237
|
+
$e,
|
|
237
238
|
G,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
239
|
+
W,
|
|
240
|
+
u
|
|
241
|
+
]), gt = d(() => {
|
|
242
|
+
We(!0);
|
|
243
|
+
}, []), [_t, vt] = m(!1), yt = d(() => {
|
|
244
|
+
vt(!0);
|
|
245
|
+
}, []), bt = d(() => {
|
|
246
|
+
vt(!1);
|
|
247
|
+
}, []), xt = d(() => {
|
|
248
|
+
We(!1);
|
|
249
|
+
}, []), [St, $] = m(!1), Ct = d(() => $(!0), []), wt = d(() => $(!1), []), Tt = d(async () => {
|
|
250
|
+
if (!M || !r || y) return;
|
|
251
|
+
let e = (M.pages?.length || 0) + 1, t = u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: e }), n = await rt({
|
|
250
252
|
dashboardId: r,
|
|
251
253
|
name: t,
|
|
252
|
-
gridColumns:
|
|
254
|
+
gridColumns: ve().defaultGridColumns
|
|
253
255
|
});
|
|
254
|
-
n && (
|
|
255
|
-
...
|
|
256
|
-
pages: [...
|
|
257
|
-
}),
|
|
256
|
+
n && (N({
|
|
257
|
+
...M,
|
|
258
|
+
pages: [...M.pages || [], n]
|
|
259
|
+
}), V(n.id));
|
|
258
260
|
}, [
|
|
259
|
-
|
|
261
|
+
M,
|
|
260
262
|
r,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
]),
|
|
267
|
-
|
|
263
|
+
y,
|
|
264
|
+
N,
|
|
265
|
+
rt,
|
|
266
|
+
V,
|
|
267
|
+
u
|
|
268
|
+
]), Et = d(async (e, t) => {
|
|
269
|
+
M && !y && await it({
|
|
268
270
|
id: e,
|
|
269
271
|
name: t
|
|
270
|
-
}) &&
|
|
271
|
-
...
|
|
272
|
-
pages:
|
|
272
|
+
}) && N({
|
|
273
|
+
...M,
|
|
274
|
+
pages: M.pages?.map((n) => n.id === e ? {
|
|
273
275
|
...n,
|
|
274
276
|
name: t
|
|
275
277
|
} : n)
|
|
276
278
|
});
|
|
277
279
|
}, [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
]),
|
|
283
|
-
if (!
|
|
284
|
-
let t =
|
|
280
|
+
M,
|
|
281
|
+
y,
|
|
282
|
+
N,
|
|
283
|
+
it
|
|
284
|
+
]), Dt = d(async (e) => {
|
|
285
|
+
if (!M || !r || y) return;
|
|
286
|
+
let t = M.pages?.find((t) => t.id === e);
|
|
285
287
|
if (!t) return;
|
|
286
|
-
let n = await
|
|
287
|
-
n && (
|
|
288
|
-
...
|
|
289
|
-
pages: [...
|
|
290
|
-
}),
|
|
288
|
+
let n = await ot(e, u("bigconsole.dashboards.view.pageCopyName", "{{name}} (Copy)", { name: t.name ?? "" }));
|
|
289
|
+
n && (N({
|
|
290
|
+
...M,
|
|
291
|
+
pages: [...M.pages || [], n]
|
|
292
|
+
}), V(n.id));
|
|
291
293
|
}, [
|
|
292
|
-
|
|
294
|
+
M,
|
|
293
295
|
r,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
]),
|
|
300
|
-
if (!(!
|
|
301
|
-
let t =
|
|
296
|
+
y,
|
|
297
|
+
N,
|
|
298
|
+
ot,
|
|
299
|
+
V,
|
|
300
|
+
u
|
|
301
|
+
]), Ot = d(async (e) => {
|
|
302
|
+
if (!(!M || y || (M.pages?.length || 0) <= 1) && await at(e)) {
|
|
303
|
+
let t = M.pages?.filter((t) => t.id !== e).map((e, t) => ({
|
|
302
304
|
...e,
|
|
303
305
|
order: t
|
|
304
306
|
}));
|
|
305
|
-
|
|
306
|
-
...
|
|
307
|
+
N({
|
|
308
|
+
...M,
|
|
307
309
|
pages: t
|
|
308
310
|
});
|
|
309
311
|
let n = t?.[0]?.id;
|
|
310
|
-
|
|
312
|
+
B === e && n && V(n, { replace: !0 });
|
|
311
313
|
}
|
|
312
314
|
}, [
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
]),
|
|
320
|
-
if (!
|
|
321
|
-
|
|
322
|
-
...
|
|
315
|
+
M,
|
|
316
|
+
y,
|
|
317
|
+
N,
|
|
318
|
+
B,
|
|
319
|
+
at,
|
|
320
|
+
V
|
|
321
|
+
]), kt = d(async (e) => {
|
|
322
|
+
if (!M || !r || y) return;
|
|
323
|
+
N({
|
|
324
|
+
...M,
|
|
323
325
|
pages: e.map((e, t) => ({
|
|
324
326
|
...e,
|
|
325
327
|
order: t
|
|
326
328
|
}))
|
|
327
329
|
});
|
|
328
330
|
let t = e.map((e) => e.id);
|
|
329
|
-
await
|
|
331
|
+
await st(r, t);
|
|
330
332
|
}, [
|
|
331
|
-
|
|
333
|
+
M,
|
|
332
334
|
r,
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
335
|
+
y,
|
|
336
|
+
N,
|
|
337
|
+
st
|
|
336
338
|
]);
|
|
337
|
-
return
|
|
339
|
+
return S ? /* @__PURE__ */ _("div", {
|
|
338
340
|
className: "flex items-center justify-center h-full",
|
|
339
|
-
children: /* @__PURE__ */
|
|
340
|
-
}) :
|
|
341
|
+
children: /* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
|
|
342
|
+
}) : C ? q ? /* @__PURE__ */ _("div", {
|
|
341
343
|
className: "flex h-full flex-col items-center justify-center",
|
|
342
344
|
style: { padding: "var(--space-pagePadding)" },
|
|
343
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ _(o, {
|
|
344
346
|
headingLevel: 2,
|
|
345
347
|
tone: "danger",
|
|
346
|
-
title:
|
|
347
|
-
description: /* @__PURE__ */
|
|
348
|
+
title: u("bigconsole.dashboards.view.errorTitle", "Error loading dashboard"),
|
|
349
|
+
description: /* @__PURE__ */ _("span", {
|
|
348
350
|
className: "break-words",
|
|
349
|
-
children:
|
|
351
|
+
children: q.message
|
|
350
352
|
}),
|
|
351
353
|
className: "w-full max-w-md",
|
|
352
354
|
"data-testid": "dashboard-view-error",
|
|
353
|
-
actions: /* @__PURE__ */
|
|
355
|
+
actions: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(h, {
|
|
354
356
|
size: "sm",
|
|
355
|
-
onClick: () =>
|
|
356
|
-
children:
|
|
357
|
-
}), /* @__PURE__ */
|
|
357
|
+
onClick: () => J(r),
|
|
358
|
+
children: u("bigconsole.dashboards.view.retry", "Retry")
|
|
359
|
+
}), /* @__PURE__ */ _(h, {
|
|
358
360
|
size: "sm",
|
|
359
361
|
variant: "outline",
|
|
360
362
|
onClick: () => c("/dashboards"),
|
|
361
|
-
children:
|
|
363
|
+
children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
|
|
362
364
|
})] })
|
|
363
365
|
})
|
|
364
|
-
}) : T ? /* @__PURE__ */
|
|
366
|
+
}) : T ? /* @__PURE__ */ _("div", {
|
|
365
367
|
className: "flex flex-col items-center justify-center h-full",
|
|
366
368
|
style: { padding: "var(--space-pagePadding)" },
|
|
367
|
-
children: /* @__PURE__ */
|
|
369
|
+
children: /* @__PURE__ */ _(Pe, {
|
|
368
370
|
illustration: "empty-data",
|
|
369
|
-
title:
|
|
370
|
-
description: /* @__PURE__ */
|
|
371
|
+
title: u("bigconsole.dashboards.view.notFoundTitle", "Dashboard not found"),
|
|
372
|
+
description: /* @__PURE__ */ v(g, { children: [u("bigconsole.dashboards.view.notFoundDescription", "The dashboard you're looking for doesn't exist or has been deleted."), /* @__PURE__ */ _("span", {
|
|
371
373
|
className: "mt-2 block font-mono text-xs text-text-muted break-all",
|
|
372
|
-
children:
|
|
374
|
+
children: u("bigconsole.dashboards.view.idLabel", "ID: {{id}}", { id: r ?? "" })
|
|
373
375
|
})] }),
|
|
374
|
-
action: /* @__PURE__ */
|
|
376
|
+
action: /* @__PURE__ */ _(h, {
|
|
375
377
|
onClick: () => c("/dashboards"),
|
|
376
|
-
children:
|
|
378
|
+
children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
|
|
377
379
|
})
|
|
378
380
|
})
|
|
379
|
-
}) :
|
|
381
|
+
}) : K || !M ? /* @__PURE__ */ _("div", {
|
|
380
382
|
className: "flex items-center justify-center h-full",
|
|
381
383
|
role: "status",
|
|
382
384
|
"aria-live": "polite",
|
|
383
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ v("div", {
|
|
384
386
|
className: "flex flex-col items-center gap-4",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ _("p", {
|
|
386
388
|
className: "text-sm text-text-secondary",
|
|
387
|
-
children:
|
|
389
|
+
children: u("bigconsole.dashboards.view.loading", "Loading dashboard...")
|
|
388
390
|
})]
|
|
389
391
|
})
|
|
390
|
-
}) : /* @__PURE__ */
|
|
391
|
-
ref:
|
|
392
|
+
}) : /* @__PURE__ */ v(g, { children: [!y && /* @__PURE__ */ _(Re, {}), /* @__PURE__ */ v("div", {
|
|
393
|
+
ref: ct,
|
|
392
394
|
className: "h-full flex flex-col overflow-hidden",
|
|
393
395
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ _(o, {
|
|
395
397
|
emphasis: "bare",
|
|
396
398
|
padding: "none",
|
|
397
399
|
"data-testid": "dashboard-route-header",
|
|
398
400
|
"aria-label": "Dashboard",
|
|
399
401
|
className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2",
|
|
400
402
|
headerClassName: "",
|
|
401
|
-
header: /* @__PURE__ */
|
|
403
|
+
header: /* @__PURE__ */ v("div", {
|
|
402
404
|
className: "flex flex-wrap items-center gap-control-gap",
|
|
403
405
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
onClick:
|
|
406
|
+
/* @__PURE__ */ v(h, {
|
|
407
|
+
onClick: dt,
|
|
406
408
|
variant: "ghost",
|
|
407
409
|
size: "sm",
|
|
408
|
-
title:
|
|
409
|
-
"aria-label":
|
|
410
|
+
title: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
|
|
411
|
+
"aria-label": u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
|
|
410
412
|
className: "flex-shrink-0",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ _(je, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.back", "Back")]
|
|
412
414
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ _("h1", {
|
|
414
416
|
className: "min-w-0 flex-1 truncate text-sm font-semibold text-text-primary",
|
|
415
|
-
title:
|
|
416
|
-
...
|
|
417
|
-
children:
|
|
417
|
+
title: M.name,
|
|
418
|
+
...Te(M.id),
|
|
419
|
+
children: M.name
|
|
418
420
|
}),
|
|
419
|
-
!
|
|
420
|
-
dashboardId:
|
|
421
|
-
enabled: !
|
|
421
|
+
!y && /* @__PURE__ */ _(me, {
|
|
422
|
+
dashboardId: M.id,
|
|
423
|
+
enabled: !y
|
|
422
424
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
|
|
424
426
|
className: "flex-shrink-0",
|
|
425
|
-
children: /* @__PURE__ */
|
|
426
|
-
onClick: () =>
|
|
427
|
-
variant:
|
|
427
|
+
children: /* @__PURE__ */ v(h, {
|
|
428
|
+
onClick: () => Je((e) => !e),
|
|
429
|
+
variant: O ? "secondary" : "ghost",
|
|
428
430
|
size: "sm",
|
|
429
|
-
"aria-pressed":
|
|
431
|
+
"aria-pressed": O,
|
|
430
432
|
"data-testid": "dashboard-comments-button",
|
|
431
|
-
title:
|
|
432
|
-
"aria-label":
|
|
433
|
-
children: [/* @__PURE__ */
|
|
433
|
+
title: u("bigconsole.dashboard.comments.openButton", "Console comments"),
|
|
434
|
+
"aria-label": u("bigconsole.dashboard.comments.openButton", "Console comments"),
|
|
435
|
+
children: [/* @__PURE__ */ _(Me, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboard.comments.buttonLabel", "Comments")]
|
|
434
436
|
})
|
|
435
437
|
}) }),
|
|
436
|
-
!
|
|
438
|
+
!y && /* @__PURE__ */ _("div", {
|
|
437
439
|
className: "flex-shrink-0",
|
|
438
|
-
children: /* @__PURE__ */
|
|
440
|
+
children: /* @__PURE__ */ _(le, {
|
|
439
441
|
isLive: D,
|
|
440
|
-
onToggle: () =>
|
|
442
|
+
onToggle: () => Ge((e) => !e)
|
|
441
443
|
})
|
|
442
444
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
|
|
444
446
|
className: "flex-shrink-0",
|
|
445
|
-
children: /* @__PURE__ */
|
|
446
|
-
onClick: () =>
|
|
447
|
+
children: /* @__PURE__ */ v(h, {
|
|
448
|
+
onClick: () => qe((e) => !e),
|
|
447
449
|
variant: "ghost",
|
|
448
450
|
size: "sm",
|
|
449
|
-
"aria-pressed":
|
|
450
|
-
title:
|
|
451
|
-
"aria-label":
|
|
452
|
-
children: [/* @__PURE__ */
|
|
451
|
+
"aria-pressed": Ke,
|
|
452
|
+
title: u("bigconsole.dashboards.view.digest", "Console digest"),
|
|
453
|
+
"aria-label": u("bigconsole.dashboards.view.digest", "Console digest"),
|
|
454
|
+
children: [/* @__PURE__ */ _(Ne, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.digest", "Digest")]
|
|
453
455
|
})
|
|
454
456
|
}) })
|
|
455
457
|
]
|
|
456
458
|
})
|
|
457
459
|
}),
|
|
458
|
-
|
|
460
|
+
ft.length > 0 && !y && /* @__PURE__ */ _("div", {
|
|
461
|
+
className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2",
|
|
462
|
+
children: /* @__PURE__ */ _(ne, {
|
|
463
|
+
ancestors: ft,
|
|
464
|
+
currentName: M.name,
|
|
465
|
+
onNavigate: pt
|
|
466
|
+
})
|
|
467
|
+
}),
|
|
468
|
+
Ke && M && /* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
|
|
459
469
|
className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2 sm:px-4",
|
|
460
|
-
children: /* @__PURE__ */
|
|
470
|
+
children: /* @__PURE__ */ _("div", {
|
|
461
471
|
className: "mx-auto max-w-3xl",
|
|
462
|
-
children: /* @__PURE__ */
|
|
463
|
-
dashboardId:
|
|
464
|
-
onClose: () =>
|
|
472
|
+
children: /* @__PURE__ */ _(Ce, {
|
|
473
|
+
dashboardId: M.id,
|
|
474
|
+
onClose: () => qe(!1)
|
|
465
475
|
})
|
|
466
476
|
})
|
|
467
477
|
}) }),
|
|
468
|
-
|
|
469
|
-
currentDashboardId:
|
|
470
|
-
currentDashboardName:
|
|
471
|
-
basePath: `${
|
|
478
|
+
k && !y && /* @__PURE__ */ _(de, {
|
|
479
|
+
currentDashboardId: M.id,
|
|
480
|
+
currentDashboardName: M.name,
|
|
481
|
+
basePath: `${ie}/dashboards`
|
|
472
482
|
}),
|
|
473
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ _("div", {
|
|
474
484
|
className: "flex-1 min-w-0 overflow-hidden",
|
|
475
|
-
children: /* @__PURE__ */
|
|
476
|
-
dashboardId:
|
|
477
|
-
pageId:
|
|
478
|
-
title:
|
|
479
|
-
onPaste:
|
|
480
|
-
onSave:
|
|
481
|
-
isSaving:
|
|
482
|
-
onReview:
|
|
483
|
-
onExport:
|
|
484
|
-
onPublishTemplate:
|
|
485
|
-
pages:
|
|
486
|
-
activePageId:
|
|
487
|
-
onPageChange:
|
|
488
|
-
onPageAdd:
|
|
489
|
-
onPageRename:
|
|
490
|
-
onPageDuplicate:
|
|
491
|
-
onPageDelete:
|
|
492
|
-
onPagesReorder:
|
|
485
|
+
children: /* @__PURE__ */ _(oe, {
|
|
486
|
+
dashboardId: M.id,
|
|
487
|
+
pageId: B || M.pages?.[0]?.id,
|
|
488
|
+
title: M.name,
|
|
489
|
+
onPaste: ht,
|
|
490
|
+
onSave: w && !y ? ut : void 0,
|
|
491
|
+
isSaving: Ve,
|
|
492
|
+
onReview: y ? void 0 : Ct,
|
|
493
|
+
onExport: ze && !y ? gt : void 0,
|
|
494
|
+
onPublishTemplate: Be && !y ? yt : void 0,
|
|
495
|
+
pages: X,
|
|
496
|
+
activePageId: Q ?? void 0,
|
|
497
|
+
onPageChange: Y,
|
|
498
|
+
onPageAdd: Tt,
|
|
499
|
+
onPageRename: Et,
|
|
500
|
+
onPageDuplicate: Dt,
|
|
501
|
+
onPageDelete: Ot,
|
|
502
|
+
onPagesReorder: kt,
|
|
493
503
|
showPageTabs: !0
|
|
494
504
|
})
|
|
495
505
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
open:
|
|
498
|
-
onClose:
|
|
499
|
-
dashboardId:
|
|
500
|
-
pages:
|
|
501
|
-
canFix:
|
|
506
|
+
/* @__PURE__ */ _(pe, {
|
|
507
|
+
open: St && !y,
|
|
508
|
+
onClose: wt,
|
|
509
|
+
dashboardId: M.id,
|
|
510
|
+
pages: X,
|
|
511
|
+
canFix: w && !y
|
|
502
512
|
}),
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
isOpen:
|
|
505
|
-
dashboardId:
|
|
506
|
-
dashboardName:
|
|
507
|
-
onClose:
|
|
513
|
+
/* @__PURE__ */ _(ue, {
|
|
514
|
+
isOpen: Ue && !y,
|
|
515
|
+
dashboardId: M.id,
|
|
516
|
+
dashboardName: M.name,
|
|
517
|
+
onClose: xt
|
|
508
518
|
}),
|
|
509
|
-
!
|
|
510
|
-
dashboardId:
|
|
511
|
-
isOpen:
|
|
512
|
-
onClose: () =>
|
|
513
|
-
widgets: Array.from(
|
|
519
|
+
!y && /* @__PURE__ */ _(he, {
|
|
520
|
+
dashboardId: M.id,
|
|
521
|
+
isOpen: O && !y,
|
|
522
|
+
onClose: () => Je(!1),
|
|
523
|
+
widgets: Array.from(z.values()).map((e) => ({
|
|
514
524
|
id: e.id,
|
|
515
525
|
title: e.title || e.type
|
|
516
526
|
})),
|
|
517
|
-
onSelectWidget: (e) =>
|
|
527
|
+
onSelectWidget: (e) => G(e)
|
|
518
528
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
isOpen:
|
|
521
|
-
dashboardId:
|
|
522
|
-
dashboardName:
|
|
523
|
-
dashboardDescription:
|
|
524
|
-
onClose:
|
|
529
|
+
/* @__PURE__ */ _(fe, {
|
|
530
|
+
isOpen: _t && !y,
|
|
531
|
+
dashboardId: M.id,
|
|
532
|
+
dashboardName: M.name,
|
|
533
|
+
dashboardDescription: M.description,
|
|
534
|
+
onClose: bt
|
|
525
535
|
})
|
|
526
536
|
]
|
|
527
|
-
})] }) : /* @__PURE__ */
|
|
528
|
-
title:
|
|
529
|
-
description:
|
|
537
|
+
})] }) : /* @__PURE__ */ _(ke, {
|
|
538
|
+
title: u("bigconsole.dashboards.view.accessDeniedTitle", "Access Denied"),
|
|
539
|
+
description: u("bigconsole.dashboards.view.accessDeniedDescription", "You don't have permission to view this dashboard.")
|
|
530
540
|
});
|
|
531
|
-
}),
|
|
541
|
+
}), Re = () => (c(), null), b = u(function() {
|
|
532
542
|
let { workspaceId: e } = r();
|
|
533
|
-
return /* @__PURE__ */
|
|
543
|
+
return /* @__PURE__ */ _(ie, {
|
|
534
544
|
workspaceId: e,
|
|
535
|
-
children: /* @__PURE__ */
|
|
545
|
+
children: /* @__PURE__ */ _(y, {})
|
|
536
546
|
});
|
|
537
547
|
});
|
|
538
|
-
export {
|
|
548
|
+
export { y as DashboardViewPage, b as default };
|