@burdenoff/microfe-sandbox 2026.624.3 → 2026.625.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,25 @@
1
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 { StatusBadge as o } from "../components/StatusBadge.js";
5
- import { ResourceDisplay as s } from "../components/ResourceDisplay.js";
6
- import { SandboxTypeIcon as c } from "../components/SandboxTypeIcon.js";
7
- import { CountdownTimer as l } from "../components/CountdownTimer.js";
8
- import { useSandboxEvents as u } from "../utils/sandboxEvents.js";
9
- import { PageLayout as d } from "../components/PageLayout.js";
10
- import { useDeleteSandboxMutation as f, useExtendSandboxTtlMutation as p, useGetSandboxLogsLazyQuery as m, useGetSandboxQuery as h, useOnSandboxStatusChangedSubscription as g, useStopSandboxMutation as _ } from "../../generated/wspace-operations.js";
11
- import { isNative as v, nativeCopyText as y, nativeImpact as b, nativeNotify as x, nativeToast as S } from "../../utils/nativeBridge.js";
12
- import { ExtendTTLModal as C } from "../components/ExtendTTLModal.js";
13
- import { SandboxActivityTab as w } from "../components/SandboxActivityTab.js";
14
- import { SandboxAgentAppPanel as ee } from "../components/SandboxAgentAppPanel.js";
15
- import { SandboxScriptRunnerPanel as te } from "../components/SandboxScriptRunnerPanel.js";
16
- import { useCallback as T, useEffect as E, useRef as D, useState as O } from "react";
17
- import { AlertCircle as k, ArrowLeft as ne, CheckCircle2 as A, Clock as re, Cog as ie, Container as ae, Copy as j, Database as oe, Download as M, Info as N, Network as se, Play as P, RefreshCw as F, Shield as I, StopCircle as L, Terminal as R, Timer as z, Trash2 as ce } from "lucide-react";
18
- import { useParams as le } from "react-router-dom";
19
- import { useI18n as B } from "@burdenoff/fe-libs/shared/providers/shell";
20
- import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
2
+ import { Badge as t, Button as n, CTAOverflowMenu as r, Card as i, CardContent as a, EmphasisPanel as o, GlassCard as s, ShowMore as c } from "../components/ui.js";
3
+ import { tWithFallback as l } from "../utils/i18n.js";
4
+ import { StatusBadge as u } from "../components/StatusBadge.js";
5
+ import { ResourceDisplay as d } from "../components/ResourceDisplay.js";
6
+ import { SandboxTypeIcon as f } from "../components/SandboxTypeIcon.js";
7
+ import { CountdownTimer as p } from "../components/CountdownTimer.js";
8
+ import { useSandboxEvents as m } from "../utils/sandboxEvents.js";
9
+ import { PageLayout as h } from "../components/PageLayout.js";
10
+ import { useDeleteSandboxMutation as g, useExtendSandboxTtlMutation as _, useGetSandboxLogsLazyQuery as v, useGetSandboxQuery as y, useOnSandboxStatusChangedSubscription as ee, useStopSandboxMutation as te } from "../../generated/wspace-operations.js";
11
+ import { isNative as b, nativeCopyText as x, nativeImpact as S, nativeNotify as C, nativeToast as w } from "../../utils/nativeBridge.js";
12
+ import { ExtendTTLModal as ne } from "../components/ExtendTTLModal.js";
13
+ import { SandboxActivityTab as T } from "../components/SandboxActivityTab.js";
14
+ import { SandboxAgentAppPanel as re } from "../components/SandboxAgentAppPanel.js";
15
+ import { SandboxScriptRunnerPanel as ie } from "../components/SandboxScriptRunnerPanel.js";
16
+ import { useCallback as E, useEffect as D, useRef as O, useState as k } from "react";
17
+ import { AlertCircle as ae, ArrowLeft as oe, CheckCircle2 as A, Clock as se, Cog as ce, Container as le, Copy as j, Database as M, Download as N, Info as P, Network as ue, Play as de, RefreshCw as F, Shield as fe, StopCircle as I, Terminal as L, Timer as R, Trash2 as z } from "lucide-react";
18
+ import { useParams as B } from "react-router-dom";
19
+ import { useI18n as V } from "@burdenoff/fe-libs/shared/providers/shell";
20
+ import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
21
21
  //#region src/sandbox/pages/SandboxDetailPage.tsx
