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