Skip to content

Commit 41d3a2d

Browse files
fix: show Killed/Paused instead of Stopped in sandbox detail header (#341)
Co-authored-by: jakub@e2b.dev <jakub@e2b.dev>
1 parent 58ab886 commit 41d3a2d

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

src/features/dashboard/sandbox/header/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function SandboxDetailsHeader() {
2121

2222
const runningLabel = isInitialLoading || isRunning ? 'running for' : 'ran for'
2323
const timeoutLabel = isKilled
24-
? 'stopped at'
24+
? 'killed at'
2525
: isPaused
2626
? 'paused at'
2727
: 'timeout in'

src/features/dashboard/sandbox/header/status.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ export default function Status() {
1717
)
1818
}
1919

20+
if (state === 'killed') {
21+
return (
22+
<Badge variant="error" className="uppercase">
23+
<DotIcon className="size-3 fill-current" />
24+
Killed
25+
</Badge>
26+
)
27+
}
28+
2029
return (
2130
<Badge variant={isRunning ? 'positive' : 'error'} className="uppercase">
2231
<DotIcon

src/features/dashboard/sandbox/inspect/stopped-banner.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface StoppedBannerProps {
1818
}
1919

2020
export function StoppedBanner({ rootNodeCount }: StoppedBannerProps) {
21-
const { isRunning } = useSandboxContext()
21+
const { isRunning, sandboxInfo } = useSandboxContext()
2222
const lastUpdated = useLastUpdated()
2323
const watcherError = useWatcherError()
2424

@@ -29,6 +29,13 @@ export function StoppedBanner({ rootNodeCount }: StoppedBannerProps) {
2929

3030
const showWatcherError = watcherError && isRunning && rootNodeCount > 0
3131

32+
const stoppedLabel =
33+
sandboxInfo?.state === 'paused'
34+
? 'Sandbox Paused'
35+
: sandboxInfo?.state === 'killed'
36+
? 'Sandbox Killed'
37+
: 'Sandbox Stopped'
38+
3239
return (
3340
<AnimatePresence mode="wait">
3441
{show && (
@@ -48,7 +55,7 @@ export function StoppedBanner({ rootNodeCount }: StoppedBannerProps) {
4855
<span className="prose-headline-small uppercase">
4956
{showWatcherError
5057
? 'Live filesystem updates disabled'
51-
: 'Sandbox Stopped'}
58+
: stoppedLabel}
5259
</span>
5360
</CardTitle>
5461
<CardDescription>

0 commit comments

Comments
 (0)