@burdenoff/microfe-sandbox 2026.624.3 → 2026.625.2
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/CountdownTimer.js.map +1 -1
- 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,15 +1,15 @@
|
|
|
1
1
|
import { useSandbox as e } from "../providers/SandboxProvider.js";
|
|
2
|
-
import { Badge as t, Button as n, Card as r, CardContent as i,
|
|
3
|
-
import { tWithFallback as
|
|
4
|
-
import { EmptyState as
|
|
5
|
-
import { useEffect as
|
|
6
|
-
import { Activity as
|
|
7
|
-
import { gql as
|
|
8
|
-
import { useMutation as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
import { jsx as
|
|
2
|
+
import { Badge as t, Button as n, Card as r, CardContent as i, GlassCard as a, Input as o, Select as s, SelectContent as c, SelectItem as l, SelectTrigger as u, SelectValue as d } from "../components/ui.js";
|
|
3
|
+
import { tWithFallback as f } from "../utils/i18n.js";
|
|
4
|
+
import { EmptyState as p, PageLayout as ee } from "../components/PageLayout.js";
|
|
5
|
+
import { useEffect as te, useMemo as m, useState as h } from "react";
|
|
6
|
+
import { Activity as g, Clock3 as _, Loader2 as v, Save as y, Shield as b, Users as ne } from "lucide-react";
|
|
7
|
+
import { gql as x } from "@apollo/client";
|
|
8
|
+
import { useMutation as re, useQuery as S } from "@apollo/client/react";
|
|
9
|
+
import { useI18n as C } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
11
11
|
//#region src/sandbox/pages/AdminPage.tsx
|
|
12
|
-
var
|
|
12
|
+
var ie = x`
|
|
13
13
|
query AdminPageGetSandboxStats($context: ContextInput!) {
|
|
14
14
|
getSandboxStats(context: $context) {
|
|
15
15
|
activeSandboxes
|
|
@@ -24,7 +24,7 @@ var w = y`
|
|
|
24
24
|
totalMemoryUsed
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`, E = x`
|
|
28
28
|
query AdminPageGetSandboxConfig($context: ContextInput!) {
|
|
29
29
|
getSandboxConfig(context: $context) {
|
|
30
30
|
id
|
|
@@ -41,7 +41,7 @@ var w = y`
|
|
|
41
41
|
allowedTemplates
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
`,
|
|
44
|
+
`, D = x`
|
|
45
45
|
query AdminPageListAllSandboxes(
|
|
46
46
|
$context: ContextInput!
|
|
47
47
|
$filter: SandboxFilterInput
|
|
@@ -71,7 +71,7 @@ var w = y`
|
|
|
71
71
|
hasMore
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`, O = x`
|
|
75
75
|
mutation AdminPageUpdateSandboxConfig($input: UpdateSandboxConfigInput!) {
|
|
76
76
|
updateSandboxConfig(input: $input) {
|
|
77
77
|
id
|
|
@@ -82,274 +82,275 @@ var w = y`
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
`;
|
|
85
|
-
function
|
|
85
|
+
function k(e) {
|
|
86
86
|
return typeof e.metadata?.assistantMode == "string" || typeof e.metadata?.assistantAuth == "object" || e.name.startsWith("ai-assistant-") ? "AI_ASSISTANT" : e.template === "DOCS_BUILDER" || typeof e.metadata?.docsRevisionId == "string" || typeof e.metadata?.docsSiteId == "string" || typeof e.metadata?.docsBuildImageId == "string" || e.name.startsWith("docs-build-") || e.name.startsWith("docs-image-canary-") ? "DOCS_BUILDER" : "MANUAL";
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
88
|
+
function A(e) {
|
|
89
|
+
return k(e) === "MANUAL" ? "USER" : "INTERNAL";
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ae(e) {
|
|
92
92
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60);
|
|
93
93
|
return t > 0 && n > 0 ? `${t}h ${n}m` : t > 0 ? `${t}h` : `${n}m`;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function j(e) {
|
|
96
96
|
return e ? new Date(e).toLocaleString() : "—";
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
let { workspaceId:
|
|
98
|
+
function M() {
|
|
99
|
+
let { workspaceId: x } = e(), { t: M } = C(), [N, P] = h(""), [F, I] = h("all"), [L, R] = h("all"), [z, B] = h(1), [V, H] = h({
|
|
100
100
|
defaultTtlSeconds: "3600",
|
|
101
101
|
maxTtlSeconds: "86400",
|
|
102
102
|
maxConcurrentPerUser: "3",
|
|
103
103
|
maxConcurrentPerWorkspace: "10"
|
|
104
|
-
}), { data:
|
|
105
|
-
variables: { context: { workspaceId:
|
|
106
|
-
skip: !
|
|
107
|
-
}), { data:
|
|
108
|
-
variables: { context: { workspaceId:
|
|
109
|
-
skip: !
|
|
110
|
-
}), { data:
|
|
104
|
+
}), { data: U, loading: W } = S(ie, {
|
|
105
|
+
variables: { context: { workspaceId: x } },
|
|
106
|
+
skip: !x
|
|
107
|
+
}), { data: G, loading: K, refetch: q } = S(E, {
|
|
108
|
+
variables: { context: { workspaceId: x } },
|
|
109
|
+
skip: !x
|
|
110
|
+
}), { data: oe, loading: se, refetch: ce } = S(D, {
|
|
111
111
|
variables: {
|
|
112
|
-
context: { workspaceId:
|
|
112
|
+
context: { workspaceId: x },
|
|
113
113
|
pagination: {
|
|
114
|
-
page:
|
|
114
|
+
page: z,
|
|
115
115
|
limit: 100
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
-
skip: !
|
|
119
|
-
}), [le, { loading:
|
|
120
|
-
|
|
121
|
-
let e =
|
|
122
|
-
e &&
|
|
118
|
+
skip: !x
|
|
119
|
+
}), [le, { loading: J }] = re(O);
|
|
120
|
+
te(() => {
|
|
121
|
+
let e = G?.getSandboxConfig;
|
|
122
|
+
e && H({
|
|
123
123
|
defaultTtlSeconds: String(e.defaultTtlSeconds),
|
|
124
124
|
maxTtlSeconds: String(e.maxTtlSeconds),
|
|
125
125
|
maxConcurrentPerUser: String(e.maxConcurrentPerUser),
|
|
126
126
|
maxConcurrentPerWorkspace: String(e.maxConcurrentPerWorkspace)
|
|
127
127
|
});
|
|
128
|
-
}, [
|
|
129
|
-
let
|
|
128
|
+
}, [G?.getSandboxConfig]);
|
|
129
|
+
let Y = U?.getSandboxStats, X = oe?.listAllSandboxes, Z = m(() => (X?.items ?? []).map((e) => ({
|
|
130
130
|
...e,
|
|
131
|
-
kind:
|
|
132
|
-
source:
|
|
133
|
-
agentEnabled:
|
|
134
|
-
})), [
|
|
135
|
-
if (
|
|
136
|
-
let t =
|
|
131
|
+
kind: A(e),
|
|
132
|
+
source: k(e),
|
|
133
|
+
agentEnabled: A(e) === "USER"
|
|
134
|
+
})), [X?.items]), Q = m(() => Z.filter((e) => {
|
|
135
|
+
if (N.trim()) {
|
|
136
|
+
let t = N.trim().toLowerCase();
|
|
137
137
|
if (!`${e.name} ${e.description ?? ""} ${e.createdBy}`.toLowerCase().includes(t)) return !1;
|
|
138
138
|
}
|
|
139
|
-
return !(
|
|
139
|
+
return !(F !== "all" && e.kind !== F || L !== "all" && e.source !== L);
|
|
140
140
|
}), [
|
|
141
|
-
|
|
141
|
+
Z,
|
|
142
|
+
F,
|
|
142
143
|
N,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
]), Q = Math.max(1, Math.ceil((Y?.total ?? 0) / 100)), $ = p(() => [
|
|
144
|
+
L
|
|
145
|
+
]), $ = Math.max(1, Math.ceil((X?.total ?? 0) / 100)), ue = m(() => [
|
|
146
146
|
{
|
|
147
|
-
label:
|
|
148
|
-
value:
|
|
149
|
-
icon: /* @__PURE__ */
|
|
147
|
+
label: f(M, "sandbox.admin.stats.activeTotal", "Active total"),
|
|
148
|
+
value: Y?.activeSandboxes ?? 0,
|
|
149
|
+
icon: /* @__PURE__ */ w(g, {
|
|
150
150
|
size: 18,
|
|
151
151
|
className: "text-primary"
|
|
152
152
|
})
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
|
-
label:
|
|
156
|
-
value:
|
|
157
|
-
icon: /* @__PURE__ */
|
|
155
|
+
label: f(M, "sandbox.admin.stats.userSandboxes", "User sandboxes"),
|
|
156
|
+
value: Z.filter((e) => e.kind === "USER").length,
|
|
157
|
+
icon: /* @__PURE__ */ w(ne, {
|
|
158
158
|
size: 18,
|
|
159
159
|
className: "text-status-success-text"
|
|
160
160
|
})
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
|
-
label:
|
|
164
|
-
value:
|
|
165
|
-
icon: /* @__PURE__ */
|
|
163
|
+
label: f(M, "sandbox.admin.stats.internalSandboxes", "Internal sandboxes"),
|
|
164
|
+
value: Z.filter((e) => e.kind === "INTERNAL").length,
|
|
165
|
+
icon: /* @__PURE__ */ w(b, {
|
|
166
166
|
size: 18,
|
|
167
167
|
className: "text-status-warning-text"
|
|
168
168
|
})
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
|
-
label:
|
|
172
|
-
value: (
|
|
173
|
-
icon: /* @__PURE__ */
|
|
171
|
+
label: f(M, "sandbox.admin.stats.failedExpired", "Failed / expired"),
|
|
172
|
+
value: (Y?.failedCount ?? 0) + (Y?.expiredCount ?? 0),
|
|
173
|
+
icon: /* @__PURE__ */ w(_, {
|
|
174
174
|
size: 18,
|
|
175
175
|
className: "text-status-error-text"
|
|
176
176
|
})
|
|
177
177
|
}
|
|
178
178
|
], [
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
]),
|
|
183
|
-
|
|
184
|
-
context: { workspaceId:
|
|
185
|
-
defaultTtlSeconds: Number(
|
|
186
|
-
maxTtlSeconds: Number(
|
|
187
|
-
maxConcurrentPerUser: Number(
|
|
188
|
-
maxConcurrentPerWorkspace: Number(
|
|
189
|
-
} } }), await Promise.all([
|
|
179
|
+
Z,
|
|
180
|
+
Y,
|
|
181
|
+
M
|
|
182
|
+
]), de = async () => {
|
|
183
|
+
x && (await le({ variables: { input: {
|
|
184
|
+
context: { workspaceId: x },
|
|
185
|
+
defaultTtlSeconds: Number(V.defaultTtlSeconds),
|
|
186
|
+
maxTtlSeconds: Number(V.maxTtlSeconds),
|
|
187
|
+
maxConcurrentPerUser: Number(V.maxConcurrentPerUser),
|
|
188
|
+
maxConcurrentPerWorkspace: Number(V.maxConcurrentPerWorkspace)
|
|
189
|
+
} } }), await Promise.all([q(), ce()]));
|
|
190
190
|
};
|
|
191
|
-
return /* @__PURE__ */
|
|
192
|
-
title:
|
|
193
|
-
subtitle:
|
|
194
|
-
icon: /* @__PURE__ */
|
|
195
|
-
headerContent: /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ T(ee, {
|
|
192
|
+
title: f(M, "sandbox.admin.title", "Sandbox Admin"),
|
|
193
|
+
subtitle: f(M, "sandbox.admin.subtitle", "Monitor internal and user sandboxes, review usage split, and manage workspace-level defaults."),
|
|
194
|
+
icon: /* @__PURE__ */ w(b, { size: 24 }),
|
|
195
|
+
headerContent: /* @__PURE__ */ w(t, {
|
|
196
196
|
variant: "secondary",
|
|
197
|
-
children:
|
|
198
|
-
user:
|
|
199
|
-
internal:
|
|
200
|
-
}) :
|
|
197
|
+
children: Y ? f(M, "sandbox.admin.usageSplit", "{{user}} user / {{internal}} internal visible", {
|
|
198
|
+
user: Z.filter((e) => e.kind === "USER").length,
|
|
199
|
+
internal: Z.filter((e) => e.kind === "INTERNAL").length
|
|
200
|
+
}) : f(M, "sandbox.admin.loadingUsageSplit", "Loading usage split…")
|
|
201
201
|
}),
|
|
202
|
-
children: [
|
|
202
|
+
children: [W ? /* @__PURE__ */ w("div", {
|
|
203
203
|
className: "flex items-center justify-center min-h-[160px]",
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
}) : /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ w(v, { className: "size-8 animate-spin text-primary" })
|
|
205
|
+
}) : /* @__PURE__ */ w("div", {
|
|
206
206
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4",
|
|
207
|
-
children:
|
|
207
|
+
children: ue.map((e, t) => /* @__PURE__ */ T(a, {
|
|
208
|
+
treatment: t === 0 ? "glass" : "metric",
|
|
208
209
|
className: "flex items-center justify-between p-5",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
210
211
|
className: "text-sm text-text-secondary",
|
|
211
212
|
children: e.label
|
|
212
|
-
}), /* @__PURE__ */
|
|
213
|
-
className: "mt-2 text-2xl font-semibold",
|
|
213
|
+
}), /* @__PURE__ */ w("p", {
|
|
214
|
+
className: "mt-2 text-2xl font-semibold tabular-nums",
|
|
214
215
|
children: e.value
|
|
215
|
-
})] }), /* @__PURE__ */
|
|
216
|
-
className: "rounded-xl bg-bg-sunken p-3",
|
|
216
|
+
})] }), /* @__PURE__ */ w("div", {
|
|
217
|
+
className: "rounded-xl bg-bg-sunken/70 p-3",
|
|
217
218
|
children: e.icon
|
|
218
219
|
})]
|
|
219
|
-
}
|
|
220
|
-
}), /* @__PURE__ */
|
|
220
|
+
}, e.label))
|
|
221
|
+
}), /* @__PURE__ */ T("div", {
|
|
221
222
|
className: "mt-6 grid grid-cols-1 gap-6 xl:grid-cols-[360px_minmax(0,1fr)]",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ w(r, { children: /* @__PURE__ */ T(i, {
|
|
223
224
|
className: "space-y-4 p-5",
|
|
224
225
|
children: [
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ T("div", {
|
|
226
227
|
className: "flex items-center justify-between",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h2", {
|
|
228
229
|
className: "text-lg font-semibold",
|
|
229
|
-
children:
|
|
230
|
-
}), /* @__PURE__ */
|
|
230
|
+
children: f(M, "sandbox.admin.config.title", "Workspace sandbox config")
|
|
231
|
+
}), /* @__PURE__ */ w("p", {
|
|
231
232
|
className: "text-sm text-text-secondary",
|
|
232
|
-
children:
|
|
233
|
-
})] }),
|
|
233
|
+
children: f(M, "sandbox.admin.config.subtitle", "Admin defaults used for manual/user sandboxes.")
|
|
234
|
+
})] }), K && /* @__PURE__ */ w(v, { className: "size-4 animate-spin text-primary" })]
|
|
234
235
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ T("label", {
|
|
236
237
|
className: "block space-y-1",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ w("span", {
|
|
238
239
|
className: "text-sm text-text-secondary",
|
|
239
|
-
children:
|
|
240
|
-
}), /* @__PURE__ */
|
|
241
|
-
value:
|
|
242
|
-
onChange: (e) =>
|
|
240
|
+
children: f(M, "sandbox.admin.config.defaultTtl", "Default TTL (seconds)")
|
|
241
|
+
}), /* @__PURE__ */ w(o, {
|
|
242
|
+
value: V.defaultTtlSeconds,
|
|
243
|
+
onChange: (e) => H((t) => ({
|
|
243
244
|
...t,
|
|
244
245
|
defaultTtlSeconds: e.target.value
|
|
245
246
|
}))
|
|
246
247
|
})]
|
|
247
248
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ T("label", {
|
|
249
250
|
className: "block space-y-1",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ w("span", {
|
|
251
252
|
className: "text-sm text-text-secondary",
|
|
252
|
-
children:
|
|
253
|
-
}), /* @__PURE__ */
|
|
254
|
-
value:
|
|
255
|
-
onChange: (e) =>
|
|
253
|
+
children: f(M, "sandbox.admin.config.maxTtl", "Max TTL (seconds)")
|
|
254
|
+
}), /* @__PURE__ */ w(o, {
|
|
255
|
+
value: V.maxTtlSeconds,
|
|
256
|
+
onChange: (e) => H((t) => ({
|
|
256
257
|
...t,
|
|
257
258
|
maxTtlSeconds: e.target.value
|
|
258
259
|
}))
|
|
259
260
|
})]
|
|
260
261
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ T("label", {
|
|
262
263
|
className: "block space-y-1",
|
|
263
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ w("span", {
|
|
264
265
|
className: "text-sm text-text-secondary",
|
|
265
|
-
children:
|
|
266
|
-
}), /* @__PURE__ */
|
|
267
|
-
value:
|
|
268
|
-
onChange: (e) =>
|
|
266
|
+
children: f(M, "sandbox.admin.config.maxConcurrentUser", "Max concurrent per user")
|
|
267
|
+
}), /* @__PURE__ */ w(o, {
|
|
268
|
+
value: V.maxConcurrentPerUser,
|
|
269
|
+
onChange: (e) => H((t) => ({
|
|
269
270
|
...t,
|
|
270
271
|
maxConcurrentPerUser: e.target.value
|
|
271
272
|
}))
|
|
272
273
|
})]
|
|
273
274
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ T("label", {
|
|
275
276
|
className: "block space-y-1",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ w("span", {
|
|
277
278
|
className: "text-sm text-text-secondary",
|
|
278
|
-
children:
|
|
279
|
-
}), /* @__PURE__ */
|
|
280
|
-
value:
|
|
281
|
-
onChange: (e) =>
|
|
279
|
+
children: f(M, "sandbox.admin.config.maxConcurrentWorkspace", "Max concurrent per workspace")
|
|
280
|
+
}), /* @__PURE__ */ w(o, {
|
|
281
|
+
value: V.maxConcurrentPerWorkspace,
|
|
282
|
+
onChange: (e) => H((t) => ({
|
|
282
283
|
...t,
|
|
283
284
|
maxConcurrentPerWorkspace: e.target.value
|
|
284
285
|
}))
|
|
285
286
|
})]
|
|
286
287
|
}),
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
onClick: () => void
|
|
289
|
-
disabled:
|
|
290
|
-
children: [
|
|
288
|
+
/* @__PURE__ */ T(n, {
|
|
289
|
+
onClick: () => void de(),
|
|
290
|
+
disabled: J || !x,
|
|
291
|
+
children: [J ? /* @__PURE__ */ w(v, {
|
|
291
292
|
size: 16,
|
|
292
293
|
className: "animate-spin"
|
|
293
|
-
}) : /* @__PURE__ */
|
|
294
|
+
}) : /* @__PURE__ */ w(y, { size: 16 }), f(M, "sandbox.admin.config.save", "Save config")]
|
|
294
295
|
})
|
|
295
296
|
]
|
|
296
|
-
}) }), /* @__PURE__ */
|
|
297
|
+
}) }), /* @__PURE__ */ w(r, { children: /* @__PURE__ */ T(i, {
|
|
297
298
|
className: "space-y-4 p-5",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ T("div", {
|
|
299
300
|
className: "flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h2", {
|
|
301
302
|
className: "text-lg font-semibold",
|
|
302
|
-
children:
|
|
303
|
-
}), /* @__PURE__ */
|
|
303
|
+
children: f(M, "sandbox.admin.list.title", "All sandboxes")
|
|
304
|
+
}), /* @__PURE__ */ w("p", {
|
|
304
305
|
className: "text-sm text-text-secondary",
|
|
305
|
-
children:
|
|
306
|
-
})] }), /* @__PURE__ */
|
|
306
|
+
children: f(M, "sandbox.admin.list.subtitle", "Superadmins can review both internal and user-owned sandboxes here.")
|
|
307
|
+
})] }), /* @__PURE__ */ T("div", {
|
|
307
308
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
308
309
|
children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
value: j,
|
|
311
|
-
onChange: (e) => M(e.target.value),
|
|
312
|
-
placeholder: d(A, "sandbox.admin.list.search", "Search sandboxes")
|
|
313
|
-
}),
|
|
314
|
-
/* @__PURE__ */ C(o, {
|
|
310
|
+
/* @__PURE__ */ w(o, {
|
|
315
311
|
value: N,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
312
|
+
onChange: (e) => P(e.target.value),
|
|
313
|
+
placeholder: f(M, "sandbox.admin.list.search", "Search sandboxes")
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ T(s, {
|
|
316
|
+
value: F,
|
|
317
|
+
onValueChange: (e) => I(e),
|
|
318
|
+
children: [/* @__PURE__ */ w(u, { children: /* @__PURE__ */ w(d, { placeholder: "Kind" }) }), /* @__PURE__ */ T(c, { children: [
|
|
319
|
+
/* @__PURE__ */ w(l, {
|
|
319
320
|
value: "all",
|
|
320
321
|
children: "All kinds"
|
|
321
322
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ w(l, {
|
|
323
324
|
value: "USER",
|
|
324
325
|
children: "User"
|
|
325
326
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ w(l, {
|
|
327
328
|
value: "INTERNAL",
|
|
328
329
|
children: "Internal"
|
|
329
330
|
})
|
|
330
331
|
] })]
|
|
331
332
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
value:
|
|
334
|
-
onValueChange: (e) =>
|
|
335
|
-
children: [/* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ T(s, {
|
|
334
|
+
value: L,
|
|
335
|
+
onValueChange: (e) => R(e),
|
|
336
|
+
children: [/* @__PURE__ */ w(u, { children: /* @__PURE__ */ w(d, { placeholder: "Source" }) }), /* @__PURE__ */ T(c, { children: [
|
|
337
|
+
/* @__PURE__ */ w(l, {
|
|
337
338
|
value: "all",
|
|
338
339
|
children: "All sources"
|
|
339
340
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ w(l, {
|
|
341
342
|
value: "MANUAL",
|
|
342
343
|
children: "Manual"
|
|
343
344
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ w(l, {
|
|
345
346
|
value: "AI_ASSISTANT",
|
|
346
347
|
children: "AI assistant"
|
|
347
348
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ w(l, {
|
|
349
350
|
value: "DOCS_BUILDER",
|
|
350
351
|
children: "Docs builder"
|
|
351
352
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ w(l, {
|
|
353
354
|
value: "SYSTEM",
|
|
354
355
|
children: "System"
|
|
355
356
|
})
|
|
@@ -357,86 +358,86 @@ function A() {
|
|
|
357
358
|
})
|
|
358
359
|
]
|
|
359
360
|
})]
|
|
360
|
-
}), se ? /* @__PURE__ */
|
|
361
|
+
}), se ? /* @__PURE__ */ w("div", {
|
|
361
362
|
className: "flex items-center justify-center min-h-[220px]",
|
|
362
|
-
children: /* @__PURE__ */
|
|
363
|
-
}) :
|
|
364
|
-
icon: /* @__PURE__ */
|
|
365
|
-
title:
|
|
366
|
-
description:
|
|
367
|
-
}) : /* @__PURE__ */
|
|
363
|
+
children: /* @__PURE__ */ w(v, { className: "size-8 animate-spin text-primary" })
|
|
364
|
+
}) : Q.length === 0 ? /* @__PURE__ */ w(p, {
|
|
365
|
+
icon: /* @__PURE__ */ w(b, { size: 48 }),
|
|
366
|
+
title: f(M, "sandbox.admin.list.empty.title", "No sandboxes found"),
|
|
367
|
+
description: f(M, "sandbox.admin.list.empty.description", "Try adjusting the filters or create a sandbox from the product UI.")
|
|
368
|
+
}) : /* @__PURE__ */ T("div", {
|
|
368
369
|
className: "space-y-3",
|
|
369
|
-
children: [
|
|
370
|
-
className: "grid gap-3 rounded-xl border border-border-
|
|
370
|
+
children: [Q.map((e) => /* @__PURE__ */ T("div", {
|
|
371
|
+
className: "grid gap-3 rounded-xl border border-border-seam bg-bg-surface p-4 lg:grid-cols-[minmax(0,2fr)_auto_auto_auto] lg:items-center",
|
|
371
372
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ T("div", {
|
|
373
374
|
className: "min-w-0",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ T("div", {
|
|
375
376
|
className: "flex flex-wrap items-center gap-2",
|
|
376
377
|
children: [
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ w("p", {
|
|
378
379
|
className: "truncate font-semibold",
|
|
379
380
|
children: e.name
|
|
380
381
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ w(t, {
|
|
382
383
|
variant: e.kind === "INTERNAL" ? "destructive" : "secondary",
|
|
383
384
|
children: e.kind
|
|
384
385
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ w(t, {
|
|
386
387
|
variant: "outline",
|
|
387
388
|
children: e.source
|
|
388
389
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ w(t, {
|
|
390
391
|
variant: "outline",
|
|
391
392
|
children: e.template
|
|
392
393
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ w(t, {
|
|
394
395
|
variant: "outline",
|
|
395
396
|
children: e.status
|
|
396
397
|
}),
|
|
397
|
-
e.agentEnabled && /* @__PURE__ */
|
|
398
|
+
e.agentEnabled && /* @__PURE__ */ w(t, {
|
|
398
399
|
variant: "outline",
|
|
399
400
|
children: "Agent enabled"
|
|
400
401
|
})
|
|
401
402
|
]
|
|
402
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ w("p", {
|
|
403
404
|
className: "mt-1 truncate text-sm text-text-secondary",
|
|
404
|
-
children: e.description ||
|
|
405
|
+
children: e.description || f(M, "sandbox.admin.list.noDescription", "No description provided")
|
|
405
406
|
})]
|
|
406
407
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ T("div", {
|
|
408
409
|
className: "text-sm text-text-secondary",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ T("div", { children: ["Owner: ", e.createdBy] }), /* @__PURE__ */ T("div", { children: ["TTL: ", ae(e.ttlSeconds)] })]
|
|
410
411
|
}),
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ T("div", {
|
|
412
413
|
className: "text-sm text-text-secondary",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ T("div", { children: ["CPU: ", e.resources?.cpuRequest ?? "—"] }), /* @__PURE__ */ T("div", { children: ["Memory: ", e.resources?.memoryRequest ?? "—"] })]
|
|
414
415
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ T("div", {
|
|
416
417
|
className: "text-sm text-text-secondary lg:text-right",
|
|
417
|
-
children: [/* @__PURE__ */
|
|
418
|
+
children: [/* @__PURE__ */ T("div", { children: ["Created: ", j(e.createdAt)] }), /* @__PURE__ */ T("div", { children: ["Expires: ", j(e.expiresAt)] })]
|
|
418
419
|
})
|
|
419
420
|
]
|
|
420
|
-
}, e.id)), /* @__PURE__ */
|
|
421
|
+
}, e.id)), /* @__PURE__ */ T("div", {
|
|
421
422
|
className: "flex items-center justify-between pt-2 text-sm text-text-secondary",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ T("span", { children: [
|
|
423
424
|
"Page ",
|
|
424
|
-
|
|
425
|
+
z,
|
|
425
426
|
" of ",
|
|
426
|
-
|
|
427
|
-
] }), /* @__PURE__ */
|
|
427
|
+
$
|
|
428
|
+
] }), /* @__PURE__ */ T("div", {
|
|
428
429
|
className: "flex gap-2",
|
|
429
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ w(n, {
|
|
430
431
|
variant: "outline",
|
|
431
432
|
size: "sm",
|
|
432
|
-
onClick: () =>
|
|
433
|
-
disabled:
|
|
433
|
+
onClick: () => B((e) => Math.max(1, e - 1)),
|
|
434
|
+
disabled: z <= 1,
|
|
434
435
|
children: "Previous"
|
|
435
|
-
}), /* @__PURE__ */
|
|
436
|
+
}), /* @__PURE__ */ w(n, {
|
|
436
437
|
variant: "outline",
|
|
437
438
|
size: "sm",
|
|
438
|
-
onClick: () =>
|
|
439
|
-
disabled:
|
|
439
|
+
onClick: () => B((e) => Math.min($, e + 1)),
|
|
440
|
+
disabled: z >= $,
|
|
440
441
|
children: "Next"
|
|
441
442
|
})]
|
|
442
443
|
})]
|
|
@@ -447,6 +448,6 @@ function A() {
|
|
|
447
448
|
});
|
|
448
449
|
}
|
|
449
450
|
//#endregion
|
|
450
|
-
export {
|
|
451
|
+
export { M as AdminPage };
|
|
451
452
|
|
|
452
453
|
//# sourceMappingURL=AdminPage.js.map
|