@burdenoff/microfe-bigconsole 2026.1104.1 → 2026.1104.2
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.
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { LIVE_DATA_REFRESH_SECONDS as e } from "../../utils/liveBoardRefresh.js";
|
|
2
|
+
import { memo as t } from "react";
|
|
3
|
+
import { Radio as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
5
|
//#region src/bigconsole/components/dashboard/LiveCanvasToggle.tsx
|
|
5
|
-
var
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
var a = t(function({ isLive: t, onToggle: a }) {
|
|
7
|
+
return /* @__PURE__ */ i("button", {
|
|
7
8
|
type: "button",
|
|
8
|
-
onClick:
|
|
9
|
-
"aria-pressed":
|
|
9
|
+
onClick: a,
|
|
10
|
+
"aria-pressed": t,
|
|
10
11
|
"data-testid": "live-canvas-toggle",
|
|
11
|
-
"data-live":
|
|
12
|
-
title:
|
|
13
|
-
className: ["inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",
|
|
14
|
-
children: [
|
|
12
|
+
"data-live": t ? "on" : "off",
|
|
13
|
+
title: t ? `Live canvas on — new widgets and pages appear automatically and widget data refreshes about every ${e} seconds, no reload needed` : `Turn on live canvas to watch the board update as the pipeline builds and refresh widget data about every ${e} seconds`,
|
|
14
|
+
className: ["inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors", t ? "bg-status-success-bg text-status-success-text border border-status-success-border" : "text-text-secondary border border-border-default hover:bg-bg-sunken"].join(" "),
|
|
15
|
+
children: [t ? /* @__PURE__ */ i("span", {
|
|
15
16
|
className: "relative flex h-2.5 w-2.5 flex-shrink-0",
|
|
16
17
|
"aria-hidden": "true",
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
}) : /* @__PURE__ */ n
|
|
18
|
+
children: [/* @__PURE__ */ r("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-status-success-text opacity-60" }), /* @__PURE__ */ r("span", { className: "relative inline-flex h-2.5 w-2.5 rounded-full bg-status-success-text" })]
|
|
19
|
+
}) : /* @__PURE__ */ r(n, {
|
|
19
20
|
className: "h-3.5 w-3.5 flex-shrink-0",
|
|
20
21
|
"aria-hidden": "true"
|
|
21
|
-
}), /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ r("span", {
|
|
22
23
|
className: "uppercase tracking-wide",
|
|
23
|
-
children:
|
|
24
|
+
children: t ? "Live" : "Go live"
|
|
24
25
|
})]
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
28
|
//#endregion
|
|
28
|
-
export {
|
|
29
|
+
export { a as LiveCanvasToggle, a as default };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useWidgetStore as e } from "../store/widgetStore.js";
|
|
2
2
|
import { useDashboardStore as t } from "../store/dashboardStore.js";
|
|
3
3
|
import "../store/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { GetWidgetDocument as n } from "../../generated/wspace-operations.js";
|
|
5
|
+
import { useBigConsoleBasePath as r, useBigConsoleNavigate as i } from "../context/BigConsoleContext.js";
|
|
5
6
|
import "../context/index.js";
|
|
6
|
-
import { Section as
|
|
7
|
+
import { Section as a } from "../components/common/Section.js";
|
|
7
8
|
import "../components/common/index.js";
|
|
8
9
|
import ee from "../hooks/useWidgetOperations.js";
|
|
9
10
|
import te from "../hooks/useDashboardOperations.js";
|
|
@@ -11,116 +12,124 @@ import ne from "../hooks/useActivePage.js";
|
|
|
11
12
|
import re, { parseUrlToGlobalFilterValues as ie } from "../hooks/useFilterUrlSync.js";
|
|
12
13
|
import ae from "../hooks/usePageOperations.js";
|
|
13
14
|
import "../hooks/index.js";
|
|
14
|
-
import { BIGCONSOLE_PERMISSIONS as
|
|
15
|
+
import { BIGCONSOLE_PERMISSIONS as o } from "../../constants/permissions.js";
|
|
15
16
|
import { loadBigConsoleSettings as oe } from "../hooks/useBigConsoleSettings.js";
|
|
16
17
|
import { DashboardCanvas as se } from "../components/dashboard/DashboardCanvas.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import { LIVE_STRUCTURE_POLL_MS as ce, isLiveDataRefreshDue as le } from "../utils/liveBoardRefresh.js";
|
|
19
|
+
import { LiveCanvasToggle as ue } from "../components/dashboard/LiveCanvasToggle.js";
|
|
20
|
+
import { ExportDashboardDialog as de } from "../components/dashboard/ExportDashboardDialog.js";
|
|
21
|
+
import { DrilldownBreadcrumb as fe } from "../components/dashboard/DrilldownBreadcrumb.js";
|
|
22
|
+
import { PublishToStoreDialog as pe } from "../components/dashboard/PublishToStoreDialog.js";
|
|
21
23
|
import "../components/dashboard/index.js";
|
|
22
|
-
import { dashboardPageTabs as
|
|
23
|
-
import { memo as
|
|
24
|
-
import { useLocation as
|
|
25
|
-
import { AccessDenied as
|
|
26
|
-
import { usePermissions as
|
|
27
|
-
import { ArrowLeft as
|
|
28
|
-
import { Button as
|
|
29
|
-
import { useI18n as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
24
|
+
import { dashboardPageTabs as me } from "../assistant/pageControls.js";
|
|
25
|
+
import { memo as s, useCallback as c, useEffect as l, useMemo as u, useRef as he, useState as d } from "react";
|
|
26
|
+
import { useLocation as ge, useParams as _e } from "react-router";
|
|
27
|
+
import { AccessDenied as ve } from "@burdenoff/fe-libs/shared/components";
|
|
28
|
+
import { usePermissions as ye } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
29
|
+
import { ArrowLeft as be } from "lucide-react";
|
|
30
|
+
import { Button as f, IllustratedEmptyState as xe } from "@burdenoff/fe-libs/ui";
|
|
31
|
+
import { useI18n as Se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
32
|
+
import { useApolloClient as Ce } from "@apollo/client/react";
|
|
33
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
34
|
+
import { useAssistantPageControls as we } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
|
|
32
35
|
//#region src/bigconsole/pages/DashboardViewPage.tsx
|
|
33
|
-
var
|
|
34
|
-
let { dashboardId:
|
|
35
|
-
|
|
36
|
-
if (!
|
|
37
|
-
|
|
36
|
+
var g = s(function() {
|
|
37
|
+
let { dashboardId: s } = _e(), g = i(), Te = r(), { t: _ } = Se(), v = Ce(), { hasPermission: y, isLoading: b } = ye(), x = y(o.DASHBOARD_READ), Ee = y(o.DASHBOARD_UPDATE), De = y(o.DASHBOARD_EXPORT), Oe = y(o.DASHBOARD_PUBLISH), [ke, S] = d(!1), [C, w] = d(!1), [Ae, T] = d(!1), [E, je] = d(!1), { isInDrilldown: D, getContextFromUrl: O, getDrilldownMetadata: k } = re(), A = t((e) => e.currentDashboard), j = t((e) => e.setCurrentDashboard), M = t((e) => e.setGlobalFilterValue), N = t((e) => e.clearAllGlobalFilters), P = t((e) => e.setGlobalFilterValues), F = e((e) => e.widgets), Me = ge(), { activePageId: I, setActivePage: L } = ne(A?.id === s ? A?.pages : void 0), R = e((e) => e.clipboardWidgetId), z = e((e) => e.clipboardAction), B = e((e) => e.clearClipboard), V = e((e) => e.selectWidget), { loading: H, error: U, fetchDashboard: W, updateDashboard: G } = te(), { createWidget: K, deleteWidget: q, duplicateWidget: Ne, batchUpdatePositions: Pe, refetch: Fe } = ee(I || void 0, s), { createPage: J, updatePage: Ie, deletePage: Le, reorderPages: Re } = ae();
|
|
38
|
+
l(() => {
|
|
39
|
+
if (!s) {
|
|
40
|
+
g("/dashboards");
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
|
-
return
|
|
41
|
-
e ||
|
|
43
|
+
return P(ie(window.location.search, "filter_")), w(!1), W(s).then((e) => {
|
|
44
|
+
e || w(!0);
|
|
42
45
|
}), () => {
|
|
43
|
-
|
|
46
|
+
j(null), N(), w(!1);
|
|
44
47
|
};
|
|
45
48
|
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
k,
|
|
49
|
+
s,
|
|
50
|
+
g,
|
|
51
|
+
W,
|
|
50
52
|
j,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
N,
|
|
54
|
+
P
|
|
55
|
+
]), l(() => {
|
|
56
|
+
if (!D) return;
|
|
57
|
+
let e = O(), t = k();
|
|
55
58
|
Object.entries(e).forEach(([e, t]) => {
|
|
56
|
-
|
|
57
|
-
}), t.depth > 0 && (
|
|
59
|
+
M(`ctx_${e}`, t);
|
|
60
|
+
}), t.depth > 0 && (M("__drilldown_depth", t.depth), M("__drilldown_parent", t.parent), M("__drilldown_path", t.path)), Object.keys(e).length > 0 && console.debug("[DashboardViewPage] Loaded drilldown context:", {
|
|
58
61
|
context: e,
|
|
59
62
|
metadata: t
|
|
60
63
|
});
|
|
61
64
|
}, [
|
|
62
|
-
T,
|
|
63
|
-
E,
|
|
64
65
|
D,
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
O,
|
|
67
|
+
k,
|
|
68
|
+
M,
|
|
69
|
+
Me.search
|
|
67
70
|
]);
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
if (!
|
|
71
|
-
let e = () => {
|
|
72
|
-
typeof document < "u" && document.visibilityState !== "visible" || t.getState().viewMode
|
|
71
|
+
let ze = he(Fe);
|
|
72
|
+
ze.current = Fe, l(() => {
|
|
73
|
+
if (!E || !s) return;
|
|
74
|
+
let e = null, r = () => {
|
|
75
|
+
if (typeof document < "u" && document.visibilityState !== "visible" || t.getState().viewMode === "edit") return;
|
|
76
|
+
W(s, { silent: !0 }), ze.current();
|
|
77
|
+
let r = Date.now();
|
|
78
|
+
le(e, r) && (e = r, v.refetchQueries({ include: [n] }).catch((e) => {
|
|
79
|
+
console.warn("[DashboardViewPage] Live widget data refresh failed", e);
|
|
80
|
+
}));
|
|
73
81
|
};
|
|
74
|
-
|
|
75
|
-
let
|
|
76
|
-
document.visibilityState === "visible" && e();
|
|
82
|
+
r();
|
|
83
|
+
let i = window.setInterval(r, ce), a = () => {
|
|
84
|
+
document.visibilityState === "visible" && (e = null, r());
|
|
77
85
|
};
|
|
78
|
-
return document.addEventListener("visibilitychange",
|
|
79
|
-
window.clearInterval(
|
|
86
|
+
return document.addEventListener("visibilitychange", a), () => {
|
|
87
|
+
window.clearInterval(i), document.removeEventListener("visibilitychange", a);
|
|
80
88
|
};
|
|
81
89
|
}, [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
90
|
+
E,
|
|
91
|
+
s,
|
|
92
|
+
W,
|
|
93
|
+
v
|
|
85
94
|
]);
|
|
86
|
-
let
|
|
87
|
-
if (
|
|
88
|
-
|
|
95
|
+
let Be = c(async () => {
|
|
96
|
+
if (s) {
|
|
97
|
+
S(!0);
|
|
89
98
|
try {
|
|
90
|
-
let e = Array.from(
|
|
99
|
+
let e = Array.from(F.values());
|
|
91
100
|
if (e.length > 0) {
|
|
92
101
|
let t = e.map((e) => ({
|
|
93
102
|
id: e.id,
|
|
94
103
|
position: e.position
|
|
95
104
|
}));
|
|
96
|
-
await
|
|
105
|
+
await Pe(t);
|
|
97
106
|
}
|
|
98
|
-
|
|
99
|
-
id:
|
|
100
|
-
name:
|
|
101
|
-
description:
|
|
107
|
+
A && await G({
|
|
108
|
+
id: s,
|
|
109
|
+
name: A.name,
|
|
110
|
+
description: A.description
|
|
102
111
|
});
|
|
103
112
|
} catch {} finally {
|
|
104
|
-
|
|
113
|
+
S(!1);
|
|
105
114
|
}
|
|
106
115
|
}
|
|
107
116
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]),
|
|
114
|
-
|
|
115
|
-
}, [
|
|
116
|
-
|
|
117
|
-
}, [
|
|
117
|
+
s,
|
|
118
|
+
F,
|
|
119
|
+
A,
|
|
120
|
+
Pe,
|
|
121
|
+
G
|
|
122
|
+
]), Ve = c(() => {
|
|
123
|
+
g("/dashboards");
|
|
124
|
+
}, [g]), Y = c((e) => {
|
|
125
|
+
L(e);
|
|
126
|
+
}, [L]), X = u(() => (A?.pages || []).map((e, t) => ({
|
|
118
127
|
id: e.id,
|
|
119
|
-
name: e.name ||
|
|
128
|
+
name: e.name || _("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: t + 1 }),
|
|
120
129
|
order: e.order ?? 0
|
|
121
|
-
})), [
|
|
122
|
-
|
|
123
|
-
dashboardName: Z ||
|
|
130
|
+
})), [A?.pages, _]), Z = A && A.id === s ? A.name : null, Q = I || A?.pages?.[0]?.id || null;
|
|
131
|
+
we(u(() => !b && x && !U && !C && !H && Z !== null ? me({
|
|
132
|
+
dashboardName: Z || _("bigconsole.dashboards.title", "Dashboards"),
|
|
124
133
|
tabs: X.map((e) => ({
|
|
125
134
|
id: e.id,
|
|
126
135
|
label: e.name
|
|
@@ -128,40 +137,40 @@ var h = o(function() {
|
|
|
128
137
|
current: Q,
|
|
129
138
|
select: Y
|
|
130
139
|
}) : null, [
|
|
131
|
-
|
|
132
|
-
y,
|
|
133
|
-
V,
|
|
140
|
+
b,
|
|
134
141
|
x,
|
|
135
|
-
|
|
142
|
+
U,
|
|
143
|
+
C,
|
|
144
|
+
H,
|
|
136
145
|
Z,
|
|
137
146
|
X,
|
|
138
147
|
Q,
|
|
139
148
|
Y,
|
|
140
|
-
|
|
149
|
+
_
|
|
141
150
|
]));
|
|
142
|
-
let
|
|
143
|
-
let e =
|
|
144
|
-
if (!
|
|
145
|
-
let t =
|
|
151
|
+
let He = c(async () => {
|
|
152
|
+
let e = I || A?.pages?.[0]?.id;
|
|
153
|
+
if (!R || !s || !e) return;
|
|
154
|
+
let t = F.get(R);
|
|
146
155
|
if (!t) {
|
|
147
|
-
|
|
156
|
+
B();
|
|
148
157
|
return;
|
|
149
158
|
}
|
|
150
159
|
let n = {
|
|
151
160
|
x: 0,
|
|
152
|
-
y: Array.from(
|
|
161
|
+
y: Array.from(F.values()).reduce((e, t) => {
|
|
153
162
|
let n = (t.positionY ?? 0) + (t.positionHeight ?? 4);
|
|
154
163
|
return Math.max(e, n);
|
|
155
164
|
}, 0),
|
|
156
|
-
width: Math.min(t.positionWidth ?? 4,
|
|
165
|
+
width: Math.min(t.positionWidth ?? 4, A?.pages.find((t) => t.id === e)?.gridColumns ?? 12),
|
|
157
166
|
height: t.positionHeight ?? 4
|
|
158
|
-
}, r =
|
|
167
|
+
}, r = z === "copy" ? _("bigconsole.dashboards.view.widgetCopyTitle", "{{title}} (Copy)", { title: t.title }) : t.title, i = null;
|
|
159
168
|
try {
|
|
160
|
-
i = await
|
|
169
|
+
i = await Ne(R, n, r);
|
|
161
170
|
} catch {}
|
|
162
|
-
i ||= await
|
|
171
|
+
i ||= await K({
|
|
163
172
|
pageId: e,
|
|
164
|
-
dashboardId:
|
|
173
|
+
dashboardId: s,
|
|
165
174
|
type: t.type,
|
|
166
175
|
title: r,
|
|
167
176
|
description: t.description,
|
|
@@ -173,252 +182,252 @@ var h = o(function() {
|
|
|
173
182
|
position: n,
|
|
174
183
|
refreshInterval: t.refreshInterval ?? void 0,
|
|
175
184
|
metadata: t.metadata
|
|
176
|
-
}), i && (
|
|
185
|
+
}), i && (V(i.id), z === "cut" && await q(R)), B();
|
|
177
186
|
}, [
|
|
187
|
+
R,
|
|
188
|
+
z,
|
|
189
|
+
s,
|
|
178
190
|
I,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
O,
|
|
183
|
-
N,
|
|
191
|
+
A,
|
|
192
|
+
F,
|
|
193
|
+
Ne,
|
|
184
194
|
K,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}, []), [ze, $] = u(!1), Be = s(() => {
|
|
195
|
+
q,
|
|
196
|
+
V,
|
|
197
|
+
B,
|
|
198
|
+
_
|
|
199
|
+
]), Ue = c(() => {
|
|
200
|
+
T(!0);
|
|
201
|
+
}, []), [We, $] = d(!1), Ge = c(() => {
|
|
193
202
|
$(!0);
|
|
194
|
-
}, []),
|
|
203
|
+
}, []), Ke = c(() => {
|
|
195
204
|
$(!1);
|
|
196
|
-
}, []),
|
|
197
|
-
|
|
198
|
-
}, []),
|
|
199
|
-
if (!
|
|
200
|
-
let e = (
|
|
201
|
-
dashboardId:
|
|
205
|
+
}, []), qe = c(() => {
|
|
206
|
+
T(!1);
|
|
207
|
+
}, []), Je = c(async () => {
|
|
208
|
+
if (!A || !s) return;
|
|
209
|
+
let e = (A.pages?.length || 0) + 1, t = _("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: e }), n = await J({
|
|
210
|
+
dashboardId: s,
|
|
202
211
|
name: t,
|
|
203
212
|
gridColumns: oe().defaultGridColumns
|
|
204
213
|
});
|
|
205
|
-
n && (
|
|
206
|
-
...
|
|
207
|
-
pages: [...
|
|
208
|
-
}),
|
|
214
|
+
n && (j({
|
|
215
|
+
...A,
|
|
216
|
+
pages: [...A.pages || [], n]
|
|
217
|
+
}), L(n.id));
|
|
209
218
|
}, [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
219
|
+
A,
|
|
220
|
+
s,
|
|
221
|
+
j,
|
|
213
222
|
J,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
]),
|
|
217
|
-
|
|
223
|
+
L,
|
|
224
|
+
_
|
|
225
|
+
]), Ye = c(async (e, t) => {
|
|
226
|
+
A && await Ie({
|
|
218
227
|
id: e,
|
|
219
228
|
name: t
|
|
220
|
-
}) &&
|
|
221
|
-
...
|
|
222
|
-
pages:
|
|
229
|
+
}) && j({
|
|
230
|
+
...A,
|
|
231
|
+
pages: A.pages?.map((n) => n.id === e ? {
|
|
223
232
|
...n,
|
|
224
233
|
name: t
|
|
225
234
|
} : n)
|
|
226
235
|
});
|
|
227
236
|
}, [
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
]),
|
|
232
|
-
if (!
|
|
233
|
-
let t =
|
|
237
|
+
A,
|
|
238
|
+
j,
|
|
239
|
+
Ie
|
|
240
|
+
]), Xe = c(async (e) => {
|
|
241
|
+
if (!A || !s) return;
|
|
242
|
+
let t = A.pages?.find((t) => t.id === e);
|
|
234
243
|
if (!t) return;
|
|
235
244
|
let n = await J({
|
|
236
|
-
dashboardId:
|
|
245
|
+
dashboardId: s,
|
|
237
246
|
gridColumns: t.gridColumns,
|
|
238
|
-
name:
|
|
247
|
+
name: _("bigconsole.dashboards.view.pageCopyName", "{{name}} (Copy)", { name: t.name ?? "" })
|
|
239
248
|
});
|
|
240
|
-
n && (
|
|
241
|
-
...
|
|
242
|
-
pages: [...
|
|
243
|
-
}),
|
|
249
|
+
n && (j({
|
|
250
|
+
...A,
|
|
251
|
+
pages: [...A.pages || [], n]
|
|
252
|
+
}), L(n.id));
|
|
244
253
|
}, [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
254
|
+
A,
|
|
255
|
+
s,
|
|
256
|
+
j,
|
|
248
257
|
J,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
]),
|
|
252
|
-
if (!(!
|
|
253
|
-
let t =
|
|
258
|
+
L,
|
|
259
|
+
_
|
|
260
|
+
]), Ze = c(async (e) => {
|
|
261
|
+
if (!(!A || (A.pages?.length || 0) <= 1) && await Le(e)) {
|
|
262
|
+
let t = A.pages?.filter((t) => t.id !== e).map((e, t) => ({
|
|
254
263
|
...e,
|
|
255
264
|
order: t
|
|
256
265
|
}));
|
|
257
|
-
|
|
258
|
-
...
|
|
266
|
+
j({
|
|
267
|
+
...A,
|
|
259
268
|
pages: t
|
|
260
269
|
});
|
|
261
270
|
let n = t?.[0]?.id;
|
|
262
|
-
|
|
271
|
+
I === e && n && L(n, { replace: !0 });
|
|
263
272
|
}
|
|
264
273
|
}, [
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
]),
|
|
271
|
-
if (!
|
|
272
|
-
|
|
273
|
-
...
|
|
274
|
+
A,
|
|
275
|
+
j,
|
|
276
|
+
I,
|
|
277
|
+
Le,
|
|
278
|
+
L
|
|
279
|
+
]), Qe = c(async (e) => {
|
|
280
|
+
if (!A || !s) return;
|
|
281
|
+
j({
|
|
282
|
+
...A,
|
|
274
283
|
pages: e.map((e, t) => ({
|
|
275
284
|
...e,
|
|
276
285
|
order: t
|
|
277
286
|
}))
|
|
278
287
|
});
|
|
279
288
|
let t = e.map((e) => e.id);
|
|
280
|
-
await
|
|
289
|
+
await Re(s, t);
|
|
281
290
|
}, [
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
291
|
+
A,
|
|
292
|
+
s,
|
|
293
|
+
j,
|
|
294
|
+
Re
|
|
286
295
|
]);
|
|
287
|
-
return
|
|
296
|
+
return b ? /* @__PURE__ */ m("div", {
|
|
288
297
|
className: "flex items-center justify-center h-full",
|
|
289
|
-
children: /* @__PURE__ */
|
|
290
|
-
}) :
|
|
298
|
+
children: /* @__PURE__ */ m("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
|
|
299
|
+
}) : x ? U ? /* @__PURE__ */ m("div", {
|
|
291
300
|
className: "flex h-full flex-col items-center justify-center",
|
|
292
301
|
style: { padding: "var(--space-pagePadding)" },
|
|
293
|
-
children: /* @__PURE__ */
|
|
302
|
+
children: /* @__PURE__ */ m(a, {
|
|
294
303
|
headingLevel: 2,
|
|
295
304
|
tone: "danger",
|
|
296
|
-
title:
|
|
297
|
-
description: /* @__PURE__ */
|
|
305
|
+
title: _("bigconsole.dashboards.view.errorTitle", "Error loading dashboard"),
|
|
306
|
+
description: /* @__PURE__ */ m("span", {
|
|
298
307
|
className: "break-words",
|
|
299
|
-
children:
|
|
308
|
+
children: U.message
|
|
300
309
|
}),
|
|
301
310
|
className: "w-full max-w-md",
|
|
302
311
|
"data-testid": "dashboard-view-error",
|
|
303
|
-
actions: /* @__PURE__ */
|
|
312
|
+
actions: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
|
|
304
313
|
size: "sm",
|
|
305
|
-
onClick: () =>
|
|
306
|
-
children:
|
|
307
|
-
}), /* @__PURE__ */
|
|
314
|
+
onClick: () => W(s),
|
|
315
|
+
children: _("bigconsole.dashboards.view.retry", "Retry")
|
|
316
|
+
}), /* @__PURE__ */ m(f, {
|
|
308
317
|
size: "sm",
|
|
309
318
|
variant: "outline",
|
|
310
|
-
onClick: () =>
|
|
311
|
-
children:
|
|
319
|
+
onClick: () => g("/dashboards"),
|
|
320
|
+
children: _("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
|
|
312
321
|
})] })
|
|
313
322
|
})
|
|
314
|
-
}) :
|
|
323
|
+
}) : C ? /* @__PURE__ */ m("div", {
|
|
315
324
|
className: "flex flex-col items-center justify-center h-full",
|
|
316
325
|
style: { padding: "var(--space-pagePadding)" },
|
|
317
|
-
children: /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ m(xe, {
|
|
318
327
|
illustration: "empty-data",
|
|
319
|
-
title:
|
|
320
|
-
description: /* @__PURE__ */
|
|
328
|
+
title: _("bigconsole.dashboards.view.notFoundTitle", "Dashboard not found"),
|
|
329
|
+
description: /* @__PURE__ */ h(p, { children: [_("bigconsole.dashboards.view.notFoundDescription", "The dashboard you're looking for doesn't exist or has been deleted."), /* @__PURE__ */ m("span", {
|
|
321
330
|
className: "mt-2 block font-mono text-xs text-text-muted break-all",
|
|
322
|
-
children:
|
|
331
|
+
children: _("bigconsole.dashboards.view.idLabel", "ID: {{id}}", { id: s ?? "" })
|
|
323
332
|
})] }),
|
|
324
|
-
action: /* @__PURE__ */
|
|
325
|
-
onClick: () =>
|
|
326
|
-
children:
|
|
333
|
+
action: /* @__PURE__ */ m(f, {
|
|
334
|
+
onClick: () => g("/dashboards"),
|
|
335
|
+
children: _("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
|
|
327
336
|
})
|
|
328
337
|
})
|
|
329
|
-
}) :
|
|
338
|
+
}) : H || !A ? /* @__PURE__ */ m("div", {
|
|
330
339
|
className: "flex items-center justify-center h-full",
|
|
331
340
|
role: "status",
|
|
332
341
|
"aria-live": "polite",
|
|
333
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ h("div", {
|
|
334
343
|
className: "flex flex-col items-center gap-4",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ m("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ m("p", {
|
|
336
345
|
className: "text-sm text-text-secondary",
|
|
337
|
-
children:
|
|
346
|
+
children: _("bigconsole.dashboards.view.loading", "Loading dashboard...")
|
|
338
347
|
})]
|
|
339
348
|
})
|
|
340
|
-
}) : /* @__PURE__ */
|
|
349
|
+
}) : /* @__PURE__ */ h("div", {
|
|
341
350
|
className: "h-full flex flex-col overflow-hidden",
|
|
342
351
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ m(a, {
|
|
344
353
|
emphasis: "bare",
|
|
345
354
|
padding: "none",
|
|
346
355
|
"data-testid": "dashboard-route-header",
|
|
347
356
|
"aria-label": "Dashboard",
|
|
348
357
|
className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2",
|
|
349
358
|
headerClassName: "",
|
|
350
|
-
header: /* @__PURE__ */
|
|
359
|
+
header: /* @__PURE__ */ h("div", {
|
|
351
360
|
className: "flex flex-wrap items-center gap-control-gap",
|
|
352
361
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
onClick:
|
|
362
|
+
/* @__PURE__ */ h(f, {
|
|
363
|
+
onClick: Ve,
|
|
355
364
|
variant: "ghost",
|
|
356
365
|
size: "sm",
|
|
357
|
-
title:
|
|
358
|
-
"aria-label":
|
|
366
|
+
title: _("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
|
|
367
|
+
"aria-label": _("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
|
|
359
368
|
className: "flex-shrink-0",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ m(be, { className: "w-4 h-4 mr-2" }), _("bigconsole.dashboards.view.back", "Back")]
|
|
361
370
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ m("h1", {
|
|
363
372
|
className: "min-w-0 flex-1 truncate text-sm font-semibold text-text-primary",
|
|
364
|
-
title:
|
|
365
|
-
children:
|
|
373
|
+
title: A.name,
|
|
374
|
+
children: A.name
|
|
366
375
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ m("div", {
|
|
368
377
|
className: "flex-shrink-0",
|
|
369
|
-
children: /* @__PURE__ */
|
|
370
|
-
isLive:
|
|
371
|
-
onToggle: () =>
|
|
378
|
+
children: /* @__PURE__ */ m(ue, {
|
|
379
|
+
isLive: E,
|
|
380
|
+
onToggle: () => je((e) => !e)
|
|
372
381
|
})
|
|
373
382
|
})
|
|
374
383
|
]
|
|
375
384
|
})
|
|
376
385
|
}),
|
|
377
|
-
|
|
378
|
-
currentDashboardId:
|
|
379
|
-
currentDashboardName:
|
|
380
|
-
basePath: `${
|
|
386
|
+
D && /* @__PURE__ */ m(fe, {
|
|
387
|
+
currentDashboardId: A.id,
|
|
388
|
+
currentDashboardName: A.name,
|
|
389
|
+
basePath: `${Te}/dashboards`
|
|
381
390
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ m("div", {
|
|
383
392
|
className: "flex-1 min-w-0 overflow-hidden",
|
|
384
|
-
children: /* @__PURE__ */
|
|
385
|
-
dashboardId:
|
|
386
|
-
pageId:
|
|
387
|
-
title:
|
|
388
|
-
onPaste:
|
|
389
|
-
onSave:
|
|
390
|
-
isSaving:
|
|
391
|
-
onExport:
|
|
392
|
-
onPublishTemplate:
|
|
393
|
+
children: /* @__PURE__ */ m(se, {
|
|
394
|
+
dashboardId: A.id,
|
|
395
|
+
pageId: I || A.pages?.[0]?.id,
|
|
396
|
+
title: A.name,
|
|
397
|
+
onPaste: He,
|
|
398
|
+
onSave: Ee ? Be : void 0,
|
|
399
|
+
isSaving: ke,
|
|
400
|
+
onExport: De ? Ue : void 0,
|
|
401
|
+
onPublishTemplate: Oe ? Ge : void 0,
|
|
393
402
|
pages: X,
|
|
394
403
|
activePageId: Q ?? void 0,
|
|
395
404
|
onPageChange: Y,
|
|
396
|
-
onPageAdd:
|
|
397
|
-
onPageRename:
|
|
398
|
-
onPageDuplicate:
|
|
399
|
-
onPageDelete:
|
|
400
|
-
onPagesReorder:
|
|
405
|
+
onPageAdd: Je,
|
|
406
|
+
onPageRename: Ye,
|
|
407
|
+
onPageDuplicate: Xe,
|
|
408
|
+
onPageDelete: Ze,
|
|
409
|
+
onPagesReorder: Qe,
|
|
401
410
|
showPageTabs: !0
|
|
402
411
|
})
|
|
403
412
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
isOpen:
|
|
406
|
-
dashboardId:
|
|
407
|
-
dashboardName:
|
|
408
|
-
onClose:
|
|
413
|
+
/* @__PURE__ */ m(de, {
|
|
414
|
+
isOpen: Ae,
|
|
415
|
+
dashboardId: A.id,
|
|
416
|
+
dashboardName: A.name,
|
|
417
|
+
onClose: qe
|
|
409
418
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
isOpen:
|
|
412
|
-
dashboardId:
|
|
413
|
-
dashboardName:
|
|
414
|
-
dashboardDescription:
|
|
415
|
-
onClose:
|
|
419
|
+
/* @__PURE__ */ m(pe, {
|
|
420
|
+
isOpen: We,
|
|
421
|
+
dashboardId: A.id,
|
|
422
|
+
dashboardName: A.name,
|
|
423
|
+
dashboardDescription: A.description,
|
|
424
|
+
onClose: Ke
|
|
416
425
|
})
|
|
417
426
|
]
|
|
418
|
-
}) : /* @__PURE__ */
|
|
419
|
-
title:
|
|
420
|
-
description:
|
|
427
|
+
}) : /* @__PURE__ */ m(ve, {
|
|
428
|
+
title: _("bigconsole.dashboards.view.accessDeniedTitle", "Access Denied"),
|
|
429
|
+
description: _("bigconsole.dashboards.view.accessDeniedDescription", "You don't have permission to view this dashboard.")
|
|
421
430
|
});
|
|
422
431
|
});
|
|
423
432
|
//#endregion
|
|
424
|
-
export {
|
|
433
|
+
export { g as DashboardViewPage, g as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live board refresh cadence (BOFF-10201).
|
|
3
|
+
*
|
|
4
|
+
* While GO LIVE is on, the dashboard view refetches two things:
|
|
5
|
+
*
|
|
6
|
+
* - the board STRUCTURE (dashboard + widget list) every few seconds, so new
|
|
7
|
+
* widgets and pages appear without a reload;
|
|
8
|
+
* - every on-screen widget's DATA (`GetWidget`), so a changed sink payload
|
|
9
|
+
* shows up within seconds.
|
|
10
|
+
*
|
|
11
|
+
* The widget list (`WidgetListFields`) carries no data, so before this change
|
|
12
|
+
* GO LIVE only refreshed structure and the numbers moved on each widget's own
|
|
13
|
+
* `refreshInterval` — 300s on generated boards, never when it is 0. A wall
|
|
14
|
+
* display therefore lagged a sink change by up to five minutes.
|
|
15
|
+
*
|
|
16
|
+
* The data cadence matches fe-libs' short-lived GraphQL read cache
|
|
17
|
+
* (`RECENT_QUERY_CACHE_TTL_MS`, 15s): refetching any faster would be answered
|
|
18
|
+
* from that cache and add requests without adding freshness.
|
|
19
|
+
*/
|
|
20
|
+
/** How often live mode refetches the dashboard and widget list. */
|
|
21
|
+
export declare const LIVE_STRUCTURE_POLL_MS = 3500;
|
|
22
|
+
/** How often live mode refetches every visible widget's data. */
|
|
23
|
+
export declare const LIVE_DATA_REFRESH_MS = 15000;
|
|
24
|
+
/** Whole seconds of the data cadence, for user-facing copy. */
|
|
25
|
+
export declare const LIVE_DATA_REFRESH_SECONDS: number;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the live data refetch is due. `lastRefreshAt` is null before the
|
|
28
|
+
* first refetch, which is always due so the board catches up the moment live
|
|
29
|
+
* mode is switched on or the tab becomes visible again.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isLiveDataRefreshDue(lastRefreshAt: number | null, now: number): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/bigconsole/utils/liveBoardRefresh.ts
|
|
2
|
+
var e = 3500, t = 15e3, n = Math.round(t / 1e3);
|
|
3
|
+
function r(e, n) {
|
|
4
|
+
return e === null || n - e >= t;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as LIVE_DATA_REFRESH_MS, n as LIVE_DATA_REFRESH_SECONDS, e as LIVE_STRUCTURE_POLL_MS, r as isLiveDataRefreshDue };
|