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