@burdenoff/microfe-bigconsole 2026.1124.9 → 2026.1124.10
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/components/dashboard/DashboardGalleryCard.js +1 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.d.ts +4 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.js +49 -35
- package/dist/bigconsole/components/fleet/FleetChildrenPanel.js +270 -186
- package/dist/bigconsole/hooks/useBoardDragLink.d.ts +2 -0
- package/dist/bigconsole/hooks/useBoardDragLink.js +9 -9
- package/dist/bigconsole/pages/DashboardsPage.js +422 -364
- package/dist/bigconsole/utils/fleetDetachCopies.d.ts +26 -0
- package/dist/bigconsole/utils/fleetDetachCopies.js +28 -0
- package/dist/bigconsole/utils/fleetDrag.d.ts +39 -3
- package/dist/bigconsole/utils/fleetDrag.js +23 -6
- package/package.json +1 -1
|
@@ -2,21 +2,25 @@ import { useBigConsole as e } from "../../context/BigConsoleContext.js";
|
|
|
2
2
|
import { BIGCONSOLE_PERMISSIONS as t } from "../../../constants/permissions.js";
|
|
3
3
|
import { useTr as n } from "../../../shared/hooks/useTr.js";
|
|
4
4
|
import "../../context/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
5
|
+
import { useFleetBoardActions as r } from "../../hooks/useFleetBoardActions.js";
|
|
6
|
+
import { useFleetChildren as i } from "../../hooks/useFleetChildren.js";
|
|
7
|
+
import { useFleetConfirm as a } from "../../hooks/useFleetConfirm.js";
|
|
8
|
+
import { useActionLock as ee, useOwnerBoundRun as te } from "../../hooks/useOwnerBoundRun.js";
|
|
9
|
+
import { useFleetMasterActions as o } from "../../hooks/useFleetMasterActions.js";
|
|
10
|
+
import { canStopBeingMaster as s, detachCopies as ne } from "../../utils/fleetDetachCopies.js";
|
|
11
|
+
import { trCount as c } from "../../utils/fleetPlural.js";
|
|
12
|
+
import { pushIsEmpty as l } from "../../utils/fleetPush.js";
|
|
13
|
+
import { CreateLinkedCopyDialog as u } from "./CreateLinkedCopyDialog.js";
|
|
14
|
+
import { FleetBindingsDialog as d } from "./FleetBindingsDialog.js";
|
|
15
|
+
import { FleetCopySection as f } from "./FleetCopySection.js";
|
|
16
|
+
import { FleetPushResultTable as p } from "./FleetPushResultTable.js";
|
|
17
|
+
import { memo as m, useCallback as h, useEffect as re, useMemo as ie, useRef as ae, useState as g } from "react";
|
|
18
|
+
import { PermissionButton as _ } from "@burdenoff/fe-libs/shared/components";
|
|
19
|
+
import { Network as oe, Unlink as se, X as v } from "lucide-react";
|
|
20
|
+
import { Button as y, Spinner as b } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
18
22
|
// src/bigconsole/components/fleet/FleetChildrenPanel.tsx
|
|
19
|
-
var
|
|
23
|
+
var w = {
|
|
20
24
|
display: "inline-flex",
|
|
21
25
|
alignItems: "center",
|
|
22
26
|
padding: "2px 8px",
|
|
@@ -27,110 +31,171 @@ var C = {
|
|
|
27
31
|
textTransform: "uppercase",
|
|
28
32
|
letterSpacing: "0.02em",
|
|
29
33
|
whiteSpace: "nowrap"
|
|
30
|
-
},
|
|
31
|
-
...
|
|
34
|
+
}, T = {
|
|
35
|
+
...w,
|
|
32
36
|
backgroundColor: "var(--color-status-warning-bgSubtle)",
|
|
33
37
|
color: "var(--color-status-warning-text)"
|
|
34
|
-
},
|
|
35
|
-
let
|
|
38
|
+
}, E = (e, t) => e instanceof Error && e.message ? e.message : t, D = m(function({ dashboardId: m, dashboardName: D, masterName: ce = null, onBoardChanged: le, lock: ue, changeToken: O, onClose: de, onOpenBoard: fe }) {
|
|
39
|
+
let k = n(), { workspaceId: pe, currentUser: me } = e(), he = `${pe ?? ""}:${me?.id ?? ""}:${m}`, { loading: A, error: j, isMaster: M, linkStatus: N, summary: P, refetch: F } = i(m, !0), I = o(), L = r(), R = a(), z = ie(() => (P?.children ?? []).filter((e) => e.status === "ACTIVE").map((e) => ({
|
|
36
40
|
id: e.dashboardId,
|
|
37
41
|
name: e.name
|
|
38
|
-
})), [
|
|
39
|
-
|
|
40
|
-
O !==
|
|
41
|
-
}, [O,
|
|
42
|
-
let
|
|
43
|
-
V({ phase: "idle" }),
|
|
44
|
-
}, []), { acting:
|
|
42
|
+
})), [P]), [B, V] = g({ phase: "idle" }), [ge, H] = g(!1), [_e, U] = g(!1), [ve, W] = g(null), [G, K] = g(null), ye = ee(), q = ue ?? ye, J = ae(O);
|
|
43
|
+
re(() => {
|
|
44
|
+
O !== J.current && (J.current = O, V((e) => e.phase === "preview" ? { phase: "idle" } : e), F());
|
|
45
|
+
}, [O, F]);
|
|
46
|
+
let be = h(() => {
|
|
47
|
+
V({ phase: "idle" }), H(!1), U(!1), W(null), K(null);
|
|
48
|
+
}, []), { acting: xe, begin: Y, run: X } = te(he, F, be, q), Z = I.busy || L.busy || xe, Q = h(() => (K(null), X(() => I.setAsMaster(m), () => K({
|
|
45
49
|
tone: "ok",
|
|
46
|
-
text:
|
|
47
|
-
}), (e) =>
|
|
50
|
+
text: k("bigconsole.fleet.children.nowMaster", "This board is now a master.")
|
|
51
|
+
}), (e) => K({
|
|
48
52
|
tone: "error",
|
|
49
|
-
text:
|
|
53
|
+
text: E(e, k("bigconsole.fleet.error.setMaster", "The board could not be made a master."))
|
|
50
54
|
}))), [
|
|
55
|
+
I,
|
|
56
|
+
m,
|
|
57
|
+
X,
|
|
58
|
+
k
|
|
59
|
+
]), Se = h(async (e) => {
|
|
60
|
+
let t = Y();
|
|
61
|
+
await R(k("bigconsole.fleet.detach.title", "Detach from master?"), k("bigconsole.fleet.detach.confirm", "\"{{name}}\" will keep a plain copy of everything and stop following its master. Detach it?", { name: e.name }), k("bigconsole.fleet.detach.ok", "Detach")) && t() && (K(null), await X(() => L.detach(e.dashboardId), () => K({
|
|
62
|
+
tone: "ok",
|
|
63
|
+
text: k("bigconsole.fleet.notice.detached", "\"{{name}}\" no longer follows a master.", { name: e.name })
|
|
64
|
+
}), (e) => K({
|
|
65
|
+
tone: "error",
|
|
66
|
+
text: E(e, k("bigconsole.fleet.error.detach", "The board could not be detached."))
|
|
67
|
+
})));
|
|
68
|
+
}, [
|
|
69
|
+
Y,
|
|
70
|
+
L,
|
|
51
71
|
R,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
X,
|
|
73
|
+
k
|
|
74
|
+
]), Ce = h(async () => {
|
|
75
|
+
K(null);
|
|
76
|
+
let e = P?.hiddenCount ?? 0, t = (P?.children ?? []).filter((e) => e.status === "ACTIVE").map((e) => ({
|
|
77
|
+
id: e.dashboardId,
|
|
78
|
+
name: e.name
|
|
79
|
+
})), n = (e) => K({
|
|
80
|
+
tone: "error",
|
|
81
|
+
text: E(e, k("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
|
|
82
|
+
});
|
|
83
|
+
if (t.length === 0) {
|
|
84
|
+
await X(() => I.unsetAsMaster(m), () => K({
|
|
85
|
+
tone: "ok",
|
|
86
|
+
text: k("bigconsole.fleet.children.noLongerMaster", "This board is no longer a master.")
|
|
87
|
+
}), n);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let r = Y();
|
|
91
|
+
await R(k("bigconsole.fleet.children.unsetTitle", "Stop being a master?"), [c(k, t.length, "bigconsole.fleet.children.unsetConfirm", "{{count}} copies follow this board. Each keeps a plain copy of everything and stops following it, and then this board stops being a master. Continue?", "1 copy follows this board. It keeps a plain copy of everything and stops following it, and then this board stops being a master. Continue?"), e > 0 ? c(k, e, "bigconsole.fleet.children.unsetConfirmHidden", "{{count}} other copies you cannot open may follow it too: if they do, this board stays a master until their owners detach them.", "1 other copy you cannot open may follow it too: if it does, this board stays a master until its owner detaches it.") : ""].filter(Boolean).join(" "), k("bigconsole.fleet.children.unsetOk", "Stop being a master")) && r() && await X(async () => {
|
|
92
|
+
let e = await ne(t, L.detach, r), n = null;
|
|
93
|
+
if (s(e)) try {
|
|
94
|
+
await I.unsetAsMaster(m);
|
|
95
|
+
} catch (e) {
|
|
96
|
+
n = e;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
result: e,
|
|
100
|
+
unsetError: n,
|
|
101
|
+
stopped: s(e) && n === null
|
|
102
|
+
};
|
|
103
|
+
}, ({ result: t, unsetError: n, stopped: r }) => {
|
|
104
|
+
if (r) {
|
|
105
|
+
K({
|
|
106
|
+
tone: "ok",
|
|
107
|
+
text: c(k, t.detached.length, "bigconsole.fleet.children.unsetDone", "{{count}} copies detached. This board is no longer a master.", "1 copy detached. This board is no longer a master.")
|
|
108
|
+
});
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
let i = t.failed.map((e) => e.message ? `${e.name}: ${e.message}` : e.name);
|
|
112
|
+
K({
|
|
113
|
+
tone: "error",
|
|
114
|
+
text: [
|
|
115
|
+
k("bigconsole.fleet.children.unsetPartial", "This board is still a master."),
|
|
116
|
+
t.detached.length > 0 ? c(k, t.detached.length, "bigconsole.fleet.children.unsetSome", "{{count}} copies were detached.", "1 copy was detached.") : "",
|
|
117
|
+
i.length > 0 ? k("bigconsole.fleet.children.unsetFailed", "These could not be detached: {{list}}.", { list: i.join("; ") }) : "",
|
|
118
|
+
n === null ? "" : e > 0 ? k("bigconsole.fleet.children.unsetHidden", "Copies you cannot open still follow it: their owners have to detach them.") : E(n, k("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
|
|
119
|
+
].filter(Boolean).join(" ")
|
|
120
|
+
});
|
|
121
|
+
}, n);
|
|
122
|
+
}, [
|
|
123
|
+
I,
|
|
124
|
+
Y,
|
|
125
|
+
L,
|
|
62
126
|
R,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
127
|
+
m,
|
|
128
|
+
X,
|
|
129
|
+
P,
|
|
130
|
+
k
|
|
131
|
+
]), we = h((e) => (W(null), X(() => I.createLinkedCopy(m, e), () => {
|
|
132
|
+
H(!1), K({
|
|
68
133
|
tone: "ok",
|
|
69
|
-
text:
|
|
134
|
+
text: k("bigconsole.fleet.children.created", "\"{{name}}\" is now a linked copy.", { name: e })
|
|
70
135
|
});
|
|
71
|
-
}, (e) =>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
]), $ =
|
|
136
|
+
}, (e) => W(E(e, k("bigconsole.fleet.error.create", "The linked copy could not be created."))))), [
|
|
137
|
+
I,
|
|
138
|
+
m,
|
|
139
|
+
X,
|
|
140
|
+
k
|
|
141
|
+
]), $ = h((e) => (K(null), X(() => I.previewPush(m, e), (t) => V({
|
|
77
142
|
phase: "preview",
|
|
78
143
|
scope: e,
|
|
79
144
|
result: t
|
|
80
|
-
}), (e) =>
|
|
145
|
+
}), (e) => K({
|
|
81
146
|
tone: "error",
|
|
82
|
-
text:
|
|
147
|
+
text: E(e, k("bigconsole.fleet.error.preview", "The preview could not be made."))
|
|
83
148
|
}))), [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
]),
|
|
149
|
+
I,
|
|
150
|
+
m,
|
|
151
|
+
X,
|
|
152
|
+
k
|
|
153
|
+
]), Te = h((e) => (K(null), X(() => I.push(m, e), (e) => V({
|
|
89
154
|
phase: "done",
|
|
90
155
|
result: e
|
|
91
|
-
}), (e) =>
|
|
156
|
+
}), (e) => K({
|
|
92
157
|
tone: "error",
|
|
93
|
-
text:
|
|
158
|
+
text: E(e, k("bigconsole.fleet.error.push", "The push could not be made."))
|
|
94
159
|
}))), [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
]),
|
|
160
|
+
I,
|
|
161
|
+
m,
|
|
162
|
+
X,
|
|
163
|
+
k
|
|
164
|
+
]), Ee = (e) => /* @__PURE__ */ C("span", {
|
|
100
165
|
className: "flex flex-wrap items-center gap-1",
|
|
101
166
|
children: [
|
|
102
|
-
e.status === "PENDING" && /* @__PURE__ */
|
|
167
|
+
e.status === "PENDING" && /* @__PURE__ */ S("span", {
|
|
103
168
|
"data-testid": "fleet-child-pending",
|
|
104
|
-
style:
|
|
105
|
-
children:
|
|
169
|
+
style: T,
|
|
170
|
+
children: k("bigconsole.fleet.badge.pending", "Waiting for the owner's OK")
|
|
106
171
|
}),
|
|
107
|
-
e.behindMaster && /* @__PURE__ */
|
|
172
|
+
e.behindMaster && /* @__PURE__ */ S("span", {
|
|
108
173
|
"data-testid": "fleet-child-behind",
|
|
109
|
-
style:
|
|
110
|
-
children: e.missingWidgetCount ?
|
|
174
|
+
style: T,
|
|
175
|
+
children: e.missingWidgetCount ? k("bigconsole.fleet.children.behindCount", "Behind · {{count}} widgets missing", { count: e.missingWidgetCount }) : k("bigconsole.fleet.children.behind", "Behind the master")
|
|
111
176
|
}),
|
|
112
|
-
e.openFlagCount > 0 && /* @__PURE__ */
|
|
177
|
+
e.openFlagCount > 0 && /* @__PURE__ */ S("span", {
|
|
113
178
|
"data-testid": "fleet-child-flags",
|
|
114
|
-
style:
|
|
115
|
-
children:
|
|
179
|
+
style: T,
|
|
180
|
+
children: k("bigconsole.fleet.children.flags", "{{count}} open flags", { count: e.openFlagCount })
|
|
116
181
|
}),
|
|
117
|
-
e.status === "ACTIVE" && !e.behindMaster && e.openFlagCount === 0 && /* @__PURE__ */
|
|
182
|
+
e.status === "ACTIVE" && !e.behindMaster && e.openFlagCount === 0 && /* @__PURE__ */ S("span", {
|
|
118
183
|
style: {
|
|
119
|
-
...
|
|
184
|
+
...w,
|
|
120
185
|
color: "var(--color-status-success-text)"
|
|
121
186
|
},
|
|
122
|
-
children:
|
|
187
|
+
children: k("bigconsole.fleet.children.inSync", "In sync")
|
|
123
188
|
})
|
|
124
189
|
]
|
|
125
190
|
});
|
|
126
|
-
return /* @__PURE__ */
|
|
127
|
-
"aria-label":
|
|
191
|
+
return /* @__PURE__ */ C("section", {
|
|
192
|
+
"aria-label": k("bigconsole.fleet.children.title", "Children"),
|
|
128
193
|
"data-testid": "fleet-children-panel",
|
|
129
194
|
className: "flex flex-col gap-form-gap",
|
|
130
195
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ C("div", {
|
|
132
197
|
className: "flex items-center justify-between gap-form-gap",
|
|
133
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ C("h2", {
|
|
134
199
|
className: "flex items-center gap-2",
|
|
135
200
|
style: {
|
|
136
201
|
margin: 0,
|
|
@@ -138,118 +203,118 @@ var C = {
|
|
|
138
203
|
fontSize: "var(--font-size-body)",
|
|
139
204
|
fontWeight: "var(--font-weight-semibold)"
|
|
140
205
|
},
|
|
141
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ S(oe, {
|
|
142
207
|
"aria-hidden": "true",
|
|
143
208
|
style: {
|
|
144
209
|
height: "var(--size-icon-sm)",
|
|
145
210
|
width: "var(--size-icon-sm)"
|
|
146
211
|
}
|
|
147
|
-
}),
|
|
148
|
-
}), /* @__PURE__ */
|
|
212
|
+
}), k("bigconsole.fleet.children.title", "Children")]
|
|
213
|
+
}), /* @__PURE__ */ S(y, {
|
|
149
214
|
variant: "ghost",
|
|
150
215
|
size: "sm",
|
|
151
|
-
onClick:
|
|
152
|
-
"aria-label":
|
|
153
|
-
title:
|
|
216
|
+
onClick: de,
|
|
217
|
+
"aria-label": k("bigconsole.fleet.children.close", "Close the Children panel"),
|
|
218
|
+
title: k("bigconsole.fleet.children.close", "Close the Children panel"),
|
|
154
219
|
"data-testid": "fleet-children-close",
|
|
155
|
-
children: /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ S(v, { style: {
|
|
156
221
|
height: "var(--size-icon-sm)",
|
|
157
222
|
width: "var(--size-icon-sm)"
|
|
158
223
|
} })
|
|
159
224
|
})]
|
|
160
225
|
}),
|
|
161
|
-
|
|
162
|
-
role:
|
|
226
|
+
G && /* @__PURE__ */ S("p", {
|
|
227
|
+
role: G.tone === "error" ? "alert" : "status",
|
|
163
228
|
"data-testid": "fleet-children-message",
|
|
164
229
|
style: {
|
|
165
230
|
margin: 0,
|
|
166
|
-
color:
|
|
231
|
+
color: G.tone === "error" ? "var(--color-status-error-text)" : "var(--color-text-primary)",
|
|
167
232
|
fontSize: "var(--font-size-body-sm)"
|
|
168
233
|
},
|
|
169
|
-
children:
|
|
234
|
+
children: G.text
|
|
170
235
|
}),
|
|
171
|
-
|
|
236
|
+
A && !P && !M && /* @__PURE__ */ C("div", {
|
|
172
237
|
className: "flex items-center gap-2",
|
|
173
238
|
style: { color: "var(--color-text-secondary)" },
|
|
174
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ S(b, { style: {
|
|
175
240
|
height: "var(--size-icon-sm)",
|
|
176
241
|
width: "var(--size-icon-sm)"
|
|
177
|
-
} }),
|
|
242
|
+
} }), k("bigconsole.fleet.children.loading", "Loading the copies of this board…")]
|
|
178
243
|
}),
|
|
179
|
-
!
|
|
244
|
+
!A && j && /* @__PURE__ */ S("p", {
|
|
180
245
|
role: "alert",
|
|
181
246
|
style: {
|
|
182
247
|
margin: 0,
|
|
183
248
|
color: "var(--color-status-error-text)"
|
|
184
249
|
},
|
|
185
|
-
children:
|
|
250
|
+
children: k("bigconsole.fleet.children.loadError", "The copies of this board could not be loaded.")
|
|
186
251
|
}),
|
|
187
|
-
!
|
|
188
|
-
dashboardId:
|
|
189
|
-
masterName:
|
|
190
|
-
onBoardChanged:
|
|
191
|
-
lock:
|
|
252
|
+
!A && !j && N === "ACTIVE" && /* @__PURE__ */ S(f, {
|
|
253
|
+
dashboardId: m,
|
|
254
|
+
masterName: ce,
|
|
255
|
+
onBoardChanged: le,
|
|
256
|
+
lock: q,
|
|
192
257
|
changeToken: O
|
|
193
258
|
}),
|
|
194
|
-
!
|
|
259
|
+
!A && !j && !M && /* @__PURE__ */ C("div", {
|
|
195
260
|
className: "flex flex-col gap-form-gap",
|
|
196
261
|
"data-testid": "fleet-children-not-master",
|
|
197
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ S("p", {
|
|
198
263
|
style: {
|
|
199
264
|
margin: 0,
|
|
200
265
|
color: "var(--color-text-secondary)",
|
|
201
266
|
fontSize: "var(--font-size-body-sm)"
|
|
202
267
|
},
|
|
203
|
-
children:
|
|
204
|
-
}), /* @__PURE__ */
|
|
268
|
+
children: k("bigconsole.fleet.children.notMaster", "Other boards can follow this one as linked copies once it is a master. Its own widgets stay as they are.")
|
|
269
|
+
}), /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(_, {
|
|
205
270
|
permission: t.DASHBOARD_UPDATE,
|
|
206
271
|
deniedBehavior: "hide",
|
|
207
|
-
children: /* @__PURE__ */
|
|
208
|
-
onClick:
|
|
209
|
-
disabled:
|
|
272
|
+
children: /* @__PURE__ */ C(y, {
|
|
273
|
+
onClick: Q,
|
|
274
|
+
disabled: Z,
|
|
210
275
|
"data-testid": "fleet-set-master",
|
|
211
|
-
children: [
|
|
276
|
+
children: [Z && /* @__PURE__ */ S(b, { style: {
|
|
212
277
|
height: "var(--size-icon-sm)",
|
|
213
278
|
width: "var(--size-icon-sm)"
|
|
214
|
-
} }),
|
|
279
|
+
} }), k("bigconsole.fleet.children.setMaster", "Set as master")]
|
|
215
280
|
})
|
|
216
281
|
}) })]
|
|
217
282
|
}),
|
|
218
|
-
!
|
|
219
|
-
/* @__PURE__ */
|
|
283
|
+
!j && M && P && /* @__PURE__ */ C(x, { children: [
|
|
284
|
+
/* @__PURE__ */ C("p", {
|
|
220
285
|
"data-testid": "fleet-children-counts",
|
|
221
286
|
style: {
|
|
222
287
|
margin: 0,
|
|
223
288
|
color: "var(--color-text-secondary)",
|
|
224
289
|
fontSize: "var(--font-size-body-sm)"
|
|
225
290
|
},
|
|
226
|
-
children: [
|
|
227
|
-
total:
|
|
228
|
-
active:
|
|
229
|
-
pending:
|
|
230
|
-
behind:
|
|
231
|
-
}),
|
|
291
|
+
children: [k("bigconsole.fleet.children.counts", "{{total}} copies: {{active}} active, {{pending}} waiting for an owner, {{behind}} behind the master.", {
|
|
292
|
+
total: P.total,
|
|
293
|
+
active: P.active,
|
|
294
|
+
pending: P.pending,
|
|
295
|
+
behind: P.behind
|
|
296
|
+
}), P.hiddenCount > 0 && /* @__PURE__ */ C(x, { children: [" ", k("bigconsole.fleet.children.hidden", "{{count}} you cannot open are not listed.", { count: P.hiddenCount })] })]
|
|
232
297
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ C("ul", {
|
|
234
299
|
className: "flex flex-col gap-1",
|
|
235
300
|
style: {
|
|
236
301
|
listStyle: "none",
|
|
237
302
|
margin: 0,
|
|
238
303
|
padding: 0
|
|
239
304
|
},
|
|
240
|
-
children: [
|
|
305
|
+
children: [P.children.length === 0 && P.total === 0 && /* @__PURE__ */ S("li", {
|
|
241
306
|
style: {
|
|
242
307
|
color: "var(--color-text-secondary)",
|
|
243
308
|
fontSize: "var(--font-size-body-sm)"
|
|
244
309
|
},
|
|
245
|
-
children:
|
|
246
|
-
}),
|
|
310
|
+
children: k("bigconsole.fleet.children.none", "No copies yet. Create one, or link a board from the dashboards list.")
|
|
311
|
+
}), P.children.map((e) => /* @__PURE__ */ C("li", {
|
|
247
312
|
"data-testid": "fleet-child",
|
|
248
313
|
className: "flex items-center justify-between gap-form-gap rounded-input border px-3 py-2",
|
|
249
314
|
style: { borderColor: "var(--color-border-subtle)" },
|
|
250
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ S("button", {
|
|
251
316
|
type: "button",
|
|
252
|
-
onClick: () =>
|
|
317
|
+
onClick: () => fe(e.dashboardId),
|
|
253
318
|
className: "min-w-0 truncate text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
254
319
|
style: {
|
|
255
320
|
color: "var(--color-text-primary)",
|
|
@@ -259,79 +324,98 @@ var C = {
|
|
|
259
324
|
cursor: "pointer"
|
|
260
325
|
},
|
|
261
326
|
children: e.name
|
|
262
|
-
}),
|
|
327
|
+
}), /* @__PURE__ */ C("span", {
|
|
328
|
+
className: "flex shrink-0 items-center gap-2",
|
|
329
|
+
children: [Ee(e), e.status === "ACTIVE" && /* @__PURE__ */ S(_, {
|
|
330
|
+
permission: t.DASHBOARD_UPDATE,
|
|
331
|
+
deniedBehavior: "hide",
|
|
332
|
+
children: /* @__PURE__ */ S(y, {
|
|
333
|
+
variant: "ghost",
|
|
334
|
+
size: "sm",
|
|
335
|
+
onClick: () => void Se(e),
|
|
336
|
+
disabled: Z,
|
|
337
|
+
"aria-label": k("bigconsole.fleet.children.detachCopy", "Detach {{name}}", { name: e.name }),
|
|
338
|
+
title: k("bigconsole.fleet.children.detachCopy", "Detach {{name}}", { name: e.name }),
|
|
339
|
+
"data-testid": "fleet-child-detach",
|
|
340
|
+
children: /* @__PURE__ */ S(se, { style: {
|
|
341
|
+
height: "var(--size-icon-sm)",
|
|
342
|
+
width: "var(--size-icon-sm)"
|
|
343
|
+
} })
|
|
344
|
+
})
|
|
345
|
+
})]
|
|
346
|
+
})]
|
|
263
347
|
}, e.dashboardId))]
|
|
264
348
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ C("div", {
|
|
266
350
|
className: "flex flex-wrap items-center gap-2",
|
|
267
351
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ S(_, {
|
|
269
353
|
permission: t.DASHBOARD_CREATE,
|
|
270
354
|
deniedBehavior: "hide",
|
|
271
|
-
children: /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ S(y, {
|
|
272
356
|
variant: "outline",
|
|
273
357
|
onClick: () => {
|
|
274
|
-
|
|
358
|
+
W(null), H(!0);
|
|
275
359
|
},
|
|
276
|
-
disabled:
|
|
360
|
+
disabled: Z,
|
|
277
361
|
"data-testid": "fleet-create-copy",
|
|
278
|
-
children:
|
|
362
|
+
children: k("bigconsole.fleet.children.createCopy", "Create linked copy…")
|
|
279
363
|
})
|
|
280
364
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ S(_, {
|
|
282
366
|
permission: t.DASHBOARD_UPDATE,
|
|
283
367
|
deniedBehavior: "hide",
|
|
284
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ S(y, {
|
|
285
369
|
onClick: () => $("DIRECT_COPIES"),
|
|
286
|
-
disabled:
|
|
370
|
+
disabled: Z || P.total === 0 || B.phase === "preview",
|
|
287
371
|
"data-testid": "fleet-push",
|
|
288
|
-
children:
|
|
372
|
+
children: k("bigconsole.fleet.children.push", "Push to copies…")
|
|
289
373
|
})
|
|
290
374
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ S(_, {
|
|
292
376
|
permission: t.DASHBOARD_UPDATE,
|
|
293
377
|
deniedBehavior: "hide",
|
|
294
|
-
children: /* @__PURE__ */
|
|
378
|
+
children: /* @__PURE__ */ S(y, {
|
|
295
379
|
variant: "outline",
|
|
296
|
-
onClick: () =>
|
|
297
|
-
disabled:
|
|
380
|
+
onClick: () => U(!0),
|
|
381
|
+
disabled: Z || z.length === 0,
|
|
298
382
|
"data-testid": "fleet-bindings",
|
|
299
|
-
children:
|
|
383
|
+
children: k("bigconsole.fleet.children.bindings", "Data sources…")
|
|
300
384
|
})
|
|
301
385
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ S(_, {
|
|
303
387
|
permission: t.DASHBOARD_UPDATE,
|
|
304
388
|
deniedBehavior: "hide",
|
|
305
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ S(y, {
|
|
306
390
|
variant: "ghost",
|
|
307
|
-
onClick:
|
|
308
|
-
disabled:
|
|
309
|
-
title:
|
|
391
|
+
onClick: () => void Ce(),
|
|
392
|
+
disabled: Z,
|
|
393
|
+
title: P.active > 0 ? k("bigconsole.fleet.children.unsetHint", "Detaches its copies first, after asking, and then stops being a master.") : void 0,
|
|
310
394
|
"data-testid": "fleet-unset-master",
|
|
311
|
-
children:
|
|
395
|
+
children: k("bigconsole.fleet.children.unsetMaster", "Stop being a master")
|
|
312
396
|
})
|
|
313
397
|
})
|
|
314
398
|
]
|
|
315
399
|
})
|
|
316
400
|
] }),
|
|
317
|
-
B.phase === "preview" && /* @__PURE__ */
|
|
401
|
+
B.phase === "preview" && /* @__PURE__ */ C("div", {
|
|
318
402
|
className: "flex flex-col gap-form-gap rounded-input border p-3",
|
|
319
403
|
style: { borderColor: "var(--color-border-subtle)" },
|
|
320
404
|
"data-testid": "fleet-push-preview",
|
|
321
405
|
children: [
|
|
322
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ S("strong", {
|
|
323
407
|
style: { color: "var(--color-text-primary)" },
|
|
324
|
-
children:
|
|
408
|
+
children: k("bigconsole.fleet.push.previewTitle", "Preview: nothing has been changed yet")
|
|
325
409
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ S("div", {
|
|
327
411
|
role: "radiogroup",
|
|
328
|
-
"aria-label":
|
|
412
|
+
"aria-label": k("bigconsole.fleet.push.scopeLabel", "How far to push"),
|
|
329
413
|
className: "flex flex-wrap gap-2",
|
|
330
|
-
children: ["DIRECT_COPIES", "ALL_UNDER"].map((e) => /* @__PURE__ */
|
|
414
|
+
children: ["DIRECT_COPIES", "ALL_UNDER"].map((e) => /* @__PURE__ */ S("button", {
|
|
331
415
|
type: "button",
|
|
332
416
|
role: "radio",
|
|
333
417
|
"aria-checked": B.scope === e,
|
|
334
|
-
disabled:
|
|
418
|
+
disabled: Z,
|
|
335
419
|
onClick: () => B.scope !== e && $(e),
|
|
336
420
|
className: "rounded-input border px-3 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
337
421
|
style: {
|
|
@@ -340,72 +424,72 @@ var C = {
|
|
|
340
424
|
color: "var(--color-text-primary)"
|
|
341
425
|
},
|
|
342
426
|
"data-testid": `fleet-push-scope-${e}`,
|
|
343
|
-
children: e === "DIRECT_COPIES" ?
|
|
427
|
+
children: e === "DIRECT_COPIES" ? k("bigconsole.fleet.push.scopeDirect", "Direct copies") : k("bigconsole.fleet.push.scopeAll", "Copies of copies too")
|
|
344
428
|
}, e))
|
|
345
429
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
|
|
430
|
+
/* @__PURE__ */ S(p, { result: B.result }),
|
|
431
|
+
l(B.result) && /* @__PURE__ */ S("p", {
|
|
348
432
|
style: {
|
|
349
433
|
margin: 0,
|
|
350
434
|
color: "var(--color-text-secondary)",
|
|
351
435
|
fontSize: "var(--font-size-body-sm)"
|
|
352
436
|
},
|
|
353
|
-
children:
|
|
437
|
+
children: k("bigconsole.fleet.push.nothing", "Nothing to push: every copy already has what this board has.")
|
|
354
438
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ C("div", {
|
|
356
440
|
className: "flex gap-2",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
358
|
-
onClick: () =>
|
|
359
|
-
disabled:
|
|
441
|
+
children: [/* @__PURE__ */ C(y, {
|
|
442
|
+
onClick: () => Te(B.scope),
|
|
443
|
+
disabled: Z || l(B.result),
|
|
360
444
|
"data-testid": "fleet-push-confirm",
|
|
361
|
-
children: [
|
|
445
|
+
children: [Z && /* @__PURE__ */ S(b, { style: {
|
|
362
446
|
height: "var(--size-icon-sm)",
|
|
363
447
|
width: "var(--size-icon-sm)"
|
|
364
|
-
} }),
|
|
365
|
-
}), /* @__PURE__ */
|
|
448
|
+
} }), k("bigconsole.fleet.push.confirm", "Push now")]
|
|
449
|
+
}), /* @__PURE__ */ S(y, {
|
|
366
450
|
variant: "outline",
|
|
367
451
|
onClick: () => V({ phase: "idle" }),
|
|
368
|
-
disabled:
|
|
369
|
-
children:
|
|
452
|
+
disabled: Z,
|
|
453
|
+
children: k("bigconsole.fleet.link.cancel", "Cancel")
|
|
370
454
|
})]
|
|
371
455
|
})
|
|
372
456
|
]
|
|
373
457
|
}),
|
|
374
|
-
B.phase === "done" && /* @__PURE__ */
|
|
458
|
+
B.phase === "done" && /* @__PURE__ */ C("div", {
|
|
375
459
|
className: "flex flex-col gap-form-gap rounded-input border p-3",
|
|
376
460
|
style: { borderColor: "var(--color-border-subtle)" },
|
|
377
461
|
"data-testid": "fleet-push-done",
|
|
378
462
|
children: [
|
|
379
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ S("strong", {
|
|
380
464
|
style: { color: "var(--color-text-primary)" },
|
|
381
|
-
children:
|
|
465
|
+
children: k("bigconsole.fleet.push.doneTitle", "Pushed")
|
|
382
466
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ S(p, { result: B.result }),
|
|
468
|
+
/* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(y, {
|
|
385
469
|
variant: "outline",
|
|
386
470
|
onClick: () => V({ phase: "idle" }),
|
|
387
|
-
children:
|
|
471
|
+
children: k("bigconsole.fleet.push.done", "Done")
|
|
388
472
|
}) })
|
|
389
473
|
]
|
|
390
474
|
}),
|
|
391
|
-
|
|
475
|
+
_e && /* @__PURE__ */ S(d, {
|
|
392
476
|
isOpen: !0,
|
|
393
|
-
masterId:
|
|
394
|
-
masterName:
|
|
477
|
+
masterId: m,
|
|
478
|
+
masterName: D,
|
|
395
479
|
copies: z,
|
|
396
|
-
lock:
|
|
397
|
-
onClose: () => G(!1),
|
|
398
|
-
onChanged: L
|
|
399
|
-
}),
|
|
400
|
-
/* @__PURE__ */ x(o, {
|
|
401
|
-
isOpen: H,
|
|
402
|
-
masterName: E,
|
|
403
|
-
busy: Q,
|
|
404
|
-
error: ce,
|
|
480
|
+
lock: q,
|
|
405
481
|
onClose: () => U(!1),
|
|
406
|
-
|
|
482
|
+
onChanged: F
|
|
483
|
+
}),
|
|
484
|
+
/* @__PURE__ */ S(u, {
|
|
485
|
+
isOpen: ge,
|
|
486
|
+
masterName: D,
|
|
487
|
+
busy: Z,
|
|
488
|
+
error: ve,
|
|
489
|
+
onClose: () => H(!1),
|
|
490
|
+
onCreate: we
|
|
407
491
|
})
|
|
408
492
|
]
|
|
409
493
|
});
|
|
410
494
|
});
|
|
411
|
-
export {
|
|
495
|
+
export { D as FleetChildrenPanel, D as default };
|