@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.
@@ -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 { 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";
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 ie = x`
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
- `, E = x`
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
- `, D = x`
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
- `, O = x`
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 k(e) {
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 A(e) {
89
- return k(e) === "MANUAL" ? "USER" : "INTERNAL";
89
+ function M(e) {
90
+ return j(e) === "MANUAL" ? "USER" : "INTERNAL";
90
91
  }
91
- function ae(e) {
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 j(e) {
96
+ function P(e) {
96
97
  return e ? new Date(e).toLocaleString() : "—";
97
98
  }
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({
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: 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, {
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: x },
113
+ context: { workspaceId: S },
113
114
  pagination: {
114
- page: z,
115
+ page: V,
115
116
  limit: 100
116
117
  }
117
118
  },
118
- skip: !x
119
- }), [le, { loading: J }] = re(O);
120
- te(() => {
121
- let e = G?.getSandboxConfig;
122
- e && H({
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
- }, [G?.getSandboxConfig]);
129
- 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) => ({
130
131
  ...e,
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();
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 !(F !== "all" && e.kind !== F || L !== "all" && e.source !== L);
140
+ return !(L !== "all" && e.kind !== L || z !== "all" && e.source !== z);
140
141
  }), [
141
142
  Z,
142
- F,
143
- N,
144
- L
145
- ]), $ = 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(() => [
146
147
  {
147
- label: f(M, "sandbox.admin.stats.activeTotal", "Active total"),
148
+ label: f(F, "sandbox.admin.stats.activeTotal", "Active total"),
148
149
  value: Y?.activeSandboxes ?? 0,
149
- icon: /* @__PURE__ */ w(g, {
150
+ icon: /* @__PURE__ */ T(_, {
150
151
  size: 18,
151
152
  className: "text-primary"
152
153
  })
153
154
  },
154
155
  {
155
- label: f(M, "sandbox.admin.stats.userSandboxes", "User sandboxes"),
156
+ label: f(F, "sandbox.admin.stats.userSandboxes", "User sandboxes"),
156
157
  value: Z.filter((e) => e.kind === "USER").length,
157
- icon: /* @__PURE__ */ w(ne, {
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(M, "sandbox.admin.stats.internalSandboxes", "Internal sandboxes"),
164
+ label: f(F, "sandbox.admin.stats.internalSandboxes", "Internal sandboxes"),
164
165
  value: Z.filter((e) => e.kind === "INTERNAL").length,
165
- icon: /* @__PURE__ */ w(b, {
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(M, "sandbox.admin.stats.failedExpired", "Failed / expired"),
172
+ label: f(F, "sandbox.admin.stats.failedExpired", "Failed / expired"),
172
173
  value: (Y?.failedCount ?? 0) + (Y?.expiredCount ?? 0),
173
- icon: /* @__PURE__ */ w(_, {
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
- 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
- };
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, {
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(M, "sandbox.admin.usageSplit", "{{user}} user / {{internal}} internal visible", {
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(M, "sandbox.admin.loadingUsageSplit", "Loading usage split…")
223
+ }) : f(F, "sandbox.admin.loadingUsageSplit", "Loading usage split…")
201
224
  }),
202
- children: [W ? /* @__PURE__ */ w("div", {
203
- className: "flex items-center justify-center min-h-[160px]",
204
- children: /* @__PURE__ */ w(v, { className: "size-8 animate-spin text-primary" })
205
- }) : /* @__PURE__ */ w("div", {
206
- className: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4",
207
- children: ue.map((e, t) => /* @__PURE__ */ T(a, {
208
- treatment: t === 0 ? "glass" : "metric",
209
- className: "flex items-center justify-between p-5",
210
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
211
- className: "text-sm text-text-secondary",
212
- children: e.label
213
- }), /* @__PURE__ */ w("p", {
214
- className: "mt-2 text-2xl font-semibold tabular-nums",
215
- children: e.value
216
- })] }), /* @__PURE__ */ w("div", {
217
- className: "rounded-xl bg-bg-sunken/70 p-3",
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: f(M, "sandbox.admin.list.subtitle", "Superadmins can review both internal and user-owned sandboxes here.")
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: "grid grid-cols-1 gap-3 sm:grid-cols-3",
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__ */ w(o, {
311
- value: N,
312
- onChange: (e) => P(e.target.value),
313
- placeholder: f(M, "sandbox.admin.list.search", "Search sandboxes")
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__ */ 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, {
320
- value: "all",
321
- children: "All kinds"
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__ */ w(l, {
324
- value: "USER",
325
- children: "User"
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__ */ w(l, {
328
- value: "INTERNAL",
329
- children: "Internal"
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
- /* @__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, {
338
- value: "all",
339
- children: "All sources"
340
- }),
341
- /* @__PURE__ */ w(l, {
342
- value: "MANUAL",
343
- children: "Manual"
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__ */ w(l, {
346
- value: "AI_ASSISTANT",
347
- children: "AI assistant"
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__ */ w(l, {
350
- value: "DOCS_BUILDER",
351
- children: "Docs builder"
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__ */ w(l, {
354
- value: "SYSTEM",
355
- children: "System"
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
- }), se ? /* @__PURE__ */ w("div", {
362
- className: "flex items-center justify-center min-h-[220px]",
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", {
369
- className: "space-y-3",
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",
372
- children: [
373
- /* @__PURE__ */ T("div", {
374
- className: "min-w-0",
375
- children: [/* @__PURE__ */ T("div", {
376
- className: "flex flex-wrap items-center gap-2",
377
- children: [
378
- /* @__PURE__ */ w("p", {
379
- className: "truncate font-semibold",
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 { M as AdminPage };
489
+ export { F as AdminPage };
452
490
 
453
491
  //# sourceMappingURL=AdminPage.js.map