@burdenoff/microfe-sandbox 2026.510.113
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/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +21253 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +1595 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-operations.js +692 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.d.ts +55214 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/sandbox/AdminRoutes.d.ts +12 -0
- package/dist/sandbox/AdminRoutes.d.ts.map +1 -0
- package/dist/sandbox/AdminRoutes.js +45 -0
- package/dist/sandbox/AdminRoutes.js.map +1 -0
- package/dist/sandbox/SandboxAdminRoot.d.ts +21 -0
- package/dist/sandbox/SandboxAdminRoot.d.ts.map +1 -0
- package/dist/sandbox/SandboxAdminRoot.js +55 -0
- package/dist/sandbox/SandboxAdminRoot.js.map +1 -0
- package/dist/sandbox/SandboxRoot.d.ts +31 -0
- package/dist/sandbox/SandboxRoot.d.ts.map +1 -0
- package/dist/sandbox/SandboxRoot.js +61 -0
- package/dist/sandbox/SandboxRoot.js.map +1 -0
- package/dist/sandbox/SandboxRoutes.d.ts +18 -0
- package/dist/sandbox/SandboxRoutes.d.ts.map +1 -0
- package/dist/sandbox/UserRoutes.d.ts +11 -0
- package/dist/sandbox/UserRoutes.d.ts.map +1 -0
- package/dist/sandbox/UserRoutes.js +57 -0
- package/dist/sandbox/UserRoutes.js.map +1 -0
- package/dist/sandbox/components/ContainerImagePicker.d.ts +24 -0
- package/dist/sandbox/components/ContainerImagePicker.d.ts.map +1 -0
- package/dist/sandbox/components/CountdownTimer.d.ts +9 -0
- package/dist/sandbox/components/CountdownTimer.d.ts.map +1 -0
- package/dist/sandbox/components/CountdownTimer.js +75 -0
- package/dist/sandbox/components/CountdownTimer.js.map +1 -0
- package/dist/sandbox/components/ExportSandboxesDialog.d.ts +8 -0
- package/dist/sandbox/components/ExportSandboxesDialog.d.ts.map +1 -0
- package/dist/sandbox/components/ExportSandboxesDialog.js +130 -0
- package/dist/sandbox/components/ExportSandboxesDialog.js.map +1 -0
- package/dist/sandbox/components/ExtendTTLModal.d.ts +10 -0
- package/dist/sandbox/components/ExtendTTLModal.d.ts.map +1 -0
- package/dist/sandbox/components/ExtendTTLModal.js +109 -0
- package/dist/sandbox/components/ExtendTTLModal.js.map +1 -0
- package/dist/sandbox/components/PageLayout.d.ts +39 -0
- package/dist/sandbox/components/PageLayout.d.ts.map +1 -0
- package/dist/sandbox/components/PageLayout.js +75 -0
- package/dist/sandbox/components/PageLayout.js.map +1 -0
- package/dist/sandbox/components/ResourceDisplay.d.ts +17 -0
- package/dist/sandbox/components/ResourceDisplay.d.ts.map +1 -0
- package/dist/sandbox/components/ResourceDisplay.js +69 -0
- package/dist/sandbox/components/ResourceDisplay.js.map +1 -0
- package/dist/sandbox/components/RouteUtils.d.ts +28 -0
- package/dist/sandbox/components/RouteUtils.d.ts.map +1 -0
- package/dist/sandbox/components/RouteUtils.js +68 -0
- package/dist/sandbox/components/RouteUtils.js.map +1 -0
- package/dist/sandbox/components/SandboxActivityTab.d.ts +14 -0
- package/dist/sandbox/components/SandboxActivityTab.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxActivityTab.js +83 -0
- package/dist/sandbox/components/SandboxActivityTab.js.map +1 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.d.ts +16 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.js +103 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.js.map +1 -0
- package/dist/sandbox/components/SandboxTypeIcon.d.ts +15 -0
- package/dist/sandbox/components/SandboxTypeIcon.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxTypeIcon.js +52 -0
- package/dist/sandbox/components/SandboxTypeIcon.js.map +1 -0
- package/dist/sandbox/components/SandboxTypeSelector.d.ts +35 -0
- package/dist/sandbox/components/SandboxTypeSelector.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxUsageBanner.d.ts +16 -0
- package/dist/sandbox/components/SandboxUsageBanner.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxUsageBanner.js +37 -0
- package/dist/sandbox/components/SandboxUsageBanner.js.map +1 -0
- package/dist/sandbox/components/StatusBadge.d.ts +15 -0
- package/dist/sandbox/components/StatusBadge.d.ts.map +1 -0
- package/dist/sandbox/components/StatusBadge.js +86 -0
- package/dist/sandbox/components/StatusBadge.js.map +1 -0
- package/dist/sandbox/components/TagsInput.d.ts +14 -0
- package/dist/sandbox/components/TagsInput.d.ts.map +1 -0
- package/dist/sandbox/components/TagsInput.js +46 -0
- package/dist/sandbox/components/TagsInput.js.map +1 -0
- package/dist/sandbox/components/ui.d.ts +6 -0
- package/dist/sandbox/components/ui.d.ts.map +1 -0
- package/dist/sandbox/components/ui.js +2 -0
- package/dist/sandbox/hooks/useRemainingSeconds.d.ts +12 -0
- package/dist/sandbox/hooks/useRemainingSeconds.d.ts.map +1 -0
- package/dist/sandbox/hooks/useRemainingSeconds.js +23 -0
- package/dist/sandbox/hooks/useRemainingSeconds.js.map +1 -0
- package/dist/sandbox/index.d.ts +30 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +4 -0
- package/dist/sandbox/pages/AdminLandingPage.d.ts +9 -0
- package/dist/sandbox/pages/AdminLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminLandingPage.js +40 -0
- package/dist/sandbox/pages/AdminLandingPage.js.map +1 -0
- package/dist/sandbox/pages/AdminPage.d.ts +2 -0
- package/dist/sandbox/pages/AdminPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminPage.js +448 -0
- package/dist/sandbox/pages/AdminPage.js.map +1 -0
- package/dist/sandbox/pages/AdminTemplatesPage.d.ts +7 -0
- package/dist/sandbox/pages/AdminTemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminTemplatesPage.js +155 -0
- package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -0
- package/dist/sandbox/pages/SandboxCreatePage.d.ts +2 -0
- package/dist/sandbox/pages/SandboxCreatePage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxCreatePage.js +1121 -0
- package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -0
- package/dist/sandbox/pages/SandboxDetailPage.d.ts +6 -0
- package/dist/sandbox/pages/SandboxDetailPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxDetailPage.js +822 -0
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -0
- package/dist/sandbox/pages/SandboxLandingPage.d.ts +12 -0
- package/dist/sandbox/pages/SandboxLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxListPage.d.ts +6 -0
- package/dist/sandbox/pages/SandboxListPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxListPage.js +820 -0
- package/dist/sandbox/pages/SandboxListPage.js.map +1 -0
- package/dist/sandbox/pages/TemplateDetailPage.d.ts +6 -0
- package/dist/sandbox/pages/TemplateDetailPage.d.ts.map +1 -0
- package/dist/sandbox/pages/TemplateDetailPage.js +691 -0
- package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -0
- package/dist/sandbox/pages/TemplatesPage.d.ts +8 -0
- package/dist/sandbox/pages/TemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserLandingPage.d.ts +9 -0
- package/dist/sandbox/pages/UserLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserLandingPage.js +52 -0
- package/dist/sandbox/pages/UserLandingPage.js.map +1 -0
- package/dist/sandbox/pages/UserTemplatesPage.d.ts +8 -0
- package/dist/sandbox/pages/UserTemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserTemplatesPage.js +121 -0
- package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -0
- package/dist/sandbox/providers/SandboxProvider.d.ts +13 -0
- package/dist/sandbox/providers/SandboxProvider.d.ts.map +1 -0
- package/dist/sandbox/providers/SandboxProvider.js +78 -0
- package/dist/sandbox/providers/SandboxProvider.js.map +1 -0
- package/dist/sandbox/store/sandboxStore.d.ts +16 -0
- package/dist/sandbox/store/sandboxStore.d.ts.map +1 -0
- package/dist/sandbox/store/sandboxStore.js +24 -0
- package/dist/sandbox/store/sandboxStore.js.map +1 -0
- package/dist/sandbox/types/index.d.ts +238 -0
- package/dist/sandbox/types/index.d.ts.map +1 -0
- package/dist/sandbox/utils/cn.d.ts +8 -0
- package/dist/sandbox/utils/cn.d.ts.map +1 -0
- package/dist/sandbox/utils/cn.js +10 -0
- package/dist/sandbox/utils/cn.js.map +1 -0
- package/dist/sandbox/utils/formatters.d.ts +7 -0
- package/dist/sandbox/utils/formatters.d.ts.map +1 -0
- package/dist/sandbox/utils/formatters.js +10 -0
- package/dist/sandbox/utils/formatters.js.map +1 -0
- package/dist/sandbox/utils/i18n.d.ts +6 -0
- package/dist/sandbox/utils/i18n.d.ts.map +1 -0
- package/dist/sandbox/utils/i18n.js +15 -0
- package/dist/sandbox/utils/i18n.js.map +1 -0
- package/dist/sandbox/utils/navigation.d.ts +5 -0
- package/dist/sandbox/utils/navigation.d.ts.map +1 -0
- package/dist/sandbox/utils/navigation.js +8 -0
- package/dist/sandbox/utils/navigation.js.map +1 -0
- package/dist/sandbox/utils/sandboxEvents.d.ts +13 -0
- package/dist/sandbox/utils/sandboxEvents.d.ts.map +1 -0
- package/dist/sandbox/utils/sandboxEvents.js +20 -0
- package/dist/sandbox/utils/sandboxEvents.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +107 -0
|
@@ -0,0 +1,1121 @@
|
|
|
1
|
+
import { useSandbox as e } from "../providers/SandboxProvider.js";
|
|
2
|
+
import { Badge as t, Button as n, Card as r, CardContent as i } from "../components/ui.js";
|
|
3
|
+
import { tWithFallback as a } from "../utils/i18n.js";
|
|
4
|
+
import { useSandboxEvents as ee } from "../utils/sandboxEvents.js";
|
|
5
|
+
import { PageLayout as o } from "../components/PageLayout.js";
|
|
6
|
+
import { useCreateSandboxMutation as s, useListSandboxTemplatesQuery as te } from "../../generated/wspace-operations.js";
|
|
7
|
+
import { TagsInput as c } from "../components/TagsInput.js";
|
|
8
|
+
import { useState as l } from "react";
|
|
9
|
+
import { AlertCircle as u, ArrowLeft as d, Box as f, CheckCircle2 as p, Container as m, Cpu as h, Database as g, HelpCircle as _, Info as ne, Loader2 as re, MemoryStick as v, Plus as y, Save as ie, Settings as b, Timer as x, Trash2 as S, X as C } from "lucide-react";
|
|
10
|
+
import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
11
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
12
|
+
//#region src/sandbox/pages/SandboxCreatePage.tsx
|
|
13
|
+
var D = [{
|
|
14
|
+
value: "MISC_SHELL",
|
|
15
|
+
labelKey: "sandbox.create.templateType.defaultSandbox.label",
|
|
16
|
+
labelFallback: "Default Sandbox",
|
|
17
|
+
descriptionKey: "sandbox.create.templateType.defaultSandbox.description",
|
|
18
|
+
descriptionFallback: "Pre-configured development environment with VibeControls agent, Bun, nginx, and common dev tools",
|
|
19
|
+
icon: f
|
|
20
|
+
}, {
|
|
21
|
+
value: "CUSTOM",
|
|
22
|
+
labelKey: "sandbox.create.templateType.customSandbox.label",
|
|
23
|
+
labelFallback: "Custom Sandbox",
|
|
24
|
+
descriptionKey: "sandbox.create.templateType.customSandbox.description",
|
|
25
|
+
descriptionFallback: "Configure your own container image and resources",
|
|
26
|
+
icon: b
|
|
27
|
+
}], O = {
|
|
28
|
+
name: "",
|
|
29
|
+
image: "",
|
|
30
|
+
ports: [],
|
|
31
|
+
env: [],
|
|
32
|
+
requestsCpu: "",
|
|
33
|
+
requestsMemory: "",
|
|
34
|
+
limitsCpu: "",
|
|
35
|
+
limitsMemory: ""
|
|
36
|
+
};
|
|
37
|
+
function k({ text: e }) {
|
|
38
|
+
let [t, n] = l(!1);
|
|
39
|
+
return /* @__PURE__ */ E("span", {
|
|
40
|
+
className: "relative inline-block ml-1.5",
|
|
41
|
+
children: [/* @__PURE__ */ T("button", {
|
|
42
|
+
type: "button",
|
|
43
|
+
onClick: () => n(!t),
|
|
44
|
+
className: "text-text-tertiary hover:text-text-secondary transition-colors",
|
|
45
|
+
children: /* @__PURE__ */ T(_, { size: 14 })
|
|
46
|
+
}), t && /* @__PURE__ */ E("div", {
|
|
47
|
+
className: "absolute left-0 top-6 z-50 w-64 rounded-lg border border-border-default bg-bg-surface p-3 text-xs text-text-secondary shadow-lg",
|
|
48
|
+
children: [e, /* @__PURE__ */ T("button", {
|
|
49
|
+
onClick: () => n(!1),
|
|
50
|
+
className: "absolute top-1 right-1 text-text-tertiary hover:text-text-secondary",
|
|
51
|
+
children: /* @__PURE__ */ T(C, { size: 12 })
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
var A = typeof window < "u" && (window.location.hostname.includes("alpha") || window.location.hostname.endsWith(".local.burdenoff.com") || window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1"), j = A ? "sandbox/vibecontrols:alpha" : "sandbox/vibecontrols:latest", M = A ? "https://alphagraphql.burdenoff.com/global/graphql" : "https://graphql.burdenoff.com/global/graphql", N = A ? "https://alphagraphqlworkspaces.burdenoff.com/workspaces/graphql" : "https://graphqlworkspaces.burdenoff.com/workspaces/graphql";
|
|
57
|
+
function P() {
|
|
58
|
+
let { basePath: _ = "/", navigate: A, workspaceId: P } = e(), F = ee(), { t: I } = w(), [L, R] = l([]), [z, B] = l({
|
|
59
|
+
name: "",
|
|
60
|
+
description: "",
|
|
61
|
+
template: "MISC_SHELL",
|
|
62
|
+
mode: "DEPLOYMENT",
|
|
63
|
+
cpuRequest: "250m",
|
|
64
|
+
cpuLimit: "2",
|
|
65
|
+
memoryRequest: "512Mi",
|
|
66
|
+
memoryLimit: "2Gi",
|
|
67
|
+
ttlSeconds: 10800,
|
|
68
|
+
templateId: "",
|
|
69
|
+
containers: [{
|
|
70
|
+
name: "main",
|
|
71
|
+
image: j,
|
|
72
|
+
ports: [{
|
|
73
|
+
containerPort: 80,
|
|
74
|
+
name: "nginx"
|
|
75
|
+
}, {
|
|
76
|
+
containerPort: 3005,
|
|
77
|
+
name: "agent"
|
|
78
|
+
}],
|
|
79
|
+
env: [],
|
|
80
|
+
requestsCpu: "250m",
|
|
81
|
+
requestsMemory: "512Mi",
|
|
82
|
+
limitsCpu: "2",
|
|
83
|
+
limitsMemory: "2Gi",
|
|
84
|
+
_registryType: "burdenoff"
|
|
85
|
+
}],
|
|
86
|
+
storageMode: "NONE",
|
|
87
|
+
storageSizeGi: 10,
|
|
88
|
+
storageMountPath: "/data",
|
|
89
|
+
storageRetainOnDelete: !1,
|
|
90
|
+
globalGatewayUrl: M,
|
|
91
|
+
workspaceGatewayUrl: N
|
|
92
|
+
}), [V, H] = l({}), [U, W] = l(null), [G, K] = l(!1), { data: q } = te({
|
|
93
|
+
variables: {
|
|
94
|
+
context: { workspaceId: P },
|
|
95
|
+
template: z.template
|
|
96
|
+
},
|
|
97
|
+
skip: !P
|
|
98
|
+
}), [J] = s(), Y = q?.listSandboxTemplates?.items ?? [], X = (e, t) => {
|
|
99
|
+
W({
|
|
100
|
+
type: e,
|
|
101
|
+
message: t
|
|
102
|
+
}), setTimeout(() => W(null), 5e3);
|
|
103
|
+
}, ae = (e) => {
|
|
104
|
+
B((t) => ({
|
|
105
|
+
...t,
|
|
106
|
+
templateId: e.id,
|
|
107
|
+
cpuRequest: e.resources?.cpuRequest ?? t.cpuRequest,
|
|
108
|
+
cpuLimit: e.resources?.cpuLimit ?? t.cpuLimit,
|
|
109
|
+
memoryRequest: e.resources?.memoryRequest ?? t.memoryRequest,
|
|
110
|
+
memoryLimit: e.resources?.memoryLimit ?? t.memoryLimit,
|
|
111
|
+
ttlSeconds: e.ttlSeconds,
|
|
112
|
+
template: e.template,
|
|
113
|
+
containers: e.containers && e.containers.length > 0 ? e.containers.map((e) => ({
|
|
114
|
+
name: e.name,
|
|
115
|
+
image: e.image,
|
|
116
|
+
ports: e.ports?.map((e) => ({
|
|
117
|
+
containerPort: e.containerPort,
|
|
118
|
+
name: e.name ?? ""
|
|
119
|
+
})) ?? [],
|
|
120
|
+
env: e.env ?? [],
|
|
121
|
+
requestsCpu: e.resources?.requestsCpu ?? "",
|
|
122
|
+
requestsMemory: e.resources?.requestsMemory ?? "",
|
|
123
|
+
limitsCpu: e.resources?.limitsCpu ?? "",
|
|
124
|
+
limitsMemory: e.resources?.limitsMemory ?? ""
|
|
125
|
+
})) : t.containers,
|
|
126
|
+
storageMode: e.storage?.mode ?? t.storageMode,
|
|
127
|
+
storageSizeGi: e.storage?.sizeGi ?? t.storageSizeGi,
|
|
128
|
+
storageMountPath: e.storage?.mountPath ?? t.storageMountPath,
|
|
129
|
+
storageRetainOnDelete: e.storage?.retainOnDelete ?? t.storageRetainOnDelete
|
|
130
|
+
}));
|
|
131
|
+
}, Z = (e, t) => {
|
|
132
|
+
B((n) => ({
|
|
133
|
+
...n,
|
|
134
|
+
[e]: t
|
|
135
|
+
})), e !== "templateId" && ([
|
|
136
|
+
"cpuRequest",
|
|
137
|
+
"cpuLimit",
|
|
138
|
+
"memoryRequest",
|
|
139
|
+
"memoryLimit",
|
|
140
|
+
"ttlSeconds"
|
|
141
|
+
].includes(e) && B((e) => ({
|
|
142
|
+
...e,
|
|
143
|
+
templateId: ""
|
|
144
|
+
})), V[e] && H((t) => {
|
|
145
|
+
let n = { ...t };
|
|
146
|
+
return delete n[e], n;
|
|
147
|
+
}));
|
|
148
|
+
}, oe = () => {
|
|
149
|
+
B((e) => ({
|
|
150
|
+
...e,
|
|
151
|
+
containers: [...e.containers, { ...O }],
|
|
152
|
+
templateId: ""
|
|
153
|
+
}));
|
|
154
|
+
}, se = (e) => {
|
|
155
|
+
B((t) => ({
|
|
156
|
+
...t,
|
|
157
|
+
containers: t.containers.filter((t, n) => n !== e),
|
|
158
|
+
templateId: ""
|
|
159
|
+
}));
|
|
160
|
+
}, Q = (e, t, n) => {
|
|
161
|
+
B((r) => ({
|
|
162
|
+
...r,
|
|
163
|
+
containers: r.containers.map((r, i) => i === e ? {
|
|
164
|
+
...r,
|
|
165
|
+
[t]: n
|
|
166
|
+
} : r),
|
|
167
|
+
templateId: ""
|
|
168
|
+
}));
|
|
169
|
+
}, ce = (e) => {
|
|
170
|
+
B((t) => ({
|
|
171
|
+
...t,
|
|
172
|
+
containers: t.containers.map((t, n) => n === e ? {
|
|
173
|
+
...t,
|
|
174
|
+
ports: [...t.ports, {
|
|
175
|
+
containerPort: 8080,
|
|
176
|
+
name: ""
|
|
177
|
+
}]
|
|
178
|
+
} : t)
|
|
179
|
+
}));
|
|
180
|
+
}, le = (e, t) => {
|
|
181
|
+
B((n) => ({
|
|
182
|
+
...n,
|
|
183
|
+
containers: n.containers.map((n, r) => r === e ? {
|
|
184
|
+
...n,
|
|
185
|
+
ports: n.ports.filter((e, n) => n !== t)
|
|
186
|
+
} : n)
|
|
187
|
+
}));
|
|
188
|
+
}, ue = (e) => {
|
|
189
|
+
B((t) => ({
|
|
190
|
+
...t,
|
|
191
|
+
containers: t.containers.map((t, n) => n === e ? {
|
|
192
|
+
...t,
|
|
193
|
+
env: [...t.env, {
|
|
194
|
+
name: "",
|
|
195
|
+
value: ""
|
|
196
|
+
}]
|
|
197
|
+
} : t)
|
|
198
|
+
}));
|
|
199
|
+
}, de = (e, t) => {
|
|
200
|
+
B((n) => ({
|
|
201
|
+
...n,
|
|
202
|
+
containers: n.containers.map((n, r) => r === e ? {
|
|
203
|
+
...n,
|
|
204
|
+
env: n.env.filter((e, n) => n !== t)
|
|
205
|
+
} : n)
|
|
206
|
+
}));
|
|
207
|
+
}, fe = () => {
|
|
208
|
+
let e = {};
|
|
209
|
+
return z.name.trim() || (e.name = a(I, "sandbox.create.errors.nameRequired", "Name is required")), z.cpuRequest.trim() || (e.cpuRequest = a(I, "sandbox.create.errors.cpuRequestRequired", "CPU request is required")), z.cpuLimit.trim() || (e.cpuLimit = a(I, "sandbox.create.errors.cpuLimitRequired", "CPU limit is required")), z.memoryRequest.trim() || (e.memoryRequest = a(I, "sandbox.create.errors.memoryRequestRequired", "Memory request is required")), z.memoryLimit.trim() || (e.memoryLimit = a(I, "sandbox.create.errors.memoryLimitRequired", "Memory limit is required")), (z.ttlSeconds < 600 || z.ttlSeconds > 86400) && (e.ttlSeconds = a(I, "sandbox.create.errors.ttlRange", "TTL must be 10m-24h")), z.containers.length === 0 && (e.containers = a(I, "sandbox.create.errors.containersRequired", "At least one container is required")), z.containers.forEach((t, n) => {
|
|
210
|
+
t.name.trim() || (e[`container_${n}_name`] = a(I, "sandbox.create.errors.containerNameRequired", "Container name is required")), t.image.trim() || (e[`container_${n}_image`] = a(I, "sandbox.create.errors.containerImageRequired", "Container image is required"));
|
|
211
|
+
}), H(e), Object.keys(e).length === 0;
|
|
212
|
+
}, pe = async (e) => {
|
|
213
|
+
if (e.preventDefault(), !fe()) {
|
|
214
|
+
X("error", a(I, "sandbox.create.notifications.fixErrors", "Please fix the form errors"));
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
K(!0);
|
|
218
|
+
try {
|
|
219
|
+
let e = z.containers.map((e) => {
|
|
220
|
+
let t = (e._registryType || "burdenoff") === "burdenoff" ? `harbor.tooling.internal.burdenoff.com/${e.image}` : e.image;
|
|
221
|
+
return {
|
|
222
|
+
name: e.name,
|
|
223
|
+
image: t,
|
|
224
|
+
ports: e.ports.length > 0 ? e.ports.map((e) => ({
|
|
225
|
+
containerPort: e.containerPort,
|
|
226
|
+
name: e.name || void 0
|
|
227
|
+
})) : void 0,
|
|
228
|
+
env: e.env.length > 0 ? e.env.filter((e) => e.name.trim()) : void 0,
|
|
229
|
+
resources: e.requestsCpu || e.requestsMemory || e.limitsCpu || e.limitsMemory ? {
|
|
230
|
+
requestsCpu: e.requestsCpu || void 0,
|
|
231
|
+
requestsMemory: e.requestsMemory || void 0,
|
|
232
|
+
limitsCpu: e.limitsCpu || void 0,
|
|
233
|
+
limitsMemory: e.limitsMemory || void 0
|
|
234
|
+
} : void 0
|
|
235
|
+
};
|
|
236
|
+
}), t = (await J({ variables: { input: {
|
|
237
|
+
context: { workspaceId: P },
|
|
238
|
+
name: z.name,
|
|
239
|
+
description: z.description || void 0,
|
|
240
|
+
template: z.template,
|
|
241
|
+
mode: z.mode,
|
|
242
|
+
containers: e,
|
|
243
|
+
resources: {
|
|
244
|
+
cpuRequest: z.cpuRequest,
|
|
245
|
+
cpuLimit: z.cpuLimit,
|
|
246
|
+
memoryRequest: z.memoryRequest,
|
|
247
|
+
memoryLimit: z.memoryLimit
|
|
248
|
+
},
|
|
249
|
+
storage: {
|
|
250
|
+
mode: z.storageMode,
|
|
251
|
+
sizeGi: z.storageMode === "NONE" ? void 0 : z.storageSizeGi,
|
|
252
|
+
mountPath: z.storageMode === "NONE" ? void 0 : z.storageMountPath,
|
|
253
|
+
retainOnDelete: z.storageMode === "PERSISTENT" ? z.storageRetainOnDelete : !1
|
|
254
|
+
},
|
|
255
|
+
ttlSeconds: z.ttlSeconds,
|
|
256
|
+
metadata: {
|
|
257
|
+
globalGatewayUrl: z.globalGatewayUrl || void 0,
|
|
258
|
+
workspaceGatewayUrl: z.workspaceGatewayUrl || void 0,
|
|
259
|
+
tags: L.length ? L : void 0
|
|
260
|
+
}
|
|
261
|
+
} } })).data?.createSandbox;
|
|
262
|
+
if (t && F.sandboxCreated({
|
|
263
|
+
sandboxId: t.id,
|
|
264
|
+
kind: t.kind?.toLowerCase?.() === "internal" ? "internal" : "user",
|
|
265
|
+
source: t.source ?? "manual"
|
|
266
|
+
}), X("success", a(I, "sandbox.create.notifications.createSuccess", "Sandbox created successfully! Provisioning...")), t?.id) {
|
|
267
|
+
let e = `${_.replace(/\/$/, "")}/${t.id}`;
|
|
268
|
+
setTimeout(() => A?.(e), 1500);
|
|
269
|
+
} else setTimeout(() => A?.(_), 1500);
|
|
270
|
+
} catch {
|
|
271
|
+
X("error", a(I, "sandbox.create.notifications.createFailed", "Failed to create sandbox"));
|
|
272
|
+
} finally {
|
|
273
|
+
K(!1);
|
|
274
|
+
}
|
|
275
|
+
}, $ = (e) => {
|
|
276
|
+
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60);
|
|
277
|
+
return t > 0 && n > 0 ? `${t}h ${n}m` : t > 0 ? `${t}h` : `${n}m`;
|
|
278
|
+
};
|
|
279
|
+
return /* @__PURE__ */ E(o, {
|
|
280
|
+
showHeader: !1,
|
|
281
|
+
children: [
|
|
282
|
+
U && /* @__PURE__ */ E("div", {
|
|
283
|
+
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-300 ${U.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"}`,
|
|
284
|
+
children: [
|
|
285
|
+
U.type === "success" ? /* @__PURE__ */ T(p, { size: 20 }) : /* @__PURE__ */ T(u, { size: 20 }),
|
|
286
|
+
/* @__PURE__ */ T("span", {
|
|
287
|
+
className: "font-medium",
|
|
288
|
+
children: U.message
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ T("button", {
|
|
291
|
+
onClick: () => W(null),
|
|
292
|
+
className: "ml-2 p-1 rounded-md hover:bg-accent",
|
|
293
|
+
children: /* @__PURE__ */ T(C, { size: 16 })
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ E("div", {
|
|
298
|
+
className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm",
|
|
299
|
+
children: [/* @__PURE__ */ E("div", {
|
|
300
|
+
className: "relative z-10 flex items-center gap-4",
|
|
301
|
+
children: [/* @__PURE__ */ T("button", {
|
|
302
|
+
onClick: () => A?.(_),
|
|
303
|
+
className: "p-2.5 hover:bg-accent rounded-lg transition-all duration-200 hover:scale-110",
|
|
304
|
+
"aria-label": a(I, "sandbox.create.header.back.ariaLabel", "Back to sandboxes"),
|
|
305
|
+
children: /* @__PURE__ */ T(d, { size: 20 })
|
|
306
|
+
}), /* @__PURE__ */ E("div", {
|
|
307
|
+
className: "flex items-center gap-3",
|
|
308
|
+
children: [/* @__PURE__ */ T("div", {
|
|
309
|
+
className: "p-2.5 rounded-lg bg-primary/10 backdrop-blur-sm",
|
|
310
|
+
children: /* @__PURE__ */ T(f, {
|
|
311
|
+
size: 24,
|
|
312
|
+
className: "text-primary"
|
|
313
|
+
})
|
|
314
|
+
}), /* @__PURE__ */ T("h1", {
|
|
315
|
+
className: "text-2xl sm:text-3xl font-bold",
|
|
316
|
+
children: a(I, "sandbox.create.header.title", "Create Sandbox")
|
|
317
|
+
})]
|
|
318
|
+
})]
|
|
319
|
+
}), /* @__PURE__ */ T("div", { className: "absolute top-0 right-0 w-64 h-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0" })]
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ E("form", {
|
|
322
|
+
onSubmit: pe,
|
|
323
|
+
className: "space-y-6",
|
|
324
|
+
children: [
|
|
325
|
+
/* @__PURE__ */ T(r, { children: /* @__PURE__ */ E(i, {
|
|
326
|
+
className: "p-6 space-y-5",
|
|
327
|
+
children: [
|
|
328
|
+
/* @__PURE__ */ E("h2", {
|
|
329
|
+
className: "text-lg font-bold flex items-center gap-2",
|
|
330
|
+
children: [/* @__PURE__ */ T(ne, {
|
|
331
|
+
size: 18,
|
|
332
|
+
className: "text-primary"
|
|
333
|
+
}), a(I, "sandbox.create.sections.basicInfo.title", "Basic Information")]
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ E("div", { children: [
|
|
336
|
+
/* @__PURE__ */ E("label", {
|
|
337
|
+
htmlFor: "name",
|
|
338
|
+
className: "block text-sm font-semibold mb-2",
|
|
339
|
+
children: [
|
|
340
|
+
a(I, "sandbox.create.fields.name.label", "Name"),
|
|
341
|
+
" ",
|
|
342
|
+
/* @__PURE__ */ T("span", {
|
|
343
|
+
className: "text-destructive",
|
|
344
|
+
children: "*"
|
|
345
|
+
})
|
|
346
|
+
]
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ T("input", {
|
|
349
|
+
type: "text",
|
|
350
|
+
id: "name",
|
|
351
|
+
value: z.name,
|
|
352
|
+
onChange: (e) => Z("name", e.target.value),
|
|
353
|
+
className: `w-full px-4 py-2.5 border-2 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V.name ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
354
|
+
placeholder: a(I, "sandbox.create.fields.name.placeholder", "My Sandbox")
|
|
355
|
+
}),
|
|
356
|
+
V.name && /* @__PURE__ */ E("p", {
|
|
357
|
+
className: "text-sm text-destructive mt-1 flex items-center gap-1",
|
|
358
|
+
children: [/* @__PURE__ */ T(u, { size: 14 }), V.name]
|
|
359
|
+
})
|
|
360
|
+
] }),
|
|
361
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
362
|
+
htmlFor: "description",
|
|
363
|
+
className: "block text-sm font-semibold mb-2",
|
|
364
|
+
children: a(I, "sandbox.create.fields.description.label", "Description")
|
|
365
|
+
}), /* @__PURE__ */ T("textarea", {
|
|
366
|
+
id: "description",
|
|
367
|
+
value: z.description,
|
|
368
|
+
onChange: (e) => Z("description", e.target.value),
|
|
369
|
+
rows: 3,
|
|
370
|
+
className: "w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
|
|
371
|
+
placeholder: a(I, "sandbox.create.fields.description.placeholder", "What is this sandbox for?")
|
|
372
|
+
})] }),
|
|
373
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
374
|
+
className: "block text-sm font-semibold mb-3",
|
|
375
|
+
children: a(I, "sandbox.create.fields.template.label", "Template")
|
|
376
|
+
}), /* @__PURE__ */ T("div", {
|
|
377
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
|
|
378
|
+
children: D.map((e) => {
|
|
379
|
+
let t = e.icon, n = z.template === e.value;
|
|
380
|
+
return /* @__PURE__ */ E("button", {
|
|
381
|
+
type: "button",
|
|
382
|
+
onClick: () => {
|
|
383
|
+
e.value === "MISC_SHELL" ? B((e) => ({
|
|
384
|
+
...e,
|
|
385
|
+
template: "MISC_SHELL",
|
|
386
|
+
containers: [{
|
|
387
|
+
name: "main",
|
|
388
|
+
image: j,
|
|
389
|
+
ports: [{
|
|
390
|
+
containerPort: 80,
|
|
391
|
+
name: "nginx"
|
|
392
|
+
}, {
|
|
393
|
+
containerPort: 3005,
|
|
394
|
+
name: "agent"
|
|
395
|
+
}],
|
|
396
|
+
env: [],
|
|
397
|
+
requestsCpu: "250m",
|
|
398
|
+
requestsMemory: "512Mi",
|
|
399
|
+
limitsCpu: "2",
|
|
400
|
+
limitsMemory: "2Gi",
|
|
401
|
+
_registryType: "burdenoff"
|
|
402
|
+
}]
|
|
403
|
+
})) : B((e) => ({
|
|
404
|
+
...e,
|
|
405
|
+
template: "CUSTOM",
|
|
406
|
+
containers: [{
|
|
407
|
+
...O,
|
|
408
|
+
name: "main",
|
|
409
|
+
image: ""
|
|
410
|
+
}]
|
|
411
|
+
}));
|
|
412
|
+
},
|
|
413
|
+
className: `p-4 rounded-lg border-2 text-left transition-all duration-200 ${n ? "border-primary bg-primary/5 shadow-sm" : "border-border hover:border-primary/50 hover:bg-muted/50"}`,
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ T(t, {
|
|
416
|
+
size: 24,
|
|
417
|
+
className: n ? "text-primary" : "text-muted-foreground"
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ T("p", {
|
|
420
|
+
className: "font-medium mt-2",
|
|
421
|
+
children: a(I, e.labelKey, e.labelFallback)
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ T("p", {
|
|
424
|
+
className: "text-xs text-muted-foreground mt-0.5",
|
|
425
|
+
children: a(I, e.descriptionKey, e.descriptionFallback)
|
|
426
|
+
})
|
|
427
|
+
]
|
|
428
|
+
}, e.value);
|
|
429
|
+
})
|
|
430
|
+
})] }),
|
|
431
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("label", {
|
|
432
|
+
className: "block text-sm font-semibold mb-3",
|
|
433
|
+
children: [a(I, "sandbox.create.fields.executionMode.label", "Execution Mode"), /* @__PURE__ */ T(k, { text: a(I, "sandbox.create.fields.executionMode.help", "Deployment keeps your sandbox running continuously and restarts on failure. Job runs to completion and exits when done.") })]
|
|
434
|
+
}), /* @__PURE__ */ T("div", {
|
|
435
|
+
className: "grid grid-cols-2 gap-3",
|
|
436
|
+
children: [{
|
|
437
|
+
value: "DEPLOYMENT",
|
|
438
|
+
labelKey: "sandbox.create.fields.executionMode.deployment.label",
|
|
439
|
+
labelFallback: "Deployment",
|
|
440
|
+
descKey: "sandbox.create.fields.executionMode.deployment.description",
|
|
441
|
+
descFallback: "Long-running container (restarts on failure)"
|
|
442
|
+
}, {
|
|
443
|
+
value: "JOB",
|
|
444
|
+
labelKey: "sandbox.create.fields.executionMode.job.label",
|
|
445
|
+
labelFallback: "Job",
|
|
446
|
+
descKey: "sandbox.create.fields.executionMode.job.description",
|
|
447
|
+
descFallback: "Run-to-completion task (exits when done)"
|
|
448
|
+
}].map((e) => /* @__PURE__ */ E("button", {
|
|
449
|
+
type: "button",
|
|
450
|
+
onClick: () => Z("mode", e.value),
|
|
451
|
+
className: `p-3 rounded-lg border-2 text-left transition-all duration-200 ${z.mode === e.value ? "border-primary bg-primary/5 shadow-sm" : "border-border hover:border-primary/50 hover:bg-muted/50"}`,
|
|
452
|
+
children: [/* @__PURE__ */ T("p", {
|
|
453
|
+
className: "font-medium text-sm",
|
|
454
|
+
children: a(I, e.labelKey, e.labelFallback)
|
|
455
|
+
}), /* @__PURE__ */ T("p", {
|
|
456
|
+
className: "text-xs text-muted-foreground mt-0.5",
|
|
457
|
+
children: a(I, e.descKey, e.descFallback)
|
|
458
|
+
})]
|
|
459
|
+
}, e.value))
|
|
460
|
+
})] })
|
|
461
|
+
]
|
|
462
|
+
}) }),
|
|
463
|
+
Y.length > 0 && /* @__PURE__ */ T(r, { children: /* @__PURE__ */ E(i, {
|
|
464
|
+
className: "p-6 space-y-4",
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ E("h2", {
|
|
467
|
+
className: "text-lg font-bold flex items-center gap-2",
|
|
468
|
+
children: [/* @__PURE__ */ T(f, {
|
|
469
|
+
size: 18,
|
|
470
|
+
className: "text-primary"
|
|
471
|
+
}), a(I, "sandbox.create.sections.quickStartTemplates.title", "Quick Start Templates")]
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ T("div", {
|
|
474
|
+
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
|
|
475
|
+
children: Y.map((e) => /* @__PURE__ */ E("button", {
|
|
476
|
+
type: "button",
|
|
477
|
+
onClick: () => ae(e),
|
|
478
|
+
className: `p-4 rounded-lg border-2 text-left transition-all duration-200 ${z.templateId === e.id ? "border-primary bg-primary/5 shadow-sm" : "border-border hover:border-primary/50 hover:bg-muted/50"}`,
|
|
479
|
+
children: [
|
|
480
|
+
/* @__PURE__ */ E("div", {
|
|
481
|
+
className: "flex items-center gap-2 mb-2",
|
|
482
|
+
children: [/* @__PURE__ */ T("span", {
|
|
483
|
+
className: "font-medium text-sm",
|
|
484
|
+
children: e.name
|
|
485
|
+
}), e.isDefault && /* @__PURE__ */ T(t, {
|
|
486
|
+
variant: "secondary",
|
|
487
|
+
className: "text-xs",
|
|
488
|
+
children: a(I, "sandbox.create.sections.quickStartTemplates.defaultBadge", "Default")
|
|
489
|
+
})]
|
|
490
|
+
}),
|
|
491
|
+
e.description && /* @__PURE__ */ T("p", {
|
|
492
|
+
className: "text-xs text-muted-foreground mb-2",
|
|
493
|
+
children: e.description
|
|
494
|
+
}),
|
|
495
|
+
/* @__PURE__ */ E("div", {
|
|
496
|
+
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
497
|
+
children: [
|
|
498
|
+
/* @__PURE__ */ E("span", { children: [e.resources?.cpuRequest ?? "?", " CPU"] }),
|
|
499
|
+
/* @__PURE__ */ T("span", {
|
|
500
|
+
className: "text-muted-foreground/40",
|
|
501
|
+
children: "|"
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ E("span", { children: [e.resources?.memoryRequest ?? "?", " mem"] }),
|
|
504
|
+
/* @__PURE__ */ T("span", {
|
|
505
|
+
className: "text-muted-foreground/40",
|
|
506
|
+
children: "|"
|
|
507
|
+
}),
|
|
508
|
+
/* @__PURE__ */ E("span", { children: [e.containers?.length ?? 0, " containers"] }),
|
|
509
|
+
/* @__PURE__ */ T("span", {
|
|
510
|
+
className: "text-muted-foreground/40",
|
|
511
|
+
children: "|"
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ T("span", { children: $(e.ttlSeconds) })
|
|
514
|
+
]
|
|
515
|
+
})
|
|
516
|
+
]
|
|
517
|
+
}, e.id))
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ T("p", {
|
|
520
|
+
className: "text-xs text-muted-foreground",
|
|
521
|
+
children: a(I, "sandbox.create.sections.quickStartTemplates.hint", "Select a template or customize resources below")
|
|
522
|
+
})
|
|
523
|
+
]
|
|
524
|
+
}) }),
|
|
525
|
+
/* @__PURE__ */ T(r, { children: /* @__PURE__ */ E(i, {
|
|
526
|
+
className: "p-6 space-y-5",
|
|
527
|
+
children: [
|
|
528
|
+
/* @__PURE__ */ E("div", {
|
|
529
|
+
className: "flex items-center justify-between",
|
|
530
|
+
children: [/* @__PURE__ */ E("h2", {
|
|
531
|
+
className: "text-lg font-bold flex items-center gap-2",
|
|
532
|
+
children: [
|
|
533
|
+
/* @__PURE__ */ T(m, {
|
|
534
|
+
size: 18,
|
|
535
|
+
className: "text-primary"
|
|
536
|
+
}),
|
|
537
|
+
a(I, "sandbox.create.sections.containers.title", "Containers"),
|
|
538
|
+
/* @__PURE__ */ T(k, { text: a(I, "sandbox.create.sections.containers.help", "A container is the application that runs inside your sandbox. The default sandbox image includes VibeControls agent, Bun, nginx, and common dev tools pre-installed.") }),
|
|
539
|
+
/* @__PURE__ */ T(t, {
|
|
540
|
+
variant: "secondary",
|
|
541
|
+
children: z.containers.length
|
|
542
|
+
})
|
|
543
|
+
]
|
|
544
|
+
}), /* @__PURE__ */ E(n, {
|
|
545
|
+
type: "button",
|
|
546
|
+
variant: "outline",
|
|
547
|
+
size: "sm",
|
|
548
|
+
onClick: oe,
|
|
549
|
+
children: [/* @__PURE__ */ T(y, { size: 14 }), a(I, "sandbox.create.sections.containers.addContainer", "Add Container")]
|
|
550
|
+
})]
|
|
551
|
+
}),
|
|
552
|
+
V.containers && /* @__PURE__ */ E("p", {
|
|
553
|
+
className: "text-sm text-destructive flex items-center gap-1",
|
|
554
|
+
children: [/* @__PURE__ */ T(u, { size: 14 }), V.containers]
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ T("div", {
|
|
557
|
+
className: "space-y-4",
|
|
558
|
+
children: z.containers.map((e, t) => /* @__PURE__ */ E("div", {
|
|
559
|
+
className: "p-4 rounded-lg border-2 border-border/50 bg-muted/20 space-y-4",
|
|
560
|
+
children: [
|
|
561
|
+
/* @__PURE__ */ E("div", {
|
|
562
|
+
className: "flex items-center justify-between",
|
|
563
|
+
children: [/* @__PURE__ */ E("h3", {
|
|
564
|
+
className: "font-semibold text-sm",
|
|
565
|
+
children: [a(I, "sandbox.create.container.heading", "Container #{number}", { number: t + 1 }), e.name && `: ${e.name}`]
|
|
566
|
+
}), z.containers.length > 1 && /* @__PURE__ */ T(n, {
|
|
567
|
+
type: "button",
|
|
568
|
+
variant: "ghost",
|
|
569
|
+
size: "icon",
|
|
570
|
+
className: "text-destructive hover:text-destructive h-7 w-7",
|
|
571
|
+
onClick: () => se(t),
|
|
572
|
+
children: /* @__PURE__ */ T(S, { size: 14 })
|
|
573
|
+
})]
|
|
574
|
+
}),
|
|
575
|
+
/* @__PURE__ */ E("div", { children: [
|
|
576
|
+
/* @__PURE__ */ E("label", {
|
|
577
|
+
className: "block text-xs font-semibold mb-1",
|
|
578
|
+
children: [
|
|
579
|
+
a(I, "sandbox.create.container.fields.name.label", "Name"),
|
|
580
|
+
" ",
|
|
581
|
+
/* @__PURE__ */ T("span", {
|
|
582
|
+
className: "text-destructive",
|
|
583
|
+
children: "*"
|
|
584
|
+
})
|
|
585
|
+
]
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ T("input", {
|
|
588
|
+
type: "text",
|
|
589
|
+
value: e.name,
|
|
590
|
+
onChange: (e) => Q(t, "name", e.target.value),
|
|
591
|
+
className: `w-full px-3 py-2 border-2 rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V[`container_${t}_name`] ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
592
|
+
placeholder: a(I, "sandbox.create.container.fields.name.placeholder", "main")
|
|
593
|
+
}),
|
|
594
|
+
V[`container_${t}_name`] && /* @__PURE__ */ T("p", {
|
|
595
|
+
className: "text-xs text-destructive mt-1",
|
|
596
|
+
children: V[`container_${t}_name`]
|
|
597
|
+
})
|
|
598
|
+
] }),
|
|
599
|
+
/* @__PURE__ */ E("div", { children: [
|
|
600
|
+
/* @__PURE__ */ E("label", {
|
|
601
|
+
className: "block text-xs font-semibold mb-1",
|
|
602
|
+
children: [
|
|
603
|
+
a(I, "sandbox.create.container.fields.image.label", "Image"),
|
|
604
|
+
" ",
|
|
605
|
+
/* @__PURE__ */ T("span", {
|
|
606
|
+
className: "text-destructive",
|
|
607
|
+
children: "*"
|
|
608
|
+
})
|
|
609
|
+
]
|
|
610
|
+
}),
|
|
611
|
+
/* @__PURE__ */ E("div", {
|
|
612
|
+
className: "flex gap-2 mb-2",
|
|
613
|
+
children: [/* @__PURE__ */ T("button", {
|
|
614
|
+
type: "button",
|
|
615
|
+
onClick: () => Q(t, "_registryType", "burdenoff"),
|
|
616
|
+
className: `flex-1 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${(e._registryType || "burdenoff") === "burdenoff" ? "border-primary bg-primary/10 text-primary" : "border-border-default text-text-secondary hover:bg-bg-sunken"}`,
|
|
617
|
+
children: a(I, "sandbox.create.container.fields.image.registryBurdenoff", "Burdenoff Repositories")
|
|
618
|
+
}), /* @__PURE__ */ T("button", {
|
|
619
|
+
type: "button",
|
|
620
|
+
onClick: () => Q(t, "_registryType", "custom"),
|
|
621
|
+
className: `flex-1 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${e._registryType === "custom" ? "border-primary bg-primary/10 text-primary" : "border-border-default text-text-secondary hover:bg-bg-sunken"}`,
|
|
622
|
+
children: a(I, "sandbox.create.container.fields.image.registryCustom", "Custom (Docker Hub)")
|
|
623
|
+
})]
|
|
624
|
+
}),
|
|
625
|
+
(e._registryType || "burdenoff") === "burdenoff" ? /* @__PURE__ */ E("div", {
|
|
626
|
+
className: "flex items-center",
|
|
627
|
+
children: [/* @__PURE__ */ T("span", {
|
|
628
|
+
className: "px-3 py-2 border-2 border-r-0 rounded-l-lg bg-bg-sunken text-xs text-text-secondary font-mono whitespace-nowrap",
|
|
629
|
+
children: "harbor.tooling.internal.burdenoff.com/"
|
|
630
|
+
}), /* @__PURE__ */ T("input", {
|
|
631
|
+
type: "text",
|
|
632
|
+
value: e.image,
|
|
633
|
+
onChange: (e) => Q(t, "image", e.target.value),
|
|
634
|
+
className: `w-full px-3 py-2 border-2 rounded-r-lg bg-background text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V[`container_${t}_image`] ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
635
|
+
placeholder: j
|
|
636
|
+
})]
|
|
637
|
+
}) : /* @__PURE__ */ T("input", {
|
|
638
|
+
type: "text",
|
|
639
|
+
value: e.image,
|
|
640
|
+
onChange: (e) => Q(t, "image", e.target.value),
|
|
641
|
+
className: `w-full px-3 py-2 border-2 rounded-lg bg-background text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V[`container_${t}_image`] ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
642
|
+
placeholder: "nginx:alpine"
|
|
643
|
+
}),
|
|
644
|
+
V[`container_${t}_image`] && /* @__PURE__ */ T("p", {
|
|
645
|
+
className: "text-xs text-destructive mt-1",
|
|
646
|
+
children: V[`container_${t}_image`]
|
|
647
|
+
})
|
|
648
|
+
] }),
|
|
649
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
650
|
+
className: "text-xs font-semibold mb-2 text-muted-foreground",
|
|
651
|
+
children: a(I, "sandbox.create.container.resources.title", "Per-Container Resources (optional)")
|
|
652
|
+
}), /* @__PURE__ */ E("div", {
|
|
653
|
+
className: "grid grid-cols-2 sm:grid-cols-4 gap-3",
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
656
|
+
className: "block text-xs text-muted-foreground mb-1",
|
|
657
|
+
children: a(I, "sandbox.create.container.resources.cpuReq", "CPU Req")
|
|
658
|
+
}), /* @__PURE__ */ T("input", {
|
|
659
|
+
type: "text",
|
|
660
|
+
value: e.requestsCpu,
|
|
661
|
+
onChange: (e) => Q(t, "requestsCpu", e.target.value),
|
|
662
|
+
className: "w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
663
|
+
placeholder: "250m"
|
|
664
|
+
})] }),
|
|
665
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
666
|
+
className: "block text-xs text-muted-foreground mb-1",
|
|
667
|
+
children: a(I, "sandbox.create.container.resources.cpuLim", "CPU Lim")
|
|
668
|
+
}), /* @__PURE__ */ T("input", {
|
|
669
|
+
type: "text",
|
|
670
|
+
value: e.limitsCpu,
|
|
671
|
+
onChange: (e) => Q(t, "limitsCpu", e.target.value),
|
|
672
|
+
className: "w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
673
|
+
placeholder: "1"
|
|
674
|
+
})] }),
|
|
675
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
676
|
+
className: "block text-xs text-muted-foreground mb-1",
|
|
677
|
+
children: a(I, "sandbox.create.container.resources.memReq", "Mem Req")
|
|
678
|
+
}), /* @__PURE__ */ T("input", {
|
|
679
|
+
type: "text",
|
|
680
|
+
value: e.requestsMemory,
|
|
681
|
+
onChange: (e) => Q(t, "requestsMemory", e.target.value),
|
|
682
|
+
className: "w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
683
|
+
placeholder: "512Mi"
|
|
684
|
+
})] }),
|
|
685
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
686
|
+
className: "block text-xs text-muted-foreground mb-1",
|
|
687
|
+
children: a(I, "sandbox.create.container.resources.memLim", "Mem Lim")
|
|
688
|
+
}), /* @__PURE__ */ T("input", {
|
|
689
|
+
type: "text",
|
|
690
|
+
value: e.limitsMemory,
|
|
691
|
+
onChange: (e) => Q(t, "limitsMemory", e.target.value),
|
|
692
|
+
className: "w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
693
|
+
placeholder: "2Gi"
|
|
694
|
+
})] })
|
|
695
|
+
]
|
|
696
|
+
})] }),
|
|
697
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("div", {
|
|
698
|
+
className: "flex items-center justify-between mb-2",
|
|
699
|
+
children: [/* @__PURE__ */ T("p", {
|
|
700
|
+
className: "text-xs font-semibold text-muted-foreground",
|
|
701
|
+
children: a(I, "sandbox.create.container.ports.title", "Ports")
|
|
702
|
+
}), /* @__PURE__ */ T("button", {
|
|
703
|
+
type: "button",
|
|
704
|
+
onClick: () => ce(t),
|
|
705
|
+
className: "text-xs text-primary hover:underline",
|
|
706
|
+
children: a(I, "sandbox.create.container.ports.add", "+ Add Port")
|
|
707
|
+
})]
|
|
708
|
+
}), e.ports.map((n, r) => /* @__PURE__ */ E("div", {
|
|
709
|
+
className: "flex items-center gap-2 mb-2",
|
|
710
|
+
children: [
|
|
711
|
+
/* @__PURE__ */ T("input", {
|
|
712
|
+
type: "number",
|
|
713
|
+
value: n.containerPort,
|
|
714
|
+
onChange: (n) => {
|
|
715
|
+
let i = [...e.ports];
|
|
716
|
+
i[r] = {
|
|
717
|
+
...i[r],
|
|
718
|
+
containerPort: Number(n.target.value)
|
|
719
|
+
}, Q(t, "ports", i);
|
|
720
|
+
},
|
|
721
|
+
className: "w-24 px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
722
|
+
placeholder: "8080"
|
|
723
|
+
}),
|
|
724
|
+
/* @__PURE__ */ T("input", {
|
|
725
|
+
type: "text",
|
|
726
|
+
value: n.name,
|
|
727
|
+
onChange: (n) => {
|
|
728
|
+
let i = [...e.ports];
|
|
729
|
+
i[r] = {
|
|
730
|
+
...i[r],
|
|
731
|
+
name: n.target.value
|
|
732
|
+
}, Q(t, "ports", i);
|
|
733
|
+
},
|
|
734
|
+
className: "flex-1 px-3 py-1.5 border rounded-lg bg-background text-xs focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
735
|
+
placeholder: a(I, "sandbox.create.container.ports.namePlaceholder", "Port name (optional)")
|
|
736
|
+
}),
|
|
737
|
+
/* @__PURE__ */ T("button", {
|
|
738
|
+
type: "button",
|
|
739
|
+
onClick: () => le(t, r),
|
|
740
|
+
className: "p-1.5 text-destructive hover:bg-destructive/10 rounded",
|
|
741
|
+
children: /* @__PURE__ */ T(C, { size: 12 })
|
|
742
|
+
})
|
|
743
|
+
]
|
|
744
|
+
}, r))] }),
|
|
745
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("div", {
|
|
746
|
+
className: "flex items-center justify-between mb-2",
|
|
747
|
+
children: [/* @__PURE__ */ T("p", {
|
|
748
|
+
className: "text-xs font-semibold text-muted-foreground",
|
|
749
|
+
children: a(I, "sandbox.create.container.envVars.title", "Environment Variables")
|
|
750
|
+
}), /* @__PURE__ */ T("button", {
|
|
751
|
+
type: "button",
|
|
752
|
+
onClick: () => ue(t),
|
|
753
|
+
className: "text-xs text-primary hover:underline",
|
|
754
|
+
children: a(I, "sandbox.create.container.envVars.add", "+ Add Variable")
|
|
755
|
+
})]
|
|
756
|
+
}), e.env.map((n, r) => /* @__PURE__ */ E("div", {
|
|
757
|
+
className: "flex items-center gap-2 mb-2",
|
|
758
|
+
children: [
|
|
759
|
+
/* @__PURE__ */ T("input", {
|
|
760
|
+
type: "text",
|
|
761
|
+
value: n.name,
|
|
762
|
+
onChange: (n) => {
|
|
763
|
+
let i = [...e.env];
|
|
764
|
+
i[r] = {
|
|
765
|
+
...i[r],
|
|
766
|
+
name: n.target.value
|
|
767
|
+
}, Q(t, "env", i);
|
|
768
|
+
},
|
|
769
|
+
className: "w-1/3 px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
770
|
+
placeholder: "KEY"
|
|
771
|
+
}),
|
|
772
|
+
/* @__PURE__ */ T("input", {
|
|
773
|
+
type: "text",
|
|
774
|
+
value: n.value,
|
|
775
|
+
onChange: (n) => {
|
|
776
|
+
let i = [...e.env];
|
|
777
|
+
i[r] = {
|
|
778
|
+
...i[r],
|
|
779
|
+
value: n.target.value
|
|
780
|
+
}, Q(t, "env", i);
|
|
781
|
+
},
|
|
782
|
+
className: "flex-1 px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
783
|
+
placeholder: "value"
|
|
784
|
+
}),
|
|
785
|
+
/* @__PURE__ */ T("button", {
|
|
786
|
+
type: "button",
|
|
787
|
+
onClick: () => de(t, r),
|
|
788
|
+
className: "p-1.5 text-destructive hover:bg-destructive/10 rounded",
|
|
789
|
+
children: /* @__PURE__ */ T(C, { size: 12 })
|
|
790
|
+
})
|
|
791
|
+
]
|
|
792
|
+
}, r))] })
|
|
793
|
+
]
|
|
794
|
+
}, t))
|
|
795
|
+
})
|
|
796
|
+
]
|
|
797
|
+
}) }),
|
|
798
|
+
/* @__PURE__ */ T(r, { children: /* @__PURE__ */ E(i, {
|
|
799
|
+
className: "p-6 space-y-5",
|
|
800
|
+
children: [
|
|
801
|
+
/* @__PURE__ */ E("h2", {
|
|
802
|
+
className: "text-lg font-bold flex items-center gap-2",
|
|
803
|
+
children: [
|
|
804
|
+
/* @__PURE__ */ T(h, {
|
|
805
|
+
size: 18,
|
|
806
|
+
className: "text-primary"
|
|
807
|
+
}),
|
|
808
|
+
a(I, "sandbox.create.sections.podResources.title", "Pod Resources"),
|
|
809
|
+
/* @__PURE__ */ T(k, { text: a(I, "sandbox.create.sections.podResources.help", "Resources allocated to the entire sandbox. CPU is in millicores (1000m = 1 CPU core). Memory in MiB or GiB.") })
|
|
810
|
+
]
|
|
811
|
+
}),
|
|
812
|
+
/* @__PURE__ */ E("div", {
|
|
813
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
|
|
814
|
+
children: [
|
|
815
|
+
/* @__PURE__ */ E("div", { children: [
|
|
816
|
+
/* @__PURE__ */ E("label", {
|
|
817
|
+
htmlFor: "cpuRequest",
|
|
818
|
+
className: "text-sm font-semibold mb-2 flex items-center gap-2",
|
|
819
|
+
children: [/* @__PURE__ */ T(h, {
|
|
820
|
+
size: 14,
|
|
821
|
+
className: "text-status-info-text"
|
|
822
|
+
}), a(I, "sandbox.create.fields.cpuRequest.label", "CPU Request")]
|
|
823
|
+
}),
|
|
824
|
+
/* @__PURE__ */ T("input", {
|
|
825
|
+
type: "text",
|
|
826
|
+
id: "cpuRequest",
|
|
827
|
+
value: z.cpuRequest,
|
|
828
|
+
onChange: (e) => Z("cpuRequest", e.target.value),
|
|
829
|
+
className: `w-full px-4 py-2.5 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V.cpuRequest ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
830
|
+
placeholder: "500m"
|
|
831
|
+
}),
|
|
832
|
+
V.cpuRequest && /* @__PURE__ */ T("p", {
|
|
833
|
+
className: "text-sm text-destructive mt-1",
|
|
834
|
+
children: V.cpuRequest
|
|
835
|
+
})
|
|
836
|
+
] }),
|
|
837
|
+
/* @__PURE__ */ E("div", { children: [
|
|
838
|
+
/* @__PURE__ */ E("label", {
|
|
839
|
+
htmlFor: "cpuLimit",
|
|
840
|
+
className: "text-sm font-semibold mb-2 flex items-center gap-2",
|
|
841
|
+
children: [/* @__PURE__ */ T(h, {
|
|
842
|
+
size: 14,
|
|
843
|
+
className: "text-status-info-text"
|
|
844
|
+
}), a(I, "sandbox.create.fields.cpuLimit.label", "CPU Limit")]
|
|
845
|
+
}),
|
|
846
|
+
/* @__PURE__ */ T("input", {
|
|
847
|
+
type: "text",
|
|
848
|
+
id: "cpuLimit",
|
|
849
|
+
value: z.cpuLimit,
|
|
850
|
+
onChange: (e) => Z("cpuLimit", e.target.value),
|
|
851
|
+
className: `w-full px-4 py-2.5 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V.cpuLimit ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
852
|
+
placeholder: "2"
|
|
853
|
+
}),
|
|
854
|
+
V.cpuLimit && /* @__PURE__ */ T("p", {
|
|
855
|
+
className: "text-sm text-destructive mt-1",
|
|
856
|
+
children: V.cpuLimit
|
|
857
|
+
})
|
|
858
|
+
] }),
|
|
859
|
+
/* @__PURE__ */ E("div", { children: [
|
|
860
|
+
/* @__PURE__ */ E("label", {
|
|
861
|
+
htmlFor: "memoryRequest",
|
|
862
|
+
className: "text-sm font-semibold mb-2 flex items-center gap-2",
|
|
863
|
+
children: [/* @__PURE__ */ T(v, {
|
|
864
|
+
size: 14,
|
|
865
|
+
className: "text-accent-purple-subtle"
|
|
866
|
+
}), a(I, "sandbox.create.fields.memoryRequest.label", "Memory Request")]
|
|
867
|
+
}),
|
|
868
|
+
/* @__PURE__ */ T("input", {
|
|
869
|
+
type: "text",
|
|
870
|
+
id: "memoryRequest",
|
|
871
|
+
value: z.memoryRequest,
|
|
872
|
+
onChange: (e) => Z("memoryRequest", e.target.value),
|
|
873
|
+
className: `w-full px-4 py-2.5 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V.memoryRequest ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
874
|
+
placeholder: "1Gi"
|
|
875
|
+
}),
|
|
876
|
+
V.memoryRequest && /* @__PURE__ */ T("p", {
|
|
877
|
+
className: "text-sm text-destructive mt-1",
|
|
878
|
+
children: V.memoryRequest
|
|
879
|
+
})
|
|
880
|
+
] }),
|
|
881
|
+
/* @__PURE__ */ E("div", { children: [
|
|
882
|
+
/* @__PURE__ */ E("label", {
|
|
883
|
+
htmlFor: "memoryLimit",
|
|
884
|
+
className: "text-sm font-semibold mb-2 flex items-center gap-2",
|
|
885
|
+
children: [/* @__PURE__ */ T(v, {
|
|
886
|
+
size: 14,
|
|
887
|
+
className: "text-accent-purple-subtle"
|
|
888
|
+
}), a(I, "sandbox.create.fields.memoryLimit.label", "Memory Limit")]
|
|
889
|
+
}),
|
|
890
|
+
/* @__PURE__ */ T("input", {
|
|
891
|
+
type: "text",
|
|
892
|
+
id: "memoryLimit",
|
|
893
|
+
value: z.memoryLimit,
|
|
894
|
+
onChange: (e) => Z("memoryLimit", e.target.value),
|
|
895
|
+
className: `w-full px-4 py-2.5 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${V.memoryLimit ? "border-destructive" : "border-border focus:border-primary"}`,
|
|
896
|
+
placeholder: "4Gi"
|
|
897
|
+
}),
|
|
898
|
+
V.memoryLimit && /* @__PURE__ */ T("p", {
|
|
899
|
+
className: "text-sm text-destructive mt-1",
|
|
900
|
+
children: V.memoryLimit
|
|
901
|
+
})
|
|
902
|
+
] })
|
|
903
|
+
]
|
|
904
|
+
}),
|
|
905
|
+
/* @__PURE__ */ E("div", { children: [
|
|
906
|
+
/* @__PURE__ */ E("label", {
|
|
907
|
+
htmlFor: "ttlSeconds",
|
|
908
|
+
className: "text-sm font-semibold mb-2 flex items-center gap-2",
|
|
909
|
+
children: [
|
|
910
|
+
/* @__PURE__ */ T(x, {
|
|
911
|
+
size: 14,
|
|
912
|
+
className: "text-status-info-text"
|
|
913
|
+
}),
|
|
914
|
+
a(I, "sandbox.create.fields.ttl.label", "Time to Live"),
|
|
915
|
+
/* @__PURE__ */ T(k, { text: a(I, "sandbox.create.fields.ttl.help", "Your sandbox will be automatically destroyed after this duration to save resources. You can extend it while it's running.") }),
|
|
916
|
+
/* @__PURE__ */ T(t, {
|
|
917
|
+
variant: "outline",
|
|
918
|
+
className: "text-xs ml-auto",
|
|
919
|
+
children: $(z.ttlSeconds)
|
|
920
|
+
})
|
|
921
|
+
]
|
|
922
|
+
}),
|
|
923
|
+
/* @__PURE__ */ T("input", {
|
|
924
|
+
type: "range",
|
|
925
|
+
id: "ttlSeconds",
|
|
926
|
+
min: 600,
|
|
927
|
+
max: 86400,
|
|
928
|
+
step: 600,
|
|
929
|
+
value: z.ttlSeconds,
|
|
930
|
+
onChange: (e) => Z("ttlSeconds", Number(e.target.value)),
|
|
931
|
+
className: "w-full mt-2 accent-primary"
|
|
932
|
+
}),
|
|
933
|
+
/* @__PURE__ */ E("div", {
|
|
934
|
+
className: "flex justify-between text-xs text-muted-foreground mt-1",
|
|
935
|
+
children: [
|
|
936
|
+
/* @__PURE__ */ T("span", { children: "10m" }),
|
|
937
|
+
/* @__PURE__ */ T("span", { children: "4h" }),
|
|
938
|
+
/* @__PURE__ */ T("span", { children: "12h" }),
|
|
939
|
+
/* @__PURE__ */ T("span", { children: "24h" })
|
|
940
|
+
]
|
|
941
|
+
}),
|
|
942
|
+
V.ttlSeconds && /* @__PURE__ */ T("p", {
|
|
943
|
+
className: "text-sm text-destructive mt-1",
|
|
944
|
+
children: V.ttlSeconds
|
|
945
|
+
})
|
|
946
|
+
] }),
|
|
947
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("label", {
|
|
948
|
+
className: "text-sm font-semibold mb-2 flex items-center gap-2",
|
|
949
|
+
children: [a(I, "sandbox.create.fields.tags.label", "Tags"), /* @__PURE__ */ T(k, { text: a(I, "sandbox.create.fields.tags.help", "Free-form labels. Use them to filter the sandbox list. Max 32 tags, 64 chars each.") })]
|
|
950
|
+
}), /* @__PURE__ */ T(c, {
|
|
951
|
+
value: L,
|
|
952
|
+
onChange: R
|
|
953
|
+
})] })
|
|
954
|
+
]
|
|
955
|
+
}) }),
|
|
956
|
+
/* @__PURE__ */ T(r, { children: /* @__PURE__ */ E(i, {
|
|
957
|
+
className: "p-6 space-y-5",
|
|
958
|
+
children: [
|
|
959
|
+
/* @__PURE__ */ E("h2", {
|
|
960
|
+
className: "text-lg font-bold flex items-center gap-2",
|
|
961
|
+
children: [
|
|
962
|
+
/* @__PURE__ */ T(g, {
|
|
963
|
+
size: 18,
|
|
964
|
+
className: "text-primary"
|
|
965
|
+
}),
|
|
966
|
+
a(I, "sandbox.create.sections.storage.title", "Storage"),
|
|
967
|
+
/* @__PURE__ */ T(k, { text: a(I, "sandbox.create.sections.storage.help", "Ephemeral storage is fast but lost when the sandbox stops. Persistent storage survives restarts.") })
|
|
968
|
+
]
|
|
969
|
+
}),
|
|
970
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
971
|
+
className: "block text-sm font-semibold mb-3",
|
|
972
|
+
children: a(I, "sandbox.create.fields.storageMode.label", "Mode")
|
|
973
|
+
}), /* @__PURE__ */ T("div", {
|
|
974
|
+
className: "grid grid-cols-3 gap-3",
|
|
975
|
+
children: [
|
|
976
|
+
"NONE",
|
|
977
|
+
"EPHEMERAL",
|
|
978
|
+
"PERSISTENT"
|
|
979
|
+
].map((e) => {
|
|
980
|
+
let t = z.storageMode === e, n = {
|
|
981
|
+
NONE: a(I, "sandbox.create.fields.storageMode.none.label", "None"),
|
|
982
|
+
EPHEMERAL: a(I, "sandbox.create.fields.storageMode.ephemeral.label", "Ephemeral"),
|
|
983
|
+
PERSISTENT: a(I, "sandbox.create.fields.storageMode.persistent.label", "Persistent")
|
|
984
|
+
}, r = {
|
|
985
|
+
NONE: a(I, "sandbox.create.fields.storageMode.none.description", "No persistent storage"),
|
|
986
|
+
EPHEMERAL: a(I, "sandbox.create.fields.storageMode.ephemeral.description", "Lost when sandbox stops"),
|
|
987
|
+
PERSISTENT: a(I, "sandbox.create.fields.storageMode.persistent.description", "Retained across restarts")
|
|
988
|
+
};
|
|
989
|
+
return /* @__PURE__ */ E("button", {
|
|
990
|
+
type: "button",
|
|
991
|
+
onClick: () => Z("storageMode", e),
|
|
992
|
+
className: `p-3 rounded-lg border-2 text-left transition-all duration-200 ${t ? "border-primary bg-primary/5 shadow-sm" : "border-border hover:border-primary/50 hover:bg-muted/50"}`,
|
|
993
|
+
children: [/* @__PURE__ */ T("p", {
|
|
994
|
+
className: "font-medium text-sm",
|
|
995
|
+
children: n[e]
|
|
996
|
+
}), /* @__PURE__ */ T("p", {
|
|
997
|
+
className: "text-xs text-muted-foreground mt-0.5",
|
|
998
|
+
children: r[e]
|
|
999
|
+
})]
|
|
1000
|
+
}, e);
|
|
1001
|
+
})
|
|
1002
|
+
})] }),
|
|
1003
|
+
z.storageMode !== "NONE" && /* @__PURE__ */ E("div", {
|
|
1004
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-5",
|
|
1005
|
+
children: [
|
|
1006
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
1007
|
+
htmlFor: "storageSizeGi",
|
|
1008
|
+
className: "block text-sm font-semibold mb-2",
|
|
1009
|
+
children: a(I, "sandbox.create.fields.storageSizeGi.label", "Size (GiB)")
|
|
1010
|
+
}), /* @__PURE__ */ T("input", {
|
|
1011
|
+
type: "number",
|
|
1012
|
+
id: "storageSizeGi",
|
|
1013
|
+
value: z.storageSizeGi,
|
|
1014
|
+
onChange: (e) => Z("storageSizeGi", Number(e.target.value)),
|
|
1015
|
+
min: 1,
|
|
1016
|
+
max: 200,
|
|
1017
|
+
className: "w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all"
|
|
1018
|
+
})] }),
|
|
1019
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
1020
|
+
htmlFor: "storageMountPath",
|
|
1021
|
+
className: "block text-sm font-semibold mb-2",
|
|
1022
|
+
children: a(I, "sandbox.create.fields.storageMountPath.label", "Mount Path")
|
|
1023
|
+
}), /* @__PURE__ */ T("input", {
|
|
1024
|
+
type: "text",
|
|
1025
|
+
id: "storageMountPath",
|
|
1026
|
+
value: z.storageMountPath,
|
|
1027
|
+
onChange: (e) => Z("storageMountPath", e.target.value),
|
|
1028
|
+
className: "w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all",
|
|
1029
|
+
placeholder: "/data"
|
|
1030
|
+
})] }),
|
|
1031
|
+
z.storageMode === "PERSISTENT" && /* @__PURE__ */ E("div", {
|
|
1032
|
+
className: "flex items-center gap-3 sm:col-span-2",
|
|
1033
|
+
children: [/* @__PURE__ */ T("input", {
|
|
1034
|
+
type: "checkbox",
|
|
1035
|
+
id: "storageRetainOnDelete",
|
|
1036
|
+
checked: z.storageRetainOnDelete,
|
|
1037
|
+
onChange: (e) => Z("storageRetainOnDelete", e.target.checked),
|
|
1038
|
+
className: "w-4 h-4 rounded border-border text-primary focus:ring-primary/20"
|
|
1039
|
+
}), /* @__PURE__ */ T("label", {
|
|
1040
|
+
htmlFor: "storageRetainOnDelete",
|
|
1041
|
+
className: "text-sm font-medium",
|
|
1042
|
+
children: a(I, "sandbox.create.fields.storageRetainOnDelete.label", "Retain volume data when sandbox is deleted")
|
|
1043
|
+
})]
|
|
1044
|
+
})
|
|
1045
|
+
]
|
|
1046
|
+
})
|
|
1047
|
+
]
|
|
1048
|
+
}) }),
|
|
1049
|
+
z.template === "MISC_SHELL" && /* @__PURE__ */ T(r, { children: /* @__PURE__ */ T(i, {
|
|
1050
|
+
className: "p-5",
|
|
1051
|
+
children: /* @__PURE__ */ E("details", { children: [/* @__PURE__ */ E("summary", {
|
|
1052
|
+
className: "cursor-pointer text-sm font-semibold text-muted-foreground flex items-center gap-2",
|
|
1053
|
+
children: [
|
|
1054
|
+
/* @__PURE__ */ T(b, { size: 14 }),
|
|
1055
|
+
a(I, "sandbox.create.sections.advancedSettings.title", "Advanced Settings"),
|
|
1056
|
+
/* @__PURE__ */ T(k, { text: a(I, "sandbox.create.sections.advancedSettings.help", "Override the gateway URLs the sandbox agent uses for authentication and API calls. Useful when exposing local gateways via tunnel for development.") })
|
|
1057
|
+
]
|
|
1058
|
+
}), /* @__PURE__ */ E("div", {
|
|
1059
|
+
className: "mt-4 space-y-4",
|
|
1060
|
+
children: [/* @__PURE__ */ E("div", { children: [
|
|
1061
|
+
/* @__PURE__ */ T("label", {
|
|
1062
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
1063
|
+
children: a(I, "sandbox.create.fields.globalGatewayUrl.label", "Global Gateway URL")
|
|
1064
|
+
}),
|
|
1065
|
+
/* @__PURE__ */ T("input", {
|
|
1066
|
+
type: "text",
|
|
1067
|
+
value: z.globalGatewayUrl,
|
|
1068
|
+
onChange: (e) => Z("globalGatewayUrl", e.target.value),
|
|
1069
|
+
placeholder: M,
|
|
1070
|
+
className: "w-full rounded-lg border border-border px-3 py-2 text-sm font-mono bg-background focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
|
|
1071
|
+
}),
|
|
1072
|
+
/* @__PURE__ */ T("p", {
|
|
1073
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
1074
|
+
children: a(I, "sandbox.create.fields.globalGatewayUrl.hint", "The agent authenticates via this URL. Override with a tunnel URL to reach local gateways.")
|
|
1075
|
+
})
|
|
1076
|
+
] }), /* @__PURE__ */ E("div", { children: [
|
|
1077
|
+
/* @__PURE__ */ T("label", {
|
|
1078
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
1079
|
+
children: a(I, "sandbox.create.fields.workspaceGatewayUrl.label", "Workspace Gateway URL")
|
|
1080
|
+
}),
|
|
1081
|
+
/* @__PURE__ */ T("input", {
|
|
1082
|
+
type: "text",
|
|
1083
|
+
value: z.workspaceGatewayUrl,
|
|
1084
|
+
onChange: (e) => Z("workspaceGatewayUrl", e.target.value),
|
|
1085
|
+
placeholder: N,
|
|
1086
|
+
className: "w-full rounded-lg border border-border px-3 py-2 text-sm font-mono bg-background focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"
|
|
1087
|
+
}),
|
|
1088
|
+
/* @__PURE__ */ T("p", {
|
|
1089
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
1090
|
+
children: a(I, "sandbox.create.fields.workspaceGatewayUrl.hint", "The agent reports to this URL. Override with a tunnel URL to reach local gateways.")
|
|
1091
|
+
})
|
|
1092
|
+
] })]
|
|
1093
|
+
})] })
|
|
1094
|
+
}) }),
|
|
1095
|
+
/* @__PURE__ */ E("div", {
|
|
1096
|
+
className: "flex flex-col sm:flex-row gap-3 pt-2",
|
|
1097
|
+
children: [/* @__PURE__ */ E(n, {
|
|
1098
|
+
type: "submit",
|
|
1099
|
+
disabled: G,
|
|
1100
|
+
size: "lg",
|
|
1101
|
+
children: [G ? /* @__PURE__ */ T(re, {
|
|
1102
|
+
size: 18,
|
|
1103
|
+
className: "animate-spin"
|
|
1104
|
+
}) : /* @__PURE__ */ T(ie, { size: 18 }), a(I, "sandbox.create.actions.submit", "Create Sandbox")]
|
|
1105
|
+
}), /* @__PURE__ */ T(n, {
|
|
1106
|
+
type: "button",
|
|
1107
|
+
variant: "outline",
|
|
1108
|
+
onClick: () => A?.(_),
|
|
1109
|
+
disabled: G,
|
|
1110
|
+
children: a(I, "sandbox.create.actions.cancel", "Cancel")
|
|
1111
|
+
})]
|
|
1112
|
+
})
|
|
1113
|
+
]
|
|
1114
|
+
})
|
|
1115
|
+
]
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
//#endregion
|
|
1119
|
+
export { P as SandboxCreatePage };
|
|
1120
|
+
|
|
1121
|
+
//# sourceMappingURL=SandboxCreatePage.js.map
|