@burdenoff/microfe-sandbox 2026.528.1 → 2026.528.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/generated/wspace-types.js +8 -0
- package/dist/generated/wspace-types.js.map +1 -0
- package/dist/sandbox/components/ExportSandboxesDialog.js +85 -84
- package/dist/sandbox/components/ExportSandboxesDialog.js.map +1 -1
- package/dist/sandbox/components/ui.js +2 -2
- package/dist/sandbox/hooks/useIsSuperAdmin.js +33 -0
- package/dist/sandbox/hooks/useIsSuperAdmin.js.map +1 -0
- package/dist/sandbox/pages/SandboxListPage.js +400 -384
- package/dist/sandbox/pages/SandboxListPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,63 +1,66 @@
|
|
|
1
1
|
import { useSandbox as e } from "../providers/SandboxProvider.js";
|
|
2
2
|
import { joinPath as t } from "../utils/navigation.js";
|
|
3
|
-
import { Badge as n, Button as r, Card as i, CardContent as a, Checkbox as o, Input as ee, Select as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { tWithFallback as
|
|
6
|
-
import { StatusBadge as
|
|
7
|
-
import { ResourceDisplay as
|
|
8
|
-
import { SandboxTypeIcon as
|
|
9
|
-
import { CountdownTimer as
|
|
10
|
-
import { useSandboxStore as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
3
|
+
import { Badge as n, Button as r, Card as i, CardContent as a, Checkbox as o, Input as ee, Select as te, SelectContent as ne, SelectItem as s, SelectTrigger as re, SelectValue as ie, Skeleton as c, Switch as ae } from "../components/ui.js";
|
|
4
|
+
import { cn as l } from "../utils/cn.js";
|
|
5
|
+
import { tWithFallback as u } from "../utils/i18n.js";
|
|
6
|
+
import { StatusBadge as oe } from "../components/StatusBadge.js";
|
|
7
|
+
import { ResourceDisplay as se } from "../components/ResourceDisplay.js";
|
|
8
|
+
import { SandboxTypeIcon as ce } from "../components/SandboxTypeIcon.js";
|
|
9
|
+
import { CountdownTimer as le } from "../components/CountdownTimer.js";
|
|
10
|
+
import { useSandboxStore as ue } from "../store/sandboxStore.js";
|
|
11
|
+
import { useIsSuperAdmin as de } from "../hooks/useIsSuperAdmin.js";
|
|
12
|
+
import { useSandboxEvents as fe } from "../utils/sandboxEvents.js";
|
|
13
|
+
import { EmptyState as pe, PageLayout as me } from "../components/PageLayout.js";
|
|
14
|
+
import { SandboxUsageBanner as he } from "../components/SandboxUsageBanner.js";
|
|
15
|
+
import { ExportSandboxesDialog as ge } from "../components/ExportSandboxesDialog.js";
|
|
16
|
+
import { ListSandboxesDocument as _e, useDeleteSandboxMutation as ve, useExtendSandboxTtlMutation as ye, useListSandboxesQuery as be, useOnSandboxesChangedSubscription as xe, useStopSandboxMutation as Se } from "../../generated/wspace-operations.js";
|
|
17
|
+
import { SandboxKind as d } from "../../generated/wspace-types.js";
|
|
18
|
+
import { nativeImpact as Ce, nativeNotify as we } from "../../utils/nativeBridge.js";
|
|
19
|
+
import { useCallback as f, useMemo as p, useState as m } from "react";
|
|
20
|
+
import { PermissionGate as Te } from "@burdenoff/fe-libs/shared/components";
|
|
21
|
+
import { AlertCircle as Ee, Box as De, CheckCircle2 as Oe, ChevronLeft as ke, ChevronRight as Ae, Container as je, Database as Me, Filter as Ne, Loader2 as h, Plus as Pe, Search as Fe, StopCircle as Ie, Timer as Le, Trash2 as Re, X as g } from "lucide-react";
|
|
22
|
+
import { useApolloClient as ze } from "@apollo/client/react";
|
|
23
|
+
import { useI18n as Be } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
24
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
23
25
|
//#region src/sandbox/pages/SandboxListPage.tsx
|
|
24
|
-
var
|
|
26
|
+
var b = ["RUNNING"], x = ["RUNNING", "PENDING"], S = [
|
|
25
27
|
"STOPPED",
|
|
26
28
|
"ERROR",
|
|
27
29
|
"EXPIRED",
|
|
28
30
|
"FAILED"
|
|
29
|
-
],
|
|
30
|
-
function
|
|
31
|
+
], C = 5;
|
|
32
|
+
function Ve(e) {
|
|
31
33
|
let t = Date.now() - new Date(e).getTime(), n = Math.floor(t / 6e4);
|
|
32
34
|
if (n < 1) return "just now";
|
|
33
35
|
if (n < 60) return `${n}m ago`;
|
|
34
36
|
let r = Math.floor(n / 60);
|
|
35
37
|
return r < 24 ? `${r}h ago` : `${Math.floor(r / 24)}d ago`;
|
|
36
38
|
}
|
|
37
|
-
function
|
|
39
|
+
function He(e) {
|
|
38
40
|
return {
|
|
39
41
|
...e.search?.trim() ? { search: e.search.trim() } : {},
|
|
40
42
|
...e.template && e.template !== "all" ? { template: e.template } : {},
|
|
41
|
-
...e.status && e.status !== "all" ? { status: e.status } : {}
|
|
43
|
+
...e.status && e.status !== "all" ? { status: e.status } : {},
|
|
44
|
+
...e.includeInternal ? {} : { kind: d.User }
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
47
|
+
function Ue(e) {
|
|
48
|
+
return b.includes(e.status);
|
|
46
49
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
50
|
+
function We(e) {
|
|
51
|
+
return x.includes(e.status);
|
|
49
52
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
53
|
+
function Ge(e) {
|
|
54
|
+
return S.includes(e.status);
|
|
52
55
|
}
|
|
53
|
-
function
|
|
56
|
+
function w(e, t) {
|
|
54
57
|
return e instanceof Error && e.message.trim() ? e.message : t;
|
|
55
58
|
}
|
|
56
|
-
function
|
|
59
|
+
function Ke(e, t, n, r) {
|
|
57
60
|
let i = [`${e} ${t} sandbox${t === 1 ? "" : "es"}`];
|
|
58
61
|
return n > 0 && i.push(`${n} failed`), r > 0 && i.push(`${r} skipped`), i.join(" • ");
|
|
59
62
|
}
|
|
60
|
-
async function
|
|
63
|
+
async function qe(e, t, n = C) {
|
|
61
64
|
let r = [];
|
|
62
65
|
for (let i = 0; i < e.length; i += n) {
|
|
63
66
|
let a = e.slice(i, i + n), o = await Promise.allSettled(a.map(t));
|
|
@@ -65,68 +68,71 @@ async function Ve(e, t, n = E) {
|
|
|
65
68
|
}
|
|
66
69
|
return r;
|
|
67
70
|
}
|
|
68
|
-
function
|
|
69
|
-
let { basePath:
|
|
71
|
+
function T() {
|
|
72
|
+
let { basePath: d = "/", navigate: b } = e(), { sandboxFilter: x, updateFilter: S, resetFilter: C } = ue(), T = ze(), { t: E } = Be(), [D, Je] = m(!1), [O, k] = m(1), [A, j] = m(/* @__PURE__ */ new Map()), [M, N] = m(null), [P, F] = m(null), [Ye, Xe] = m(!1), I = de(), { workspaceId: L } = e(), Ze = I && Ye, R = He({
|
|
73
|
+
...x,
|
|
74
|
+
includeInternal: Ze
|
|
75
|
+
}), { data: Qe, loading: $e, refetch: z } = be({
|
|
70
76
|
variables: {
|
|
71
|
-
context: { workspaceId:
|
|
72
|
-
filter:
|
|
77
|
+
context: { workspaceId: L },
|
|
78
|
+
filter: R,
|
|
73
79
|
pagination: {
|
|
74
|
-
page:
|
|
80
|
+
page: O,
|
|
75
81
|
limit: 20
|
|
76
82
|
}
|
|
77
83
|
},
|
|
78
|
-
skip: !
|
|
79
|
-
}), [
|
|
80
|
-
|
|
81
|
-
variables: { workspaceId:
|
|
82
|
-
skip: !
|
|
84
|
+
skip: !L
|
|
85
|
+
}), [B] = Se(), [V] = ve(), [et] = ye(), tt = fe(), [nt, rt] = m(!1);
|
|
86
|
+
xe({
|
|
87
|
+
variables: { workspaceId: L },
|
|
88
|
+
skip: !L,
|
|
83
89
|
onData: ({ data: e }) => {
|
|
84
90
|
let t = e.data?.onSandboxesChanged;
|
|
85
|
-
t && (t.changeType === "CREATED" || t.changeType === "DELETED") &&
|
|
91
|
+
t && (t.changeType === "CREATED" || t.changeType === "DELETED") && z();
|
|
86
92
|
}
|
|
87
93
|
});
|
|
88
|
-
let
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
|
|
92
|
-
}, [
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
94
|
+
let it = Qe?.listSandboxes?.items ?? [], H = Qe?.listSandboxes?.total ?? 0, at = $e, ot = it, U = Math.ceil(H / 20), W = ot, G = x.search || x.template && x.template !== "all" || x.status && x.status !== "all", K = it.filter((e) => e.status === "RUNNING").length, q = H, st = p(() => Array.from(A.keys()), [A]), J = p(() => Array.from(A.values()), [A]), Y = p(() => W.filter((e) => A.has(e.id)).length, [W, A]), X = p(() => J.filter(Ue), [J]), Z = p(() => J.filter(Ge), [J]), Q = st.length > 0, ct = W.length > 0 && Y === W.length, lt = Y > 0 && Y < W.length, $ = M !== null, ut = M === "select-all", dt = M === "stop", ft = M === "delete", pt = f((e) => {
|
|
95
|
+
S({ search: e }), k(1);
|
|
96
|
+
}, [S]), mt = f(() => {
|
|
97
|
+
C(), k(1);
|
|
98
|
+
}, [C]), ht = () => {
|
|
99
|
+
b?.(t(d, "new"));
|
|
100
|
+
}, gt = (e) => {
|
|
101
|
+
b?.(t(d, e));
|
|
102
|
+
}, _t = f((e, t) => {
|
|
103
|
+
j((n) => {
|
|
98
104
|
let r = new Map(n);
|
|
99
105
|
return t ? r.set(e.id, e) : r.delete(e.id), r;
|
|
100
106
|
});
|
|
101
|
-
}, []),
|
|
102
|
-
|
|
107
|
+
}, []), vt = f((e) => {
|
|
108
|
+
j((t) => {
|
|
103
109
|
let n = new Map(t);
|
|
104
|
-
for (let t of
|
|
110
|
+
for (let t of W) e ? n.set(t.id, t) : n.delete(t.id);
|
|
105
111
|
return n;
|
|
106
112
|
});
|
|
107
|
-
}, [
|
|
108
|
-
|
|
109
|
-
}, []),
|
|
110
|
-
|
|
113
|
+
}, [W]), yt = f(() => {
|
|
114
|
+
j(/* @__PURE__ */ new Map());
|
|
115
|
+
}, []), bt = f((e) => {
|
|
116
|
+
j((t) => {
|
|
111
117
|
if (!t.has(e)) return t;
|
|
112
118
|
let n = new Map(t);
|
|
113
119
|
return n.delete(e), n;
|
|
114
120
|
});
|
|
115
|
-
}, []),
|
|
116
|
-
|
|
121
|
+
}, []), xt = f((e) => {
|
|
122
|
+
j((t) => {
|
|
117
123
|
if (!t.has(e.id)) return t;
|
|
118
124
|
let n = new Map(t);
|
|
119
125
|
return n.set(e.id, e), n;
|
|
120
126
|
});
|
|
121
|
-
}, []),
|
|
122
|
-
if (!
|
|
127
|
+
}, []), St = f(async () => {
|
|
128
|
+
if (!L) return [];
|
|
123
129
|
let e = [], t = 1;
|
|
124
130
|
for (;;) {
|
|
125
|
-
let n = (await
|
|
126
|
-
query:
|
|
131
|
+
let n = (await T.query({
|
|
132
|
+
query: _e,
|
|
127
133
|
variables: {
|
|
128
|
-
context: { workspaceId:
|
|
129
|
-
filter:
|
|
134
|
+
context: { workspaceId: L },
|
|
135
|
+
filter: R,
|
|
130
136
|
pagination: {
|
|
131
137
|
page: t,
|
|
132
138
|
limit: 100
|
|
@@ -139,322 +145,332 @@ function O() {
|
|
|
139
145
|
}
|
|
140
146
|
return e;
|
|
141
147
|
}, [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
]),
|
|
148
|
+
T,
|
|
149
|
+
R,
|
|
150
|
+
L
|
|
151
|
+
]), Ct = f(async (e) => {
|
|
146
152
|
try {
|
|
147
|
-
let t = (await
|
|
148
|
-
context: { workspaceId:
|
|
153
|
+
let t = (await B({ variables: {
|
|
154
|
+
context: { workspaceId: L },
|
|
149
155
|
id: e.id
|
|
150
156
|
} })).data?.stopSandbox;
|
|
151
157
|
if (!t) throw Error(`Failed to stop sandbox "${e.name}".`);
|
|
152
|
-
|
|
158
|
+
xt({
|
|
153
159
|
...e,
|
|
154
160
|
status: t.status,
|
|
155
161
|
stoppedAt: t.stoppedAt ?? e.stoppedAt
|
|
156
|
-
}), await
|
|
162
|
+
}), await z();
|
|
157
163
|
} catch (t) {
|
|
158
|
-
|
|
164
|
+
F({
|
|
159
165
|
kind: "error",
|
|
160
|
-
message:
|
|
166
|
+
message: w(t, `Failed to stop sandbox "${e.name}".`)
|
|
161
167
|
});
|
|
162
168
|
}
|
|
163
169
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
]),
|
|
169
|
-
|
|
170
|
+
z,
|
|
171
|
+
B,
|
|
172
|
+
xt,
|
|
173
|
+
L
|
|
174
|
+
]), wt = f(async (e) => {
|
|
175
|
+
Ce("medium");
|
|
170
176
|
try {
|
|
171
|
-
if (!(await
|
|
172
|
-
context: { workspaceId:
|
|
177
|
+
if (!(await V({ variables: {
|
|
178
|
+
context: { workspaceId: L },
|
|
173
179
|
id: e.id
|
|
174
180
|
} })).data?.deleteSandbox) throw Error(`Failed to delete sandbox "${e.name}".`);
|
|
175
|
-
|
|
181
|
+
we("success"), tt.sandboxDeleted({ sandboxId: e.id }), bt(e.id), await z();
|
|
176
182
|
} catch (t) {
|
|
177
|
-
|
|
183
|
+
we("error"), F({
|
|
178
184
|
kind: "error",
|
|
179
|
-
message:
|
|
185
|
+
message: w(t, `Failed to delete sandbox "${e.name}".`)
|
|
180
186
|
});
|
|
181
187
|
}
|
|
182
188
|
}, [
|
|
183
|
-
U,
|
|
184
189
|
V,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
z,
|
|
191
|
+
bt,
|
|
192
|
+
tt,
|
|
193
|
+
L
|
|
194
|
+
]), Tt = f(async () => {
|
|
195
|
+
N("select-all");
|
|
190
196
|
try {
|
|
191
|
-
let e = await
|
|
192
|
-
|
|
197
|
+
let e = await St();
|
|
198
|
+
j(new Map(e.map((e) => [e.id, e]))), F({
|
|
193
199
|
kind: "success",
|
|
194
200
|
message: `Selected ${e.length} sandbox${e.length === 1 ? "" : "es"}.`
|
|
195
201
|
});
|
|
196
202
|
} catch (e) {
|
|
197
|
-
|
|
203
|
+
F({
|
|
198
204
|
kind: "error",
|
|
199
|
-
message:
|
|
205
|
+
message: w(e, "Failed to select all matching sandboxes.")
|
|
200
206
|
});
|
|
201
207
|
} finally {
|
|
202
|
-
|
|
208
|
+
N(null);
|
|
203
209
|
}
|
|
204
|
-
}, [
|
|
205
|
-
if (
|
|
206
|
-
|
|
210
|
+
}, [St]), Et = f(async () => {
|
|
211
|
+
if (X.length === 0) {
|
|
212
|
+
F({
|
|
207
213
|
kind: "error",
|
|
208
214
|
message: "Select at least one running sandbox to stop."
|
|
209
215
|
});
|
|
210
216
|
return;
|
|
211
217
|
}
|
|
212
|
-
let e =
|
|
213
|
-
|
|
218
|
+
let e = J.length - X.length;
|
|
219
|
+
N("stop");
|
|
214
220
|
try {
|
|
215
|
-
let t = await
|
|
216
|
-
let t = await
|
|
217
|
-
context: { workspaceId:
|
|
221
|
+
let t = await qe(X, async (e) => {
|
|
222
|
+
let t = await B({ variables: {
|
|
223
|
+
context: { workspaceId: L },
|
|
218
224
|
id: e.id
|
|
219
225
|
} });
|
|
220
226
|
if (!t.data?.stopSandbox) throw Error(`Failed to stop sandbox "${e.name}".`);
|
|
221
227
|
return t.data.stopSandbox;
|
|
222
228
|
}), n = t.filter((e) => e.status === "fulfilled").length, r = t.length - n;
|
|
223
|
-
|
|
229
|
+
j(/* @__PURE__ */ new Map()), await z(), F({
|
|
224
230
|
kind: r === 0 ? "success" : "error",
|
|
225
|
-
message:
|
|
231
|
+
message: Ke("Stopped", n, r, e)
|
|
226
232
|
});
|
|
227
233
|
} catch (e) {
|
|
228
|
-
|
|
234
|
+
F({
|
|
229
235
|
kind: "error",
|
|
230
|
-
message:
|
|
236
|
+
message: w(e, "Failed to stop selected sandboxes.")
|
|
231
237
|
});
|
|
232
238
|
} finally {
|
|
233
|
-
|
|
239
|
+
N(null);
|
|
234
240
|
}
|
|
235
241
|
}, [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
]),
|
|
242
|
-
if (
|
|
243
|
-
|
|
242
|
+
z,
|
|
243
|
+
J.length,
|
|
244
|
+
X,
|
|
245
|
+
B,
|
|
246
|
+
L
|
|
247
|
+
]), Dt = f(async () => {
|
|
248
|
+
if (Z.length === 0) {
|
|
249
|
+
F({
|
|
244
250
|
kind: "error",
|
|
245
251
|
message: "Select at least one stopped, failed, expired, or errored sandbox to delete."
|
|
246
252
|
});
|
|
247
253
|
return;
|
|
248
254
|
}
|
|
249
|
-
let e =
|
|
250
|
-
if (window.confirm(e > 0 ? `Delete ${
|
|
251
|
-
|
|
255
|
+
let e = J.length - Z.length;
|
|
256
|
+
if (window.confirm(e > 0 ? `Delete ${Z.length} selected sandbox(es)? ${e} selected sandbox(es) cannot be deleted right now and will be skipped. This cannot be undone.` : `Delete ${Z.length} selected sandbox(es)? This cannot be undone.`)) {
|
|
257
|
+
N("delete");
|
|
252
258
|
try {
|
|
253
|
-
let t = await
|
|
254
|
-
let t = await
|
|
255
|
-
context: { workspaceId:
|
|
259
|
+
let t = await qe(Z, async (e) => {
|
|
260
|
+
let t = await V({ variables: {
|
|
261
|
+
context: { workspaceId: L },
|
|
256
262
|
id: e.id
|
|
257
263
|
} });
|
|
258
264
|
if (!t.data?.deleteSandbox) throw Error(`Failed to delete sandbox "${e.name}".`);
|
|
259
265
|
return t.data.deleteSandbox;
|
|
260
266
|
}), n = t.filter((e) => e.status === "fulfilled").length, r = t.length - n;
|
|
261
|
-
|
|
267
|
+
j(/* @__PURE__ */ new Map()), await z(), F({
|
|
262
268
|
kind: r === 0 ? "success" : "error",
|
|
263
|
-
message:
|
|
269
|
+
message: Ke("Deleted", n, r, e)
|
|
264
270
|
});
|
|
265
271
|
} catch (e) {
|
|
266
|
-
|
|
272
|
+
F({
|
|
267
273
|
kind: "error",
|
|
268
|
-
message:
|
|
274
|
+
message: w(e, "Failed to delete selected sandboxes.")
|
|
269
275
|
});
|
|
270
276
|
} finally {
|
|
271
|
-
|
|
277
|
+
N(null);
|
|
272
278
|
}
|
|
273
279
|
}
|
|
274
280
|
}, [
|
|
275
|
-
U,
|
|
276
281
|
V,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
282
|
+
z,
|
|
283
|
+
Z,
|
|
284
|
+
J.length,
|
|
285
|
+
L
|
|
280
286
|
]);
|
|
281
|
-
return /* @__PURE__ */
|
|
282
|
-
title:
|
|
283
|
-
subtitle:
|
|
284
|
-
icon: /* @__PURE__ */
|
|
285
|
-
headerActions: /* @__PURE__ */
|
|
287
|
+
return /* @__PURE__ */ y(me, {
|
|
288
|
+
title: u(E, "sandbox.list.title", "Sandboxes"),
|
|
289
|
+
subtitle: u(E, "sandbox.list.subtitle", "Manage ephemeral sandbox environments for development and testing"),
|
|
290
|
+
icon: /* @__PURE__ */ v(De, { size: 24 }),
|
|
291
|
+
headerActions: /* @__PURE__ */ v(Te, {
|
|
286
292
|
permission: "sandbox:create",
|
|
287
|
-
children: /* @__PURE__ */
|
|
288
|
-
onClick:
|
|
293
|
+
children: /* @__PURE__ */ y(r, {
|
|
294
|
+
onClick: ht,
|
|
289
295
|
size: "lg",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ v(Pe, { size: 18 }), u(E, "sandbox.list.actions.create", "Create Sandbox")]
|
|
291
297
|
})
|
|
292
298
|
}),
|
|
293
|
-
headerContent:
|
|
294
|
-
className: "flex items-center gap-3",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
299
|
+
headerContent: q > 0 || I ? /* @__PURE__ */ y("div", {
|
|
300
|
+
className: "flex items-center gap-3 flex-wrap",
|
|
301
|
+
children: [q > 0 && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(n, {
|
|
296
302
|
variant: "secondary",
|
|
297
303
|
className: "gap-1.5",
|
|
298
|
-
children:
|
|
299
|
-
}), /* @__PURE__ */
|
|
304
|
+
children: u(E, "sandbox.list.header.total", "{count} total", { count: q })
|
|
305
|
+
}), /* @__PURE__ */ v(n, {
|
|
300
306
|
variant: "default",
|
|
301
307
|
className: "gap-1.5 bg-status-success-bg-subtle text-status-success-text border-border-default",
|
|
302
|
-
children:
|
|
308
|
+
children: u(E, "sandbox.list.header.running", "{count} running", { count: K })
|
|
309
|
+
})] }), I && /* @__PURE__ */ y("label", {
|
|
310
|
+
className: "inline-flex items-center gap-2 text-sm text-text-secondary cursor-pointer select-none",
|
|
311
|
+
title: u(E, "sandbox.list.header.showInternal.tooltip", "Include sandboxes created by the AI assistant, docs builder, and other internal services. Super-admin only."),
|
|
312
|
+
children: [/* @__PURE__ */ v(ae, {
|
|
313
|
+
checked: Ye,
|
|
314
|
+
onCheckedChange: (e) => {
|
|
315
|
+
Xe(e), k(1);
|
|
316
|
+
},
|
|
317
|
+
"aria-label": u(E, "sandbox.list.header.showInternal.ariaLabel", "Show internal sandboxes")
|
|
318
|
+
}), /* @__PURE__ */ v("span", { children: u(E, "sandbox.list.header.showInternal.label", "Show internal sandboxes") })]
|
|
303
319
|
})]
|
|
304
320
|
}) : null,
|
|
305
321
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
runningCount:
|
|
308
|
-
maxConcurrent: Math.max(
|
|
322
|
+
/* @__PURE__ */ v(he, {
|
|
323
|
+
runningCount: K,
|
|
324
|
+
maxConcurrent: Math.max(K, 10)
|
|
309
325
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ y("div", {
|
|
311
327
|
className: "space-y-4",
|
|
312
328
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ y("div", {
|
|
314
330
|
className: "flex flex-col sm:flex-row gap-3",
|
|
315
331
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ v(r, {
|
|
317
333
|
variant: "outline",
|
|
318
334
|
size: "sm",
|
|
319
|
-
onClick: () =>
|
|
320
|
-
"aria-label":
|
|
335
|
+
onClick: () => rt(!0),
|
|
336
|
+
"aria-label": u(E, "sandbox.list.actions.export.ariaLabel", "Export sandboxes"),
|
|
321
337
|
className: "self-start sm:self-auto",
|
|
322
|
-
children:
|
|
338
|
+
children: u(E, "sandbox.list.actions.export.label", "Export")
|
|
323
339
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ y("div", {
|
|
325
341
|
className: "flex-1 relative group",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ v(Fe, {
|
|
327
343
|
size: 18,
|
|
328
344
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground group-focus-within:text-primary transition-colors"
|
|
329
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ v(ee, {
|
|
330
346
|
type: "text",
|
|
331
|
-
placeholder:
|
|
332
|
-
value:
|
|
333
|
-
onChange: (e) =>
|
|
347
|
+
placeholder: u(E, "sandbox.list.search.placeholder", "Search sandboxes by name, description, or ID..."),
|
|
348
|
+
value: x.search,
|
|
349
|
+
onChange: (e) => pt(e.target.value),
|
|
334
350
|
className: "pl-[3.25rem] h-10",
|
|
335
|
-
"aria-label":
|
|
351
|
+
"aria-label": u(E, "sandbox.list.search.ariaLabel", "Search sandboxes")
|
|
336
352
|
})]
|
|
337
353
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
variant:
|
|
340
|
-
onClick: () =>
|
|
341
|
-
"aria-label":
|
|
354
|
+
/* @__PURE__ */ y(r, {
|
|
355
|
+
variant: D || G ? "default" : "outline",
|
|
356
|
+
onClick: () => Je(!D),
|
|
357
|
+
"aria-label": u(E, "sandbox.list.filters.toggle.ariaLabel", "Toggle filters"),
|
|
342
358
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
|
|
345
|
-
|
|
359
|
+
/* @__PURE__ */ v(Ne, { size: 16 }),
|
|
360
|
+
D ? u(E, "sandbox.list.filters.toggle.hide", "Hide") : u(E, "sandbox.list.filters.toggle.show", "Filter"),
|
|
361
|
+
G && /* @__PURE__ */ v(n, {
|
|
346
362
|
variant: "secondary",
|
|
347
363
|
className: "ml-1 h-5 min-w-5 px-1.5",
|
|
348
364
|
children: [
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
365
|
+
x.search,
|
|
366
|
+
x.template !== "all" && x.template,
|
|
367
|
+
x.status !== "all" && x.status
|
|
352
368
|
].filter(Boolean).length
|
|
353
369
|
})
|
|
354
370
|
]
|
|
355
371
|
})
|
|
356
372
|
]
|
|
357
373
|
}),
|
|
358
|
-
|
|
374
|
+
D && /* @__PURE__ */ v(i, {
|
|
359
375
|
className: "animate-in slide-in-from-top-2 duration-200",
|
|
360
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ y(a, {
|
|
361
377
|
className: "p-4",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ y("div", {
|
|
363
379
|
className: "flex items-center justify-between mb-4",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
365
381
|
className: "font-semibold text-foreground flex items-center gap-2",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ v(Ne, {
|
|
367
383
|
size: 16,
|
|
368
384
|
className: "text-primary"
|
|
369
|
-
}),
|
|
370
|
-
}),
|
|
385
|
+
}), u(E, "sandbox.list.filters.panel.title", "Filter Sandboxes")]
|
|
386
|
+
}), G && /* @__PURE__ */ y(r, {
|
|
371
387
|
variant: "ghost",
|
|
372
388
|
size: "sm",
|
|
373
|
-
onClick:
|
|
389
|
+
onClick: mt,
|
|
374
390
|
className: "text-muted-foreground hover:text-destructive",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
391
|
+
children: [/* @__PURE__ */ v(g, { size: 16 }), u(E, "sandbox.list.filters.clearAll", "Clear All")]
|
|
376
392
|
})]
|
|
377
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ y("div", {
|
|
378
394
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
379
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ y("div", {
|
|
380
396
|
className: "space-y-2",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ v("label", {
|
|
382
398
|
className: "block text-sm font-medium text-foreground",
|
|
383
|
-
children:
|
|
384
|
-
}), /* @__PURE__ */
|
|
385
|
-
value:
|
|
399
|
+
children: u(E, "sandbox.list.filters.template.label", "Template")
|
|
400
|
+
}), /* @__PURE__ */ y(te, {
|
|
401
|
+
value: x.template || "all",
|
|
386
402
|
onValueChange: (e) => {
|
|
387
|
-
|
|
403
|
+
S({ template: e }), k(1);
|
|
388
404
|
},
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
405
|
+
children: [/* @__PURE__ */ v(re, { children: /* @__PURE__ */ v(ie, { placeholder: u(E, "sandbox.list.filters.template.all", "All Templates") }) }), /* @__PURE__ */ y(ne, { children: [
|
|
406
|
+
/* @__PURE__ */ v(s, {
|
|
391
407
|
value: "all",
|
|
392
|
-
children:
|
|
408
|
+
children: u(E, "sandbox.list.filters.template.all", "All Templates")
|
|
393
409
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ v(s, {
|
|
395
411
|
value: "AI_BUILDER",
|
|
396
|
-
children:
|
|
412
|
+
children: u(E, "sandbox.list.filters.template.aiBuilder", "AI Builder")
|
|
397
413
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ v(s, {
|
|
399
415
|
value: "WORKFLOW_MULTI_NODE",
|
|
400
|
-
children:
|
|
416
|
+
children: u(E, "sandbox.list.filters.template.workflowMultiNode", "Workflow Multi-Node")
|
|
401
417
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ v(s, {
|
|
403
419
|
value: "MISC_SHELL",
|
|
404
|
-
children:
|
|
420
|
+
children: u(E, "sandbox.list.filters.template.miscShell", "Misc Shell")
|
|
405
421
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ v(s, {
|
|
407
423
|
value: "CUSTOM",
|
|
408
|
-
children:
|
|
424
|
+
children: u(E, "sandbox.list.filters.template.custom", "Custom")
|
|
409
425
|
})
|
|
410
426
|
] })]
|
|
411
427
|
})]
|
|
412
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ y("div", {
|
|
413
429
|
className: "space-y-2",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ v("label", {
|
|
415
431
|
className: "block text-sm font-medium text-foreground",
|
|
416
|
-
children:
|
|
417
|
-
}), /* @__PURE__ */
|
|
418
|
-
value:
|
|
432
|
+
children: u(E, "sandbox.list.filters.status.label", "Status")
|
|
433
|
+
}), /* @__PURE__ */ y(te, {
|
|
434
|
+
value: x.status || "all",
|
|
419
435
|
onValueChange: (e) => {
|
|
420
|
-
|
|
436
|
+
S({ status: e }), k(1);
|
|
421
437
|
},
|
|
422
|
-
children: [/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ v(re, { children: /* @__PURE__ */ v(ie, { placeholder: u(E, "sandbox.list.filters.status.all", "All Statuses") }) }), /* @__PURE__ */ y(ne, { children: [
|
|
439
|
+
/* @__PURE__ */ v(s, {
|
|
424
440
|
value: "all",
|
|
425
|
-
children:
|
|
441
|
+
children: u(E, "sandbox.list.filters.status.all", "All Statuses")
|
|
426
442
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ v(s, {
|
|
428
444
|
value: "PENDING",
|
|
429
|
-
children:
|
|
445
|
+
children: u(E, "sandbox.list.filters.status.pending", "Pending")
|
|
430
446
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ v(s, {
|
|
432
448
|
value: "PROVISIONING",
|
|
433
|
-
children:
|
|
449
|
+
children: u(E, "sandbox.list.filters.status.provisioning", "Provisioning")
|
|
434
450
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ v(s, {
|
|
436
452
|
value: "RUNNING",
|
|
437
|
-
children:
|
|
453
|
+
children: u(E, "sandbox.list.filters.status.running", "Running")
|
|
438
454
|
}),
|
|
439
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ v(s, {
|
|
440
456
|
value: "STOPPING",
|
|
441
|
-
children:
|
|
457
|
+
children: u(E, "sandbox.list.filters.status.stopping", "Stopping")
|
|
442
458
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ v(s, {
|
|
444
460
|
value: "STOPPED",
|
|
445
|
-
children:
|
|
461
|
+
children: u(E, "sandbox.list.filters.status.stopped", "Stopped")
|
|
446
462
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ v(s, {
|
|
448
464
|
value: "ERROR",
|
|
449
|
-
children:
|
|
465
|
+
children: u(E, "sandbox.list.filters.status.error", "Error")
|
|
450
466
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ v(s, {
|
|
452
468
|
value: "EXPIRED",
|
|
453
|
-
children:
|
|
469
|
+
children: u(E, "sandbox.list.filters.status.expired", "Expired")
|
|
454
470
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ v(s, {
|
|
456
472
|
value: "FAILED",
|
|
457
|
-
children:
|
|
473
|
+
children: u(E, "sandbox.list.filters.status.failed", "Failed")
|
|
458
474
|
})
|
|
459
475
|
] })]
|
|
460
476
|
})]
|
|
@@ -462,283 +478,283 @@ function O() {
|
|
|
462
478
|
})]
|
|
463
479
|
})
|
|
464
480
|
}),
|
|
465
|
-
|
|
466
|
-
className:
|
|
467
|
-
children: /* @__PURE__ */
|
|
481
|
+
P && /* @__PURE__ */ v(i, {
|
|
482
|
+
className: l("border-l-4", P.kind === "success" ? "border-l-status-success-text bg-status-success-bg-subtle" : "border-l-destructive bg-destructive/5"),
|
|
483
|
+
children: /* @__PURE__ */ y(a, {
|
|
468
484
|
className: "p-4 flex items-start justify-between gap-3",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
470
|
-
role:
|
|
485
|
+
children: [/* @__PURE__ */ y("div", {
|
|
486
|
+
role: P.kind === "error" ? "alert" : "status",
|
|
471
487
|
className: "flex items-start gap-2 text-sm",
|
|
472
|
-
children: [
|
|
488
|
+
children: [P.kind === "success" ? /* @__PURE__ */ v(Oe, {
|
|
473
489
|
size: 16,
|
|
474
490
|
className: "mt-0.5 text-status-success-text"
|
|
475
|
-
}) : /* @__PURE__ */
|
|
491
|
+
}) : /* @__PURE__ */ v(Ee, {
|
|
476
492
|
size: 16,
|
|
477
493
|
className: "mt-0.5 text-destructive"
|
|
478
|
-
}), /* @__PURE__ */
|
|
479
|
-
className:
|
|
480
|
-
children:
|
|
494
|
+
}), /* @__PURE__ */ v("span", {
|
|
495
|
+
className: l("font-medium", P.kind === "success" ? "text-status-success-text" : "text-destructive"),
|
|
496
|
+
children: P.message
|
|
481
497
|
})]
|
|
482
|
-
}), /* @__PURE__ */
|
|
498
|
+
}), /* @__PURE__ */ v(r, {
|
|
483
499
|
variant: "ghost",
|
|
484
500
|
size: "icon",
|
|
485
|
-
onClick: () =>
|
|
486
|
-
"aria-label":
|
|
487
|
-
children: /* @__PURE__ */
|
|
501
|
+
onClick: () => F(null),
|
|
502
|
+
"aria-label": u(E, "sandbox.list.bulk.feedback.dismiss.ariaLabel", "Dismiss bulk action message"),
|
|
503
|
+
children: /* @__PURE__ */ v(g, { size: 16 })
|
|
488
504
|
})]
|
|
489
505
|
})
|
|
490
506
|
})
|
|
491
507
|
]
|
|
492
508
|
}),
|
|
493
|
-
|
|
509
|
+
at && /* @__PURE__ */ v("div", {
|
|
494
510
|
className: "space-y-4 animate-in fade-in-0 duration-300",
|
|
495
511
|
children: [...[
|
|
496
512
|
,
|
|
497
513
|
,
|
|
498
514
|
,
|
|
499
|
-
]].map((e, t) => /* @__PURE__ */
|
|
515
|
+
]].map((e, t) => /* @__PURE__ */ v(i, { children: /* @__PURE__ */ v(a, {
|
|
500
516
|
className: "p-5",
|
|
501
|
-
children: /* @__PURE__ */
|
|
517
|
+
children: /* @__PURE__ */ y("div", {
|
|
502
518
|
className: "flex items-start gap-4",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
519
|
+
children: [/* @__PURE__ */ v(c, { className: "size-12 rounded-lg" }), /* @__PURE__ */ y("div", {
|
|
504
520
|
className: "flex-1 space-y-2",
|
|
505
521
|
children: [
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ v(c, { className: "h-5 w-1/3" }),
|
|
523
|
+
/* @__PURE__ */ v(c, { className: "h-4 w-2/3" }),
|
|
524
|
+
/* @__PURE__ */ y("div", {
|
|
509
525
|
className: "flex gap-2 pt-1",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ v(c, { className: "h-5 w-20 rounded-full" }), /* @__PURE__ */ v(c, { className: "h-5 w-24 rounded-full" })]
|
|
511
527
|
})
|
|
512
528
|
]
|
|
513
529
|
})]
|
|
514
530
|
})
|
|
515
531
|
}) }, t))
|
|
516
532
|
}),
|
|
517
|
-
!
|
|
533
|
+
!at && /* @__PURE__ */ v("div", {
|
|
518
534
|
className: "space-y-4",
|
|
519
|
-
children:
|
|
520
|
-
/* @__PURE__ */
|
|
535
|
+
children: W.length > 0 ? /* @__PURE__ */ y(_, { children: [
|
|
536
|
+
/* @__PURE__ */ v(i, {
|
|
521
537
|
className: "animate-in fade-in-0 duration-300",
|
|
522
|
-
children: /* @__PURE__ */
|
|
538
|
+
children: /* @__PURE__ */ y(a, {
|
|
523
539
|
className: "p-4 space-y-3",
|
|
524
|
-
children: [/* @__PURE__ */
|
|
540
|
+
children: [/* @__PURE__ */ y("div", {
|
|
525
541
|
className: "flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",
|
|
526
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ y("div", {
|
|
527
543
|
className: "flex flex-wrap items-center gap-3",
|
|
528
544
|
children: [
|
|
529
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ y("label", {
|
|
530
546
|
className: "inline-flex items-center gap-2 text-sm font-medium text-foreground",
|
|
531
|
-
children: [/* @__PURE__ */
|
|
532
|
-
checked:
|
|
533
|
-
onCheckedChange: (e) =>
|
|
534
|
-
"aria-label":
|
|
535
|
-
}), /* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ v(o, {
|
|
548
|
+
checked: ct ? !0 : lt ? "indeterminate" : !1,
|
|
549
|
+
onCheckedChange: (e) => vt(e === !0),
|
|
550
|
+
"aria-label": u(E, "sandbox.list.bulk.selectPage.ariaLabel", "Select all sandboxes on this page")
|
|
551
|
+
}), /* @__PURE__ */ v("span", { children: u(E, "sandbox.list.bulk.selectPage.label", "Select page") })]
|
|
536
552
|
}),
|
|
537
|
-
|
|
553
|
+
H > W.length && /* @__PURE__ */ y(r, {
|
|
538
554
|
variant: "ghost",
|
|
539
555
|
size: "sm",
|
|
540
|
-
onClick:
|
|
556
|
+
onClick: Tt,
|
|
541
557
|
disabled: $,
|
|
542
|
-
children: [
|
|
558
|
+
children: [ut ? /* @__PURE__ */ v(h, {
|
|
543
559
|
size: 14,
|
|
544
560
|
className: "animate-spin"
|
|
545
|
-
}) : null,
|
|
561
|
+
}) : null, u(E, "sandbox.list.bulk.selectAll", "Select all {count}", { count: H })]
|
|
546
562
|
}),
|
|
547
|
-
|
|
563
|
+
Q && /* @__PURE__ */ v(r, {
|
|
548
564
|
variant: "ghost",
|
|
549
565
|
size: "sm",
|
|
550
|
-
onClick:
|
|
566
|
+
onClick: yt,
|
|
551
567
|
disabled: $,
|
|
552
|
-
children:
|
|
568
|
+
children: u(E, "sandbox.list.bulk.clearSelection", "Clear selection")
|
|
553
569
|
})
|
|
554
570
|
]
|
|
555
|
-
}), /* @__PURE__ */
|
|
571
|
+
}), /* @__PURE__ */ y("div", {
|
|
556
572
|
className: "flex flex-wrap items-center gap-2",
|
|
557
573
|
children: [
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
variant:
|
|
574
|
+
/* @__PURE__ */ v(n, {
|
|
575
|
+
variant: Q ? "default" : "secondary",
|
|
560
576
|
className: "gap-1.5",
|
|
561
|
-
children:
|
|
577
|
+
children: u(E, "sandbox.list.bulk.selectedCount", "{count} selected", { count: st.length })
|
|
562
578
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ y(r, {
|
|
564
580
|
variant: "outline",
|
|
565
|
-
onClick:
|
|
566
|
-
disabled: $ ||
|
|
581
|
+
onClick: Et,
|
|
582
|
+
disabled: $ || X.length === 0,
|
|
567
583
|
children: [
|
|
568
|
-
|
|
584
|
+
dt ? /* @__PURE__ */ v(h, {
|
|
569
585
|
size: 16,
|
|
570
586
|
className: "animate-spin"
|
|
571
|
-
}) : /* @__PURE__ */
|
|
572
|
-
|
|
573
|
-
|
|
587
|
+
}) : /* @__PURE__ */ v(Ie, { size: 16 }),
|
|
588
|
+
u(E, "sandbox.list.bulk.stopSelected", "Stop Selected"),
|
|
589
|
+
X.length > 0 ? ` (${X.length})` : ""
|
|
574
590
|
]
|
|
575
591
|
}),
|
|
576
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ y(r, {
|
|
577
593
|
variant: "outline",
|
|
578
594
|
className: "text-destructive border-destructive/50 hover:bg-destructive/10",
|
|
579
|
-
onClick:
|
|
580
|
-
disabled: $ ||
|
|
595
|
+
onClick: Dt,
|
|
596
|
+
disabled: $ || Z.length === 0,
|
|
581
597
|
children: [
|
|
582
|
-
|
|
598
|
+
ft ? /* @__PURE__ */ v(h, {
|
|
583
599
|
size: 16,
|
|
584
600
|
className: "animate-spin"
|
|
585
|
-
}) : /* @__PURE__ */
|
|
586
|
-
|
|
587
|
-
|
|
601
|
+
}) : /* @__PURE__ */ v(Re, { size: 16 }),
|
|
602
|
+
u(E, "sandbox.list.bulk.deleteSelected", "Delete Selected"),
|
|
603
|
+
Z.length > 0 ? ` (${Z.length})` : ""
|
|
588
604
|
]
|
|
589
605
|
})
|
|
590
606
|
]
|
|
591
607
|
})]
|
|
592
|
-
}), /* @__PURE__ */
|
|
608
|
+
}), /* @__PURE__ */ v("p", {
|
|
593
609
|
className: "text-xs text-muted-foreground",
|
|
594
|
-
children:
|
|
610
|
+
children: u(E, "sandbox.list.bulk.helpText", "Select one, many, or every sandbox on the current filter set. Only running sandboxes can be stopped, and only stopped, failed, expired, or errored sandboxes can be deleted.")
|
|
595
611
|
})]
|
|
596
612
|
})
|
|
597
613
|
}),
|
|
598
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ v("div", {
|
|
599
615
|
className: "space-y-3",
|
|
600
|
-
children:
|
|
601
|
-
let n =
|
|
602
|
-
return /* @__PURE__ */
|
|
603
|
-
className:
|
|
616
|
+
children: W.map((e, t) => {
|
|
617
|
+
let n = A.has(e.id);
|
|
618
|
+
return /* @__PURE__ */ v(i, {
|
|
619
|
+
className: l("cursor-pointer overflow-hidden group", "hover:shadow-md hover:border-primary/30 transition-all duration-200", "animate-in fade-in-0 slide-in-from-bottom-2", n && "border-primary/60 bg-primary/5 shadow-sm"),
|
|
604
620
|
style: { animationDelay: `${t * 40}ms` },
|
|
605
|
-
onClick: () =>
|
|
621
|
+
onClick: () => gt(e.id),
|
|
606
622
|
tabIndex: 0,
|
|
607
623
|
onKeyDown: (t) => {
|
|
608
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
624
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), gt(e.id));
|
|
609
625
|
},
|
|
610
|
-
children: /* @__PURE__ */
|
|
626
|
+
children: /* @__PURE__ */ v(a, {
|
|
611
627
|
className: "p-5",
|
|
612
|
-
children: /* @__PURE__ */
|
|
628
|
+
children: /* @__PURE__ */ y("div", {
|
|
613
629
|
className: "flex items-start gap-4",
|
|
614
630
|
children: [
|
|
615
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ v("div", {
|
|
616
632
|
className: "pt-1",
|
|
617
|
-
children: /* @__PURE__ */
|
|
633
|
+
children: /* @__PURE__ */ v(o, {
|
|
618
634
|
checked: n,
|
|
619
|
-
onCheckedChange: (t) =>
|
|
635
|
+
onCheckedChange: (t) => _t(e, t === !0),
|
|
620
636
|
onClick: (e) => e.stopPropagation(),
|
|
621
|
-
"aria-label":
|
|
637
|
+
"aria-label": u(E, "sandbox.list.item.select.ariaLabel", "Select sandbox {name}", { name: e.name })
|
|
622
638
|
})
|
|
623
639
|
}),
|
|
624
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ v("div", {
|
|
625
641
|
className: "flex-shrink-0 p-3 rounded-lg bg-muted/50",
|
|
626
|
-
children: /* @__PURE__ */
|
|
642
|
+
children: /* @__PURE__ */ v(ce, {
|
|
627
643
|
type: e.template,
|
|
628
644
|
size: 24
|
|
629
645
|
})
|
|
630
646
|
}),
|
|
631
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ y("div", {
|
|
632
648
|
className: "flex-1 min-w-0",
|
|
633
649
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ y("div", {
|
|
635
651
|
className: "flex items-start justify-between gap-3",
|
|
636
|
-
children: [/* @__PURE__ */
|
|
652
|
+
children: [/* @__PURE__ */ y("div", {
|
|
637
653
|
className: "min-w-0",
|
|
638
|
-
children: [/* @__PURE__ */
|
|
654
|
+
children: [/* @__PURE__ */ y("div", {
|
|
639
655
|
className: "flex items-center gap-2 mb-1",
|
|
640
|
-
children: [/* @__PURE__ */
|
|
656
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
641
657
|
className: "font-semibold text-base truncate",
|
|
642
658
|
children: e.name
|
|
643
|
-
}), /* @__PURE__ */
|
|
644
|
-
}), e.description && /* @__PURE__ */
|
|
659
|
+
}), /* @__PURE__ */ v(oe, { status: e.status })]
|
|
660
|
+
}), e.description && /* @__PURE__ */ v("p", {
|
|
645
661
|
className: "text-sm text-muted-foreground line-clamp-1 mb-2",
|
|
646
662
|
children: e.description
|
|
647
663
|
})]
|
|
648
|
-
}), /* @__PURE__ */
|
|
649
|
-
className:
|
|
664
|
+
}), /* @__PURE__ */ y("div", {
|
|
665
|
+
className: l("flex items-center gap-1 transition-opacity flex-shrink-0", n ? "opacity-100" : "opacity-0 group-hover:opacity-100"),
|
|
650
666
|
children: [
|
|
651
|
-
|
|
667
|
+
Ue(e) && /* @__PURE__ */ v(r, {
|
|
652
668
|
variant: "ghost",
|
|
653
669
|
size: "icon",
|
|
654
670
|
onClick: (t) => {
|
|
655
|
-
t.stopPropagation(),
|
|
671
|
+
t.stopPropagation(), Ct(e);
|
|
656
672
|
},
|
|
657
|
-
"aria-label":
|
|
658
|
-
children: /* @__PURE__ */
|
|
673
|
+
"aria-label": u(E, "sandbox.list.item.actions.stop.ariaLabel", "Stop sandbox"),
|
|
674
|
+
children: /* @__PURE__ */ v(Ie, { size: 16 })
|
|
659
675
|
}),
|
|
660
|
-
|
|
676
|
+
We(e) && /* @__PURE__ */ v(r, {
|
|
661
677
|
variant: "ghost",
|
|
662
678
|
size: "icon",
|
|
663
679
|
onClick: (t) => {
|
|
664
|
-
t.stopPropagation(),
|
|
665
|
-
context: { workspaceId:
|
|
680
|
+
t.stopPropagation(), et({ variables: {
|
|
681
|
+
context: { workspaceId: L },
|
|
666
682
|
id: e.id,
|
|
667
683
|
additionalSeconds: 3600
|
|
668
|
-
} }).then(() =>
|
|
684
|
+
} }).then(() => z());
|
|
669
685
|
},
|
|
670
|
-
"aria-label":
|
|
671
|
-
children: /* @__PURE__ */
|
|
686
|
+
"aria-label": u(E, "sandbox.list.item.actions.extendTtl.ariaLabel", "Extend TTL"),
|
|
687
|
+
children: /* @__PURE__ */ v(Le, { size: 16 })
|
|
672
688
|
}),
|
|
673
|
-
|
|
689
|
+
Ge(e) && /* @__PURE__ */ v(r, {
|
|
674
690
|
variant: "ghost",
|
|
675
691
|
size: "icon",
|
|
676
692
|
className: "text-destructive hover:text-destructive",
|
|
677
693
|
onClick: (t) => {
|
|
678
|
-
t.stopPropagation(),
|
|
694
|
+
t.stopPropagation(), wt(e);
|
|
679
695
|
},
|
|
680
|
-
"aria-label":
|
|
681
|
-
children: /* @__PURE__ */
|
|
696
|
+
"aria-label": u(E, "sandbox.list.item.actions.delete.ariaLabel", "Delete sandbox"),
|
|
697
|
+
children: /* @__PURE__ */ v(Re, { size: 16 })
|
|
682
698
|
})
|
|
683
699
|
]
|
|
684
700
|
})]
|
|
685
701
|
}),
|
|
686
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ y("div", {
|
|
687
703
|
className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-muted-foreground",
|
|
688
704
|
children: [
|
|
689
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ v(se, {
|
|
690
706
|
cpuRequest: e.resources?.cpuRequest ?? "0",
|
|
691
707
|
memoryRequest: e.resources?.memoryRequest ?? "0",
|
|
692
708
|
containerCount: e.containers?.length,
|
|
693
709
|
className: "text-xs"
|
|
694
710
|
}),
|
|
695
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ v("span", {
|
|
696
712
|
className: "text-muted-foreground/40",
|
|
697
713
|
children: "|"
|
|
698
714
|
}),
|
|
699
|
-
/* @__PURE__ */
|
|
715
|
+
/* @__PURE__ */ v(ce, {
|
|
700
716
|
type: e.template,
|
|
701
717
|
size: 12,
|
|
702
718
|
showLabel: !0
|
|
703
719
|
}),
|
|
704
|
-
e.storage?.mode && e.storage.mode !== "NONE" && /* @__PURE__ */
|
|
720
|
+
e.storage?.mode && e.storage.mode !== "NONE" && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
|
|
705
721
|
className: "text-muted-foreground/40",
|
|
706
722
|
children: "|"
|
|
707
|
-
}), /* @__PURE__ */
|
|
723
|
+
}), /* @__PURE__ */ y("span", {
|
|
708
724
|
className: "inline-flex items-center gap-1",
|
|
709
725
|
children: [
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
e.storage.mode === "EPHEMERAL" ?
|
|
726
|
+
/* @__PURE__ */ v(Me, { size: 12 }),
|
|
727
|
+
e.storage.mode === "EPHEMERAL" ? u(E, "sandbox.list.item.storage.ephemeral", "Ephemeral") : u(E, "sandbox.list.item.storage.persistent", "Persistent"),
|
|
712
728
|
e.storage.sizeGi && ` ${e.storage.sizeGi}Gi`
|
|
713
729
|
]
|
|
714
730
|
})] }),
|
|
715
|
-
e.containers?.length > 0 && /* @__PURE__ */
|
|
731
|
+
e.containers?.length > 0 && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
|
|
716
732
|
className: "text-muted-foreground/40",
|
|
717
733
|
children: "|"
|
|
718
|
-
}), /* @__PURE__ */
|
|
734
|
+
}), /* @__PURE__ */ y("span", {
|
|
719
735
|
className: "inline-flex items-center gap-1",
|
|
720
|
-
children: [/* @__PURE__ */
|
|
736
|
+
children: [/* @__PURE__ */ v(je, { size: 12 }), u(E, "sandbox.list.item.containers", "{count} container{count, plural, one {} other {s}}", { count: e.containers.length })]
|
|
721
737
|
})] }),
|
|
722
|
-
e.expiresAt && e.status === "RUNNING" && /* @__PURE__ */
|
|
738
|
+
e.expiresAt && e.status === "RUNNING" && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
|
|
723
739
|
className: "text-muted-foreground/40",
|
|
724
740
|
children: "|"
|
|
725
|
-
}), /* @__PURE__ */
|
|
741
|
+
}), /* @__PURE__ */ v(le, {
|
|
726
742
|
compact: !0,
|
|
727
743
|
expiresAt: e.expiresAt
|
|
728
744
|
})] }),
|
|
729
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ v("span", {
|
|
730
746
|
className: "text-muted-foreground/40",
|
|
731
747
|
children: "|"
|
|
732
748
|
}),
|
|
733
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ v("span", { children: u(E, "sandbox.list.item.created", "Created {time}", { time: Ve(e.createdAt) }) })
|
|
734
750
|
]
|
|
735
751
|
}),
|
|
736
|
-
e.errorMessage && /* @__PURE__ */
|
|
752
|
+
e.errorMessage && /* @__PURE__ */ y("div", {
|
|
737
753
|
className: "mt-2 flex items-start gap-1.5 text-xs text-status-error-text bg-status-error-bg-subtle px-2.5 py-1.5 rounded-md",
|
|
738
|
-
children: [/* @__PURE__ */
|
|
754
|
+
children: [/* @__PURE__ */ v(Ee, {
|
|
739
755
|
size: 12,
|
|
740
756
|
className: "flex-shrink-0 mt-0.5"
|
|
741
|
-
}), /* @__PURE__ */
|
|
757
|
+
}), /* @__PURE__ */ v("span", {
|
|
742
758
|
className: "line-clamp-1",
|
|
743
759
|
children: e.errorMessage
|
|
744
760
|
})]
|
|
@@ -751,71 +767,71 @@ function O() {
|
|
|
751
767
|
}, e.id);
|
|
752
768
|
})
|
|
753
769
|
}),
|
|
754
|
-
|
|
770
|
+
U > 1 && /* @__PURE__ */ v(i, {
|
|
755
771
|
className: "animate-in fade-in-0 duration-300",
|
|
756
|
-
children: /* @__PURE__ */
|
|
772
|
+
children: /* @__PURE__ */ y(a, {
|
|
757
773
|
className: "p-4 flex flex-col sm:flex-row items-center justify-between gap-3",
|
|
758
|
-
children: [/* @__PURE__ */
|
|
774
|
+
children: [/* @__PURE__ */ v("p", {
|
|
759
775
|
className: "text-sm text-muted-foreground",
|
|
760
|
-
children:
|
|
761
|
-
from: (
|
|
762
|
-
to: Math.min(
|
|
763
|
-
total:
|
|
776
|
+
children: u(E, "sandbox.list.pagination.showing", "Showing {from}-{to} of {total}", {
|
|
777
|
+
from: (O - 1) * 20 + 1,
|
|
778
|
+
to: Math.min(O * 20, H),
|
|
779
|
+
total: H
|
|
764
780
|
})
|
|
765
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ y("div", {
|
|
766
782
|
className: "flex items-center gap-2",
|
|
767
783
|
children: [
|
|
768
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ v(r, {
|
|
769
785
|
variant: "outline",
|
|
770
786
|
size: "icon",
|
|
771
|
-
onClick: () =>
|
|
772
|
-
disabled:
|
|
773
|
-
"aria-label":
|
|
774
|
-
children: /* @__PURE__ */
|
|
787
|
+
onClick: () => k((e) => Math.max(1, e - 1)),
|
|
788
|
+
disabled: O === 1,
|
|
789
|
+
"aria-label": u(E, "sandbox.list.pagination.previous.ariaLabel", "Previous page"),
|
|
790
|
+
children: /* @__PURE__ */ v(ke, { size: 18 })
|
|
775
791
|
}),
|
|
776
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ v(n, {
|
|
777
793
|
variant: "secondary",
|
|
778
794
|
className: "px-4 py-2 text-sm",
|
|
779
|
-
children:
|
|
780
|
-
current:
|
|
781
|
-
total:
|
|
795
|
+
children: u(E, "sandbox.list.pagination.pageOf", "Page {current} of {total}", {
|
|
796
|
+
current: O,
|
|
797
|
+
total: U
|
|
782
798
|
})
|
|
783
799
|
}),
|
|
784
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ v(r, {
|
|
785
801
|
variant: "outline",
|
|
786
802
|
size: "icon",
|
|
787
|
-
onClick: () =>
|
|
788
|
-
disabled:
|
|
789
|
-
"aria-label":
|
|
790
|
-
children: /* @__PURE__ */
|
|
803
|
+
onClick: () => k((e) => Math.min(U, e + 1)),
|
|
804
|
+
disabled: O === U,
|
|
805
|
+
"aria-label": u(E, "sandbox.list.pagination.next.ariaLabel", "Next page"),
|
|
806
|
+
children: /* @__PURE__ */ v(Ae, { size: 18 })
|
|
791
807
|
})
|
|
792
808
|
]
|
|
793
809
|
})]
|
|
794
810
|
})
|
|
795
811
|
})
|
|
796
|
-
] }) : /* @__PURE__ */
|
|
797
|
-
icon:
|
|
798
|
-
title:
|
|
799
|
-
description:
|
|
800
|
-
action:
|
|
812
|
+
] }) : /* @__PURE__ */ v(pe, {
|
|
813
|
+
icon: v(G ? Fe : De, { size: 48 }),
|
|
814
|
+
title: G ? u(E, "sandbox.list.empty.filtered.title", "No matching sandboxes") : u(E, "sandbox.list.empty.title", "No sandboxes yet"),
|
|
815
|
+
description: G ? u(E, "sandbox.list.empty.filtered.description", "Try adjusting your search or filters to find what you're looking for.") : u(E, "sandbox.list.empty.description", "Create your first sandbox to start building and testing in isolated environments."),
|
|
816
|
+
action: G ? /* @__PURE__ */ y(r, {
|
|
801
817
|
variant: "outline",
|
|
802
|
-
onClick:
|
|
803
|
-
children: [/* @__PURE__ */
|
|
804
|
-
}) : /* @__PURE__ */
|
|
805
|
-
onClick:
|
|
806
|
-
children: [/* @__PURE__ */
|
|
818
|
+
onClick: mt,
|
|
819
|
+
children: [/* @__PURE__ */ v(g, { size: 16 }), u(E, "sandbox.list.empty.filtered.clearFilters", "Clear Filters")]
|
|
820
|
+
}) : /* @__PURE__ */ y(r, {
|
|
821
|
+
onClick: ht,
|
|
822
|
+
children: [/* @__PURE__ */ v(Pe, { size: 16 }), u(E, "sandbox.list.empty.createFirst", "Create First Sandbox")]
|
|
807
823
|
})
|
|
808
824
|
})
|
|
809
825
|
}),
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
workspaceId:
|
|
812
|
-
open:
|
|
813
|
-
onClose: () =>
|
|
826
|
+
/* @__PURE__ */ v(ge, {
|
|
827
|
+
workspaceId: L ?? "",
|
|
828
|
+
open: nt,
|
|
829
|
+
onClose: () => rt(!1)
|
|
814
830
|
})
|
|
815
831
|
]
|
|
816
832
|
});
|
|
817
833
|
}
|
|
818
834
|
//#endregion
|
|
819
|
-
export {
|
|
835
|
+
export { T as SandboxListPage };
|
|
820
836
|
|
|
821
837
|
//# sourceMappingURL=SandboxListPage.js.map
|