@burdenoff/microfe-sandbox 2026.624.2 → 2026.625.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import { useSandbox as e } from "../providers/SandboxProvider.js";
2
2
  import { joinPath as t } from "../utils/navigation.js";
3
- import { Badge as n, Button as r, Card as i, CardContent as a } from "../components/ui.js";
4
- import { tWithFallback as o } from "../utils/i18n.js";
5
- import { PageLayout as s } from "../components/PageLayout.js";
6
- import { useCreateSandboxTemplateMutation as c, useGetSandboxTemplateQuery as l, useUpdateSandboxTemplateMutation as u } from "../../generated/wspace-operations.js";
7
- import { useEffect as d, useState as f } from "react";
8
- import { AlertCircle as p, ArrowLeft as m, CheckCircle2 as h, Container as g, Cpu as _, Database as v, Image as y, Info as ee, LayoutTemplate as b, Loader2 as x, MemoryStick as S, Plus as C, Save as w, Timer as T, Trash2 as E, X as D } from "lucide-react";
3
+ import { Badge as n, Button as r, Card as i, CardContent as a, EmphasisPanel as o } from "../components/ui.js";
4
+ import { tWithFallback as s } from "../utils/i18n.js";
5
+ import { PageLayout as c } from "../components/PageLayout.js";
6
+ import { useCreateSandboxTemplateMutation as l, useGetSandboxTemplateQuery as u, useUpdateSandboxTemplateMutation as d } from "../../generated/wspace-operations.js";
7
+ import { useEffect as f, useState as p } from "react";
8
+ import { AlertCircle as m, ArrowLeft as h, CheckCircle2 as ee, Container as te, Cpu as g, Database as _, Image as v, Info as y, LayoutTemplate as b, Loader2 as x, MemoryStick as S, Plus as C, Save as w, Timer as T, Trash2 as E, X as D } from "lucide-react";
9
9
  import { useParams as O } from "react-router-dom";
10
10
  import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell";
11
11
  import { jsx as A, jsxs as j } from "react/jsx-runtime";
@@ -28,13 +28,13 @@ function P() {
28
28
  };
29
29
  }
