@burdenoff/microfe-sandbox 2026.530.1 → 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,335 +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",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ b(je, { size: 18 }), u(k, "sandbox.list.actions.create", "Create Sandbox")]
|
|
298
294
|
})
|
|
299
295
|
}),
|
|
300
|
-
headerContent:
|
|
296
|
+
headerContent: $e > 0 ? /* @__PURE__ */ x("div", {
|
|
301
297
|
className: "flex items-center gap-3 flex-wrap",
|
|
302
|
-
children: [
|
|
298
|
+
children: [/* @__PURE__ */ b(n, {
|
|
303
299
|
variant: "secondary",
|
|
304
300
|
className: "gap-1.5",
|
|
305
|
-
children: u(
|
|
306
|
-
}), /* @__PURE__ */
|
|
301
|
+
children: u(k, "sandbox.list.header.total", "{count} total", { count: $e })
|
|
302
|
+
}), /* @__PURE__ */ b(n, {
|
|
307
303
|
variant: "default",
|
|
308
304
|
className: "gap-1.5 bg-status-success-bg-subtle text-status-success-text border-border-default",
|
|
309
|
-
children: u(
|
|
310
|
-
})] }), I && /* @__PURE__ */ y("label", {
|
|
311
|
-
className: "inline-flex items-center gap-2 text-sm text-text-secondary cursor-pointer select-none",
|
|
312
|
-
title: u(E, "sandbox.list.header.showInternal.tooltip", "Include sandboxes created by the AI assistant, docs builder, and other internal services. Super-admin only."),
|
|
313
|
-
children: [/* @__PURE__ */ v(ae, {
|
|
314
|
-
checked: Ye,
|
|
315
|
-
onCheckedChange: (e) => {
|
|
316
|
-
Xe(e), k(1);
|
|
317
|
-
},
|
|
318
|
-
"aria-label": u(E, "sandbox.list.header.showInternal.ariaLabel", "Show internal sandboxes")
|
|
319
|
-
}), /* @__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 })
|
|
320
306
|
})]
|
|
321
307
|
}) : null,
|
|
322
308
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
runningCount:
|
|
325
|
-
maxConcurrent: Math.max(
|
|
309
|
+
/* @__PURE__ */ b(pe, {
|
|
310
|
+
runningCount: J,
|
|
311
|
+
maxConcurrent: Math.max(J, 10)
|
|
326
312
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ x("div", {
|
|
328
314
|
className: "space-y-4",
|
|
329
315
|
children: [
|
|
330
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ x("div", {
|
|
331
317
|
className: "flex flex-col sm:flex-row gap-3",
|
|
332
318
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ b(r, {
|
|
334
320
|
variant: "outline",
|
|
335
321
|
size: "sm",
|
|
336
|
-
onClick: () =>
|
|
337
|
-
"aria-label": u(
|
|
322
|
+
onClick: () => Ye(!0),
|
|
323
|
+
"aria-label": u(k, "sandbox.list.actions.export.ariaLabel", "Export sandboxes"),
|
|
338
324
|
className: "self-start sm:self-auto",
|
|
339
|
-
children: u(
|
|
325
|
+
children: u(k, "sandbox.list.actions.export.label", "Export")
|
|
340
326
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ x("div", {
|
|
342
328
|
className: "flex-1 relative group",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ b(Me, {
|
|
344
330
|
size: 18,
|
|
345
331
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground group-focus-within:text-primary transition-colors"
|
|
346
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ b(ee, {
|
|
347
333
|
type: "text",
|
|
348
|
-
placeholder: u(
|
|
349
|
-
value:
|
|
350
|
-
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),
|
|
351
337
|
className: "pl-[3.25rem] h-10",
|
|
352
|
-
"aria-label": u(
|
|
338
|
+
"aria-label": u(k, "sandbox.list.search.ariaLabel", "Search sandboxes"),
|
|
353
339
|
"data-tour": "sandbox-list-search-input"
|
|
354
340
|
})]
|
|
355
341
|
}),
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
variant:
|
|
358
|
-
onClick: () =>
|
|
359
|
-
"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"),
|
|
360
346
|
"data-tour": "sandbox-list-filters-button",
|
|
361
347
|
children: [
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
|
|
364
|
-
|
|
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, {
|
|
365
351
|
variant: "secondary",
|
|
366
352
|
className: "ml-1 h-5 min-w-5 px-1.5",
|
|
367
353
|
children: [
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
354
|
+
C.search,
|
|
355
|
+
C.template !== "all" && C.template,
|
|
356
|
+
C.status !== "all" && C.status
|
|
371
357
|
].filter(Boolean).length
|
|
372
358
|
})
|
|
373
359
|
]
|
|
374
360
|
})
|
|
375
361
|
]
|
|
376
362
|
}),
|
|
377
|
-
|
|
363
|
+
A && /* @__PURE__ */ b(i, {
|
|
378
364
|
className: "animate-in slide-in-from-top-2 duration-200",
|
|
379
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ x(a, {
|
|
380
366
|
className: "p-4",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ x("div", {
|
|
382
368
|
className: "flex items-center justify-between mb-4",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
384
370
|
className: "font-semibold text-foreground flex items-center gap-2",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ b(h, {
|
|
386
372
|
size: 16,
|
|
387
373
|
className: "text-primary"
|
|
388
|
-
}), u(
|
|
389
|
-
}),
|
|
374
|
+
}), u(k, "sandbox.list.filters.panel.title", "Filter Sandboxes")]
|
|
375
|
+
}), q && /* @__PURE__ */ x(r, {
|
|
390
376
|
variant: "ghost",
|
|
391
377
|
size: "sm",
|
|
392
|
-
onClick:
|
|
378
|
+
onClick: ct,
|
|
393
379
|
className: "text-muted-foreground hover:text-destructive",
|
|
394
|
-
children: [/* @__PURE__ */ v
|
|
380
|
+
children: [/* @__PURE__ */ b(v, { size: 16 }), u(k, "sandbox.list.filters.clearAll", "Clear All")]
|
|
395
381
|
})]
|
|
396
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ x("div", {
|
|
397
383
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ x("div", {
|
|
399
385
|
className: "space-y-2",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ b("label", {
|
|
401
387
|
className: "block text-sm font-medium text-foreground",
|
|
402
|
-
children: u(
|
|
403
|
-
}), /* @__PURE__ */
|
|
404
|
-
value:
|
|
388
|
+
children: u(k, "sandbox.list.filters.template.label", "Template")
|
|
389
|
+
}), /* @__PURE__ */ x(te, {
|
|
390
|
+
value: C.template || "all",
|
|
405
391
|
onValueChange: (e) => {
|
|
406
|
-
|
|
392
|
+
w({ template: e }), M(1);
|
|
407
393
|
},
|
|
408
|
-
children: [/* @__PURE__ */
|
|
409
|
-
/* @__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, {
|
|
410
396
|
value: "all",
|
|
411
|
-
children: u(
|
|
397
|
+
children: u(k, "sandbox.list.filters.template.all", "All Templates")
|
|
412
398
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ b(s, {
|
|
414
400
|
value: "AI_BUILDER",
|
|
415
|
-
children: u(
|
|
401
|
+
children: u(k, "sandbox.list.filters.template.aiBuilder", "AI Builder")
|
|
416
402
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ b(s, {
|
|
418
404
|
value: "WORKFLOW_MULTI_NODE",
|
|
419
|
-
children: u(
|
|
405
|
+
children: u(k, "sandbox.list.filters.template.workflowMultiNode", "Workflow Multi-Node")
|
|
420
406
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ b(s, {
|
|
422
408
|
value: "MISC_SHELL",
|
|
423
|
-
children: u(
|
|
409
|
+
children: u(k, "sandbox.list.filters.template.miscShell", "Misc Shell")
|
|
424
410
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ b(s, {
|
|
426
412
|
value: "CUSTOM",
|
|
427
|
-
children: u(
|
|
413
|
+
children: u(k, "sandbox.list.filters.template.custom", "Custom")
|
|
428
414
|
})
|
|
429
415
|
] })]
|
|
430
416
|
})]
|
|
431
|
-
}), /* @__PURE__ */
|
|
417
|
+
}), /* @__PURE__ */ x("div", {
|
|
432
418
|
className: "space-y-2",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ b("label", {
|
|
434
420
|
className: "block text-sm font-medium text-foreground",
|
|
435
|
-
children: u(
|
|
436
|
-
}), /* @__PURE__ */
|
|
437
|
-
value:
|
|
421
|
+
children: u(k, "sandbox.list.filters.status.label", "Status")
|
|
422
|
+
}), /* @__PURE__ */ x(te, {
|
|
423
|
+
value: C.status || "all",
|
|
438
424
|
onValueChange: (e) => {
|
|
439
|
-
|
|
425
|
+
w({ status: e }), M(1);
|
|
440
426
|
},
|
|
441
|
-
children: [/* @__PURE__ */
|
|
442
|
-
/* @__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, {
|
|
443
429
|
value: "all",
|
|
444
|
-
children: u(
|
|
430
|
+
children: u(k, "sandbox.list.filters.status.all", "All Statuses")
|
|
445
431
|
}),
|
|
446
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ b(s, {
|
|
447
433
|
value: "PENDING",
|
|
448
|
-
children: u(
|
|
434
|
+
children: u(k, "sandbox.list.filters.status.pending", "Pending")
|
|
449
435
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ b(s, {
|
|
451
437
|
value: "PROVISIONING",
|
|
452
|
-
children: u(
|
|
438
|
+
children: u(k, "sandbox.list.filters.status.provisioning", "Provisioning")
|
|
453
439
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ b(s, {
|
|
455
441
|
value: "RUNNING",
|
|
456
|
-
children: u(
|
|
442
|
+
children: u(k, "sandbox.list.filters.status.running", "Running")
|
|
457
443
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ b(s, {
|
|
459
445
|
value: "STOPPING",
|
|
460
|
-
children: u(
|
|
446
|
+
children: u(k, "sandbox.list.filters.status.stopping", "Stopping")
|
|
461
447
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ b(s, {
|
|
463
449
|
value: "STOPPED",
|
|
464
|
-
children: u(
|
|
450
|
+
children: u(k, "sandbox.list.filters.status.stopped", "Stopped")
|
|
465
451
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ b(s, {
|
|
467
453
|
value: "ERROR",
|
|
468
|
-
children: u(
|
|
454
|
+
children: u(k, "sandbox.list.filters.status.error", "Error")
|
|
469
455
|
}),
|
|
470
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ b(s, {
|
|
471
457
|
value: "EXPIRED",
|
|
472
|
-
children: u(
|
|
458
|
+
children: u(k, "sandbox.list.filters.status.expired", "Expired")
|
|
473
459
|
}),
|
|
474
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ b(s, {
|
|
475
461
|
value: "FAILED",
|
|
476
|
-
children: u(
|
|
462
|
+
children: u(k, "sandbox.list.filters.status.failed", "Failed")
|
|
477
463
|
})
|
|
478
464
|
] })]
|
|
479
465
|
})]
|
|
@@ -481,285 +467,285 @@ function T() {
|
|
|
481
467
|
})]
|
|
482
468
|
})
|
|
483
469
|
}),
|
|
484
|
-
|
|
485
|
-
className: l("border-l-4",
|
|
486
|
-
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, {
|
|
487
473
|
className: "p-4 flex items-start justify-between gap-3",
|
|
488
|
-
children: [/* @__PURE__ */
|
|
489
|
-
role:
|
|
474
|
+
children: [/* @__PURE__ */ x("div", {
|
|
475
|
+
role: L.kind === "error" ? "alert" : "status",
|
|
490
476
|
className: "flex items-start gap-2 text-sm",
|
|
491
|
-
children: [
|
|
477
|
+
children: [L.kind === "success" ? /* @__PURE__ */ b(Ee, {
|
|
492
478
|
size: 16,
|
|
493
479
|
className: "mt-0.5 text-status-success-text"
|
|
494
|
-
}) : /* @__PURE__ */
|
|
480
|
+
}) : /* @__PURE__ */ b(we, {
|
|
495
481
|
size: 16,
|
|
496
482
|
className: "mt-0.5 text-destructive"
|
|
497
|
-
}), /* @__PURE__ */
|
|
498
|
-
className: l("font-medium",
|
|
499
|
-
children:
|
|
483
|
+
}), /* @__PURE__ */ b("span", {
|
|
484
|
+
className: l("font-medium", L.kind === "success" ? "text-status-success-text" : "text-destructive"),
|
|
485
|
+
children: L.message
|
|
500
486
|
})]
|
|
501
|
-
}), /* @__PURE__ */
|
|
487
|
+
}), /* @__PURE__ */ b(r, {
|
|
502
488
|
variant: "ghost",
|
|
503
489
|
size: "icon",
|
|
504
|
-
onClick: () =>
|
|
505
|
-
"aria-label": u(
|
|
506
|
-
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 })
|
|
507
493
|
})]
|
|
508
494
|
})
|
|
509
495
|
})
|
|
510
496
|
]
|
|
511
497
|
}),
|
|
512
|
-
|
|
498
|
+
Ze && /* @__PURE__ */ b("div", {
|
|
513
499
|
className: "space-y-4 animate-in fade-in-0 duration-300",
|
|
514
500
|
children: [...[
|
|
515
501
|
,
|
|
516
502
|
,
|
|
517
503
|
,
|
|
518
|
-
]].map((e, t) => /* @__PURE__ */
|
|
504
|
+
]].map((e, t) => /* @__PURE__ */ b(i, { children: /* @__PURE__ */ b(a, {
|
|
519
505
|
className: "p-5",
|
|
520
|
-
children: /* @__PURE__ */
|
|
506
|
+
children: /* @__PURE__ */ x("div", {
|
|
521
507
|
className: "flex items-start gap-4",
|
|
522
|
-
children: [/* @__PURE__ */
|
|
508
|
+
children: [/* @__PURE__ */ b(c, { className: "size-12 rounded-lg" }), /* @__PURE__ */ x("div", {
|
|
523
509
|
className: "flex-1 space-y-2",
|
|
524
510
|
children: [
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
/* @__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", {
|
|
528
514
|
className: "flex gap-2 pt-1",
|
|
529
|
-
children: [/* @__PURE__ */
|
|
515
|
+
children: [/* @__PURE__ */ b(c, { className: "h-5 w-20 rounded-full" }), /* @__PURE__ */ b(c, { className: "h-5 w-24 rounded-full" })]
|
|
530
516
|
})
|
|
531
517
|
]
|
|
532
518
|
})]
|
|
533
519
|
})
|
|
534
520
|
}) }, t))
|
|
535
521
|
}),
|
|
536
|
-
!
|
|
522
|
+
!Ze && /* @__PURE__ */ b("div", {
|
|
537
523
|
className: "space-y-4",
|
|
538
|
-
children:
|
|
539
|
-
/* @__PURE__ */
|
|
524
|
+
children: K.length > 0 ? /* @__PURE__ */ x(y, { children: [
|
|
525
|
+
/* @__PURE__ */ b(i, {
|
|
540
526
|
className: "animate-in fade-in-0 duration-300",
|
|
541
|
-
children: /* @__PURE__ */
|
|
527
|
+
children: /* @__PURE__ */ x(a, {
|
|
542
528
|
className: "p-4 space-y-3",
|
|
543
|
-
children: [/* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ x("div", {
|
|
544
530
|
className: "flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",
|
|
545
531
|
"data-tour": "sandbox-list-bulk-controls",
|
|
546
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ x("div", {
|
|
547
533
|
className: "flex flex-wrap items-center gap-3",
|
|
548
534
|
children: [
|
|
549
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ x("label", {
|
|
550
536
|
className: "inline-flex items-center gap-2 text-sm font-medium text-foreground",
|
|
551
|
-
children: [/* @__PURE__ */
|
|
552
|
-
checked:
|
|
553
|
-
onCheckedChange: (e) =>
|
|
554
|
-
"aria-label": u(
|
|
555
|
-
}), /* @__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") })]
|
|
556
542
|
}),
|
|
557
|
-
|
|
543
|
+
W > K.length && /* @__PURE__ */ x(r, {
|
|
558
544
|
variant: "ghost",
|
|
559
545
|
size: "sm",
|
|
560
|
-
onClick:
|
|
546
|
+
onClick: yt,
|
|
561
547
|
disabled: $,
|
|
562
|
-
children: [
|
|
548
|
+
children: [it ? /* @__PURE__ */ b(g, {
|
|
563
549
|
size: 14,
|
|
564
550
|
className: "animate-spin"
|
|
565
|
-
}) : null, u(
|
|
551
|
+
}) : null, u(k, "sandbox.list.bulk.selectAll", "Select all {count}", { count: W })]
|
|
566
552
|
}),
|
|
567
|
-
|
|
553
|
+
tt && /* @__PURE__ */ b(r, {
|
|
568
554
|
variant: "ghost",
|
|
569
555
|
size: "sm",
|
|
570
|
-
onClick:
|
|
556
|
+
onClick: pt,
|
|
571
557
|
disabled: $,
|
|
572
|
-
children: u(
|
|
558
|
+
children: u(k, "sandbox.list.bulk.clearSelection", "Clear selection")
|
|
573
559
|
})
|
|
574
560
|
]
|
|
575
|
-
}), /* @__PURE__ */
|
|
561
|
+
}), /* @__PURE__ */ x("div", {
|
|
576
562
|
className: "flex flex-wrap items-center gap-2",
|
|
577
563
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
variant:
|
|
564
|
+
/* @__PURE__ */ b(n, {
|
|
565
|
+
variant: tt ? "default" : "secondary",
|
|
580
566
|
className: "gap-1.5",
|
|
581
|
-
children: u(
|
|
567
|
+
children: u(k, "sandbox.list.bulk.selectedCount", "{count} selected", { count: et.length })
|
|
582
568
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ x(r, {
|
|
584
570
|
variant: "outline",
|
|
585
|
-
onClick:
|
|
586
|
-
disabled: $ ||
|
|
571
|
+
onClick: bt,
|
|
572
|
+
disabled: $ || Z.length === 0,
|
|
587
573
|
children: [
|
|
588
|
-
|
|
574
|
+
at ? /* @__PURE__ */ b(g, {
|
|
589
575
|
size: 16,
|
|
590
576
|
className: "animate-spin"
|
|
591
|
-
}) : /* @__PURE__ */
|
|
592
|
-
u(
|
|
593
|
-
|
|
577
|
+
}) : /* @__PURE__ */ b(_, { size: 16 }),
|
|
578
|
+
u(k, "sandbox.list.bulk.stopSelected", "Stop Selected"),
|
|
579
|
+
Z.length > 0 ? ` (${Z.length})` : ""
|
|
594
580
|
]
|
|
595
581
|
}),
|
|
596
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ x(r, {
|
|
597
583
|
variant: "outline",
|
|
598
584
|
className: "text-destructive border-destructive/50 hover:bg-destructive/10",
|
|
599
|
-
onClick:
|
|
600
|
-
disabled: $ ||
|
|
585
|
+
onClick: xt,
|
|
586
|
+
disabled: $ || Q.length === 0,
|
|
601
587
|
children: [
|
|
602
|
-
|
|
588
|
+
ot ? /* @__PURE__ */ b(g, {
|
|
603
589
|
size: 16,
|
|
604
590
|
className: "animate-spin"
|
|
605
|
-
}) : /* @__PURE__ */
|
|
606
|
-
u(
|
|
607
|
-
|
|
591
|
+
}) : /* @__PURE__ */ b(Pe, { size: 16 }),
|
|
592
|
+
u(k, "sandbox.list.bulk.deleteSelected", "Delete Selected"),
|
|
593
|
+
Q.length > 0 ? ` (${Q.length})` : ""
|
|
608
594
|
]
|
|
609
595
|
})
|
|
610
596
|
]
|
|
611
597
|
})]
|
|
612
|
-
}), /* @__PURE__ */
|
|
598
|
+
}), /* @__PURE__ */ b("p", {
|
|
613
599
|
className: "text-xs text-muted-foreground",
|
|
614
|
-
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.")
|
|
615
601
|
})]
|
|
616
602
|
})
|
|
617
603
|
}),
|
|
618
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ b("div", {
|
|
619
605
|
className: "space-y-3",
|
|
620
|
-
children:
|
|
621
|
-
let n =
|
|
622
|
-
return /* @__PURE__ */
|
|
606
|
+
children: K.map((e, t) => {
|
|
607
|
+
let n = N.has(e.id);
|
|
608
|
+
return /* @__PURE__ */ b(i, {
|
|
623
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"),
|
|
624
610
|
style: { animationDelay: `${t * 40}ms` },
|
|
625
|
-
onClick: () =>
|
|
611
|
+
onClick: () => ut(e.id),
|
|
626
612
|
tabIndex: 0,
|
|
627
613
|
onKeyDown: (t) => {
|
|
628
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
614
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), ut(e.id));
|
|
629
615
|
},
|
|
630
616
|
"data-tour": "sandbox-list-item-card",
|
|
631
|
-
children: /* @__PURE__ */
|
|
617
|
+
children: /* @__PURE__ */ b(a, {
|
|
632
618
|
className: "p-5",
|
|
633
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ x("div", {
|
|
634
620
|
className: "flex items-start gap-4",
|
|
635
621
|
children: [
|
|
636
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ b("div", {
|
|
637
623
|
className: "pt-1",
|
|
638
|
-
children: /* @__PURE__ */
|
|
624
|
+
children: /* @__PURE__ */ b(o, {
|
|
639
625
|
checked: n,
|
|
640
|
-
onCheckedChange: (t) =>
|
|
626
|
+
onCheckedChange: (t) => dt(e, t === !0),
|
|
641
627
|
onClick: (e) => e.stopPropagation(),
|
|
642
|
-
"aria-label": u(
|
|
628
|
+
"aria-label": u(k, "sandbox.list.item.select.ariaLabel", "Select sandbox {name}", { name: e.name })
|
|
643
629
|
})
|
|
644
630
|
}),
|
|
645
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ b("div", {
|
|
646
632
|
className: "flex-shrink-0 p-3 rounded-lg bg-muted/50",
|
|
647
|
-
children: /* @__PURE__ */
|
|
633
|
+
children: /* @__PURE__ */ b(se, {
|
|
648
634
|
type: e.template,
|
|
649
635
|
size: 24
|
|
650
636
|
})
|
|
651
637
|
}),
|
|
652
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ x("div", {
|
|
653
639
|
className: "flex-1 min-w-0",
|
|
654
640
|
children: [
|
|
655
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ x("div", {
|
|
656
642
|
className: "flex items-start justify-between gap-3",
|
|
657
|
-
children: [/* @__PURE__ */
|
|
643
|
+
children: [/* @__PURE__ */ x("div", {
|
|
658
644
|
className: "min-w-0",
|
|
659
|
-
children: [/* @__PURE__ */
|
|
645
|
+
children: [/* @__PURE__ */ x("div", {
|
|
660
646
|
className: "flex items-center gap-2 mb-1",
|
|
661
|
-
children: [/* @__PURE__ */
|
|
647
|
+
children: [/* @__PURE__ */ b("h3", {
|
|
662
648
|
className: "font-semibold text-base truncate",
|
|
663
649
|
children: e.name
|
|
664
|
-
}), /* @__PURE__ */
|
|
665
|
-
}), e.description && /* @__PURE__ */
|
|
650
|
+
}), /* @__PURE__ */ b(ae, { status: e.status })]
|
|
651
|
+
}), e.description && /* @__PURE__ */ b("p", {
|
|
666
652
|
className: "text-sm text-muted-foreground line-clamp-1 mb-2",
|
|
667
653
|
children: e.description
|
|
668
654
|
})]
|
|
669
|
-
}), /* @__PURE__ */
|
|
655
|
+
}), /* @__PURE__ */ x("div", {
|
|
670
656
|
className: l("flex items-center gap-1 transition-opacity flex-shrink-0", n ? "opacity-100" : "opacity-0 group-hover:opacity-100"),
|
|
671
657
|
children: [
|
|
672
|
-
|
|
658
|
+
ze(e) && /* @__PURE__ */ b(r, {
|
|
673
659
|
variant: "ghost",
|
|
674
660
|
size: "icon",
|
|
675
661
|
onClick: (t) => {
|
|
676
|
-
t.stopPropagation(),
|
|
662
|
+
t.stopPropagation(), _t(e);
|
|
677
663
|
},
|
|
678
|
-
"aria-label": u(
|
|
679
|
-
children: /* @__PURE__ */
|
|
664
|
+
"aria-label": u(k, "sandbox.list.item.actions.stop.ariaLabel", "Stop sandbox"),
|
|
665
|
+
children: /* @__PURE__ */ b(_, { size: 16 })
|
|
680
666
|
}),
|
|
681
|
-
|
|
667
|
+
Be(e) && /* @__PURE__ */ b(r, {
|
|
682
668
|
variant: "ghost",
|
|
683
669
|
size: "icon",
|
|
684
670
|
onClick: (t) => {
|
|
685
|
-
t.stopPropagation(),
|
|
686
|
-
context: { workspaceId:
|
|
671
|
+
t.stopPropagation(), Ke({ variables: {
|
|
672
|
+
context: { workspaceId: z },
|
|
687
673
|
id: e.id,
|
|
688
674
|
additionalSeconds: 3600
|
|
689
|
-
} }).then(() =>
|
|
675
|
+
} }).then(() => V());
|
|
690
676
|
},
|
|
691
|
-
"aria-label": u(
|
|
692
|
-
children: /* @__PURE__ */
|
|
677
|
+
"aria-label": u(k, "sandbox.list.item.actions.extendTtl.ariaLabel", "Extend TTL"),
|
|
678
|
+
children: /* @__PURE__ */ b(Ne, { size: 16 })
|
|
693
679
|
}),
|
|
694
|
-
|
|
680
|
+
Ve(e) && /* @__PURE__ */ b(r, {
|
|
695
681
|
variant: "ghost",
|
|
696
682
|
size: "icon",
|
|
697
683
|
className: "text-destructive hover:text-destructive",
|
|
698
684
|
onClick: (t) => {
|
|
699
|
-
t.stopPropagation(),
|
|
685
|
+
t.stopPropagation(), vt(e);
|
|
700
686
|
},
|
|
701
|
-
"aria-label": u(
|
|
702
|
-
children: /* @__PURE__ */
|
|
687
|
+
"aria-label": u(k, "sandbox.list.item.actions.delete.ariaLabel", "Delete sandbox"),
|
|
688
|
+
children: /* @__PURE__ */ b(Pe, { size: 16 })
|
|
703
689
|
})
|
|
704
690
|
]
|
|
705
691
|
})]
|
|
706
692
|
}),
|
|
707
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ x("div", {
|
|
708
694
|
className: "flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-muted-foreground",
|
|
709
695
|
children: [
|
|
710
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ b(oe, {
|
|
711
697
|
cpuRequest: e.resources?.cpuRequest ?? "0",
|
|
712
698
|
memoryRequest: e.resources?.memoryRequest ?? "0",
|
|
713
699
|
containerCount: e.containers?.length,
|
|
714
700
|
className: "text-xs"
|
|
715
701
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ b("span", {
|
|
717
703
|
className: "text-muted-foreground/40",
|
|
718
704
|
children: "|"
|
|
719
705
|
}),
|
|
720
|
-
/* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ b(se, {
|
|
721
707
|
type: e.template,
|
|
722
708
|
size: 12,
|
|
723
709
|
showLabel: !0
|
|
724
710
|
}),
|
|
725
|
-
e.storage?.mode && e.storage.mode !== "NONE" && /* @__PURE__ */ y
|
|
711
|
+
e.storage?.mode && e.storage.mode !== "NONE" && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
726
712
|
className: "text-muted-foreground/40",
|
|
727
713
|
children: "|"
|
|
728
|
-
}), /* @__PURE__ */
|
|
714
|
+
}), /* @__PURE__ */ x("span", {
|
|
729
715
|
className: "inline-flex items-center gap-1",
|
|
730
716
|
children: [
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
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"),
|
|
733
719
|
e.storage.sizeGi && ` ${e.storage.sizeGi}Gi`
|
|
734
720
|
]
|
|
735
721
|
})] }),
|
|
736
|
-
e.containers?.length > 0 && /* @__PURE__ */ y
|
|
722
|
+
e.containers?.length > 0 && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
737
723
|
className: "text-muted-foreground/40",
|
|
738
724
|
children: "|"
|
|
739
|
-
}), /* @__PURE__ */
|
|
725
|
+
}), /* @__PURE__ */ x("span", {
|
|
740
726
|
className: "inline-flex items-center gap-1",
|
|
741
|
-
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 })]
|
|
742
728
|
})] }),
|
|
743
|
-
e.expiresAt && e.status === "RUNNING" && /* @__PURE__ */ y
|
|
729
|
+
e.expiresAt && e.status === "RUNNING" && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", {
|
|
744
730
|
className: "text-muted-foreground/40",
|
|
745
731
|
children: "|"
|
|
746
|
-
}), /* @__PURE__ */
|
|
732
|
+
}), /* @__PURE__ */ b(ce, {
|
|
747
733
|
compact: !0,
|
|
748
734
|
expiresAt: e.expiresAt
|
|
749
735
|
})] }),
|
|
750
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ b("span", {
|
|
751
737
|
className: "text-muted-foreground/40",
|
|
752
738
|
children: "|"
|
|
753
739
|
}),
|
|
754
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ b("span", { children: u(k, "sandbox.list.item.created", "Created {time}", { time: Le(e.createdAt) }) })
|
|
755
741
|
]
|
|
756
742
|
}),
|
|
757
|
-
e.errorMessage && /* @__PURE__ */
|
|
743
|
+
e.errorMessage && /* @__PURE__ */ x("div", {
|
|
758
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",
|
|
759
|
-
children: [/* @__PURE__ */
|
|
745
|
+
children: [/* @__PURE__ */ b(we, {
|
|
760
746
|
size: 12,
|
|
761
747
|
className: "flex-shrink-0 mt-0.5"
|
|
762
|
-
}), /* @__PURE__ */
|
|
748
|
+
}), /* @__PURE__ */ b("span", {
|
|
763
749
|
className: "line-clamp-1",
|
|
764
750
|
children: e.errorMessage
|
|
765
751
|
})]
|
|
@@ -772,71 +758,71 @@ function T() {
|
|
|
772
758
|
}, e.id);
|
|
773
759
|
})
|
|
774
760
|
}),
|
|
775
|
-
|
|
761
|
+
G > 1 && /* @__PURE__ */ b(i, {
|
|
776
762
|
className: "animate-in fade-in-0 duration-300",
|
|
777
|
-
children: /* @__PURE__ */
|
|
763
|
+
children: /* @__PURE__ */ x(a, {
|
|
778
764
|
className: "p-4 flex flex-col sm:flex-row items-center justify-between gap-3",
|
|
779
|
-
children: [/* @__PURE__ */
|
|
765
|
+
children: [/* @__PURE__ */ b("p", {
|
|
780
766
|
className: "text-sm text-muted-foreground",
|
|
781
|
-
children: u(
|
|
782
|
-
from: (
|
|
783
|
-
to: Math.min(
|
|
784
|
-
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
|
|
785
771
|
})
|
|
786
|
-
}), /* @__PURE__ */
|
|
772
|
+
}), /* @__PURE__ */ x("div", {
|
|
787
773
|
className: "flex items-center gap-2",
|
|
788
774
|
children: [
|
|
789
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ b(r, {
|
|
790
776
|
variant: "outline",
|
|
791
777
|
size: "icon",
|
|
792
|
-
onClick: () =>
|
|
793
|
-
disabled:
|
|
794
|
-
"aria-label": u(
|
|
795
|
-
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 })
|
|
796
782
|
}),
|
|
797
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ b(n, {
|
|
798
784
|
variant: "secondary",
|
|
799
785
|
className: "px-4 py-2 text-sm",
|
|
800
|
-
children: u(
|
|
801
|
-
current:
|
|
802
|
-
total:
|
|
786
|
+
children: u(k, "sandbox.list.pagination.pageOf", "Page {current} of {total}", {
|
|
787
|
+
current: j,
|
|
788
|
+
total: G
|
|
803
789
|
})
|
|
804
790
|
}),
|
|
805
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ b(r, {
|
|
806
792
|
variant: "outline",
|
|
807
793
|
size: "icon",
|
|
808
|
-
onClick: () =>
|
|
809
|
-
disabled:
|
|
810
|
-
"aria-label": u(
|
|
811
|
-
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 })
|
|
812
798
|
})
|
|
813
799
|
]
|
|
814
800
|
})]
|
|
815
801
|
})
|
|
816
802
|
})
|
|
817
|
-
] }) : /* @__PURE__ */
|
|
818
|
-
icon:
|
|
819
|
-
title:
|
|
820
|
-
description:
|
|
821
|
-
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, {
|
|
822
808
|
variant: "outline",
|
|
823
|
-
onClick:
|
|
824
|
-
children: [/* @__PURE__ */ v
|
|
825
|
-
}) : /* @__PURE__ */
|
|
826
|
-
onClick:
|
|
827
|
-
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")]
|
|
828
814
|
})
|
|
829
815
|
})
|
|
830
816
|
}),
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
workspaceId:
|
|
833
|
-
open:
|
|
834
|
-
onClose: () =>
|
|
817
|
+
/* @__PURE__ */ b(me, {
|
|
818
|
+
workspaceId: z ?? "",
|
|
819
|
+
open: Je,
|
|
820
|
+
onClose: () => Ye(!1)
|
|
835
821
|
})
|
|
836
822
|
]
|
|
837
823
|
});
|
|
838
824
|
}
|
|
839
825
|
//#endregion
|
|
840
|
-
export {
|
|
826
|
+
export { O as SandboxListPage };
|
|
841
827
|
|
|
842
828
|
//# sourceMappingURL=SandboxListPage.js.map
|