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