30
30
  function F() {
31
- let { templateId: M } = O(), { basePath: F = "/", navigate: I, workspaceId: L } = e(), { t: R } = k(), z = !!M && M !== "new", [B] = c(), [V] = u(), { data: H } = l({
31
+ let { templateId: M } = O(), { basePath: F = "/", navigate: I, workspaceId: L } = e(), { t: R } = k(), z = !!M && M !== "new", [B] = l(), [V] = d(), { data: H } = u({
32
32
  variables: {
33
33
  context: { workspaceId: L },
34
34
  id: M
35
35
  },
36
36
  skip: !z || !M || !L
37
- }), [U, W] = f({
37
+ }), [U, W] = p({
38
38
  name: "",
39
39
  description: "",
40
40
  template: "AI_BUILDER",
@@ -54,7 +54,7 @@ function F() {
54
54
  storageRetainOnDelete: !1,
55
55
  allowedImages: []
56
56
  });
57
- d(() => {
57
+ f(() => {
58
58
  let e = H?.getSandboxTemplate;
59
59
  e && W({
60
60
  name: e.name ?? "",
@@ -91,7 +91,7 @@ function F() {
91
91
  allowedImages: e.allowedImages ?? []
92
92
  });
93
93
  }, [H]);
94
- let [G, K] = f({}), [q, J] = f(null), [Y, X] = f(!1), Z = (e, t) => {
94
+ let [G, K] = p({}), [q, J] = p(null), [Y, X] = p(!1), Z = (e, t) => {
95
95
  J({
96
96
  type: e,
97
97
  message: t
@@ -104,12 +104,12 @@ function F() {
104
104
  let n = { ...t };
105
105
  return delete n[e], n;
106
106
  });
107
- }, te = () => {
107
+ }, ne = () => {
108
108
  W((e) => ({
109
109
  ...e,
110
110
  containers: [...e.containers, P()]
111
111
  }));
112
- }, ne = (e) => {
112
+ }, re = (e) => {
113
113
  W((t) => ({
114
114
  ...t,
115
115
  containers: t.containers.filter((t, n) => n !== e)
@@ -122,32 +122,32 @@ function F() {
122
122
  [t]: n
123
123
  } : r)
124
124
  }));
125
- }, re = () => {
125
+ }, ie = () => {
126
126
  W((e) => ({
127
127
  ...e,
128
128
  allowedImages: [...e.allowedImages, ""]
129
129
  }));
130
- }, ie = (e) => {
130
+ }, ae = (e) => {
131
131
  W((t) => ({
132
132
  ...t,
133
133
  allowedImages: t.allowedImages.filter((t, n) => n !== e)
134
134
  }));
135
- }, ae = (e, t) => {
135
+ }, oe = (e, t) => {
136
136
  W((n) => ({
137
137
  ...n,
138
138
  allowedImages: n.allowedImages.map((n, r) => r === e ? t : n)
139
139
  }));
140
- }, oe = () => {
140
+ }, se = () => {
141
141
  let e = {};
142
- return U.name.trim() || (e.name = o(R, "sandbox.template.errors.nameRequired", "Name is required")), U.cpuRequest.trim() || (e.cpuRequest = o(R, "sandbox.template.errors.cpuRequestRequired", "CPU request is required")), U.cpuLimit.trim() || (e.cpuLimit = o(R, "sandbox.template.errors.cpuLimitRequired", "CPU limit is required")), U.memoryRequest.trim() || (e.memoryRequest = o(R, "sandbox.template.errors.memoryRequestRequired", "Memory request is required")), U.memoryLimit.trim() || (e.memoryLimit = o(R, "sandbox.template.errors.memoryLimitRequired", "Memory limit is required")), K(e), Object.keys(e).length === 0;
142
+ return U.name.trim() || (e.name = s(R, "sandbox.template.errors.nameRequired", "Name is required")), U.cpuRequest.trim() || (e.cpuRequest = s(R, "sandbox.template.errors.cpuRequestRequired", "CPU request is required")), U.cpuLimit.trim() || (e.cpuLimit = s(R, "sandbox.template.errors.cpuLimitRequired", "CPU limit is required")), U.memoryRequest.trim() || (e.memoryRequest = s(R, "sandbox.template.errors.memoryRequestRequired", "Memory request is required")), U.memoryLimit.trim() || (e.memoryLimit = s(R, "sandbox.template.errors.memoryLimitRequired", "Memory limit is required")), K(e), Object.keys(e).length === 0;
143
143
  };
144
- return /* @__PURE__ */ j(s, {
144
+ return /* @__PURE__ */ j(c, {
145
145
  showHeader: !1,
146
146
  children: [
147
147
  q && /* @__PURE__ */ j("div", {
148
148
  className: `fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200 ${q.type === "success" ? "bg-status-success-bg-subtle text-status-success-text border-border-default" : "bg-status-error-bg-subtle text-status-error-text border-border-default"}`,
149
149
  children: [
150
- q.type === "success" ? /* @__PURE__ */ A(h, { size: 20 }) : /* @__PURE__ */ A(p, { size: 20 }),
150
+ q.type === "success" ? /* @__PURE__ */ A(ee, { size: 20 }) : /* @__PURE__ */ A(m, { size: 20 }),
151
151
  /* @__PURE__ */ A("span", {
152
152
  className: "font-medium",
153
153
  children: q.message
@@ -161,16 +161,16 @@ function F() {
161
161
  })
162
162
  ]
163
163
  }),
164
- /* @__PURE__ */ A("div", {
165
- className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm",
164
+ /* @__PURE__ */ A(o, {
165
+ className: "overflow-hidden bg-hero-mesh",
166
166
  children: /* @__PURE__ */ j("div", {
167
- className: "relative z-10 flex items-center gap-4",
167
+ className: "flex items-center gap-4",
168
168
  children: [/* @__PURE__ */ A("button", {
169
169
  type: "button",
170
170
  onClick: () => I?.(t(F, "templates")),
171
- className: "p-2.5 hover:bg-accent rounded-lg transition-all duration-200",
172
- "aria-label": o(R, "sandbox.template.actions.backToTemplates", "Back to templates"),
173
- children: /* @__PURE__ */ A(m, { size: 20 })
171
+ className: "flex size-11 flex-shrink-0 items-center justify-center rounded-lg hover:bg-bg-sunken/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border",
172
+ "aria-label": s(R, "sandbox.template.actions.backToTemplates", "Back to templates"),
173
+ children: /* @__PURE__ */ A(h, { size: 20 })
174
174
  }), /* @__PURE__ */ j("div", {
175
175
  className: "flex items-center gap-3",
176
176
  children: [/* @__PURE__ */ A("div", {
@@ -181,15 +181,15 @@ function F() {
181
181
  })
182
182
  }), /* @__PURE__ */ A("h1", {
183
183
  className: "text-2xl sm:text-3xl font-bold",
184
- children: z ? o(R, "sandbox.template.title.edit", "Edit Template") : o(R, "sandbox.template.title.create", "Create Template")
184
+ children: z ? s(R, "sandbox.template.title.edit", "Edit Template") : s(R, "sandbox.template.title.create", "Create Template")
185
185
  })]
186
186
  })]
187
187
  })
188
188
  }),
189
189
  /* @__PURE__ */ j("form", {
190
190
  onSubmit: async (e) => {
191
- if (e.preventDefault(), !oe()) {
192
- Z("error", o(R, "sandbox.template.errors.fixFormErrors", "Please fix the form errors"));
191
+ if (e.preventDefault(), !se()) {
192
+ Z("error", s(R, "sandbox.template.errors.fixFormErrors", "Please fix the form errors"));
193
193
  return;
194
194
  }
195
195
  X(!0);
@@ -230,487 +230,502 @@ function F() {
230
230
  z ? await V({ variables: { input: {
231
231
  id: M,
232
232
  ...n
233
- } } }) : await B({ variables: { input: n } }), Z("success", z ? o(R, "sandbox.template.success.updated", "Template updated!") : o(R, "sandbox.template.success.created", "Template created!")), setTimeout(() => I?.(t(F, "templates")), 1500);
233
+ } } }) : await B({ variables: { input: n } }), Z("success", z ? s(R, "sandbox.template.success.updated", "Template updated!") : s(R, "sandbox.template.success.created", "Template created!")), setTimeout(() => I?.(t(F, "templates")), 1500);
234
234
  } catch {
235
- Z("error", o(R, "sandbox.template.errors.saveFailed", "Failed to save template"));
235
+ Z("error", s(R, "sandbox.template.errors.saveFailed", "Failed to save template"));
236
236
  } finally {
237
237
  X(!1);
238
238
  }
239
239
  },
240
240
  className: "space-y-6",
241
241
  children: [
242
- /* @__PURE__ */ A(i, { children: /* @__PURE__ */ j(a, {
243
- className: "p-6 space-y-5",
244
- children: [
245
- /* @__PURE__ */ j("h2", {
246
- className: "text-lg font-bold flex items-center gap-2",
247
- children: [/* @__PURE__ */ A(ee, {
248
- size: 18,
249
- className: "text-primary"
250
- }), o(R, "sandbox.template.sections.info", "Template Information")]
251
- }),
252
- /* @__PURE__ */ j("div", { children: [
253
- /* @__PURE__ */ j("label", {
254
- htmlFor: "name",
255
- className: "block text-sm font-semibold mb-2",
256
- children: ["Name ", /* @__PURE__ */ A("span", {
257
- className: "text-status-error-text",
258
- children: "*"
259
- })]
260
- }),
261
- /* @__PURE__ */ A("input", {
262
- "aria-label": "Name",
263
- type: "text",
264
- id: "name",
265
- value: U.name,
266
- onChange: (e) => Q("name", e.target.value),
267
- className: `w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.name ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
268
- placeholder: "AI Builder - Standard"
269
- }),
270
- G.name && /* @__PURE__ */ j("p", {
271
- className: "text-sm text-status-error-text mt-1 flex items-center gap-1",
272
- children: [/* @__PURE__ */ A(p, { size: 14 }), G.name]
273
- })
274
- ] }),
275
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
276
- htmlFor: "description",
277
- className: "block text-sm font-semibold mb-2",
278
- children: "Description"
279
- }), /* @__PURE__ */ A("textarea", {
280
- "aria-label": "Description",
281
- id: "description",
282
- value: U.description,
283
- onChange: (e) => Q("description", e.target.value),
284
- rows: 3,
285
- className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
286
- placeholder: "Template description..."
287
- })] }),
288
- /* @__PURE__ */ j("div", {
289
- className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
290
- children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
291
- htmlFor: "template",
292
- className: "block text-sm font-semibold mb-2",
293
- children: "Template Type"
294
- }), /* @__PURE__ */ j("select", {
295
- id: "template",
296
- value: U.template,
297
- onChange: (e) => Q("template", e.target.value),
298
- className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
299
- children: [
300
- /* @__PURE__ */ A("option", {
301
- value: "AI_BUILDER",
302
- children: "AI Builder"
303
- }),
304
- /* @__PURE__ */ A("option", {
305
- value: "WORKFLOW_MULTI_NODE",
306
- children: "Workflow Multi-Node"
307
- }),
308
- /* @__PURE__ */ A("option", {
309
- value: "MISC_SHELL",
310
- children: "Misc Shell"
311
- }),
312
- /* @__PURE__ */ A("option", {
313
- value: "CUSTOM",
314
- children: "Custom"
315
- })
316
- ]
317
- })] }), /* @__PURE__ */ j("div", {
318
- className: "flex items-center gap-3 pt-7",
319
- children: [/* @__PURE__ */ A("input", {
320
- "aria-label": "Default template",
321
- type: "checkbox",
322
- id: "isDefault",
323
- checked: U.isDefault,
324
- onChange: (e) => Q("isDefault", e.target.checked),
325
- className: "size-4 rounded border-border-subtle text-primary focus:ring-primary/20"
326
- }), /* @__PURE__ */ A("label", {
327
- htmlFor: "isDefault",
328
- className: "text-sm font-medium",
329
- children: "Set as default template for this type"
330
- })]
331
- })]
332
- })
333
- ]
334
- }) }),
335
- /* @__PURE__ */ A(i, { children: /* @__PURE__ */ j(a, {
336
- className: "p-6 space-y-5",
337
- children: [/* @__PURE__ */ j("div", {
338
- className: "flex items-center justify-between",
339
- children: [/* @__PURE__ */ j("h2", {
340
- className: "text-lg font-bold flex items-center gap-2",
341
- children: [
342
- /* @__PURE__ */ A(g, {
242
+ /* @__PURE__ */ A(i, {
243
+ className: "border-border-seam",
244
+ children: /* @__PURE__ */ j(a, {
245
+ className: "p-6 space-y-5",
246
+ children: [
247
+ /* @__PURE__ */ j("h2", {
248
+ className: "text-lg font-bold flex items-center gap-2",
249
+ children: [/* @__PURE__ */ A(y, {
343
250
  size: 18,
344
251
  className: "text-primary"
345
- }),
346
- o(R, "sandbox.template.sections.containers", "Default Containers"),
347
- /* @__PURE__ */ A(n, {
348
- variant: "secondary",
349
- children: U.containers.length
350
- })
351
- ]
352
- }), /* @__PURE__ */ j(r, {
353
- type: "button",
354
- variant: "outline",
355
- size: "sm",
356
- onClick: te,
357
- children: [/* @__PURE__ */ A(C, { size: 14 }), "Add Container"]
358
- })]
359
- }), /* @__PURE__ */ A("div", {
360
- className: "space-y-4",
361
- children: U.containers.map((e, t) => /* @__PURE__ */ j("div", {
362
- className: "p-4 rounded-lg border-2 border-border-subtle/50 bg-bg-sunken/20 space-y-3",
363
- children: [
364
- /* @__PURE__ */ j("div", {
365
- className: "flex items-center justify-between",
366
- children: [/* @__PURE__ */ j("h3", {
367
- className: "font-semibold text-sm",
368
- children: [
369
- "Container #",
370
- t + 1,
371
- e.name && `: ${e.name}`
372
- ]
373
- }), U.containers.length > 1 && /* @__PURE__ */ A(r, {
374
- type: "button",
375
- variant: "ghost",
376
- size: "icon",
377
- className: "text-status-error-text hover:text-status-error-text size-7",
378
- onClick: () => ne(t),
379
- children: /* @__PURE__ */ A(E, { size: 14 })
252
+ }), s(R, "sandbox.template.sections.info", "Template Information")]
253
+ }),
254
+ /* @__PURE__ */ j("div", { children: [
255
+ /* @__PURE__ */ j("label", {
256
+ htmlFor: "name",
257
+ className: "block text-sm font-semibold mb-2",
258
+ children: ["Name ", /* @__PURE__ */ A("span", {
259
+ className: "text-status-error-text",
260
+ children: "*"
380
261
  })]
381
262
  }),
382
- /* @__PURE__ */ j("div", {
383
- className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
384
- children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
385
- htmlFor: `tpl-${e._rowId}-name`,
386
- className: "block text-xs font-semibold mb-1",
387
- children: "Name"
388
- }), /* @__PURE__ */ A("input", {
389
- "aria-label": "Name",
390
- id: `tpl-${e._rowId}-name`,
391
- type: "text",
392
- value: e.name,
393
- onChange: (e) => $(t, "name", e.target.value),
394
- className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
395
- placeholder: "main"
396
- })] }), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
397
- htmlFor: `tpl-${e._rowId}-image`,
398
- className: "block text-xs font-semibold mb-1",
399
- children: "Image"
400
- }), /* @__PURE__ */ A("input", {
401
- "aria-label": "Image",
402
- id: `tpl-${e._rowId}-image`,
403
- type: "text",
404
- value: e.image,
405
- onChange: (e) => $(t, "image", e.target.value),
406
- className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
407
- placeholder: "harbor-internal.burdenoff.com/sandbox/python:3.12"
408
- })] })]
409
- }),
410
- /* @__PURE__ */ j("div", {
411
- className: "grid grid-cols-2 sm:grid-cols-4 gap-3",
412
- children: [
413
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
414
- htmlFor: `tpl-${e._rowId}-cpuReq`,
415
- className: "block text-xs text-text-secondary mb-1",
416
- children: "CPU Req"
417
- }), /* @__PURE__ */ A("input", {
418
- "aria-label": "CPU Req",
419
- id: `tpl-${e._rowId}-cpuReq`,
420
- type: "text",
421
- value: e.requestsCpu,
422
- onChange: (e) => $(t, "requestsCpu", e.target.value),
423
- className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
424
- placeholder: "250m"
425
- })] }),
426
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
427
- htmlFor: `tpl-${e._rowId}-cpuLim`,
428
- className: "block text-xs text-text-secondary mb-1",
429
- children: "CPU Lim"
430
- }), /* @__PURE__ */ A("input", {
431
- "aria-label": "CPU Lim",
432
- id: `tpl-${e._rowId}-cpuLim`,
433
- type: "text",
434
- value: e.limitsCpu,
435
- onChange: (e) => $(t, "limitsCpu", e.target.value),
436
- className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
437
- placeholder: "1"
438
- })] }),
439
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
440
- htmlFor: `tpl-${e._rowId}-memReq`,
441
- className: "block text-xs text-text-secondary mb-1",
442
- children: "Mem Req"
443
- }), /* @__PURE__ */ A("input", {
444
- "aria-label": "Mem Req",
445
- id: `tpl-${e._rowId}-memReq`,
446
- type: "text",
447
- value: e.requestsMemory,
448
- onChange: (e) => $(t, "requestsMemory", e.target.value),
449
- className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
450
- placeholder: "512Mi"
451
- })] }),
452
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
453
- htmlFor: `tpl-${e._rowId}-memLim`,
454
- className: "block text-xs text-text-secondary mb-1",
455
- children: "Mem Lim"
456
- }), /* @__PURE__ */ A("input", {
457
- "aria-label": "Memory limit",
458
- id: `tpl-${e._rowId}-memLim`,
459
- type: "text",
460
- value: e.limitsMemory,
461
- onChange: (e) => $(t, "limitsMemory", e.target.value),
462
- className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
463
- placeholder: "2Gi"
464
- })] })
465
- ]
466
- })
467
- ]
468
- }, e._rowId))
469
- })]
470
- }) }),
471
- /* @__PURE__ */ A(i, { children: /* @__PURE__ */ j(a, {
472
- className: "p-6 space-y-5",
473
- children: [
474
- /* @__PURE__ */ j("h2", {
475
- className: "text-lg font-bold flex items-center gap-2",
476
- children: [/* @__PURE__ */ A(_, {
477
- size: 18,
478
- className: "text-primary"
479
- }), o(R, "sandbox.template.sections.resources", "Default Pod Resources")]
480
- }),
481
- /* @__PURE__ */ j("div", {
482
- className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
483
- children: [
484
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
485
- htmlFor: "cpuRequest",
486
- className: "text-sm font-semibold flex items-center gap-2",
487
- children: [/* @__PURE__ */ A(_, {
488
- size: 14,
489
- className: "text-status-info-text"
490
- }), " CPU Request"]
491
- }), /* @__PURE__ */ A("input", {
492
- "aria-label": "CPU Request",
493
- type: "text",
494
- id: "cpuRequest",
495
- value: U.cpuRequest,
496
- onChange: (e) => Q("cpuRequest", e.target.value),
497
- className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.cpuRequest ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
498
- placeholder: "500m"
499
- })] }),
500
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
501
- htmlFor: "cpuLimit",
502
- className: "text-sm font-semibold flex items-center gap-2",
503
- children: [/* @__PURE__ */ A(_, {
504
- size: 14,
505
- className: "text-status-info-text"
506
- }), " CPU Limit"]
507
- }), /* @__PURE__ */ A("input", {
508
- "aria-label": "CPU Limit",
509
- type: "text",
510
- id: "cpuLimit",
511
- value: U.cpuLimit,
512
- onChange: (e) => Q("cpuLimit", e.target.value),
513
- className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.cpuLimit ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
514
- placeholder: "2"
515
- })] }),
516
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
517
- htmlFor: "memoryRequest",
518
- className: "text-sm font-semibold flex items-center gap-2",
519
- children: [/* @__PURE__ */ A(S, {
520
- size: 14,
521
- className: "text-accent-purple-subtle"
522
- }), " Memory Request"]
523
- }), /* @__PURE__ */ A("input", {
524
- "aria-label": "Memory request",
525
- type: "text",
526
- id: "memoryRequest",
527
- value: U.memoryRequest,
528
- onChange: (e) => Q("memoryRequest", e.target.value),
529
- className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.memoryRequest ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
530
- placeholder: "1Gi"
531
- })] }),
532
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
533
- htmlFor: "memoryLimit",
534
- className: "text-sm font-semibold flex items-center gap-2",
535
- children: [/* @__PURE__ */ A(S, {
536
- size: 14,
537
- className: "text-accent-purple-subtle"
538
- }), " Memory Limit"]
539
- }), /* @__PURE__ */ A("input", {
540
- "aria-label": "Memory limit",
263
+ /* @__PURE__ */ A("input", {
264
+ "aria-label": "Name",
541
265
  type: "text",
542
- id: "memoryLimit",
543
- value: U.memoryLimit,
544
- onChange: (e) => Q("memoryLimit", e.target.value),
545
- className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.memoryLimit ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
546
- placeholder: "4Gi"
547
- })] })
548
- ]
549
- }),
550
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
551
- htmlFor: "ttlSeconds",
552
- className: "text-sm font-semibold flex items-center gap-2",
553
- children: [
554
- /* @__PURE__ */ A(T, {
555
- size: 14,
556
- className: "text-status-info-text"
266
+ id: "name",
267
+ value: U.name,
268
+ onChange: (e) => Q("name", e.target.value),
269
+ className: `w-full px-4 py-2.5 border-2 rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.name ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
270
+ placeholder: "AI Builder - Standard"
557
271
  }),
558
- " Default TTL",
559
- /* @__PURE__ */ A(n, {
560
- variant: "outline",
561
- className: "text-xs ml-auto",
562
- children: ((e) => {
563
- let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60);
564
- return t > 0 && n > 0 ? `${t}h ${n}m` : t > 0 ? `${t}h` : `${n}m`;
565
- })(U.ttlSeconds)
272
+ G.name && /* @__PURE__ */ j("p", {
273
+ className: "text-sm text-status-error-text mt-1 flex items-center gap-1",
274
+ children: [/* @__PURE__ */ A(m, { size: 14 }), G.name]
566
275
  })
567
- ]
568
- }), /* @__PURE__ */ A("input", {
569
- "aria-label": "Default TTL seconds",
570
- type: "range",
571
- id: "ttlSeconds",
572
- min: 600,
573
- max: 86400,
574
- step: 600,
575
- value: U.ttlSeconds,
576
- onChange: (e) => Q("ttlSeconds", Number(e.target.value)),
577
- className: "w-full mt-2 accent-primary"
578
- })] })
579
- ]
580
- }) }),
581
- /* @__PURE__ */ A(i, { children: /* @__PURE__ */ j(a, {
582
- className: "p-6 space-y-5",
583
- children: [
584
- /* @__PURE__ */ j("h2", {
585
- className: "text-lg font-bold flex items-center gap-2",
586
- children: [/* @__PURE__ */ A(v, {
587
- size: 18,
588
- className: "text-primary"
589
- }), o(R, "sandbox.template.sections.storage", "Default Storage")]
590
- }),
591
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
592
- htmlFor: "storageModeGroup",
593
- className: "block text-sm font-semibold mb-3",
594
- children: "Mode"
595
- }), /* @__PURE__ */ A("div", {
596
- id: "storageModeGroup",
597
- "aria-label": "Storage mode",
598
- className: "grid grid-cols-3 gap-3",
599
- children: [
600
- "NONE",
601
- "EPHEMERAL",
602
- "PERSISTENT"
603
- ].map((e) => /* @__PURE__ */ A("button", {
604
- type: "button",
605
- onClick: () => Q("storageMode", e),
606
- className: `p-3 rounded-lg border-2 text-left transition-all duration-200 ${U.storageMode === e ? "border-primary bg-action-primary-bg/5 shadow-sm" : "border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50"}`,
607
- children: /* @__PURE__ */ A("p", {
608
- className: "font-medium text-sm",
609
- children: {
610
- NONE: "None",
611
- EPHEMERAL: "Ephemeral",
612
- PERSISTENT: "Persistent"
613
- }[e]
614
- })
615
- }, e))
616
- })] }),
617
- U.storageMode !== "NONE" && /* @__PURE__ */ j("div", {
618
- className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
619
- children: [
620
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
621
- htmlFor: "tplStorageSizeGi",
622
- className: "block text-sm font-semibold mb-2",
623
- children: "Size (GiB)"
624
- }), /* @__PURE__ */ A("input", {
625
- id: "tplStorageSizeGi",
626
- "aria-label": "Size (GiB)",
627
- type: "number",
628
- value: U.storageSizeGi,
629
- onChange: (e) => Q("storageSizeGi", Number(e.target.value)),
630
- min: 1,
631
- max: 200,
632
- className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all"
633
- })] }),
634
- /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
635
- htmlFor: "tplStorageMountPath",
276
+ ] }),
277
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
278
+ htmlFor: "description",
279
+ className: "block text-sm font-semibold mb-2",
280
+ children: "Description"
281
+ }), /* @__PURE__ */ A("textarea", {
282
+ "aria-label": "Description",
283
+ id: "description",
284
+ value: U.description,
285
+ onChange: (e) => Q("description", e.target.value),
286
+ rows: 3,
287
+ className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
288
+ placeholder: "Template description..."
289
+ })] }),
290
+ /* @__PURE__ */ j("div", {
291
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
292
+ children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
293
+ htmlFor: "template",
636
294
  className: "block text-sm font-semibold mb-2",
637
- children: "Mount Path"
638
- }), /* @__PURE__ */ A("input", {
639
- id: "tplStorageMountPath",
640
- "aria-label": "Mount Path",
641
- type: "text",
642
- value: U.storageMountPath,
643
- onChange: (e) => Q("storageMountPath", e.target.value),
644
- className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
645
- placeholder: "/data"
646
- })] }),
647
- U.storageMode === "PERSISTENT" && /* @__PURE__ */ j("div", {
648
- className: "flex items-center gap-3 sm:col-span-2",
295
+ children: "Template Type"
296
+ }), /* @__PURE__ */ j("select", {
297
+ id: "template",
298
+ value: U.template,
299
+ onChange: (e) => Q("template", e.target.value),
300
+ className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
301
+ children: [
302
+ /* @__PURE__ */ A("option", {
303
+ value: "AI_BUILDER",
304
+ children: "AI Builder"
305
+ }),
306
+ /* @__PURE__ */ A("option", {
307
+ value: "WORKFLOW_MULTI_NODE",
308
+ children: "Workflow Multi-Node"
309
+ }),
310
+ /* @__PURE__ */ A("option", {
311
+ value: "MISC_SHELL",
312
+ children: "Misc Shell"
313
+ }),
314
+ /* @__PURE__ */ A("option", {
315
+ value: "CUSTOM",
316
+ children: "Custom"
317
+ })
318
+ ]
319
+ })] }), /* @__PURE__ */ j("div", {
320
+ className: "flex items-center gap-3 pt-7",
649
321
  children: [/* @__PURE__ */ A("input", {
650
- "aria-label": "Retain storage on delete",
322
+ "aria-label": "Default template",
651
323
  type: "checkbox",
652
- id: "storageRetainOnDelete",
653
- checked: U.storageRetainOnDelete,
654
- onChange: (e) => Q("storageRetainOnDelete", e.target.checked),
324
+ id: "isDefault",
325
+ checked: U.isDefault,
326
+ onChange: (e) => Q("isDefault", e.target.checked),
655
327
  className: "size-4 rounded border-border-subtle text-primary focus:ring-primary/20"
656
328
  }), /* @__PURE__ */ A("label", {
657
- htmlFor: "storageRetainOnDelete",
329
+ htmlFor: "isDefault",
658
330
  className: "text-sm font-medium",
659
- children: "Retain volume data when sandbox is deleted"
331
+ children: "Set as default template for this type"
660
332
  })]
661
- })
662
- ]
663
- })
664
- ]
665
- }) }),
666
- /* @__PURE__ */ A(i, { children: /* @__PURE__ */ j(a, {
667
- className: "p-6 space-y-5",
668
- children: [
669
- /* @__PURE__ */ j("div", {
333
+ })]
334
+ })
335
+ ]
336
+ })
337
+ }),
338
+ /* @__PURE__ */ A(i, {
339
+ className: "border-border-seam",
340
+ children: /* @__PURE__ */ j(a, {
341
+ className: "p-6 space-y-5",
342
+ children: [/* @__PURE__ */ j("div", {
670
343
  className: "flex items-center justify-between",
671
344
  children: [/* @__PURE__ */ j("h2", {
672
345
  className: "text-lg font-bold flex items-center gap-2",
673
346
  children: [
674
- /* @__PURE__ */ A(y, {
347
+ /* @__PURE__ */ A(te, {
675
348
  size: 18,
676
349
  className: "text-primary"
677
350
  }),
678
- o(R, "sandbox.template.sections.allowedImages", "Allowed Images"),
679
- U.allowedImages.length > 0 && /* @__PURE__ */ A(n, {
351
+ s(R, "sandbox.template.sections.containers", "Default Containers"),
352
+ /* @__PURE__ */ A(n, {
680
353
  variant: "secondary",
681
- children: U.allowedImages.length
354
+ children: U.containers.length
682
355
  })
683
356
  ]
684
357
  }), /* @__PURE__ */ j(r, {
685
358
  type: "button",
686
359
  variant: "outline",
687
360
  size: "sm",
688
- onClick: re,
689
- children: [/* @__PURE__ */ A(C, { size: 14 }), "Add Image"]
690
- })]
691
- }),
692
- /* @__PURE__ */ A("p", {
693
- className: "text-xs text-text-secondary",
694
- children: o(R, "sandbox.template.allowedImages.hint", "Restrict which container images can be used with this template. Leave empty to allow any image.")
695
- }),
696
- U.allowedImages.map((e, t) => /* @__PURE__ */ j("div", {
697
- className: "flex items-center gap-2",
698
- children: [/* @__PURE__ */ A("input", {
699
- "aria-label": "Allowed image",
700
- type: "text",
701
- value: e,
702
- onChange: (e) => ae(t, e.target.value),
703
- className: "flex-1 px-4 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
704
- placeholder: "harbor-internal.burdenoff.com/sandbox/*"
705
- }), /* @__PURE__ */ A("button", {
706
- type: "button",
707
- onClick: () => ie(t),
708
- className: "p-2 text-status-error-text hover:bg-status-error-bg/10 rounded-lg",
709
- children: /* @__PURE__ */ A(E, { size: 14 })
361
+ onClick: ne,
362
+ children: [/* @__PURE__ */ A(C, { size: 14 }), "Add Container"]
710
363
  })]
711
- }, `allowed-img-${t}-${e}`))
712
- ]
713
- }) }),
364
+ }), /* @__PURE__ */ A("div", {
365
+ className: "space-y-4",
366
+ children: U.containers.map((e, t) => /* @__PURE__ */ j("div", {
367
+ className: "p-4 rounded-lg border-2 border-border-subtle/50 bg-bg-sunken/20 space-y-3",
368
+ children: [
369
+ /* @__PURE__ */ j("div", {
370
+ className: "flex items-center justify-between",
371
+ children: [/* @__PURE__ */ j("h3", {
372
+ className: "font-semibold text-sm",
373
+ children: [
374
+ "Container #",
375
+ t + 1,
376
+ e.name && `: ${e.name}`
377
+ ]
378
+ }), U.containers.length > 1 && /* @__PURE__ */ A(r, {
379
+ type: "button",
380
+ variant: "ghost",
381
+ size: "icon",
382
+ className: "text-status-error-text hover:text-status-error-text size-7",
383
+ onClick: () => re(t),
384
+ children: /* @__PURE__ */ A(E, { size: 14 })
385
+ })]
386
+ }),
387
+ /* @__PURE__ */ j("div", {
388
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
389
+ children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
390
+ htmlFor: `tpl-${e._rowId}-name`,
391
+ className: "block text-xs font-semibold mb-1",
392
+ children: "Name"
393
+ }), /* @__PURE__ */ A("input", {
394
+ "aria-label": "Name",
395
+ id: `tpl-${e._rowId}-name`,
396
+ type: "text",
397
+ value: e.name,
398
+ onChange: (e) => $(t, "name", e.target.value),
399
+ className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
400
+ placeholder: "main"
401
+ })] }), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
402
+ htmlFor: `tpl-${e._rowId}-image`,
403
+ className: "block text-xs font-semibold mb-1",
404
+ children: "Image"
405
+ }), /* @__PURE__ */ A("input", {
406
+ "aria-label": "Image",
407
+ id: `tpl-${e._rowId}-image`,
408
+ type: "text",
409
+ value: e.image,
410
+ onChange: (e) => $(t, "image", e.target.value),
411
+ className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
412
+ placeholder: "harbor-internal.burdenoff.com/sandbox/python:3.12"
413
+ })] })]
414
+ }),
415
+ /* @__PURE__ */ j("div", {
416
+ className: "grid grid-cols-2 sm:grid-cols-4 gap-3",
417
+ children: [
418
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
419
+ htmlFor: `tpl-${e._rowId}-cpuReq`,
420
+ className: "block text-xs text-text-secondary mb-1",
421
+ children: "CPU Req"
422
+ }), /* @__PURE__ */ A("input", {
423
+ "aria-label": "CPU Req",
424
+ id: `tpl-${e._rowId}-cpuReq`,
425
+ type: "text",
426
+ value: e.requestsCpu,
427
+ onChange: (e) => $(t, "requestsCpu", e.target.value),
428
+ className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
429
+ placeholder: "250m"
430
+ })] }),
431
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
432
+ htmlFor: `tpl-${e._rowId}-cpuLim`,
433
+ className: "block text-xs text-text-secondary mb-1",
434
+ children: "CPU Lim"
435
+ }), /* @__PURE__ */ A("input", {
436
+ "aria-label": "CPU Lim",
437
+ id: `tpl-${e._rowId}-cpuLim`,
438
+ type: "text",
439
+ value: e.limitsCpu,
440
+ onChange: (e) => $(t, "limitsCpu", e.target.value),
441
+ className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
442
+ placeholder: "1"
443
+ })] }),
444
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
445
+ htmlFor: `tpl-${e._rowId}-memReq`,
446
+ className: "block text-xs text-text-secondary mb-1",
447
+ children: "Mem Req"
448
+ }), /* @__PURE__ */ A("input", {
449
+ "aria-label": "Mem Req",
450
+ id: `tpl-${e._rowId}-memReq`,
451
+ type: "text",
452
+ value: e.requestsMemory,
453
+ onChange: (e) => $(t, "requestsMemory", e.target.value),
454
+ className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
455
+ placeholder: "512Mi"
456
+ })] }),
457
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
458
+ htmlFor: `tpl-${e._rowId}-memLim`,
459
+ className: "block text-xs text-text-secondary mb-1",
460
+ children: "Mem Lim"
461
+ }), /* @__PURE__ */ A("input", {
462
+ "aria-label": "Memory limit",
463
+ id: `tpl-${e._rowId}-memLim`,
464
+ type: "text",
465
+ value: e.limitsMemory,
466
+ onChange: (e) => $(t, "limitsMemory", e.target.value),
467
+ className: "w-full px-3 py-1.5 border rounded-lg bg-bg-surface text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
468
+ placeholder: "2Gi"
469
+ })] })
470
+ ]
471
+ })
472
+ ]
473
+ }, e._rowId))
474
+ })]
475
+ })
476
+ }),
477
+ /* @__PURE__ */ A(i, {
478
+ className: "border-border-seam",
479
+ children: /* @__PURE__ */ j(a, {
480
+ className: "p-6 space-y-5",
481
+ children: [
482
+ /* @__PURE__ */ j("h2", {
483
+ className: "text-lg font-bold flex items-center gap-2",
484
+ children: [/* @__PURE__ */ A(g, {
485
+ size: 18,
486
+ className: "text-primary"
487
+ }), s(R, "sandbox.template.sections.resources", "Default Pod Resources")]
488
+ }),
489
+ /* @__PURE__ */ j("div", {
490
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
491
+ children: [
492
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
493
+ htmlFor: "cpuRequest",
494
+ className: "text-sm font-semibold flex items-center gap-2",
495
+ children: [/* @__PURE__ */ A(g, {
496
+ size: 14,
497
+ className: "text-status-info-text"
498
+ }), " CPU Request"]
499
+ }), /* @__PURE__ */ A("input", {
500
+ "aria-label": "CPU Request",
501
+ type: "text",
502
+ id: "cpuRequest",
503
+ value: U.cpuRequest,
504
+ onChange: (e) => Q("cpuRequest", e.target.value),
505
+ className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.cpuRequest ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
506
+ placeholder: "500m"
507
+ })] }),
508
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
509
+ htmlFor: "cpuLimit",
510
+ className: "text-sm font-semibold flex items-center gap-2",
511
+ children: [/* @__PURE__ */ A(g, {
512
+ size: 14,
513
+ className: "text-status-info-text"
514
+ }), " CPU Limit"]
515
+ }), /* @__PURE__ */ A("input", {
516
+ "aria-label": "CPU Limit",
517
+ type: "text",
518
+ id: "cpuLimit",
519
+ value: U.cpuLimit,
520
+ onChange: (e) => Q("cpuLimit", e.target.value),
521
+ className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.cpuLimit ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
522
+ placeholder: "2"
523
+ })] }),
524
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
525
+ htmlFor: "memoryRequest",
526
+ className: "text-sm font-semibold flex items-center gap-2",
527
+ children: [/* @__PURE__ */ A(S, {
528
+ size: 14,
529
+ className: "text-accent-purple-subtle"
530
+ }), " Memory Request"]
531
+ }), /* @__PURE__ */ A("input", {
532
+ "aria-label": "Memory request",
533
+ type: "text",
534
+ id: "memoryRequest",
535
+ value: U.memoryRequest,
536
+ onChange: (e) => Q("memoryRequest", e.target.value),
537
+ className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.memoryRequest ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
538
+ placeholder: "1Gi"
539
+ })] }),
540
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
541
+ htmlFor: "memoryLimit",
542
+ className: "text-sm font-semibold flex items-center gap-2",
543
+ children: [/* @__PURE__ */ A(S, {
544
+ size: 14,
545
+ className: "text-accent-purple-subtle"
546
+ }), " Memory Limit"]
547
+ }), /* @__PURE__ */ A("input", {
548
+ "aria-label": "Memory limit",
549
+ type: "text",
550
+ id: "memoryLimit",
551
+ value: U.memoryLimit,
552
+ onChange: (e) => Q("memoryLimit", e.target.value),
553
+ className: `w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${G.memoryLimit ? "border-status-error-border" : "border-border-subtle focus:border-primary"}`,
554
+ placeholder: "4Gi"
555
+ })] })
556
+ ]
557
+ }),
558
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("label", {
559
+ htmlFor: "ttlSeconds",
560
+ className: "text-sm font-semibold flex items-center gap-2",
561
+ children: [
562
+ /* @__PURE__ */ A(T, {
563
+ size: 14,
564
+ className: "text-status-info-text"
565
+ }),
566
+ " Default TTL",
567
+ /* @__PURE__ */ A(n, {
568
+ variant: "outline",
569
+ className: "text-xs ml-auto",
570
+ children: ((e) => {
571
+ let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60);
572
+ return t > 0 && n > 0 ? `${t}h ${n}m` : t > 0 ? `${t}h` : `${n}m`;
573
+ })(U.ttlSeconds)
574
+ })
575
+ ]
576
+ }), /* @__PURE__ */ A("input", {
577
+ "aria-label": "Default TTL seconds",
578
+ type: "range",
579
+ id: "ttlSeconds",
580
+ min: 600,
581
+ max: 86400,
582
+ step: 600,
583
+ value: U.ttlSeconds,
584
+ onChange: (e) => Q("ttlSeconds", Number(e.target.value)),
585
+ className: "w-full mt-2 accent-primary"
586
+ })] })
587
+ ]
588
+ })
589
+ }),
590
+ /* @__PURE__ */ A(i, {
591
+ className: "border-border-seam",
592
+ children: /* @__PURE__ */ j(a, {
593
+ className: "p-6 space-y-5",
594
+ children: [
595
+ /* @__PURE__ */ j("h2", {
596
+ className: "text-lg font-bold flex items-center gap-2",
597
+ children: [/* @__PURE__ */ A(_, {
598
+ size: 18,
599
+ className: "text-primary"
600
+ }), s(R, "sandbox.template.sections.storage", "Default Storage")]
601
+ }),
602
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
603
+ htmlFor: "storageModeGroup",
604
+ className: "block text-sm font-semibold mb-3",
605
+ children: "Mode"
606
+ }), /* @__PURE__ */ A("div", {
607
+ id: "storageModeGroup",
608
+ "aria-label": "Storage mode",
609
+ className: "grid grid-cols-3 gap-3",
610
+ children: [
611
+ "NONE",
612
+ "EPHEMERAL",
613
+ "PERSISTENT"
614
+ ].map((e) => /* @__PURE__ */ A("button", {
615
+ type: "button",
616
+ onClick: () => Q("storageMode", e),
617
+ className: `p-3 rounded-lg border-2 text-left transition-all duration-200 ${U.storageMode === e ? "border-primary bg-action-primary-bg/5 shadow-sm" : "border-border-subtle hover:border-primary/50 hover:bg-bg-sunken/50"}`,
618
+ children: /* @__PURE__ */ A("p", {
619
+ className: "font-medium text-sm",
620
+ children: {
621
+ NONE: "None",
622
+ EPHEMERAL: "Ephemeral",
623
+ PERSISTENT: "Persistent"
624
+ }[e]
625
+ })
626
+ }, e))
627
+ })] }),
628
+ U.storageMode !== "NONE" && /* @__PURE__ */ j("div", {
629
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
630
+ children: [
631
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
632
+ htmlFor: "tplStorageSizeGi",
633
+ className: "block text-sm font-semibold mb-2",
634
+ children: "Size (GiB)"
635
+ }), /* @__PURE__ */ A("input", {
636
+ id: "tplStorageSizeGi",
637
+ "aria-label": "Size (GiB)",
638
+ type: "number",
639
+ value: U.storageSizeGi,
640
+ onChange: (e) => Q("storageSizeGi", Number(e.target.value)),
641
+ min: 1,
642
+ max: 200,
643
+ className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all"
644
+ })] }),
645
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
646
+ htmlFor: "tplStorageMountPath",
647
+ className: "block text-sm font-semibold mb-2",
648
+ children: "Mount Path"
649
+ }), /* @__PURE__ */ A("input", {
650
+ id: "tplStorageMountPath",
651
+ "aria-label": "Mount Path",
652
+ type: "text",
653
+ value: U.storageMountPath,
654
+ onChange: (e) => Q("storageMountPath", e.target.value),
655
+ className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
656
+ placeholder: "/data"
657
+ })] }),
658
+ U.storageMode === "PERSISTENT" && /* @__PURE__ */ j("div", {
659
+ className: "flex items-center gap-3 sm:col-span-2",
660
+ children: [/* @__PURE__ */ A("input", {
661
+ "aria-label": "Retain storage on delete",
662
+ type: "checkbox",
663
+ id: "storageRetainOnDelete",
664
+ checked: U.storageRetainOnDelete,
665
+ onChange: (e) => Q("storageRetainOnDelete", e.target.checked),
666
+ className: "size-4 rounded border-border-subtle text-primary focus:ring-primary/20"
667
+ }), /* @__PURE__ */ A("label", {
668
+ htmlFor: "storageRetainOnDelete",
669
+ className: "text-sm font-medium",
670
+ children: "Retain volume data when sandbox is deleted"
671
+ })]
672
+ })
673
+ ]
674
+ })
675
+ ]
676
+ })
677
+ }),
678
+ /* @__PURE__ */ A(i, {
679
+ className: "border-border-seam",
680
+ children: /* @__PURE__ */ j(a, {
681
+ className: "p-6 space-y-5",
682
+ children: [
683
+ /* @__PURE__ */ j("div", {
684
+ className: "flex items-center justify-between",
685
+ children: [/* @__PURE__ */ j("h2", {
686
+ className: "text-lg font-bold flex items-center gap-2",
687
+ children: [
688
+ /* @__PURE__ */ A(v, {
689
+ size: 18,
690
+ className: "text-primary"
691
+ }),
692
+ s(R, "sandbox.template.sections.allowedImages", "Allowed Images"),
693
+ U.allowedImages.length > 0 && /* @__PURE__ */ A(n, {
694
+ variant: "secondary",
695
+ children: U.allowedImages.length
696
+ })
697
+ ]
698
+ }), /* @__PURE__ */ j(r, {
699
+ type: "button",
700
+ variant: "outline",
701
+ size: "sm",
702
+ onClick: ie,
703
+ children: [/* @__PURE__ */ A(C, { size: 14 }), "Add Image"]
704
+ })]
705
+ }),
706
+ /* @__PURE__ */ A("p", {
707
+ className: "text-xs text-text-secondary",
708
+ children: s(R, "sandbox.template.allowedImages.hint", "Restrict which container images can be used with this template. Leave empty to allow any image.")
709
+ }),
710
+ U.allowedImages.map((e, t) => /* @__PURE__ */ j("div", {
711
+ className: "flex items-center gap-2",
712
+ children: [/* @__PURE__ */ A("input", {
713
+ "aria-label": "Allowed image",
714
+ type: "text",
715
+ value: e,
716
+ onChange: (e) => oe(t, e.target.value),
717
+ className: "flex-1 px-4 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
718
+ placeholder: "harbor-internal.burdenoff.com/sandbox/*"
719
+ }), /* @__PURE__ */ A("button", {
720
+ type: "button",
721
+ onClick: () => ae(t),
722
+ className: "p-2 text-status-error-text hover:bg-status-error-bg/10 rounded-lg",
723
+ children: /* @__PURE__ */ A(E, { size: 14 })
724
+ })]
725
+ }, `allowed-img-${t}-${e}`))
726
+ ]
727
+ })
728
+ }),
714
729
  /* @__PURE__ */ j("div", {
715
730
  className: "flex flex-col sm:flex-row gap-3 pt-2",
716
731
  children: [/* @__PURE__ */ j(r, {
@@ -720,13 +735,13 @@ function F() {
720
735
  children: [Y ? /* @__PURE__ */ A(x, {
721
736
  size: 18,
722
737
  className: "animate-spin"
723
- }) : /* @__PURE__ */ A(w, { size: 18 }), z ? o(R, "sandbox.template.actions.saveChanges", "Save Changes") : o(R, "sandbox.template.actions.create", "Create Template")]
738
+ }) : /* @__PURE__ */ A(w, { size: 18 }), z ? s(R, "sandbox.template.actions.saveChanges", "Save Changes") : s(R, "sandbox.template.actions.create", "Create Template")]
724
739
  }), /* @__PURE__ */ A(r, {
725
740
  type: "button",
726
741
  variant: "outline",
727
742
  onClick: () => I?.(t(F, "templates")),
728
743
  disabled: Y,
729
- children: o(R, "sandbox.template.actions.cancel", "Cancel")
744
+ children: s(R, "sandbox.template.actions.cancel", "Cancel")
730
745
  })]
731
746
  })
732
747
  ]