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