@burdenoff/microfe-sandbox 2026.510.113

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