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