@burdenoff/microfe-sandbox 2026.1117.1 → 2026.1119.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/SandboxScriptRunnerPanel.js +72 -71
- package/dist/sandbox/components/SandboxScriptRunnerPanel.js.map +1 -1
- package/dist/sandbox/pages/SandboxDetailPage.js +26 -26
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -1
- package/dist/sandbox/pages/TemplateDetailPage.js +68 -68
- package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -6,14 +6,15 @@ import { AlertCircle as f, ArrowUpCircle as p, CheckCircle2 as m, Loader2 as h,
|
|
|
6
6
|
import { useSearchParams as b } from "react-router";
|
|
7
7
|
import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
8
|
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
9
|
+
import { ThemedSelect as w } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
// src/sandbox/components/SandboxScriptRunnerPanel.tsx
|
|
10
|
-
var
|
|
11
|
+
var T = [
|
|
11
12
|
"bash",
|
|
12
13
|
"sh",
|
|
13
14
|
"python",
|
|
14
15
|
"node"
|
|
15
16
|
];
|
|
16
|
-
function
|
|
17
|
+
function E(e) {
|
|
17
18
|
if (!e) return "";
|
|
18
19
|
try {
|
|
19
20
|
return atob(e);
|
|
@@ -21,53 +22,53 @@ function T(e) {
|
|
|
21
22
|
return e;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
let { t:
|
|
25
|
+
function D({ sandbox: m, workspaceId: D }) {
|
|
26
|
+
let { t: A } = x(), j = (e, t) => i(A, e, t), [M, N] = b(), [P, F] = d(() => E(M.get("script"))), [I, L] = d("bash"), [R, z] = d(""), [B, V] = d(null), H = m.status === "RUNNING", { data: U, refetch: W } = s({
|
|
26
27
|
variables: {
|
|
27
28
|
sandboxId: m.id,
|
|
28
|
-
context: { workspaceId:
|
|
29
|
+
context: { workspaceId: D }
|
|
29
30
|
},
|
|
30
|
-
skip: !
|
|
31
|
+
skip: !D,
|
|
31
32
|
fetchPolicy: "cache-and-network"
|
|
32
|
-
}), [
|
|
33
|
+
}), [G, { loading: K, error: q }] = o(), [J, { loading: Y }] = a(), X = u(() => U?.sandboxScriptRuns ?? [], [U]), Z = X.find((e) => e.id === B) ?? X[0] ?? null;
|
|
33
34
|
l(() => {
|
|
34
|
-
if (
|
|
35
|
-
let e = new URLSearchParams(
|
|
36
|
-
e.delete("script"),
|
|
35
|
+
if (M.get("script")) {
|
|
36
|
+
let e = new URLSearchParams(M);
|
|
37
|
+
e.delete("script"), N(e, { replace: !0 });
|
|
37
38
|
}
|
|
38
39
|
}, []);
|
|
39
|
-
let
|
|
40
|
-
if (
|
|
41
|
-
let e = (await
|
|
40
|
+
let Q = c(async () => {
|
|
41
|
+
if (P.trim() && H) try {
|
|
42
|
+
let e = (await G({ variables: { input: {
|
|
42
43
|
sandboxId: m.id,
|
|
43
|
-
script:
|
|
44
|
-
interpreter:
|
|
45
|
-
label:
|
|
46
|
-
context: { workspaceId:
|
|
44
|
+
script: P,
|
|
45
|
+
interpreter: I,
|
|
46
|
+
label: R.trim() || null,
|
|
47
|
+
context: { workspaceId: D }
|
|
47
48
|
} } })).data?.runSandboxScript;
|
|
48
|
-
e &&
|
|
49
|
+
e && V(e.id), await W();
|
|
49
50
|
} catch {}
|
|
50
51
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
P,
|
|
53
|
+
H,
|
|
54
|
+
G,
|
|
54
55
|
m.id,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]),
|
|
56
|
+
I,
|
|
57
|
+
R,
|
|
58
|
+
D,
|
|
59
|
+
W
|
|
60
|
+
]), $ = c(async (e) => {
|
|
60
61
|
try {
|
|
61
|
-
await
|
|
62
|
+
await J({ variables: {
|
|
62
63
|
id: e,
|
|
63
64
|
note: null,
|
|
64
|
-
context: { workspaceId:
|
|
65
|
-
} }), await
|
|
65
|
+
context: { workspaceId: D }
|
|
66
|
+
} }), await W();
|
|
66
67
|
} catch {}
|
|
67
68
|
}, [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
J,
|
|
70
|
+
D,
|
|
71
|
+
W
|
|
71
72
|
]);
|
|
72
73
|
return /* @__PURE__ */ S(n, { children: /* @__PURE__ */ C(r, {
|
|
73
74
|
className: "p-5",
|
|
@@ -82,86 +83,86 @@ function E({ sandbox: m, workspaceId: E }) {
|
|
|
82
83
|
size: 14,
|
|
83
84
|
className: "text-primary"
|
|
84
85
|
})
|
|
85
|
-
}),
|
|
86
|
+
}), j("sandbox.detail.scriptRunner.title", "Script Runner")]
|
|
86
87
|
})
|
|
87
88
|
}),
|
|
88
89
|
/* @__PURE__ */ S("p", {
|
|
89
90
|
className: "mb-3 text-sm text-text-secondary",
|
|
90
|
-
children:
|
|
91
|
+
children: j("sandbox.detail.scriptRunner.subtitle", "Run an AI-generated script in this isolated sandbox and review the output before promoting it to the real target.")
|
|
91
92
|
}),
|
|
92
|
-
!
|
|
93
|
+
!H && /* @__PURE__ */ C("div", {
|
|
93
94
|
className: "mb-3 flex items-center gap-2 rounded-lg bg-amber-500/10 px-3 py-2 text-sm text-amber-600",
|
|
94
|
-
children: [/* @__PURE__ */ S(f, { size: 14 }),
|
|
95
|
+
children: [/* @__PURE__ */ S(f, { size: 14 }), j("sandbox.detail.scriptRunner.notRunning", "The sandbox must be running to execute a script.")]
|
|
95
96
|
}),
|
|
96
97
|
/* @__PURE__ */ C("div", {
|
|
97
98
|
className: "space-y-3",
|
|
98
99
|
children: [
|
|
99
100
|
/* @__PURE__ */ C("div", {
|
|
100
101
|
className: "flex flex-wrap items-center gap-2",
|
|
101
|
-
children: [/* @__PURE__ */ S(
|
|
102
|
-
value:
|
|
103
|
-
onChange: (e) =>
|
|
102
|
+
children: [/* @__PURE__ */ S(w, {
|
|
103
|
+
value: I,
|
|
104
|
+
onChange: (e) => L(e.target.value),
|
|
104
105
|
className: "rounded-lg border bg-bg-surface px-2 py-1 font-mono text-xs scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
105
|
-
children:
|
|
106
|
+
children: T.map((e) => /* @__PURE__ */ S("option", {
|
|
106
107
|
value: e,
|
|
107
108
|
children: e
|
|
108
109
|
}, e))
|
|
109
110
|
}), /* @__PURE__ */ S("input", {
|
|
110
|
-
value:
|
|
111
|
-
onChange: (e) =>
|
|
112
|
-
placeholder:
|
|
111
|
+
value: R,
|
|
112
|
+
onChange: (e) => z(e.target.value),
|
|
113
|
+
placeholder: j("sandbox.detail.scriptRunner.labelPlaceholder", "Label (optional)"),
|
|
113
114
|
className: "flex-1 rounded-lg border bg-bg-surface px-2 py-1 text-xs"
|
|
114
115
|
})]
|
|
115
116
|
}),
|
|
116
117
|
/* @__PURE__ */ S("textarea", {
|
|
117
|
-
value:
|
|
118
|
-
onChange: (e) =>
|
|
118
|
+
value: P,
|
|
119
|
+
onChange: (e) => F(e.target.value),
|
|
119
120
|
spellCheck: !1,
|
|
120
|
-
placeholder:
|
|
121
|
+
placeholder: j("sandbox.detail.scriptRunner.placeholder", "# Paste the AI-generated script here, then Run to test it in the sandbox"),
|
|
121
122
|
className: "h-40 w-full resize-y rounded-lg border bg-bg-surface p-3 font-mono text-xs"
|
|
122
123
|
}),
|
|
123
124
|
/* @__PURE__ */ S("div", {
|
|
124
125
|
className: "flex justify-end",
|
|
125
126
|
children: /* @__PURE__ */ C(t, {
|
|
126
|
-
onClick: () => void
|
|
127
|
-
disabled: !
|
|
128
|
-
children: [
|
|
127
|
+
onClick: () => void Q(),
|
|
128
|
+
disabled: !H || K || !P.trim(),
|
|
129
|
+
children: [K ? /* @__PURE__ */ S(h, {
|
|
129
130
|
size: 14,
|
|
130
131
|
className: "animate-spin"
|
|
131
|
-
}) : /* @__PURE__ */ S(g, { size: 14 }),
|
|
132
|
+
}) : /* @__PURE__ */ S(g, { size: 14 }), j("sandbox.detail.scriptRunner.run", "Run in sandbox")]
|
|
132
133
|
})
|
|
133
134
|
}),
|
|
134
|
-
|
|
135
|
+
q && /* @__PURE__ */ C("div", {
|
|
135
136
|
className: "flex items-center gap-2 rounded-lg bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
136
|
-
children: [/* @__PURE__ */ S(y, { size: 14 }),
|
|
137
|
+
children: [/* @__PURE__ */ S(y, { size: 14 }), q.message]
|
|
137
138
|
})
|
|
138
139
|
]
|
|
139
140
|
}),
|
|
140
|
-
|
|
141
|
+
Z && /* @__PURE__ */ S("div", {
|
|
141
142
|
className: "mt-4",
|
|
142
|
-
children: /* @__PURE__ */ S(
|
|
143
|
-
run:
|
|
144
|
-
tr:
|
|
143
|
+
children: /* @__PURE__ */ S(k, {
|
|
144
|
+
run: Z,
|
|
145
|
+
tr: j
|
|
145
146
|
})
|
|
146
147
|
}),
|
|
147
|
-
|
|
148
|
+
X.length > 0 && /* @__PURE__ */ C("div", {
|
|
148
149
|
className: "mt-4",
|
|
149
150
|
children: [/* @__PURE__ */ S("h4", {
|
|
150
151
|
className: "mb-2 text-xs font-semibold uppercase text-text-secondary",
|
|
151
|
-
children:
|
|
152
|
+
children: j("sandbox.detail.scriptRunner.history", "Run history")
|
|
152
153
|
}), /* @__PURE__ */ S("ul", {
|
|
153
154
|
className: "divide-y rounded-lg border",
|
|
154
|
-
children:
|
|
155
|
+
children: X.map((n) => /* @__PURE__ */ C("li", {
|
|
155
156
|
className: "flex items-center gap-3 px-3 py-2 text-sm",
|
|
156
157
|
children: [
|
|
157
|
-
/* @__PURE__ */ S(
|
|
158
|
+
/* @__PURE__ */ S(O, {
|
|
158
159
|
status: n.status,
|
|
159
160
|
exitCode: n.exitCode,
|
|
160
|
-
tr:
|
|
161
|
+
tr: j
|
|
161
162
|
}),
|
|
162
163
|
/* @__PURE__ */ C("button", {
|
|
163
164
|
type: "button",
|
|
164
|
-
onClick: () =>
|
|
165
|
+
onClick: () => V(n.id),
|
|
165
166
|
className: "min-w-0 flex-1 truncate text-left hover:underline",
|
|
166
167
|
children: [
|
|
167
168
|
/* @__PURE__ */ S("span", {
|
|
@@ -177,14 +178,14 @@ function E({ sandbox: m, workspaceId: E }) {
|
|
|
177
178
|
}),
|
|
178
179
|
n.promotedAt ? /* @__PURE__ */ C(e, {
|
|
179
180
|
className: "shrink-0 gap-1 bg-green-500/10 text-green-600",
|
|
180
|
-
children: [/* @__PURE__ */ S(_, { size: 12 }),
|
|
181
|
+
children: [/* @__PURE__ */ S(_, { size: 12 }), j("sandbox.detail.scriptRunner.promoted", "Promoted")]
|
|
181
182
|
}) : n.status === "succeeded" && /* @__PURE__ */ C(t, {
|
|
182
183
|
variant: "outline",
|
|
183
|
-
onClick: () => void
|
|
184
|
-
disabled:
|
|
184
|
+
onClick: () => void $(n.id),
|
|
185
|
+
disabled: Y,
|
|
185
186
|
className: "shrink-0",
|
|
186
|
-
title:
|
|
187
|
-
children: [/* @__PURE__ */ S(p, { size: 12 }),
|
|
187
|
+
title: j("sandbox.detail.scriptRunner.promoteTitle", "Sign off this reviewed run for the real target"),
|
|
188
|
+
children: [/* @__PURE__ */ S(p, { size: 12 }), j("sandbox.detail.scriptRunner.promote", "Promote")]
|
|
188
189
|
})
|
|
189
190
|
]
|
|
190
191
|
}, n.id))
|
|
@@ -193,7 +194,7 @@ function E({ sandbox: m, workspaceId: E }) {
|
|
|
193
194
|
]
|
|
194
195
|
}) });
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function O({ status: t, exitCode: n, tr: r }) {
|
|
197
198
|
return t === "running" ? /* @__PURE__ */ C(e, {
|
|
198
199
|
className: "gap-1 bg-blue-500/10 text-blue-600",
|
|
199
200
|
children: [/* @__PURE__ */ S(h, {
|
|
@@ -208,13 +209,13 @@ function D({ status: t, exitCode: n, tr: r }) {
|
|
|
208
209
|
children: [/* @__PURE__ */ S(y, { size: 12 }), t === "error" ? r("sandbox.detail.scriptRunner.status.error", "Error") : `${r("sandbox.detail.scriptRunner.status.failed", "Failed")}${n == null ? "" : ` (${n})`}`]
|
|
209
210
|
});
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
+
function k({ run: e, tr: t }) {
|
|
212
213
|
return /* @__PURE__ */ C("div", {
|
|
213
214
|
className: "rounded-lg border bg-bg-sunken/30 p-3",
|
|
214
215
|
children: [
|
|
215
216
|
/* @__PURE__ */ C("div", {
|
|
216
217
|
className: "mb-2 flex items-center gap-2 text-xs text-text-secondary",
|
|
217
|
-
children: [/* @__PURE__ */ S(
|
|
218
|
+
children: [/* @__PURE__ */ S(O, {
|
|
218
219
|
status: e.status,
|
|
219
220
|
exitCode: e.exitCode,
|
|
220
221
|
tr: t
|
|
@@ -235,6 +236,6 @@ function O({ run: e, tr: t }) {
|
|
|
235
236
|
]
|
|
236
237
|
});
|
|
237
238
|
}
|
|
238
|
-
export {
|
|
239
|
+
export { D as SandboxScriptRunnerPanel };
|
|
239
240
|
|
|
240
241
|
//# sourceMappingURL=SandboxScriptRunnerPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxScriptRunnerPanel.js","names":["INTERPRETERS","decodeSeed","raw","SandboxScriptRunnerPanel","useI18n","tr","tWithFallback","t","key","fallback","searchParams","setSearchParams","useSearchParams","script","setScript","useState","interpreter","setInterpreter","label","setLabel","activeRunId","setActiveRunId","isRunning","sandbox","useSandboxScriptRunsQuery","workspaceId","runScript","running","runError","useRunSandboxScriptMutation","promote","promoting","usePromoteSandboxScriptRunMutation","runs","useMemo","data","activeRun","r","next","handleRun","useCallback","created","refetch","handlePromote","runId","Card","CardContent","Terminal","AlertCircle","i","Button","Loader2","Play","XCircle","RunOutput","RunStatusBadge","Badge","ShieldCheck","ArrowUpCircle","status","CheckCircle2","exitCode","run"],"sources":["../../../src/sandbox/components/SandboxScriptRunnerPanel.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useMemo } from 'react';\nimport { useSearchParams } from 'react-router';\nimport {\n Terminal,\n Play,\n Loader2,\n CheckCircle2,\n XCircle,\n AlertCircle,\n ArrowUpCircle,\n ShieldCheck,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { Button, Card, CardContent, Badge } from './ui';\nimport { tWithFallback } from '../utils/i18n';\nimport {\n useSandboxScriptRunsQuery,\n useRunSandboxScriptMutation,\n usePromoteSandboxScriptRunMutation,\n type SandboxScriptRunFieldsFragment,\n} from '../../generated/wspace-operations';\n\nconst INTERPRETERS = ['bash', 'sh', 'python', 'node'] as const;\n\nfunction decodeSeed(raw: string | null): string {\n if (!raw) return '';\n try {\n // Accept base64 (used by deep-links, e.g. the assistant's \"Send to Sandbox\") or plain text.\n return atob(raw);\n } catch {\n return raw;\n }\n}\n\n/**\n * SandboxScriptRunnerPanel — the sandbox-safe-execution review surface. Paste (or deep-link in via\n * `?script=<base64>`) an AI-generated script, run it inside this isolated sandbox, and review the\n * captured stdout/stderr/exit code. Each run is recorded; a run that succeeded can be promoted to the\n * real target, which stamps the sign-off onto the same record. The sandbox must be running.\n */\nexport function SandboxScriptRunnerPanel({\n sandbox,\n workspaceId,\n}: {\n sandbox: { id: string; status?: string | null };\n workspaceId: string;\n}): React.ReactElement {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => tWithFallback(t, key, fallback);\n const [searchParams, setSearchParams] = useSearchParams();\n\n const [script, setScript] = useState<string>(() => decodeSeed(searchParams.get('script')));\n const [interpreter, setInterpreter] = useState<(typeof INTERPRETERS)[number]>('bash');\n const [label, setLabel] = useState('');\n const [activeRunId, setActiveRunId] = useState<string | null>(null);\n\n const isRunning = sandbox.status === 'RUNNING';\n\n const { data, refetch } = useSandboxScriptRunsQuery({\n variables: { sandboxId: sandbox.id, context: { workspaceId } },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n });\n const [runScript, { loading: running, error: runError }] = useRunSandboxScriptMutation();\n const [promote, { loading: promoting }] = usePromoteSandboxScriptRunMutation();\n\n const runs = useMemo<SandboxScriptRunFieldsFragment[]>(\n () => data?.sandboxScriptRuns ?? [],\n [data]\n );\n const activeRun = runs.find((r) => r.id === activeRunId) ?? runs[0] ?? null;\n\n // One-shot: if we were deep-linked with a script, clear it from the URL so a refresh doesn't re-seed.\n useEffect(() => {\n if (searchParams.get('script')) {\n const next = new URLSearchParams(searchParams);\n next.delete('script');\n setSearchParams(next, { replace: true });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleRun = useCallback(async () => {\n if (!script.trim() || !isRunning) return;\n try {\n const res = await runScript({\n variables: {\n input: {\n sandboxId: sandbox.id,\n script,\n interpreter,\n label: label.trim() || null,\n context: { workspaceId },\n },\n },\n });\n const created = res.data?.runSandboxScript;\n if (created) setActiveRunId(created.id);\n await refetch();\n } catch {\n // surfaced via runError below\n }\n }, [script, isRunning, runScript, sandbox.id, interpreter, label, workspaceId, refetch]);\n\n const handlePromote = useCallback(\n async (runId: string) => {\n try {\n await promote({ variables: { id: runId, note: null, context: { workspaceId } } });\n await refetch();\n } catch {\n // surfaced inline on the run row via refetch\n }\n },\n [promote, workspaceId, refetch]\n );\n\n return (\n <Card>\n <CardContent className=\"p-5\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"flex items-center gap-2 font-semibold\">\n <div className=\"rounded-lg bg-action-primary-bg/10 p-1.5\">\n <Terminal size={14} className=\"text-primary\" />\n </div>\n {tr('sandbox.detail.scriptRunner.title', 'Script Runner')}\n </h3>\n </div>\n <p className=\"mb-3 text-sm text-text-secondary\">\n {tr(\n 'sandbox.detail.scriptRunner.subtitle',\n 'Run an AI-generated script in this isolated sandbox and review the output before promoting it to the real target.'\n )}\n </p>\n\n {!isRunning && (\n <div className=\"mb-3 flex items-center gap-2 rounded-lg bg-amber-500/10 px-3 py-2 text-sm text-amber-600\">\n <AlertCircle size={14} />\n {tr(\n 'sandbox.detail.scriptRunner.notRunning',\n 'The sandbox must be running to execute a script.'\n )}\n </div>\n )}\n\n <div className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <select\n value={interpreter}\n onChange={(e) => setInterpreter(e.target.value as (typeof INTERPRETERS)[number])}\n className=\"rounded-lg border bg-bg-surface px-2 py-1 font-mono text-xs scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {INTERPRETERS.map((i) => (\n <option key={i} value={i}>\n {i}\n </option>\n ))}\n </select>\n <input\n value={label}\n onChange={(e) => setLabel(e.target.value)}\n placeholder={tr('sandbox.detail.scriptRunner.labelPlaceholder', 'Label (optional)')}\n className=\"flex-1 rounded-lg border bg-bg-surface px-2 py-1 text-xs\"\n />\n </div>\n <textarea\n value={script}\n onChange={(e) => setScript(e.target.value)}\n spellCheck={false}\n placeholder={tr(\n 'sandbox.detail.scriptRunner.placeholder',\n '# Paste the AI-generated script here, then Run to test it in the sandbox'\n )}\n className=\"h-40 w-full resize-y rounded-lg border bg-bg-surface p-3 font-mono text-xs\"\n />\n <div className=\"flex justify-end\">\n <Button\n onClick={() => void handleRun()}\n disabled={!isRunning || running || !script.trim()}\n >\n {running ? <Loader2 size={14} className=\"animate-spin\" /> : <Play size={14} />}\n {tr('sandbox.detail.scriptRunner.run', 'Run in sandbox')}\n </Button>\n </div>\n {runError && (\n <div className=\"flex items-center gap-2 rounded-lg bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text\">\n <XCircle size={14} />\n {runError.message}\n </div>\n )}\n </div>\n\n {activeRun && (\n <div className=\"mt-4\">\n <RunOutput run={activeRun} tr={tr} />\n </div>\n )}\n\n {runs.length > 0 && (\n <div className=\"mt-4\">\n <h4 className=\"mb-2 text-xs font-semibold uppercase text-text-secondary\">\n {tr('sandbox.detail.scriptRunner.history', 'Run history')}\n </h4>\n <ul className=\"divide-y rounded-lg border\">\n {runs.map((r) => (\n <li key={r.id} className=\"flex items-center gap-3 px-3 py-2 text-sm\">\n <RunStatusBadge status={r.status} exitCode={r.exitCode} tr={tr} />\n <button\n type=\"button\"\n onClick={() => setActiveRunId(r.id)}\n className=\"min-w-0 flex-1 truncate text-left hover:underline\"\n >\n <span className=\"font-mono text-xs\">{r.interpreter}</span>\n {r.label ? ` · ${r.label}` : ''}\n <span className=\"ml-1 text-xs text-text-secondary\">\n {new Date(r.createdAt as unknown as string).toLocaleString()}\n </span>\n </button>\n {r.promotedAt ? (\n <Badge className=\"shrink-0 gap-1 bg-green-500/10 text-green-600\">\n <ShieldCheck size={12} />\n {tr('sandbox.detail.scriptRunner.promoted', 'Promoted')}\n </Badge>\n ) : (\n r.status === 'succeeded' && (\n <Button\n variant=\"outline\"\n onClick={() => void handlePromote(r.id)}\n disabled={promoting}\n className=\"shrink-0\"\n title={tr(\n 'sandbox.detail.scriptRunner.promoteTitle',\n 'Sign off this reviewed run for the real target'\n )}\n >\n <ArrowUpCircle size={12} />\n {tr('sandbox.detail.scriptRunner.promote', 'Promote')}\n </Button>\n )\n )}\n </li>\n ))}\n </ul>\n </div>\n )}\n </CardContent>\n </Card>\n );\n}\n\nfunction RunStatusBadge({\n status,\n exitCode,\n tr,\n}: {\n status: string;\n exitCode?: number | null;\n tr: (k: string, f: string) => string;\n}): React.ReactElement {\n if (status === 'running') {\n return (\n <Badge className=\"gap-1 bg-blue-500/10 text-blue-600\">\n <Loader2 size={12} className=\"animate-spin\" />\n {tr('sandbox.detail.scriptRunner.status.running', 'Running')}\n </Badge>\n );\n }\n if (status === 'succeeded') {\n return (\n <Badge className=\"gap-1 bg-green-500/10 text-green-600\">\n <CheckCircle2 size={12} />\n {tr('sandbox.detail.scriptRunner.status.succeeded', 'Succeeded')}\n </Badge>\n );\n }\n return (\n <Badge className=\"gap-1 bg-status-error-bg/10 text-status-error-text\">\n <XCircle size={12} />\n {status === 'error'\n ? tr('sandbox.detail.scriptRunner.status.error', 'Error')\n : `${tr('sandbox.detail.scriptRunner.status.failed', 'Failed')}${\n exitCode != null ? ` (${exitCode})` : ''\n }`}\n </Badge>\n );\n}\n\nfunction RunOutput({\n run,\n tr,\n}: {\n run: SandboxScriptRunFieldsFragment;\n tr: (k: string, f: string) => string;\n}): React.ReactElement {\n return (\n <div className=\"rounded-lg border bg-bg-sunken/30 p-3\">\n <div className=\"mb-2 flex items-center gap-2 text-xs text-text-secondary\">\n <RunStatusBadge status={run.status} exitCode={run.exitCode} tr={tr} />\n {run.durationMs != null && <span>{run.durationMs} ms</span>}\n </div>\n {run.stdout && (\n <pre className=\"max-h-64 overflow-auto whitespace-pre-wrap break-words font-mono text-xs\">\n {run.stdout}\n </pre>\n )}\n {run.stderr && (\n <pre className=\"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-xs text-status-error-text\">\n {run.stderr}\n </pre>\n )}\n {!run.stdout && !run.stderr && (\n <p className=\"text-xs text-text-secondary\">\n {tr('sandbox.detail.scriptRunner.noOutput', '(no output)')}\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAuBA,IAAMA,IAAe;CAAC;CAAQ;CAAM;CAAU;AAAM;AAEpD,SAASC,EAAW,GAA4B;CAC9C,IAAI,CAACC,GAAK,OAAO;CACjB,IAAI;EAEF,OAAO,KAAKA,CAAG;CACjB,QAAQ;EACN,OAAOA;CACT;AACF;AAQA,SAAgBC,EAAyB,EACvC,YACA,kBAIqB;CACrB,IAAM,EAAE,SAAMC,EAAQ,GAChBC,KAAM,GAAa,MAA6BC,EAAcC,GAAGC,GAAKC,CAAQ,GAC9E,CAACC,GAAcC,KAAmBC,EAAgB,GAElD,CAACC,GAAQC,KAAaC,QAAuBd,EAAWS,EAAa,IAAI,QAAQ,CAAC,CAAC,GACnF,CAACM,GAAaC,KAAkBF,EAAwC,MAAM,GAC9E,CAACG,GAAOC,KAAYJ,EAAS,EAAE,GAC/B,CAACK,GAAaC,KAAkBN,EAAwB,IAAI,GAE5DO,IAAYC,EAAQ,WAAW,WAE/B,EAAE,SAAM,eAAYC,EA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CAACA,EAAI,UACnB,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAzD,EAAG,wCAAwC,aAAa;GACxD,CAAA;EAEF;;AAET"}
|
|
1
|
+
{"version":3,"file":"SandboxScriptRunnerPanel.js","names":["INTERPRETERS","decodeSeed","raw","SandboxScriptRunnerPanel","useI18n","tr","tWithFallback","t","key","fallback","searchParams","setSearchParams","useSearchParams","script","setScript","useState","interpreter","setInterpreter","label","setLabel","activeRunId","setActiveRunId","isRunning","sandbox","useSandboxScriptRunsQuery","workspaceId","runScript","running","runError","useRunSandboxScriptMutation","promote","promoting","usePromoteSandboxScriptRunMutation","runs","useMemo","data","activeRun","r","next","handleRun","useCallback","created","refetch","handlePromote","runId","Card","CardContent","Terminal","AlertCircle","ThemedSelect","i","Button","Loader2","Play","XCircle","RunOutput","RunStatusBadge","Badge","ShieldCheck","ArrowUpCircle","status","CheckCircle2","exitCode","run"],"sources":["../../../src/sandbox/components/SandboxScriptRunnerPanel.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useMemo } from 'react';\nimport { useSearchParams } from 'react-router';\nimport {\n Terminal,\n Play,\n Loader2,\n CheckCircle2,\n XCircle,\n AlertCircle,\n ArrowUpCircle,\n ShieldCheck,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { Button, Card, CardContent, Badge } from './ui';\nimport { tWithFallback } from '../utils/i18n';\nimport {\n useSandboxScriptRunsQuery,\n useRunSandboxScriptMutation,\n usePromoteSandboxScriptRunMutation,\n type SandboxScriptRunFieldsFragment,\n} from '../../generated/wspace-operations';\nimport { ThemedSelect } from '@burdenoff/fe-libs/ui';\n\nconst INTERPRETERS = ['bash', 'sh', 'python', 'node'] as const;\n\nfunction decodeSeed(raw: string | null): string {\n if (!raw) return '';\n try {\n // Accept base64 (used by deep-links, e.g. the assistant's \"Send to Sandbox\") or plain text.\n return atob(raw);\n } catch {\n return raw;\n }\n}\n\n/**\n * SandboxScriptRunnerPanel — the sandbox-safe-execution review surface. Paste (or deep-link in via\n * `?script=<base64>`) an AI-generated script, run it inside this isolated sandbox, and review the\n * captured stdout/stderr/exit code. Each run is recorded; a run that succeeded can be promoted to the\n * real target, which stamps the sign-off onto the same record. The sandbox must be running.\n */\nexport function SandboxScriptRunnerPanel({\n sandbox,\n workspaceId,\n}: {\n sandbox: { id: string; status?: string | null };\n workspaceId: string;\n}): React.ReactElement {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => tWithFallback(t, key, fallback);\n const [searchParams, setSearchParams] = useSearchParams();\n\n const [script, setScript] = useState<string>(() => decodeSeed(searchParams.get('script')));\n const [interpreter, setInterpreter] = useState<(typeof INTERPRETERS)[number]>('bash');\n const [label, setLabel] = useState('');\n const [activeRunId, setActiveRunId] = useState<string | null>(null);\n\n const isRunning = sandbox.status === 'RUNNING';\n\n const { data, refetch } = useSandboxScriptRunsQuery({\n variables: { sandboxId: sandbox.id, context: { workspaceId } },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n });\n const [runScript, { loading: running, error: runError }] = useRunSandboxScriptMutation();\n const [promote, { loading: promoting }] = usePromoteSandboxScriptRunMutation();\n\n const runs = useMemo<SandboxScriptRunFieldsFragment[]>(\n () => data?.sandboxScriptRuns ?? [],\n [data]\n );\n const activeRun = runs.find((r) => r.id === activeRunId) ?? runs[0] ?? null;\n\n // One-shot: if we were deep-linked with a script, clear it from the URL so a refresh doesn't re-seed.\n useEffect(() => {\n if (searchParams.get('script')) {\n const next = new URLSearchParams(searchParams);\n next.delete('script');\n setSearchParams(next, { replace: true });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleRun = useCallback(async () => {\n if (!script.trim() || !isRunning) return;\n try {\n const res = await runScript({\n variables: {\n input: {\n sandboxId: sandbox.id,\n script,\n interpreter,\n label: label.trim() || null,\n context: { workspaceId },\n },\n },\n });\n const created = res.data?.runSandboxScript;\n if (created) setActiveRunId(created.id);\n await refetch();\n } catch {\n // surfaced via runError below\n }\n }, [script, isRunning, runScript, sandbox.id, interpreter, label, workspaceId, refetch]);\n\n const handlePromote = useCallback(\n async (runId: string) => {\n try {\n await promote({ variables: { id: runId, note: null, context: { workspaceId } } });\n await refetch();\n } catch {\n // surfaced inline on the run row via refetch\n }\n },\n [promote, workspaceId, refetch]\n );\n\n return (\n <Card>\n <CardContent className=\"p-5\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"flex items-center gap-2 font-semibold\">\n <div className=\"rounded-lg bg-action-primary-bg/10 p-1.5\">\n <Terminal size={14} className=\"text-primary\" />\n </div>\n {tr('sandbox.detail.scriptRunner.title', 'Script Runner')}\n </h3>\n </div>\n <p className=\"mb-3 text-sm text-text-secondary\">\n {tr(\n 'sandbox.detail.scriptRunner.subtitle',\n 'Run an AI-generated script in this isolated sandbox and review the output before promoting it to the real target.'\n )}\n </p>\n\n {!isRunning && (\n <div className=\"mb-3 flex items-center gap-2 rounded-lg bg-amber-500/10 px-3 py-2 text-sm text-amber-600\">\n <AlertCircle size={14} />\n {tr(\n 'sandbox.detail.scriptRunner.notRunning',\n 'The sandbox must be running to execute a script.'\n )}\n </div>\n )}\n\n <div className=\"space-y-3\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <ThemedSelect\n value={interpreter}\n onChange={(e) => setInterpreter(e.target.value as (typeof INTERPRETERS)[number])}\n className=\"rounded-lg border bg-bg-surface px-2 py-1 font-mono text-xs scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {INTERPRETERS.map((i) => (\n <option key={i} value={i}>\n {i}\n </option>\n ))}\n </ThemedSelect>\n <input\n value={label}\n onChange={(e) => setLabel(e.target.value)}\n placeholder={tr('sandbox.detail.scriptRunner.labelPlaceholder', 'Label (optional)')}\n className=\"flex-1 rounded-lg border bg-bg-surface px-2 py-1 text-xs\"\n />\n </div>\n <textarea\n value={script}\n onChange={(e) => setScript(e.target.value)}\n spellCheck={false}\n placeholder={tr(\n 'sandbox.detail.scriptRunner.placeholder',\n '# Paste the AI-generated script here, then Run to test it in the sandbox'\n )}\n className=\"h-40 w-full resize-y rounded-lg border bg-bg-surface p-3 font-mono text-xs\"\n />\n <div className=\"flex justify-end\">\n <Button\n onClick={() => void handleRun()}\n disabled={!isRunning || running || !script.trim()}\n >\n {running ? <Loader2 size={14} className=\"animate-spin\" /> : <Play size={14} />}\n {tr('sandbox.detail.scriptRunner.run', 'Run in sandbox')}\n </Button>\n </div>\n {runError && (\n <div className=\"flex items-center gap-2 rounded-lg bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text\">\n <XCircle size={14} />\n {runError.message}\n </div>\n )}\n </div>\n\n {activeRun && (\n <div className=\"mt-4\">\n <RunOutput run={activeRun} tr={tr} />\n </div>\n )}\n\n {runs.length > 0 && (\n <div className=\"mt-4\">\n <h4 className=\"mb-2 text-xs font-semibold uppercase text-text-secondary\">\n {tr('sandbox.detail.scriptRunner.history', 'Run history')}\n </h4>\n <ul className=\"divide-y rounded-lg border\">\n {runs.map((r) => (\n <li key={r.id} className=\"flex items-center gap-3 px-3 py-2 text-sm\">\n <RunStatusBadge status={r.status} exitCode={r.exitCode} tr={tr} />\n <button\n type=\"button\"\n onClick={() => setActiveRunId(r.id)}\n className=\"min-w-0 flex-1 truncate text-left hover:underline\"\n >\n <span className=\"font-mono text-xs\">{r.interpreter}</span>\n {r.label ? ` · ${r.label}` : ''}\n <span className=\"ml-1 text-xs text-text-secondary\">\n {new Date(r.createdAt as unknown as string).toLocaleString()}\n </span>\n </button>\n {r.promotedAt ? (\n <Badge className=\"shrink-0 gap-1 bg-green-500/10 text-green-600\">\n <ShieldCheck size={12} />\n {tr('sandbox.detail.scriptRunner.promoted', 'Promoted')}\n </Badge>\n ) : (\n r.status === 'succeeded' && (\n <Button\n variant=\"outline\"\n onClick={() => void handlePromote(r.id)}\n disabled={promoting}\n className=\"shrink-0\"\n title={tr(\n 'sandbox.detail.scriptRunner.promoteTitle',\n 'Sign off this reviewed run for the real target'\n )}\n >\n <ArrowUpCircle size={12} />\n {tr('sandbox.detail.scriptRunner.promote', 'Promote')}\n </Button>\n )\n )}\n </li>\n ))}\n </ul>\n </div>\n )}\n </CardContent>\n </Card>\n );\n}\n\nfunction RunStatusBadge({\n status,\n exitCode,\n tr,\n}: {\n status: string;\n exitCode?: number | null;\n tr: (k: string, f: string) => string;\n}): React.ReactElement {\n if (status === 'running') {\n return (\n <Badge className=\"gap-1 bg-blue-500/10 text-blue-600\">\n <Loader2 size={12} className=\"animate-spin\" />\n {tr('sandbox.detail.scriptRunner.status.running', 'Running')}\n </Badge>\n );\n }\n if (status === 'succeeded') {\n return (\n <Badge className=\"gap-1 bg-green-500/10 text-green-600\">\n <CheckCircle2 size={12} />\n {tr('sandbox.detail.scriptRunner.status.succeeded', 'Succeeded')}\n </Badge>\n );\n }\n return (\n <Badge className=\"gap-1 bg-status-error-bg/10 text-status-error-text\">\n <XCircle size={12} />\n {status === 'error'\n ? tr('sandbox.detail.scriptRunner.status.error', 'Error')\n : `${tr('sandbox.detail.scriptRunner.status.failed', 'Failed')}${\n exitCode != null ? ` (${exitCode})` : ''\n }`}\n </Badge>\n );\n}\n\nfunction RunOutput({\n run,\n tr,\n}: {\n run: SandboxScriptRunFieldsFragment;\n tr: (k: string, f: string) => string;\n}): React.ReactElement {\n return (\n <div className=\"rounded-lg border bg-bg-sunken/30 p-3\">\n <div className=\"mb-2 flex items-center gap-2 text-xs text-text-secondary\">\n <RunStatusBadge status={run.status} exitCode={run.exitCode} tr={tr} />\n {run.durationMs != null && <span>{run.durationMs} ms</span>}\n </div>\n {run.stdout && (\n <pre className=\"max-h-64 overflow-auto whitespace-pre-wrap break-words font-mono text-xs\">\n {run.stdout}\n </pre>\n )}\n {run.stderr && (\n <pre className=\"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-xs text-status-error-text\">\n {run.stderr}\n </pre>\n )}\n {!run.stdout && !run.stderr && (\n <p className=\"text-xs text-text-secondary\">\n {tr('sandbox.detail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BAACoD,GAAD;EAAO,WAAU;EAAjB,UAAA,CACE,kBAACH,GAAD,EAAS,MAAM,GAAK,CAAA,GACnBM,MAAW,UACRvD,EAAG,4CAA4C,OAAO,IACtD,GAAGA,EAAG,6CAA6C,QAAQ,IACzDyD,KAAY,OAA0B,KAAnB,KAAKA,EAAS,IAElC;;AAEX;AAEA,SAASP,EAAU,EACjB,QACA,SAIqB;CACrB,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACC,GAAD;KAAgB,QAAQO,EAAI;KAAQ,UAAUA,EAAI;KAAc;IAAK,CAAA,GACpEA,EAAI,cAAc,QAAQ,kBAAC,QAAD,EAAA,UAAA,CAAOA,EAAI,YAAW,KAAS,EAAA,CAAA,CACvD;;GACJA,EAAI,UACH,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAA,EAAI;GACF,CAAA;GAENA,EAAI,UACH,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAA,EAAI;GACF,CAAA;GAEN,CAACA,EAAI,UAAU,CAACA,EAAI,UACnB,kBAAC,KAAD;IAAG,WAAU;IACV,UAAA1D,EAAG,wCAAwC,aAAa;GACxD,CAAA;EAEF;;AAET"}
|
|
@@ -18,9 +18,9 @@ import { AlertCircle as oe, ArrowLeft as se, CheckCircle2 as k, Clock as ce, Cog
|
|
|
18
18
|
import { useParams as he } from "react-router";
|
|
19
19
|
import { useI18n as R } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
20
20
|
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
21
|
-
import { IllustratedEmptyState as ge, NextSteps as _e, PagePurpose as ve } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { IllustratedEmptyState as ge, NextSteps as _e, PagePurpose as ve, ThemedSelect as H } from "@burdenoff/fe-libs/ui";
|
|
22
22
|
// src/sandbox/pages/SandboxDetailPage.tsx
|
|
23
|
-
function
|
|
23
|
+
function U(e) {
|
|
24
24
|
return new Date(e).toLocaleString(void 0, {
|
|
25
25
|
year: "numeric",
|
|
26
26
|
month: "short",
|
|
@@ -40,7 +40,7 @@ function be(e) {
|
|
|
40
40
|
let n = Math.floor(t / 36e5), r = Math.floor(t % 36e5 / 6e4);
|
|
41
41
|
return n > 0 ? `${n}h ${r}m remaining` : `${r}m remaining`;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function W({ isCopied: e, onCopy: t, ariaLabel: n }) {
|
|
44
44
|
return /* @__PURE__ */ B("button", {
|
|
45
45
|
type: "button",
|
|
46
46
|
onClick: t,
|
|
@@ -55,8 +55,8 @@ function U({ isCopied: e, onCopy: t, ariaLabel: n }) {
|
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return /* @__PURE__ */ B(
|
|
58
|
+
function G({ value: e, field: t, copiedField: n, onCopy: r, ariaLabel: i }) {
|
|
59
|
+
return /* @__PURE__ */ B(W, {
|
|
60
60
|
isCopied: n === t,
|
|
61
61
|
onCopy: () => r(e, t),
|
|
62
62
|
ariaLabel: i
|
|
@@ -68,8 +68,8 @@ function xe({ enabled: e, collapsedHeight: t, children: n }) {
|
|
|
68
68
|
children: n
|
|
69
69
|
}) : /* @__PURE__ */ B(z, { children: n });
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
let { sandboxId: s } = he(), { basePath: y = "/", navigate: T, workspaceId: E } = g(), { t: D } = R(), [k, A] = O(null), [j,
|
|
71
|
+
function K() {
|
|
72
|
+
let { sandboxId: s } = he(), { basePath: y = "/", navigate: T, workspaceId: E } = g(), { t: D } = R(), [k, A] = O(null), [j, H] = O(!1), [W, K] = O(!1), { data: Ce, loading: we, refetch: q } = re({
|
|
73
73
|
variables: {
|
|
74
74
|
context: { workspaceId: E },
|
|
75
75
|
id: s
|
|
@@ -113,7 +113,7 @@ function G() {
|
|
|
113
113
|
let ke = Y.status === "RUNNING" || Y.status === "PROVISIONING" || Y.status === "PENDING", Q = Y.status === "RUNNING", Ae = Y.status === "STOPPED" || Y.status === "ERROR" || Y.status === "EXPIRED" || Y.status === "FAILED", je = Y.status === "RUNNING", Me = [
|
|
114
114
|
...je ? [{
|
|
115
115
|
label: v(D, "sandbox.detail.actions.extendTtl", "Extend TTL"),
|
|
116
|
-
onSelect: () =>
|
|
116
|
+
onSelect: () => H(!0),
|
|
117
117
|
icon: /* @__PURE__ */ B(L, { size: 16 })
|
|
118
118
|
}] : [],
|
|
119
119
|
...Q ? [{
|
|
@@ -155,7 +155,7 @@ function G() {
|
|
|
155
155
|
label: v(D, "sandbox.detail.nextSteps.extendTtl.label", "Extend the time-to-live"),
|
|
156
156
|
description: v(D, "sandbox.detail.nextSteps.extendTtl.desc", "Keep this sandbox alive longer before it auto-expires."),
|
|
157
157
|
icon: /* @__PURE__ */ B(L, { size: 16 }),
|
|
158
|
-
onClick: () =>
|
|
158
|
+
onClick: () => H(!0)
|
|
159
159
|
} : null,
|
|
160
160
|
Q ? {
|
|
161
161
|
id: "stop",
|
|
@@ -206,7 +206,7 @@ function G() {
|
|
|
206
206
|
className: "text-sm text-text-secondary font-mono truncate",
|
|
207
207
|
children: Y.id
|
|
208
208
|
}),
|
|
209
|
-
/* @__PURE__ */ B(
|
|
209
|
+
/* @__PURE__ */ B(G, {
|
|
210
210
|
value: Y.id,
|
|
211
211
|
field: "id",
|
|
212
212
|
copiedField: k,
|
|
@@ -235,7 +235,7 @@ function G() {
|
|
|
235
235
|
children: [
|
|
236
236
|
/* @__PURE__ */ B(N, { size: 14 }),
|
|
237
237
|
Y.network.internalUrl,
|
|
238
|
-
/* @__PURE__ */ B(
|
|
238
|
+
/* @__PURE__ */ B(G, {
|
|
239
239
|
value: Y.network.internalUrl,
|
|
240
240
|
field: "internalUrl",
|
|
241
241
|
copiedField: k,
|
|
@@ -250,7 +250,7 @@ function G() {
|
|
|
250
250
|
children: /* @__PURE__ */ B(d, {
|
|
251
251
|
expiresAt: Y.expiresAt,
|
|
252
252
|
onExpired: () => q(),
|
|
253
|
-
onExtend: () =>
|
|
253
|
+
onExtend: () => H(!0)
|
|
254
254
|
})
|
|
255
255
|
})
|
|
256
256
|
]
|
|
@@ -330,7 +330,7 @@ function G() {
|
|
|
330
330
|
children: [/* @__PURE__ */ B("span", {
|
|
331
331
|
className: "text-sm font-mono",
|
|
332
332
|
children: Y.crdName
|
|
333
|
-
}), /* @__PURE__ */ B(
|
|
333
|
+
}), /* @__PURE__ */ B(G, {
|
|
334
334
|
value: Y.crdName,
|
|
335
335
|
field: "crdName",
|
|
336
336
|
copiedField: k,
|
|
@@ -349,7 +349,7 @@ function G() {
|
|
|
349
349
|
children: [/* @__PURE__ */ B("span", {
|
|
350
350
|
className: "text-sm font-mono",
|
|
351
351
|
children: Y.podName
|
|
352
|
-
}), /* @__PURE__ */ B(
|
|
352
|
+
}), /* @__PURE__ */ B(G, {
|
|
353
353
|
value: Y.podName,
|
|
354
354
|
field: "podName",
|
|
355
355
|
copiedField: k,
|
|
@@ -389,7 +389,7 @@ function G() {
|
|
|
389
389
|
children: [/* @__PURE__ */ B("span", {
|
|
390
390
|
className: "text-sm font-mono",
|
|
391
391
|
children: Y.network.serviceName
|
|
392
|
-
}), /* @__PURE__ */ B(
|
|
392
|
+
}), /* @__PURE__ */ B(G, {
|
|
393
393
|
value: Y.network.serviceName,
|
|
394
394
|
field: "serviceName",
|
|
395
395
|
copiedField: k,
|
|
@@ -408,7 +408,7 @@ function G() {
|
|
|
408
408
|
children: [/* @__PURE__ */ B("span", {
|
|
409
409
|
className: "text-sm text-primary font-mono truncate max-w-48",
|
|
410
410
|
children: Y.network.internalUrl
|
|
411
|
-
}), /* @__PURE__ */ B(
|
|
411
|
+
}), /* @__PURE__ */ B(G, {
|
|
412
412
|
value: Y.network.internalUrl,
|
|
413
413
|
field: "internalUrl",
|
|
414
414
|
copiedField: k,
|
|
@@ -434,7 +434,7 @@ function G() {
|
|
|
434
434
|
children: [/* @__PURE__ */ B("span", {
|
|
435
435
|
className: "text-xs text-primary font-mono truncate max-w-40",
|
|
436
436
|
children: n
|
|
437
|
-
}), /* @__PURE__ */ B(
|
|
437
|
+
}), /* @__PURE__ */ B(G, {
|
|
438
438
|
value: n,
|
|
439
439
|
field: `container-${t}`,
|
|
440
440
|
copiedField: k,
|
|
@@ -494,7 +494,7 @@ function G() {
|
|
|
494
494
|
children: v(D, "sandbox.detail.cards.lifecycle.created", "Created")
|
|
495
495
|
}), /* @__PURE__ */ B("span", {
|
|
496
496
|
className: "text-sm",
|
|
497
|
-
children:
|
|
497
|
+
children: U(Y.createdAt)
|
|
498
498
|
})]
|
|
499
499
|
}),
|
|
500
500
|
/* @__PURE__ */ V("div", {
|
|
@@ -504,7 +504,7 @@ function G() {
|
|
|
504
504
|
children: v(D, "sandbox.detail.cards.lifecycle.updated", "Updated")
|
|
505
505
|
}), /* @__PURE__ */ B("span", {
|
|
506
506
|
className: "text-sm",
|
|
507
|
-
children:
|
|
507
|
+
children: U(Y.updatedAt)
|
|
508
508
|
})]
|
|
509
509
|
}),
|
|
510
510
|
Y.stoppedAt && /* @__PURE__ */ V("div", {
|
|
@@ -514,7 +514,7 @@ function G() {
|
|
|
514
514
|
children: v(D, "sandbox.detail.cards.lifecycle.stopped", "Stopped")
|
|
515
515
|
}), /* @__PURE__ */ B("span", {
|
|
516
516
|
className: "text-sm",
|
|
517
|
-
children:
|
|
517
|
+
children: U(Y.stoppedAt)
|
|
518
518
|
})]
|
|
519
519
|
})
|
|
520
520
|
]
|
|
@@ -786,9 +786,9 @@ function G() {
|
|
|
786
786
|
}),
|
|
787
787
|
Y.expiresAt && /* @__PURE__ */ B(f, {
|
|
788
788
|
isOpen: j,
|
|
789
|
-
onClose: () =>
|
|
789
|
+
onClose: () => H(!1),
|
|
790
790
|
currentExpiresAt: Y.expiresAt,
|
|
791
|
-
isLoading:
|
|
791
|
+
isLoading: W,
|
|
792
792
|
onExtend: (e) => {
|
|
793
793
|
K(!0), Ee({ variables: {
|
|
794
794
|
context: { workspaceId: E },
|
|
@@ -804,7 +804,7 @@ function G() {
|
|
|
804
804
|
}).catch((e) => {
|
|
805
805
|
console.error("Failed to extend TTL:", e);
|
|
806
806
|
}).finally(() => {
|
|
807
|
-
K(!1),
|
|
807
|
+
K(!1), H(!1);
|
|
808
808
|
});
|
|
809
809
|
}
|
|
810
810
|
})
|
|
@@ -856,7 +856,7 @@ function Se({ sandbox: e, workspaceId: n }) {
|
|
|
856
856
|
}), /* @__PURE__ */ V("div", {
|
|
857
857
|
className: "flex items-center gap-2",
|
|
858
858
|
children: [
|
|
859
|
-
e.containers && e.containers.length > 1 && /* @__PURE__ */ B(
|
|
859
|
+
e.containers && e.containers.length > 1 && /* @__PURE__ */ B(H, {
|
|
860
860
|
value: i,
|
|
861
861
|
onChange: (e) => a(e.target.value),
|
|
862
862
|
className: "px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
@@ -865,7 +865,7 @@ function Se({ sandbox: e, workspaceId: n }) {
|
|
|
865
865
|
children: e.name
|
|
866
866
|
}, e.name))
|
|
867
867
|
}),
|
|
868
|
-
/* @__PURE__ */ V(
|
|
868
|
+
/* @__PURE__ */ V(H, {
|
|
869
869
|
value: s,
|
|
870
870
|
onChange: (e) => c(Number(e.target.value)),
|
|
871
871
|
className: "px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
@@ -948,6 +948,6 @@ function Se({ sandbox: e, workspaceId: n }) {
|
|
|
948
948
|
})
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
|
-
export {
|
|
951
|
+
export { K as SandboxDetailPage };
|
|
952
952
|
|
|
953
953
|
//# sourceMappingURL=SandboxDetailPage.js.map
|