22
- function W(e) {
22
+ function G(e) {
23
23
  return new Date(e).toLocaleString(void 0, {
24
24
  year: "numeric",
25
25
  month: "short",
@@ -28,687 +28,737 @@ function W(e) {
28
28
  minute: "2-digit"
29
29
  });
30
30
  }
31
- function G(e) {
31
+ function K(e) {
32
32
  let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60);
33
33
  return t > 0 ? `${t}h ${n}m` : `${n}m`;
34
34
  }
35
- function ue(e) {
35
+ function pe(e) {
36
36
  if (!e) return null;
37
37
  let t = new Date(e).getTime() - Date.now();
38
38
  if (t <= 0) return "Expired";
39
39
  let n = Math.floor(t / 36e5), r = Math.floor(t % 36e5 / 6e4);
40
40
  return n > 0 ? `${n}h ${r}m remaining` : `${r}m remaining`;
41
41
  }
42
- function K({ isCopied: e, onCopy: t, ariaLabel: n }) {
43
- return /* @__PURE__ */ H("button", {
42
+ function q({ isCopied: e, onCopy: t, ariaLabel: n }) {
43
+ return /* @__PURE__ */ U("button", {
44
44
  type: "button",
45
45
  onClick: t,
46
46
  className: "p-1 rounded hover:bg-bg-sunken transition-colors",
47
47
  "aria-label": n,
48
- children: e ? /* @__PURE__ */ H(A, {
48
+ children: e ? /* @__PURE__ */ U(A, {
49
49
  size: 14,
50
50
  className: "text-status-success-text"
51
- }) : /* @__PURE__ */ H(j, {
51
+ }) : /* @__PURE__ */ U(j, {
52
52
  size: 14,
53
53
  className: "text-text-secondary"
54
54
  })
55
55
  });
56
56
  }
57
- function q({ value: e, field: t, copiedField: n, onCopy: r, ariaLabel: i }) {
58
- return /* @__PURE__ */ H(K, {
57
+ function J({ value: e, field: t, copiedField: n, onCopy: r, ariaLabel: i }) {
58
+ return /* @__PURE__ */ U(q, {
59
59
  isCopied: n === t,
60
60
  onCopy: () => r(e, t),
61
61
  ariaLabel: i
62
62
  });
63
63
  }
64
- function J() {
65
- let { sandboxId: m } = le(), { basePath: T = "/", navigate: E, workspaceId: D } = e(), { t: A } = B(), [j, M] = O(null), [R, K] = O(!1), [J, Y] = O(!1), { data: fe, loading: pe, refetch: X } = h({
64
+ function me({ enabled: e, collapsedHeight: t, children: n }) {
65
+ return e ? /* @__PURE__ */ U(c, {
66
+ collapsedHeight: t,
67
+ children: n
68
+ }) : /* @__PURE__ */ U(H, { children: n });
69
+ }
70
+ function Y() {
71
+ let { sandboxId: c } = B(), { basePath: v = "/", navigate: E, workspaceId: D } = e(), { t: O } = V(), [A, j] = k(null), [N, L] = k(!1), [q, Y] = k(!1), { data: ge, loading: _e, refetch: X } = y({
66
72
  variables: {
67
73
  context: { workspaceId: D },
68
- id: m
74
+ id: c
69
75
  },
70
- skip: !m || !D
76
+ skip: !c || !D
71
77
  });
72
- g({
78
+ ee({
73
79
  variables: {
74
80
  workspaceId: D,
75
- sandboxId: m
81
+ sandboxId: c
76
82
  },
77
- skip: !m || !D
83
+ skip: !c || !D
78
84
  });
79
- let [me] = _(), [he] = f(), [ge] = p(), _e = u(), Z = fe?.getSandbox, ve = async (e, t) => {
80
- b("light"), await y(e) ? (x("success"), v() && S(`Copied ${t}`), M(t), setTimeout(() => M(null), 2e3)) : x("error");
85
+ let [ve] = te(), [ye] = g(), [be] = _(), xe = m(), Z = ge?.getSandbox, Se = async (e, t) => {
86
+ S("light"), await x(e) ? (C("success"), b() && w(`Copied ${t}`), j(t), setTimeout(() => j(null), 2e3)) : C("error");
81
87
  }, Q = (e, t) => {
82
- ve(e, t);
83
- }, $ = (e) => a(A, "sandbox.detail.actions.copy.ariaLabel", "Copy {field}", { field: e });
84
- if (pe) return /* @__PURE__ */ H(d, {
88
+ Se(e, t);
89
+ }, $ = (e) => l(O, "sandbox.detail.actions.copy.ariaLabel", "Copy {field}", { field: e });
90
+ if (_e) return /* @__PURE__ */ U(h, {
85
91
  showHeader: !1,
86
- children: /* @__PURE__ */ H("div", {
92
+ children: /* @__PURE__ */ U("div", {
87
93
  className: "flex items-center justify-center h-64",
88
- children: /* @__PURE__ */ H(F, {
94
+ children: /* @__PURE__ */ U(F, {
89
95
  size: 24,
90
96
  className: "animate-spin text-text-secondary"
91
97
  })
92
98
  })
93
99
  });
94
- if (!Z) return /* @__PURE__ */ H(d, {
100
+ if (!Z) return /* @__PURE__ */ U(h, {
95
101
  showHeader: !1,
96
- children: /* @__PURE__ */ U("div", {
102
+ children: /* @__PURE__ */ W("div", {
97
103
  className: "text-center py-16",
98
- children: [/* @__PURE__ */ H("p", {
104
+ children: [/* @__PURE__ */ U("p", {
99
105
  className: "text-text-secondary",
100
- children: a(A, "sandbox.detail.notFound.message", "Sandbox not found")
101
- }), /* @__PURE__ */ H(n, {
106
+ children: l(O, "sandbox.detail.notFound.message", "Sandbox not found")
107
+ }), /* @__PURE__ */ U(n, {
102
108
  variant: "outline",
103
- onClick: () => E?.(T),
109
+ onClick: () => E?.(v),
104
110
  className: "mt-4",
105
- children: a(A, "sandbox.detail.notFound.backButton", "Back to Sandboxes")
111
+ children: l(O, "sandbox.detail.notFound.backButton", "Back to Sandboxes")
106
112
  })]
107
113
  })
108
114
  });
109
- let ye = Z.status === "RUNNING" || Z.status === "PROVISIONING" || Z.status === "PENDING", be = Z.status === "RUNNING", xe = Z.status === "STOPPED" || Z.status === "ERROR" || Z.status === "EXPIRED" || Z.status === "FAILED", Se = Z.status === "RUNNING";
110
- return /* @__PURE__ */ U(d, {
115
+ let Ce = Z.status === "RUNNING" || Z.status === "PROVISIONING" || Z.status === "PENDING", we = Z.status === "RUNNING", Te = Z.status === "STOPPED" || Z.status === "ERROR" || Z.status === "EXPIRED" || Z.status === "FAILED", Ee = [
116
+ ...Z.status === "RUNNING" ? [{
117
+ label: l(O, "sandbox.detail.actions.extendTtl", "Extend TTL"),
118
+ onSelect: () => L(!0),
119
+ icon: /* @__PURE__ */ U(R, { size: 16 })
120
+ }] : [],
121
+ ...we ? [{
122
+ label: l(O, "sandbox.detail.actions.stop", "Stop"),
123
+ onSelect: () => void ve({ variables: {
124
+ context: { workspaceId: D },
125
+ id: Z.id
126
+ } }).then(() => X()),
127
+ icon: /* @__PURE__ */ U(I, { size: 16 })
128
+ }] : [],
129
+ ...Te ? [{
130
+ label: l(O, "sandbox.detail.actions.delete", "Delete"),
131
+ onSelect: () => void ye({ variables: {
132
+ context: { workspaceId: D },
133
+ id: Z.id
134
+ } }).then(() => {
135
+ E?.(v);
136
+ }),
137
+ icon: /* @__PURE__ */ U(z, { size: 16 }),
138
+ intent: "destructive"
139
+ }] : []
140
+ ];
141
+ return /* @__PURE__ */ W(h, {
111
142
  showHeader: !1,
112
143
  children: [
113
- /* @__PURE__ */ U("div", {
114
- className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm",
115
- children: [/* @__PURE__ */ U("div", {
116
- className: "relative z-10",
117
- children: [
118
- /* @__PURE__ */ U("div", {
119
- className: "flex items-center gap-4 mb-4",
120
- children: [/* @__PURE__ */ H("button", {
121
- type: "button",
122
- onClick: () => E?.(T),
123
- className: "p-2.5 hover:bg-accent rounded-lg transition-all duration-200",
124
- "aria-label": a(A, "sandbox.detail.header.back.ariaLabel", "Back to sandboxes"),
125
- children: /* @__PURE__ */ H(ne, { size: 20 })
126
- }), /* @__PURE__ */ U("div", {
127
- className: "flex items-center gap-3 flex-1",
128
- children: [/* @__PURE__ */ H(c, {
129
- type: Z.template,
130
- size: 28
131
- }), /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("h1", {
132
- className: "text-2xl sm:text-3xl font-bold",
133
- children: Z.name
134
- }), /* @__PURE__ */ U("div", {
135
- className: "flex items-center gap-2 mt-1",
136
- children: [
137
- /* @__PURE__ */ H(o, {
138
- status: Z.status,
139
- size: "md"
140
- }),
141
- /* @__PURE__ */ H("span", {
142
- className: "text-sm text-text-secondary font-mono",
143
- children: Z.id
144
- }),
145
- /* @__PURE__ */ H(q, {
146
- value: Z.id,
147
- field: "id",
148
- copiedField: j,
149
- onCopy: Q,
150
- ariaLabel: $("id")
151
- })
152
- ]
153
- })] })]
154
- })]
155
- }),
156
- /* @__PURE__ */ U("div", {
157
- className: "flex flex-wrap gap-2",
144
+ /* @__PURE__ */ W(o, {
145
+ className: "overflow-hidden bg-hero-mesh",
146
+ children: [
147
+ /* @__PURE__ */ W("div", {
148
+ className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
149
+ children: [/* @__PURE__ */ W("div", {
150
+ className: "flex items-center gap-3 min-w-0",
158
151
  children: [
159
- Z.network?.internalUrl && Z.status === "RUNNING" && /* @__PURE__ */ U(t, {
160
- variant: "outline",
161
- className: "gap-1.5 px-3 py-1.5 text-sm",
162
- children: [
163
- /* @__PURE__ */ H(se, { size: 14 }),
164
- Z.network.internalUrl,
165
- /* @__PURE__ */ H(q, {
166
- value: Z.network.internalUrl,
167
- field: "internalUrl",
168
- copiedField: j,
169
- onCopy: Q,
170
- ariaLabel: $("internalUrl")
171
- })
172
- ]
173
- }),
174
- Se && /* @__PURE__ */ U(n, {
175
- variant: "outline",
176
- onClick: () => K(!0),
177
- children: [/* @__PURE__ */ H(z, { size: 16 }), a(A, "sandbox.detail.actions.extendTtl", "Extend TTL")]
178
- }),
179
- be && /* @__PURE__ */ U(n, {
180
- variant: "outline",
181
- className: "text-status-warning-text border-border-default hover:bg-status-warning-bg-subtle",
182
- onClick: () => me({ variables: {
183
- context: { workspaceId: D },
184
- id: Z.id
185
- } }).then(() => X()),
186
- children: [/* @__PURE__ */ H(L, { size: 16 }), a(A, "sandbox.detail.actions.stop", "Stop")]
152
+ /* @__PURE__ */ U("button", {
153
+ type: "button",
154
+ onClick: () => E?.(v),
155
+ className: "flex size-11 flex-shrink-0 items-center justify-center rounded-lg hover:bg-bg-sunken/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border",
156
+ "aria-label": l(O, "sandbox.detail.header.back.ariaLabel", "Back to sandboxes"),
157
+ children: /* @__PURE__ */ U(oe, { size: 20 })
187
158
  }),
188
- xe && /* @__PURE__ */ U(n, {
189
- variant: "outline",
190
- className: "text-status-error-text border-status-error-border/50 hover:bg-status-error-bg/10",
191
- onClick: () => he({ variables: {
192
- context: { workspaceId: D },
193
- id: Z.id
194
- } }).then(() => {
195
- E?.(T);
196
- }),
197
- children: [/* @__PURE__ */ H(ce, { size: 16 }), a(A, "sandbox.detail.actions.delete", "Delete")]
159
+ /* @__PURE__ */ U(f, {
160
+ type: Z.template,
161
+ size: 28
198
162
  }),
199
- /* @__PURE__ */ U(n, {
200
- variant: "ghost",
201
- onClick: () => X(),
202
- children: [/* @__PURE__ */ H(F, { size: 16 }), a(A, "sandbox.detail.actions.refresh", "Refresh")]
163
+ /* @__PURE__ */ W("div", {
164
+ className: "min-w-0",
165
+ children: [/* @__PURE__ */ U("h1", {
166
+ className: "truncate text-2xl sm:text-3xl font-bold",
167
+ children: Z.name
168
+ }), /* @__PURE__ */ W("div", {
169
+ className: "flex flex-wrap items-center gap-2 mt-1",
170
+ children: [
171
+ /* @__PURE__ */ U(u, {
172
+ status: Z.status,
173
+ size: "md"
174
+ }),
175
+ /* @__PURE__ */ U("span", {
176
+ className: "text-sm text-text-secondary font-mono truncate",
177
+ children: Z.id
178
+ }),
179
+ /* @__PURE__ */ U(J, {
180
+ value: Z.id,
181
+ field: "id",
182
+ copiedField: A,
183
+ onCopy: Q,
184
+ ariaLabel: $("id")
185
+ })
186
+ ]
187
+ })]
188
+ })
189
+ ]
190
+ }), /* @__PURE__ */ U(r, {
191
+ className: "flex-shrink-0",
192
+ primary: {
193
+ label: l(O, "sandbox.detail.actions.refresh", "Refresh"),
194
+ onSelect: () => void X(),
195
+ icon: /* @__PURE__ */ U(F, { size: 16 })
196
+ },
197
+ actions: Ee
198
+ })]
199
+ }),
200
+ Z.network?.internalUrl && Z.status === "RUNNING" && /* @__PURE__ */ U("div", {
201
+ className: "mt-4",
202
+ children: /* @__PURE__ */ W(t, {
203
+ variant: "outline",
204
+ className: "gap-1.5 px-3 py-1.5 text-sm border-border-seam",
205
+ children: [
206
+ /* @__PURE__ */ U(ue, { size: 14 }),
207
+ Z.network.internalUrl,
208
+ /* @__PURE__ */ U(J, {
209
+ value: Z.network.internalUrl,
210
+ field: "internalUrl",
211
+ copiedField: A,
212
+ onCopy: Q,
213
+ ariaLabel: $("internalUrl")
203
214
  })
204
215
  ]
205
- }),
206
- Z.status === "RUNNING" && Z.expiresAt && /* @__PURE__ */ H("div", {
207
- className: "mt-4",
208
- children: /* @__PURE__ */ H(l, {
209
- expiresAt: Z.expiresAt,
210
- onExpired: () => X(),
211
- onExtend: () => K(!0)
212
- })
213
216
  })
214
- ]
215
- }), /* @__PURE__ */ H("div", { className: "absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0" })]
217
+ }),
218
+ Z.status === "RUNNING" && Z.expiresAt && /* @__PURE__ */ U("div", {
219
+ className: "mt-4",
220
+ children: /* @__PURE__ */ U(p, {
221
+ expiresAt: Z.expiresAt,
222
+ onExpired: () => X(),
223
+ onExtend: () => L(!0)
224
+ })
225
+ })
226
+ ]
216
227
  }),
217
- Z.description && /* @__PURE__ */ H(r, { children: /* @__PURE__ */ H(i, {
218
- className: "p-5",
219
- children: /* @__PURE__ */ U("div", {
220
- className: "flex items-start gap-3",
221
- children: [/* @__PURE__ */ H(N, {
222
- size: 18,
223
- className: "text-primary flex-shrink-0 mt-0.5"
224
- }), /* @__PURE__ */ H("p", {
225
- className: "text-sm text-text-secondary leading-relaxed",
226
- children: Z.description
227
- })]
228
+ Z.description && /* @__PURE__ */ U(i, {
229
+ className: "border-border-seam",
230
+ children: /* @__PURE__ */ U(a, {
231
+ className: "p-5",
232
+ children: /* @__PURE__ */ W("div", {
233
+ className: "flex items-start gap-3",
234
+ children: [/* @__PURE__ */ U(P, {
235
+ size: 18,
236
+ className: "text-primary flex-shrink-0 mt-0.5"
237
+ }), /* @__PURE__ */ U("p", {
238
+ className: "text-sm text-text-secondary leading-relaxed",
239
+ children: Z.description
240
+ })]
241
+ })
228
242
  })
229
- }) }),
230
- /* @__PURE__ */ U("div", {
243
+ }),
244
+ /* @__PURE__ */ W("div", {
231
245
  className: "grid grid-cols-1 lg:grid-cols-2 gap-4",
232
246
  children: [
233
- /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
234
- className: "p-5",
235
- children: [/* @__PURE__ */ U("h3", {
236
- className: "font-semibold mb-4 flex items-center gap-2",
237
- children: [/* @__PURE__ */ H("div", {
238
- className: "p-1.5 rounded-lg bg-action-primary-bg/10",
239
- children: /* @__PURE__ */ H(F, {
240
- size: 14,
241
- className: "text-primary"
242
- })
243
- }), a(A, "sandbox.detail.cards.resources.title", "Resources")]
244
- }), /* @__PURE__ */ H(s, {
245
- cpuRequest: Z.resources?.cpuRequest ?? "0",
246
- cpuLimit: Z.resources?.cpuLimit,
247
- memoryRequest: Z.resources?.memoryRequest ?? "0",
248
- memoryLimit: Z.resources?.memoryLimit,
249
- containerCount: Z.containers?.length,
250
- layout: "grid"
251
- })]
252
- }) }),
253
- /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
254
- className: "p-5",
255
- children: [/* @__PURE__ */ U("h3", {
256
- className: "font-semibold mb-4 flex items-center gap-2",
257
- children: [/* @__PURE__ */ H("div", {
258
- className: "p-1.5 rounded-lg bg-action-primary-bg/10",
259
- children: /* @__PURE__ */ H(I, {
260
- size: 14,
261
- className: "text-primary"
262
- })
263
- }), a(A, "sandbox.detail.cards.kubernetes.title", "Kubernetes")]
264
- }), /* @__PURE__ */ U("div", {
265
- className: "space-y-3",
266
- children: [
267
- Z.crdName && /* @__PURE__ */ U("div", {
268
- className: "flex items-center justify-between",
269
- children: [/* @__PURE__ */ H("span", {
270
- className: "text-sm text-text-secondary",
271
- children: a(A, "sandbox.detail.cards.kubernetes.crdName", "CRD Name")
272
- }), /* @__PURE__ */ U("div", {
273
- className: "flex items-center gap-1.5",
274
- children: [/* @__PURE__ */ H("span", {
275
- className: "text-sm font-mono",
276
- children: Z.crdName
277
- }), /* @__PURE__ */ H(q, {
278
- value: Z.crdName,
279
- field: "crdName",
280
- copiedField: j,
281
- onCopy: Q,
282
- ariaLabel: $("crdName")
247
+ /* @__PURE__ */ U(s, {
248
+ treatment: "plain",
249
+ className: "border-border-seam",
250
+ children: /* @__PURE__ */ W("div", {
251
+ className: "p-5",
252
+ children: [/* @__PURE__ */ W("h3", {
253
+ className: "font-semibold mb-4 flex items-center gap-2",
254
+ children: [/* @__PURE__ */ U("div", {
255
+ className: "p-1.5 rounded-lg bg-action-primary-bg/10",
256
+ children: /* @__PURE__ */ U(F, {
257
+ size: 14,
258
+ className: "text-primary"
259
+ })
260
+ }), l(O, "sandbox.detail.cards.resources.title", "Resources")]
261
+ }), /* @__PURE__ */ U(d, {
262
+ cpuRequest: Z.resources?.cpuRequest ?? "0",
263
+ cpuLimit: Z.resources?.cpuLimit,
264
+ memoryRequest: Z.resources?.memoryRequest ?? "0",
265
+ memoryLimit: Z.resources?.memoryLimit,
266
+ containerCount: Z.containers?.length,
267
+ layout: "grid"
268
+ })]
269
+ })
270
+ }),
271
+ /* @__PURE__ */ U(s, {
272
+ treatment: "plain",
273
+ className: "border-border-seam",
274
+ children: /* @__PURE__ */ W("div", {
275
+ className: "p-5",
276
+ children: [/* @__PURE__ */ W("h3", {
277
+ className: "font-semibold mb-4 flex items-center gap-2",
278
+ children: [/* @__PURE__ */ U("div", {
279
+ className: "p-1.5 rounded-lg bg-action-primary-bg/10",
280
+ children: /* @__PURE__ */ U(fe, {
281
+ size: 14,
282
+ className: "text-primary"
283
+ })
284
+ }), l(O, "sandbox.detail.cards.kubernetes.title", "Kubernetes")]
285
+ }), /* @__PURE__ */ W("div", {
286
+ className: "space-y-3",
287
+ children: [
288
+ Z.crdName && /* @__PURE__ */ W("div", {
289
+ className: "flex items-center justify-between",
290
+ children: [/* @__PURE__ */ U("span", {
291
+ className: "text-sm text-text-secondary",
292
+ children: l(O, "sandbox.detail.cards.kubernetes.crdName", "CRD Name")
293
+ }), /* @__PURE__ */ W("div", {
294
+ className: "flex items-center gap-1.5",
295
+ children: [/* @__PURE__ */ U("span", {
296
+ className: "text-sm font-mono",
297
+ children: Z.crdName
298
+ }), /* @__PURE__ */ U(J, {
299
+ value: Z.crdName,
300
+ field: "crdName",
301
+ copiedField: A,
302
+ onCopy: Q,
303
+ ariaLabel: $("crdName")
304
+ })]
283
305
  })]
284
- })]
285
- }),
286
- Z.podName && /* @__PURE__ */ U("div", {
287
- className: "flex items-center justify-between",
288
- children: [/* @__PURE__ */ H("span", {
289
- className: "text-sm text-text-secondary",
290
- children: a(A, "sandbox.detail.cards.kubernetes.podName", "Pod Name")
291
- }), /* @__PURE__ */ U("div", {
292
- className: "flex items-center gap-1.5",
293
- children: [/* @__PURE__ */ H("span", {
294
- className: "text-sm font-mono",
295
- children: Z.podName
296
- }), /* @__PURE__ */ H(q, {
297
- value: Z.podName,
298
- field: "podName",
299
- copiedField: j,
300
- onCopy: Q,
301
- ariaLabel: $("podName")
306
+ }),
307
+ Z.podName && /* @__PURE__ */ W("div", {
308
+ className: "flex items-center justify-between",
309
+ children: [/* @__PURE__ */ U("span", {
310
+ className: "text-sm text-text-secondary",
311
+ children: l(O, "sandbox.detail.cards.kubernetes.podName", "Pod Name")
312
+ }), /* @__PURE__ */ W("div", {
313
+ className: "flex items-center gap-1.5",
314
+ children: [/* @__PURE__ */ U("span", {
315
+ className: "text-sm font-mono",
316
+ children: Z.podName
317
+ }), /* @__PURE__ */ U(J, {
318
+ value: Z.podName,
319
+ field: "podName",
320
+ copiedField: A,
321
+ onCopy: Q,
322
+ ariaLabel: $("podName")
323
+ })]
302
324
  })]
303
- })]
304
- }),
305
- /* @__PURE__ */ U("div", {
306
- className: "flex items-center justify-between",
307
- children: [/* @__PURE__ */ H("span", {
308
- className: "text-sm text-text-secondary",
309
- children: a(A, "sandbox.detail.cards.kubernetes.namespace", "Namespace")
310
- }), /* @__PURE__ */ H("span", {
311
- className: "text-sm font-mono",
312
- children: Z.namespace
313
- })]
314
- }),
315
- /* @__PURE__ */ U("div", {
316
- className: "flex items-center justify-between",
317
- children: [/* @__PURE__ */ H("span", {
318
- className: "text-sm text-text-secondary",
319
- children: a(A, "sandbox.detail.cards.kubernetes.runtimeClass", "Runtime Class")
320
- }), /* @__PURE__ */ H(t, {
321
- variant: "secondary",
322
- className: "font-mono text-xs",
323
- children: Z.runtimeClass
324
- })]
325
- }),
326
- Z.network?.serviceName && /* @__PURE__ */ U("div", {
327
- className: "flex items-center justify-between",
328
- children: [/* @__PURE__ */ H("span", {
329
- className: "text-sm text-text-secondary",
330
- children: a(A, "sandbox.detail.cards.kubernetes.serviceName", "Service Name")
331
- }), /* @__PURE__ */ U("div", {
332
- className: "flex items-center gap-1.5",
333
- children: [/* @__PURE__ */ H("span", {
325
+ }),
326
+ /* @__PURE__ */ W("div", {
327
+ className: "flex items-center justify-between",
328
+ children: [/* @__PURE__ */ U("span", {
329
+ className: "text-sm text-text-secondary",
330
+ children: l(O, "sandbox.detail.cards.kubernetes.namespace", "Namespace")
331
+ }), /* @__PURE__ */ U("span", {
334
332
  className: "text-sm font-mono",
335
- children: Z.network.serviceName
336
- }), /* @__PURE__ */ H(q, {
337
- value: Z.network.serviceName,
338
- field: "serviceName",
339
- copiedField: j,
340
- onCopy: Q,
341
- ariaLabel: $("serviceName")
333
+ children: Z.namespace
342
334
  })]
343
- })]
344
- }),
345
- Z.network?.internalUrl && /* @__PURE__ */ U("div", {
346
- className: "flex items-center justify-between",
347
- children: [/* @__PURE__ */ H("span", {
348
- className: "text-sm text-text-secondary",
349
- children: a(A, "sandbox.detail.cards.kubernetes.internalUrl", "Internal URL")
350
- }), /* @__PURE__ */ U("div", {
351
- className: "flex items-center gap-1.5",
352
- children: [/* @__PURE__ */ H("span", {
353
- className: "text-sm text-primary font-mono truncate max-w-48",
354
- children: Z.network.internalUrl
355
- }), /* @__PURE__ */ H(q, {
356
- value: Z.network.internalUrl,
357
- field: "internalUrl",
358
- copiedField: j,
359
- onCopy: Q,
360
- ariaLabel: $("internalUrl")
335
+ }),
336
+ /* @__PURE__ */ W("div", {
337
+ className: "flex items-center justify-between",
338
+ children: [/* @__PURE__ */ U("span", {
339
+ className: "text-sm text-text-secondary",
340
+ children: l(O, "sandbox.detail.cards.kubernetes.runtimeClass", "Runtime Class")
341
+ }), /* @__PURE__ */ U(t, {
342
+ variant: "secondary",
343
+ className: "font-mono text-xs",
344
+ children: Z.runtimeClass
361
345
  })]
362
- })]
363
- }),
364
- Z.network?.containerUrls && typeof Z.network.containerUrls == "object" && Object.keys(Z.network.containerUrls).filter((e) => !e.includes(":")).length > 1 && /* @__PURE__ */ U("div", {
365
- className: "mt-3 pt-3 border-t border-border-subtle/30",
366
- children: [/* @__PURE__ */ H("p", {
367
- className: "text-xs font-semibold text-text-secondary mb-2",
368
- children: a(A, "sandbox.detail.cards.kubernetes.containerEndpoints", "Container Endpoints")
369
- }), /* @__PURE__ */ H("div", {
370
- className: "space-y-1.5",
371
- children: Object.entries(Z.network.containerUrls).reduce((e, [t, n]) => (t.includes(":") || e.push(/* @__PURE__ */ U("div", {
372
- className: "flex items-center justify-between",
373
- children: [/* @__PURE__ */ H("span", {
374
- className: "text-xs text-text-secondary font-mono",
375
- children: t
376
- }), /* @__PURE__ */ U("div", {
377
- className: "flex items-center gap-1.5",
378
- children: [/* @__PURE__ */ H("span", {
379
- className: "text-xs text-primary font-mono truncate max-w-40",
380
- children: n
381
- }), /* @__PURE__ */ H(q, {
382
- value: n,
383
- field: `container-${t}`,
384
- copiedField: j,
385
- onCopy: Q,
386
- ariaLabel: $(`container-${t}`)
387
- })]
346
+ }),
347
+ Z.network?.serviceName && /* @__PURE__ */ W("div", {
348
+ className: "flex items-center justify-between",
349
+ children: [/* @__PURE__ */ U("span", {
350
+ className: "text-sm text-text-secondary",
351
+ children: l(O, "sandbox.detail.cards.kubernetes.serviceName", "Service Name")
352
+ }), /* @__PURE__ */ W("div", {
353
+ className: "flex items-center gap-1.5",
354
+ children: [/* @__PURE__ */ U("span", {
355
+ className: "text-sm font-mono",
356
+ children: Z.network.serviceName
357
+ }), /* @__PURE__ */ U(J, {
358
+ value: Z.network.serviceName,
359
+ field: "serviceName",
360
+ copiedField: A,
361
+ onCopy: Q,
362
+ ariaLabel: $("serviceName")
388
363
  })]
389
- }, t)), e), [])
390
- })]
391
- })
392
- ]
393
- })]
394
- }) }),
395
- /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
396
- className: "p-5",
397
- children: [/* @__PURE__ */ U("h3", {
398
- className: "font-semibold mb-4 flex items-center gap-2",
399
- children: [/* @__PURE__ */ H("div", {
400
- className: "p-1.5 rounded-lg bg-action-primary-bg/10",
401
- children: /* @__PURE__ */ H(re, {
402
- size: 14,
403
- className: "text-primary"
404
- })
405
- }), a(A, "sandbox.detail.cards.lifecycle.title", "Lifecycle")]
406
- }), /* @__PURE__ */ U("div", {
407
- className: "space-y-3",
408
- children: [
409
- /* @__PURE__ */ U("div", {
410
- className: "flex items-center justify-between",
411
- children: [/* @__PURE__ */ H("span", {
412
- className: "text-sm text-text-secondary",
413
- children: a(A, "sandbox.detail.cards.lifecycle.ttl", "TTL")
414
- }), /* @__PURE__ */ H("span", {
415
- className: "text-sm font-medium",
416
- children: G(Z.ttlSeconds)
417
- })]
418
- }),
419
- Z.expiresAt && ye && /* @__PURE__ */ U("div", {
420
- className: "flex items-center justify-between",
421
- children: [/* @__PURE__ */ H("span", {
422
- className: "text-sm text-text-secondary",
423
- children: a(A, "sandbox.detail.cards.lifecycle.expires", "Expires")
424
- }), /* @__PURE__ */ U(t, {
425
- variant: "outline",
426
- className: "gap-1",
427
- children: [/* @__PURE__ */ H(z, { size: 12 }), ue(Z.expiresAt)]
428
- })]
429
- }),
430
- /* @__PURE__ */ U("div", {
431
- className: "flex items-center justify-between",
432
- children: [/* @__PURE__ */ H("span", {
433
- className: "text-sm text-text-secondary",
434
- children: a(A, "sandbox.detail.cards.lifecycle.created", "Created")
435
- }), /* @__PURE__ */ H("span", {
436
- className: "text-sm",
437
- children: W(Z.createdAt)
438
- })]
439
- }),
440
- /* @__PURE__ */ U("div", {
441
- className: "flex items-center justify-between",
442
- children: [/* @__PURE__ */ H("span", {
443
- className: "text-sm text-text-secondary",
444
- children: a(A, "sandbox.detail.cards.lifecycle.updated", "Updated")
445
- }), /* @__PURE__ */ H("span", {
446
- className: "text-sm",
447
- children: W(Z.updatedAt)
448
- })]
449
- }),
450
- Z.stoppedAt && /* @__PURE__ */ U("div", {
451
- className: "flex items-center justify-between",
452
- children: [/* @__PURE__ */ H("span", {
453
- className: "text-sm text-text-secondary",
454
- children: a(A, "sandbox.detail.cards.lifecycle.stopped", "Stopped")
455
- }), /* @__PURE__ */ H("span", {
456
- className: "text-sm",
457
- children: W(Z.stoppedAt)
458
- })]
459
- })
460
- ]
461
- })]
462
- }) }),
463
- /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
464
- className: "p-5",
465
- children: [/* @__PURE__ */ U("h3", {
466
- className: "font-semibold mb-4 flex items-center gap-2",
467
- children: [/* @__PURE__ */ H("div", {
364
+ })]
365
+ }),
366
+ Z.network?.internalUrl && /* @__PURE__ */ W("div", {
367
+ className: "flex items-center justify-between",
368
+ children: [/* @__PURE__ */ U("span", {
369
+ className: "text-sm text-text-secondary",
370
+ children: l(O, "sandbox.detail.cards.kubernetes.internalUrl", "Internal URL")
371
+ }), /* @__PURE__ */ W("div", {
372
+ className: "flex items-center gap-1.5",
373
+ children: [/* @__PURE__ */ U("span", {
374
+ className: "text-sm text-primary font-mono truncate max-w-48",
375
+ children: Z.network.internalUrl
376
+ }), /* @__PURE__ */ U(J, {
377
+ value: Z.network.internalUrl,
378
+ field: "internalUrl",
379
+ copiedField: A,
380
+ onCopy: Q,
381
+ ariaLabel: $("internalUrl")
382
+ })]
383
+ })]
384
+ }),
385
+ Z.network?.containerUrls && typeof Z.network.containerUrls == "object" && Object.keys(Z.network.containerUrls).filter((e) => !e.includes(":")).length > 1 && /* @__PURE__ */ W("div", {
386
+ className: "mt-3 pt-3 border-t border-border-subtle/30",
387
+ children: [/* @__PURE__ */ U("p", {
388
+ className: "text-xs font-semibold text-text-secondary mb-2",
389
+ children: l(O, "sandbox.detail.cards.kubernetes.containerEndpoints", "Container Endpoints")
390
+ }), /* @__PURE__ */ U("div", {
391
+ className: "space-y-1.5",
392
+ children: Object.entries(Z.network.containerUrls).reduce((e, [t, n]) => (t.includes(":") || e.push(/* @__PURE__ */ W("div", {
393
+ className: "flex items-center justify-between",
394
+ children: [/* @__PURE__ */ U("span", {
395
+ className: "text-xs text-text-secondary font-mono",
396
+ children: t
397
+ }), /* @__PURE__ */ W("div", {
398
+ className: "flex items-center gap-1.5",
399
+ children: [/* @__PURE__ */ U("span", {
400
+ className: "text-xs text-primary font-mono truncate max-w-40",
401
+ children: n
402
+ }), /* @__PURE__ */ U(J, {
403
+ value: n,
404
+ field: `container-${t}`,
405
+ copiedField: A,
406
+ onCopy: Q,
407
+ ariaLabel: $(`container-${t}`)
408
+ })]
409
+ })]
410
+ }, t)), e), [])
411
+ })]
412
+ })
413
+ ]
414
+ })]
415
+ })
416
+ }),
417
+ /* @__PURE__ */ U(s, {
418
+ treatment: "plain",
419
+ className: "border-border-seam",
420
+ children: /* @__PURE__ */ W("div", {
421
+ className: "p-5",
422
+ children: [/* @__PURE__ */ W("h3", {
423
+ className: "font-semibold mb-4 flex items-center gap-2",
424
+ children: [/* @__PURE__ */ U("div", {
425
+ className: "p-1.5 rounded-lg bg-action-primary-bg/10",
426
+ children: /* @__PURE__ */ U(se, {
427
+ size: 14,
428
+ className: "text-primary"
429
+ })
430
+ }), l(O, "sandbox.detail.cards.lifecycle.title", "Lifecycle")]
431
+ }), /* @__PURE__ */ W("div", {
432
+ className: "space-y-3",
433
+ children: [
434
+ /* @__PURE__ */ W("div", {
435
+ className: "flex items-center justify-between",
436
+ children: [/* @__PURE__ */ U("span", {
437
+ className: "text-sm text-text-secondary",
438
+ children: l(O, "sandbox.detail.cards.lifecycle.ttl", "TTL")
439
+ }), /* @__PURE__ */ U("span", {
440
+ className: "text-sm font-medium",
441
+ children: K(Z.ttlSeconds)
442
+ })]
443
+ }),
444
+ Z.expiresAt && Ce && /* @__PURE__ */ W("div", {
445
+ className: "flex items-center justify-between",
446
+ children: [/* @__PURE__ */ U("span", {
447
+ className: "text-sm text-text-secondary",
448
+ children: l(O, "sandbox.detail.cards.lifecycle.expires", "Expires")
449
+ }), /* @__PURE__ */ W(t, {
450
+ variant: "outline",
451
+ className: "gap-1",
452
+ children: [/* @__PURE__ */ U(R, { size: 12 }), pe(Z.expiresAt)]
453
+ })]
454
+ }),
455
+ /* @__PURE__ */ W("div", {
456
+ className: "flex items-center justify-between",
457
+ children: [/* @__PURE__ */ U("span", {
458
+ className: "text-sm text-text-secondary",
459
+ children: l(O, "sandbox.detail.cards.lifecycle.created", "Created")
460
+ }), /* @__PURE__ */ U("span", {
461
+ className: "text-sm",
462
+ children: G(Z.createdAt)
463
+ })]
464
+ }),
465
+ /* @__PURE__ */ W("div", {
466
+ className: "flex items-center justify-between",
467
+ children: [/* @__PURE__ */ U("span", {
468
+ className: "text-sm text-text-secondary",
469
+ children: l(O, "sandbox.detail.cards.lifecycle.updated", "Updated")
470
+ }), /* @__PURE__ */ U("span", {
471
+ className: "text-sm",
472
+ children: G(Z.updatedAt)
473
+ })]
474
+ }),
475
+ Z.stoppedAt && /* @__PURE__ */ W("div", {
476
+ className: "flex items-center justify-between",
477
+ children: [/* @__PURE__ */ U("span", {
478
+ className: "text-sm text-text-secondary",
479
+ children: l(O, "sandbox.detail.cards.lifecycle.stopped", "Stopped")
480
+ }), /* @__PURE__ */ U("span", {
481
+ className: "text-sm",
482
+ children: G(Z.stoppedAt)
483
+ })]
484
+ })
485
+ ]
486
+ })]
487
+ })
488
+ }),
489
+ /* @__PURE__ */ U(s, {
490
+ treatment: "plain",
491
+ className: "border-border-seam",
492
+ children: /* @__PURE__ */ W("div", {
493
+ className: "p-5",
494
+ children: [/* @__PURE__ */ W("h3", {
495
+ className: "font-semibold mb-4 flex items-center gap-2",
496
+ children: [/* @__PURE__ */ U("div", {
497
+ className: "p-1.5 rounded-lg bg-action-primary-bg/10",
498
+ children: /* @__PURE__ */ U(P, {
499
+ size: 14,
500
+ className: "text-primary"
501
+ })
502
+ }), l(O, "sandbox.detail.cards.details.title", "Details")]
503
+ }), /* @__PURE__ */ W("div", {
504
+ className: "space-y-3",
505
+ children: [
506
+ /* @__PURE__ */ W("div", {
507
+ className: "flex items-center justify-between",
508
+ children: [/* @__PURE__ */ U("span", {
509
+ className: "text-sm text-text-secondary",
510
+ children: l(O, "sandbox.detail.cards.details.template", "Template")
511
+ }), /* @__PURE__ */ U(f, {
512
+ type: Z.template,
513
+ showLabel: !0
514
+ })]
515
+ }),
516
+ /* @__PURE__ */ W("div", {
517
+ className: "flex items-center justify-between",
518
+ children: [/* @__PURE__ */ U("span", {
519
+ className: "text-sm text-text-secondary",
520
+ children: l(O, "sandbox.detail.cards.details.mode", "Mode")
521
+ }), /* @__PURE__ */ U(t, {
522
+ variant: "outline",
523
+ className: "gap-1 text-xs font-mono",
524
+ children: Z.mode === "JOB" ? /* @__PURE__ */ W(H, { children: [
525
+ /* @__PURE__ */ U(de, { size: 12 }),
526
+ " ",
527
+ l(O, "sandbox.detail.cards.details.mode.job", "Job")
528
+ ] }) : /* @__PURE__ */ W(H, { children: [
529
+ /* @__PURE__ */ U(ce, { size: 12 }),
530
+ " ",
531
+ l(O, "sandbox.detail.cards.details.mode.deployment", "Deployment")
532
+ ] })
533
+ })]
534
+ }),
535
+ /* @__PURE__ */ W("div", {
536
+ className: "flex items-center justify-between",
537
+ children: [/* @__PURE__ */ U("span", {
538
+ className: "text-sm text-text-secondary",
539
+ children: l(O, "sandbox.detail.cards.details.workspace", "Workspace")
540
+ }), /* @__PURE__ */ U("span", {
541
+ className: "text-sm font-mono",
542
+ children: Z.workspaceId
543
+ })]
544
+ }),
545
+ /* @__PURE__ */ W("div", {
546
+ className: "flex items-center justify-between",
547
+ children: [/* @__PURE__ */ U("span", {
548
+ className: "text-sm text-text-secondary",
549
+ children: l(O, "sandbox.detail.cards.details.createdBy", "Created By")
550
+ }), /* @__PURE__ */ U("span", {
551
+ className: "text-sm",
552
+ children: Z.createdBy
553
+ })]
554
+ })
555
+ ]
556
+ })]
557
+ })
558
+ })
559
+ ]
560
+ }),
561
+ Z.containers && Z.containers.length > 0 && /* @__PURE__ */ U(s, {
562
+ treatment: "plain",
563
+ className: "border-border-seam",
564
+ children: /* @__PURE__ */ W("div", {
565
+ className: "p-5",
566
+ children: [/* @__PURE__ */ W("h3", {
567
+ className: "font-semibold mb-4 flex items-center gap-2",
568
+ children: [
569
+ /* @__PURE__ */ U("div", {
468
570
  className: "p-1.5 rounded-lg bg-action-primary-bg/10",
469
- children: /* @__PURE__ */ H(N, {
571
+ children: /* @__PURE__ */ U(le, {
470
572
  size: 14,
471
573
  className: "text-primary"
472
574
  })
473
- }), a(A, "sandbox.detail.cards.details.title", "Details")]
474
- }), /* @__PURE__ */ U("div", {
575
+ }),
576
+ l(O, "sandbox.detail.cards.containers.title", "Containers"),
577
+ /* @__PURE__ */ U(t, {
578
+ variant: "secondary",
579
+ className: "ml-1",
580
+ children: Z.containers.length
581
+ })
582
+ ]
583
+ }), /* @__PURE__ */ U(me, {
584
+ enabled: Z.containers.length > 4,
585
+ collapsedHeight: 220,
586
+ children: /* @__PURE__ */ U("div", {
475
587
  className: "space-y-3",
476
- children: [
477
- /* @__PURE__ */ U("div", {
478
- className: "flex items-center justify-between",
479
- children: [/* @__PURE__ */ H("span", {
480
- className: "text-sm text-text-secondary",
481
- children: a(A, "sandbox.detail.cards.details.template", "Template")
482
- }), /* @__PURE__ */ H(c, {
483
- type: Z.template,
484
- showLabel: !0
485
- })]
486
- }),
487
- /* @__PURE__ */ U("div", {
488
- className: "flex items-center justify-between",
489
- children: [/* @__PURE__ */ H("span", {
490
- className: "text-sm text-text-secondary",
491
- children: a(A, "sandbox.detail.cards.details.mode", "Mode")
492
- }), /* @__PURE__ */ H(t, {
493
- variant: "outline",
494
- className: "gap-1 text-xs font-mono",
495
- children: Z.mode === "JOB" ? /* @__PURE__ */ U(V, { children: [
496
- /* @__PURE__ */ H(P, { size: 12 }),
497
- " ",
498
- a(A, "sandbox.detail.cards.details.mode.job", "Job")
499
- ] }) : /* @__PURE__ */ U(V, { children: [
500
- /* @__PURE__ */ H(ie, { size: 12 }),
501
- " ",
502
- a(A, "sandbox.detail.cards.details.mode.deployment", "Deployment")
503
- ] })
504
- })]
505
- }),
506
- /* @__PURE__ */ U("div", {
507
- className: "flex items-center justify-between",
508
- children: [/* @__PURE__ */ H("span", {
509
- className: "text-sm text-text-secondary",
510
- children: a(A, "sandbox.detail.cards.details.workspace", "Workspace")
511
- }), /* @__PURE__ */ H("span", {
512
- className: "text-sm font-mono",
513
- children: Z.workspaceId
514
- })]
515
- }),
516
- /* @__PURE__ */ U("div", {
517
- className: "flex items-center justify-between",
518
- children: [/* @__PURE__ */ H("span", {
519
- className: "text-sm text-text-secondary",
520
- children: a(A, "sandbox.detail.cards.details.createdBy", "Created By")
521
- }), /* @__PURE__ */ H("span", {
522
- className: "text-sm",
523
- children: Z.createdBy
588
+ children: Z.containers.map((e, n) => {
589
+ let r = Z.containerStatuses?.find((t) => t.name === e.name);
590
+ return /* @__PURE__ */ W("div", {
591
+ className: "flex items-center justify-between p-3 rounded-lg border border-border-seam hover:bg-bg-sunken/30 transition-colors",
592
+ children: [/* @__PURE__ */ W("div", {
593
+ className: "flex items-center gap-3 min-w-0",
594
+ children: [/* @__PURE__ */ U("div", { className: `w-2.5 h-2.5 rounded-full flex-shrink-0 ${r?.ready ? "bg-status-success-text" : r ? "bg-status-warning-text animate-pulse" : "bg-text-tertiary"}` }), /* @__PURE__ */ W("div", {
595
+ className: "min-w-0",
596
+ children: [/* @__PURE__ */ U("p", {
597
+ className: "text-sm font-medium",
598
+ children: e.name
599
+ }), /* @__PURE__ */ U("p", {
600
+ className: "text-xs text-text-secondary font-mono truncate",
601
+ children: e.image
602
+ })]
603
+ })]
604
+ }), /* @__PURE__ */ W("div", {
605
+ className: "flex items-center gap-2 flex-shrink-0",
606
+ children: [
607
+ e.ports?.map((e) => /* @__PURE__ */ W(t, {
608
+ variant: "outline",
609
+ className: "text-xs font-mono",
610
+ children: [
611
+ ":",
612
+ e.containerPort,
613
+ e.name ? ` (${e.name})` : ""
614
+ ]
615
+ }, e.containerPort)),
616
+ r && /* @__PURE__ */ U(t, {
617
+ variant: r.ready ? "default" : "secondary",
618
+ className: `text-xs ${r.ready ? "bg-status-success-bg-subtle text-status-success-text" : ""}`,
619
+ children: r.ready ? l(O, "sandbox.detail.cards.containers.status.ready", "Ready") : l(O, "sandbox.detail.cards.containers.status.notReady", "Not Ready")
620
+ }),
621
+ r?.restartCount !== void 0 && r.restartCount > 0 && /* @__PURE__ */ W(t, {
622
+ variant: "outline",
623
+ className: "text-xs text-status-warning-text",
624
+ children: [
625
+ r.restartCount,
626
+ " restart",
627
+ r.restartCount === 1 ? "" : "s"
628
+ ]
629
+ })
630
+ ]
524
631
  })]
525
- })
526
- ]
527
- })]
528
- }) })
529
- ]
632
+ }, e.name || n);
633
+ })
634
+ })
635
+ })]
636
+ })
530
637
  }),
531
- Z.containers && Z.containers.length > 0 && /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
532
- className: "p-5",
533
- children: [/* @__PURE__ */ U("h3", {
534
- className: "font-semibold mb-4 flex items-center gap-2",
535
- children: [
536
- /* @__PURE__ */ H("div", {
638
+ Z.storage && Z.storage.mode !== "NONE" && /* @__PURE__ */ U(s, {
639
+ treatment: "plain",
640
+ className: "border-border-seam",
641
+ children: /* @__PURE__ */ W("div", {
642
+ className: "p-5",
643
+ children: [/* @__PURE__ */ W("h3", {
644
+ className: "font-semibold mb-4 flex items-center gap-2",
645
+ children: [/* @__PURE__ */ U("div", {
537
646
  className: "p-1.5 rounded-lg bg-action-primary-bg/10",
538
- children: /* @__PURE__ */ H(ae, {
647
+ children: /* @__PURE__ */ U(M, {
539
648
  size: 14,
540
649
  className: "text-primary"
541
650
  })
542
- }),
543
- a(A, "sandbox.detail.cards.containers.title", "Containers"),
544
- /* @__PURE__ */ H(t, {
545
- variant: "secondary",
546
- className: "ml-1",
547
- children: Z.containers.length
548
- })
549
- ]
550
- }), /* @__PURE__ */ H("div", {
551
- className: "space-y-3",
552
- children: Z.containers.map((e, n) => {
553
- let r = Z.containerStatuses?.find((t) => t.name === e.name);
554
- return /* @__PURE__ */ U("div", {
555
- className: "flex items-center justify-between p-3 rounded-lg border border-border-subtle/50 hover:bg-bg-sunken/30 transition-colors",
556
- children: [/* @__PURE__ */ U("div", {
557
- className: "flex items-center gap-3 min-w-0",
558
- children: [/* @__PURE__ */ H("div", { className: `w-2.5 h-2.5 rounded-full flex-shrink-0 ${r?.ready ? "bg-status-success-text" : r ? "bg-status-warning-text animate-pulse" : "bg-text-tertiary"}` }), /* @__PURE__ */ U("div", {
559
- className: "min-w-0",
560
- children: [/* @__PURE__ */ H("p", {
561
- className: "text-sm font-medium",
562
- children: e.name
563
- }), /* @__PURE__ */ H("p", {
564
- className: "text-xs text-text-secondary font-mono truncate",
565
- children: e.image
566
- })]
651
+ }), l(O, "sandbox.detail.cards.storage.title", "Storage")]
652
+ }), /* @__PURE__ */ W("div", {
653
+ className: "space-y-3",
654
+ children: [
655
+ /* @__PURE__ */ W("div", {
656
+ className: "flex items-center justify-between",
657
+ children: [/* @__PURE__ */ U("span", {
658
+ className: "text-sm text-text-secondary",
659
+ children: l(O, "sandbox.detail.cards.storage.mode", "Mode")
660
+ }), /* @__PURE__ */ U(t, {
661
+ variant: "outline",
662
+ children: Z.storage.mode === "EPHEMERAL" ? l(O, "sandbox.detail.cards.storage.ephemeral", "Ephemeral") : l(O, "sandbox.detail.cards.storage.persistent", "Persistent")
567
663
  })]
568
- }), /* @__PURE__ */ U("div", {
569
- className: "flex items-center gap-2 flex-shrink-0",
570
- children: [
571
- e.ports?.map((e) => /* @__PURE__ */ U(t, {
572
- variant: "outline",
573
- className: "text-xs font-mono",
574
- children: [
575
- ":",
576
- e.containerPort,
577
- e.name ? ` (${e.name})` : ""
578
- ]
579
- }, e.containerPort)),
580
- r && /* @__PURE__ */ H(t, {
581
- variant: r.ready ? "default" : "secondary",
582
- className: `text-xs ${r.ready ? "bg-status-success-bg-subtle text-status-success-text" : ""}`,
583
- children: r.ready ? a(A, "sandbox.detail.cards.containers.status.ready", "Ready") : a(A, "sandbox.detail.cards.containers.status.notReady", "Not Ready")
584
- }),
585
- r?.restartCount !== void 0 && r.restartCount > 0 && /* @__PURE__ */ U(t, {
586
- variant: "outline",
587
- className: "text-xs text-status-warning-text",
588
- children: [
589
- r.restartCount,
590
- " restart",
591
- r.restartCount === 1 ? "" : "s"
592
- ]
593
- })
594
- ]
595
- })]
596
- }, e.name || n);
597
- })
598
- })]
599
- }) }),
600
- Z.storage && Z.storage.mode !== "NONE" && /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
601
- className: "p-5",
602
- children: [/* @__PURE__ */ U("h3", {
603
- className: "font-semibold mb-4 flex items-center gap-2",
604
- children: [/* @__PURE__ */ H("div", {
605
- className: "p-1.5 rounded-lg bg-action-primary-bg/10",
606
- children: /* @__PURE__ */ H(oe, {
607
- size: 14,
608
- className: "text-primary"
609
- })
610
- }), a(A, "sandbox.detail.cards.storage.title", "Storage")]
611
- }), /* @__PURE__ */ U("div", {
612
- className: "space-y-3",
613
- children: [
614
- /* @__PURE__ */ U("div", {
615
- className: "flex items-center justify-between",
616
- children: [/* @__PURE__ */ H("span", {
617
- className: "text-sm text-text-secondary",
618
- children: a(A, "sandbox.detail.cards.storage.mode", "Mode")
619
- }), /* @__PURE__ */ H(t, {
620
- variant: "outline",
621
- children: Z.storage.mode === "EPHEMERAL" ? a(A, "sandbox.detail.cards.storage.ephemeral", "Ephemeral") : a(A, "sandbox.detail.cards.storage.persistent", "Persistent")
622
- })]
623
- }),
624
- Z.storage.sizeGi && /* @__PURE__ */ U("div", {
625
- className: "flex items-center justify-between",
626
- children: [/* @__PURE__ */ H("span", {
627
- className: "text-sm text-text-secondary",
628
- children: a(A, "sandbox.detail.cards.storage.size", "Size")
629
- }), /* @__PURE__ */ U("span", {
630
- className: "text-sm font-medium",
631
- children: [Z.storage.sizeGi, " GiB"]
632
- })]
633
- }),
634
- Z.storage.mountPath && /* @__PURE__ */ U("div", {
635
- className: "flex items-center justify-between",
636
- children: [/* @__PURE__ */ H("span", {
637
- className: "text-sm text-text-secondary",
638
- children: a(A, "sandbox.detail.cards.storage.mountPath", "Mount Path")
639
- }), /* @__PURE__ */ H("span", {
640
- className: "text-sm font-mono",
641
- children: Z.storage.mountPath
642
- })]
643
- }),
644
- /* @__PURE__ */ U("div", {
645
- className: "flex items-center justify-between",
646
- children: [/* @__PURE__ */ H("span", {
647
- className: "text-sm text-text-secondary",
648
- children: a(A, "sandbox.detail.cards.storage.retainOnDelete", "Retain on Delete")
649
- }), /* @__PURE__ */ H(t, {
650
- variant: Z.storage.retainOnDelete ? "default" : "secondary",
651
- children: Z.storage.retainOnDelete ? a(A, "sandbox.detail.cards.storage.retainYes", "Yes") : a(A, "sandbox.detail.cards.storage.retainNo", "No")
652
- })]
653
- })
654
- ]
655
- })]
656
- }) }),
657
- Z.errorMessage && /* @__PURE__ */ H(r, {
664
+ }),
665
+ Z.storage.sizeGi && /* @__PURE__ */ W("div", {
666
+ className: "flex items-center justify-between",
667
+ children: [/* @__PURE__ */ U("span", {
668
+ className: "text-sm text-text-secondary",
669
+ children: l(O, "sandbox.detail.cards.storage.size", "Size")
670
+ }), /* @__PURE__ */ W("span", {
671
+ className: "text-sm font-medium",
672
+ children: [Z.storage.sizeGi, " GiB"]
673
+ })]
674
+ }),
675
+ Z.storage.mountPath && /* @__PURE__ */ W("div", {
676
+ className: "flex items-center justify-between",
677
+ children: [/* @__PURE__ */ U("span", {
678
+ className: "text-sm text-text-secondary",
679
+ children: l(O, "sandbox.detail.cards.storage.mountPath", "Mount Path")
680
+ }), /* @__PURE__ */ U("span", {
681
+ className: "text-sm font-mono",
682
+ children: Z.storage.mountPath
683
+ })]
684
+ }),
685
+ /* @__PURE__ */ W("div", {
686
+ className: "flex items-center justify-between",
687
+ children: [/* @__PURE__ */ U("span", {
688
+ className: "text-sm text-text-secondary",
689
+ children: l(O, "sandbox.detail.cards.storage.retainOnDelete", "Retain on Delete")
690
+ }), /* @__PURE__ */ U(t, {
691
+ variant: Z.storage.retainOnDelete ? "default" : "secondary",
692
+ children: Z.storage.retainOnDelete ? l(O, "sandbox.detail.cards.storage.retainYes", "Yes") : l(O, "sandbox.detail.cards.storage.retainNo", "No")
693
+ })]
694
+ })
695
+ ]
696
+ })]
697
+ })
698
+ }),
699
+ Z.errorMessage && /* @__PURE__ */ U(i, {
658
700
  className: "border-status-error-border/50 bg-status-error-bg/5",
659
- children: /* @__PURE__ */ U(i, {
701
+ children: /* @__PURE__ */ W(a, {
660
702
  className: "p-5",
661
- children: [/* @__PURE__ */ U("h3", {
703
+ children: [/* @__PURE__ */ W("h3", {
662
704
  className: "font-semibold text-status-error-text mb-2 flex items-center gap-2",
663
- children: [/* @__PURE__ */ H(k, { size: 18 }), a(A, "sandbox.detail.cards.errorDetails.title", "Error Details")]
664
- }), /* @__PURE__ */ H("p", {
705
+ children: [/* @__PURE__ */ U(ae, { size: 18 }), l(O, "sandbox.detail.cards.errorDetails.title", "Error Details")]
706
+ }), /* @__PURE__ */ U("p", {
665
707
  className: "text-sm text-status-error-text/80 font-mono bg-status-error-bg/5 rounded-lg p-3",
666
708
  children: Z.errorMessage
667
709
  })]
668
710
  })
669
711
  }),
670
712
  (() => {
671
- let e = Z.metadata ?? null, t = e?.devPortalApplicationId ?? e?.appId, n = e?.clientId, a = e?.clientSecretRevealOnce;
672
- return !t && !n ? null : /* @__PURE__ */ H(r, { children: /* @__PURE__ */ H(i, {
673
- className: "p-5",
674
- children: /* @__PURE__ */ H(ee, {
675
- appId: t,
676
- clientId: n,
677
- clientSecret: a
713
+ let e = Z.metadata ?? null, t = e?.devPortalApplicationId ?? e?.appId, n = e?.clientId, r = e?.clientSecretRevealOnce;
714
+ return !t && !n ? null : /* @__PURE__ */ U(s, {
715
+ treatment: "plain",
716
+ className: "border-border-seam",
717
+ children: /* @__PURE__ */ U("div", {
718
+ className: "p-5",
719
+ children: /* @__PURE__ */ U(re, {
720
+ appId: t,
721
+ clientId: n,
722
+ clientSecret: r
723
+ })
678
724
  })
679
- }) });
725
+ });
680
726
  })(),
681
- /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
682
- className: "p-5",
683
- children: [/* @__PURE__ */ H("h3", {
684
- className: "mb-3 text-sm font-semibold text-text-primary",
685
- children: a(A, "sandbox.detail.cards.activity.title", "Activity")
686
- }), /* @__PURE__ */ H(w, {
687
- sandboxId: Z.id,
688
- workspaceId: D ?? ""
689
- })]
690
- }) }),
691
- /* @__PURE__ */ H(de, {
727
+ /* @__PURE__ */ U(s, {
728
+ treatment: "plain",
729
+ className: "border-border-seam",
730
+ children: /* @__PURE__ */ W("div", {
731
+ className: "p-5",
732
+ children: [/* @__PURE__ */ U("h3", {
733
+ className: "mb-3 text-sm font-semibold text-text-primary",
734
+ children: l(O, "sandbox.detail.cards.activity.title", "Activity")
735
+ }), /* @__PURE__ */ U(T, {
736
+ sandboxId: Z.id,
737
+ workspaceId: D ?? ""
738
+ })]
739
+ })
740
+ }),
741
+ /* @__PURE__ */ U(he, {
692
742
  sandbox: Z,
693
743
  workspaceId: D ?? ""
694
744
  }),
695
- /* @__PURE__ */ H(te, {
745
+ /* @__PURE__ */ U(ie, {
696
746
  sandbox: Z,
697
747
  workspaceId: D ?? ""
698
748
  }),
699
- Z.expiresAt && /* @__PURE__ */ H(C, {
700
- isOpen: R,
701
- onClose: () => K(!1),
749
+ Z.expiresAt && /* @__PURE__ */ U(ne, {
750
+ isOpen: N,
751
+ onClose: () => L(!1),
702
752
  currentExpiresAt: Z.expiresAt,
703
- isLoading: J,
753
+ isLoading: q,
704
754
  onExtend: (e) => {
705
- Y(!0), ge({ variables: {
755
+ Y(!0), be({ variables: {
706
756
  context: { workspaceId: D },
707
757
  id: Z.id,
708
758
  additionalSeconds: e
709
759
  } }).then((t) => {
710
760
  let n = t.data?.extendSandboxTTL;
711
- n && _e.sandboxExtended({
761
+ n && xe.sandboxExtended({
712
762
  sandboxId: n.id,
713
763
  addedSeconds: e,
714
764
  newExpiresAt: n.expiresAt
@@ -716,147 +766,151 @@ function J() {
716
766
  }).catch((e) => {
717
767
  console.error("Failed to extend TTL:", e);
718
768
  }).finally(() => {
719
- Y(!1), K(!1);
769
+ Y(!1), L(!1);
720
770
  });
721
771
  }
722
772
  })
723
773
  ]
724
774
  });
725
775
  }
726
- function de({ sandbox: e, workspaceId: t }) {
727
- let { t: o } = B(), [s, c] = O(e.containers?.[0]?.name ?? ""), [l, u] = O(100), d = D(null), [f, { data: p, loading: h, error: g }] = m(), _ = e.status === "RUNNING" || e.status === "PROVISIONING", C = T(() => {
728
- !s || !_ || f({ variables: {
776
+ function he({ sandbox: e, workspaceId: t }) {
777
+ let { t: r } = V(), [i, a] = k(e.containers?.[0]?.name ?? ""), [o, c] = k(100), u = O(null), [d, { data: f, loading: p, error: m }] = v(), h = e.status === "RUNNING" || e.status === "PROVISIONING", g = E(() => {
778
+ !i || !h || d({ variables: {
729
779
  context: { workspaceId: t },
730
780
  id: e.id,
731
- containerName: s,
732
- tailLines: l
781
+ containerName: i,
782
+ tailLines: o
733
783
  } });
734
784
  }, [
735
- f,
785
+ d,
736
786
  t,
737
787
  e.id,
738
- s,
739
- l,
740
- _
788
+ i,
789
+ o,
790
+ h
741
791
  ]);
742
- E(() => {
743
- _ && s && C();
792
+ D(() => {
793
+ h && i && g();
744
794
  }, [
745
- s,
746
- _,
747
- C
748
- ]), E(() => {
749
- d.current?.scrollIntoView({ behavior: "smooth" });
750
- }, [p]);
751
- let w = p?.getSandboxLogs?.split("\n") ?? [];
752
- return /* @__PURE__ */ H(r, { children: /* @__PURE__ */ U(i, {
753
- className: "p-5",
754
- children: [/* @__PURE__ */ U("div", {
755
- className: "flex items-center justify-between mb-4",
756
- children: [/* @__PURE__ */ U("h3", {
757
- className: "font-semibold flex items-center gap-2",
758
- children: [/* @__PURE__ */ H("div", {
759
- className: "p-1.5 rounded-lg bg-action-primary-bg/10",
760
- children: /* @__PURE__ */ H(R, {
761
- size: 14,
762
- className: "text-primary"
763
- })
764
- }), a(o, "sandbox.detail.logs.title", "Logs")]
765
- }), /* @__PURE__ */ U("div", {
766
- className: "flex items-center gap-2",
795
+ i,
796
+ h,
797
+ g
798
+ ]), D(() => {
799
+ u.current?.scrollIntoView({ behavior: "smooth" });
800
+ }, [f]);
801
+ let _ = f?.getSandboxLogs?.split("\n") ?? [];
802
+ return /* @__PURE__ */ U(s, {
803
+ treatment: "plain",
804
+ className: "border-border-seam",
805
+ children: /* @__PURE__ */ W("div", {
806
+ className: "p-5",
807
+ children: [/* @__PURE__ */ W("div", {
808
+ className: "flex items-center justify-between mb-4",
809
+ children: [/* @__PURE__ */ W("h3", {
810
+ className: "font-semibold flex items-center gap-2",
811
+ children: [/* @__PURE__ */ U("div", {
812
+ className: "p-1.5 rounded-lg bg-action-primary-bg/10",
813
+ children: /* @__PURE__ */ U(L, {
814
+ size: 14,
815
+ className: "text-primary"
816
+ })
817
+ }), l(r, "sandbox.detail.logs.title", "Logs")]
818
+ }), /* @__PURE__ */ W("div", {
819
+ className: "flex items-center gap-2",
820
+ children: [
821
+ e.containers && e.containers.length > 1 && /* @__PURE__ */ U("select", {
822
+ value: i,
823
+ onChange: (e) => a(e.target.value),
824
+ className: "px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono",
825
+ children: e.containers.map((e) => /* @__PURE__ */ U("option", {
826
+ value: e.name,
827
+ children: e.name
828
+ }, e.name))
829
+ }),
830
+ /* @__PURE__ */ W("select", {
831
+ value: o,
832
+ onChange: (e) => c(Number(e.target.value)),
833
+ className: "px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono",
834
+ children: [
835
+ /* @__PURE__ */ U("option", {
836
+ value: 50,
837
+ children: l(r, "sandbox.detail.logs.tailLines.50", "50 lines")
838
+ }),
839
+ /* @__PURE__ */ U("option", {
840
+ value: 100,
841
+ children: l(r, "sandbox.detail.logs.tailLines.100", "100 lines")
842
+ }),
843
+ /* @__PURE__ */ U("option", {
844
+ value: 500,
845
+ children: l(r, "sandbox.detail.logs.tailLines.500", "500 lines")
846
+ }),
847
+ /* @__PURE__ */ U("option", {
848
+ value: 1e3,
849
+ children: l(r, "sandbox.detail.logs.tailLines.1000", "1000 lines")
850
+ })
851
+ ]
852
+ }),
853
+ /* @__PURE__ */ W(n, {
854
+ variant: "ghost",
855
+ size: "sm",
856
+ onClick: g,
857
+ disabled: !h || p,
858
+ children: [/* @__PURE__ */ U(F, {
859
+ size: 14,
860
+ className: p ? "animate-spin" : ""
861
+ }), l(r, "sandbox.detail.logs.refresh", "Refresh")]
862
+ }),
863
+ _.length > 0 && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(n, {
864
+ variant: "ghost",
865
+ size: "sm",
866
+ onClick: () => {
867
+ S("light"), x(_.join("\n")).then((e) => {
868
+ e ? (C("success"), b() && w("Copied logs")) : C("error");
869
+ });
870
+ },
871
+ title: l(r, "sandbox.detail.logs.copy.title", "Copy logs to clipboard"),
872
+ children: /* @__PURE__ */ U(j, { size: 14 })
873
+ }), /* @__PURE__ */ U(n, {
874
+ variant: "ghost",
875
+ size: "sm",
876
+ onClick: () => {
877
+ let t = new Blob([_.join("\n")], { type: "text/plain" }), n = URL.createObjectURL(t), r = document.createElement("a");
878
+ r.href = n, r.download = `sandbox-${e.name}-logs.txt`, r.click(), URL.revokeObjectURL(n);
879
+ },
880
+ title: l(r, "sandbox.detail.logs.download.title", "Download logs"),
881
+ children: /* @__PURE__ */ U(N, { size: 14 })
882
+ })] })
883
+ ]
884
+ })]
885
+ }), /* @__PURE__ */ W("div", {
886
+ className: "bg-zinc-950 text-zinc-300 rounded-lg p-4 font-mono text-xs leading-relaxed min-h-[200px] max-h-[500px] overflow-y-auto",
767
887
  children: [
768
- e.containers && e.containers.length > 1 && /* @__PURE__ */ H("select", {
769
- value: s,
770
- onChange: (e) => c(e.target.value),
771
- className: "px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono",
772
- children: e.containers.map((e) => /* @__PURE__ */ H("option", {
773
- value: e.name,
774
- children: e.name
775
- }, e.name))
888
+ !h && /* @__PURE__ */ U("p", {
889
+ className: "text-zinc-500",
890
+ children: l(r, "sandbox.detail.logs.unavailable", "Logs are available when the sandbox is running.")
776
891
  }),
777
- /* @__PURE__ */ U("select", {
778
- value: l,
779
- onChange: (e) => u(Number(e.target.value)),
780
- className: "px-2 py-1 text-xs border rounded-lg bg-bg-surface font-mono",
781
- children: [
782
- /* @__PURE__ */ H("option", {
783
- value: 50,
784
- children: a(o, "sandbox.detail.logs.tailLines.50", "50 lines")
785
- }),
786
- /* @__PURE__ */ H("option", {
787
- value: 100,
788
- children: a(o, "sandbox.detail.logs.tailLines.100", "100 lines")
789
- }),
790
- /* @__PURE__ */ H("option", {
791
- value: 500,
792
- children: a(o, "sandbox.detail.logs.tailLines.500", "500 lines")
793
- }),
794
- /* @__PURE__ */ H("option", {
795
- value: 1e3,
796
- children: a(o, "sandbox.detail.logs.tailLines.1000", "1000 lines")
797
- })
798
- ]
892
+ p && /* @__PURE__ */ U("p", {
893
+ className: "text-zinc-500 animate-pulse",
894
+ children: l(r, "sandbox.detail.logs.fetching", "Fetching logs...")
799
895
  }),
800
- /* @__PURE__ */ U(n, {
801
- variant: "ghost",
802
- size: "sm",
803
- onClick: C,
804
- disabled: !_ || h,
805
- children: [/* @__PURE__ */ H(F, {
806
- size: 14,
807
- className: h ? "animate-spin" : ""
808
- }), a(o, "sandbox.detail.logs.refresh", "Refresh")]
896
+ m && /* @__PURE__ */ U("p", {
897
+ className: "text-status-error-text",
898
+ children: l(r, "sandbox.detail.logs.fetchError", "Failed to fetch logs: {message}", { message: m.message })
899
+ }),
900
+ _.length > 0 && !p ? _.map((e, t) => /* @__PURE__ */ U("p", {
901
+ className: e.toLowerCase().includes("error") ? "text-status-error-text" : e.toLowerCase().includes("warn") ? "text-status-warning-text" : "text-zinc-300",
902
+ children: e
903
+ }, `${t}:${e}`)) : !p && h && !m && /* @__PURE__ */ U("p", {
904
+ className: "text-zinc-500",
905
+ children: l(r, "sandbox.detail.logs.empty", "No logs yet. Click Refresh to fetch.")
809
906
  }),
810
- w.length > 0 && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(n, {
811
- variant: "ghost",
812
- size: "sm",
813
- onClick: () => {
814
- b("light"), y(w.join("\n")).then((e) => {
815
- e ? (x("success"), v() && S("Copied logs")) : x("error");
816
- });
817
- },
818
- title: a(o, "sandbox.detail.logs.copy.title", "Copy logs to clipboard"),
819
- children: /* @__PURE__ */ H(j, { size: 14 })
820
- }), /* @__PURE__ */ H(n, {
821
- variant: "ghost",
822
- size: "sm",
823
- onClick: () => {
824
- let t = new Blob([w.join("\n")], { type: "text/plain" }), n = URL.createObjectURL(t), r = document.createElement("a");
825
- r.href = n, r.download = `sandbox-${e.name}-logs.txt`, r.click(), URL.revokeObjectURL(n);
826
- },
827
- title: a(o, "sandbox.detail.logs.download.title", "Download logs"),
828
- children: /* @__PURE__ */ H(M, { size: 14 })
829
- })] })
907
+ /* @__PURE__ */ U("div", { ref: u })
830
908
  ]
831
909
  })]
832
- }), /* @__PURE__ */ U("div", {
833
- className: "bg-zinc-950 text-zinc-300 rounded-lg p-4 font-mono text-xs leading-relaxed min-h-[200px] max-h-[500px] overflow-y-auto",
834
- children: [
835
- !_ && /* @__PURE__ */ H("p", {
836
- className: "text-zinc-500",
837
- children: a(o, "sandbox.detail.logs.unavailable", "Logs are available when the sandbox is running.")
838
- }),
839
- h && /* @__PURE__ */ H("p", {
840
- className: "text-zinc-500 animate-pulse",
841
- children: a(o, "sandbox.detail.logs.fetching", "Fetching logs...")
842
- }),
843
- g && /* @__PURE__ */ H("p", {
844
- className: "text-status-error-text",
845
- children: a(o, "sandbox.detail.logs.fetchError", "Failed to fetch logs: {message}", { message: g.message })
846
- }),
847
- w.length > 0 && !h ? w.map((e, t) => /* @__PURE__ */ H("p", {
848
- className: e.toLowerCase().includes("error") ? "text-status-error-text" : e.toLowerCase().includes("warn") ? "text-status-warning-text" : "text-zinc-300",
849
- children: e
850
- }, `${t}:${e}`)) : !h && _ && !g && /* @__PURE__ */ H("p", {
851
- className: "text-zinc-500",
852
- children: a(o, "sandbox.detail.logs.empty", "No logs yet. Click Refresh to fetch.")
853
- }),
854
- /* @__PURE__ */ H("div", { ref: d })
855
- ]
856
- })]
857
- }) });
910
+ })
911
+ });
858
912
  }
859
913
  //#endregion
860
- export { J as SandboxDetailPage };
914
+ export { Y as SandboxDetailPage };
861
915
 
862
916
  //# sourceMappingURL=SandboxDetailPage.js.map