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