Show sandbox list in destroy mode
This commit is contained in:
+33
-1
@@ -214,12 +214,13 @@ export default function Dashboard() {
|
|||||||
<ConfigurationPanel sandboxId="new-sandbox" mode="create" onCreateSuccess={handleCreateSuccess} />
|
<ConfigurationPanel sandboxId="new-sandbox" mode="create" onCreateSuccess={handleCreateSuccess} />
|
||||||
</div>
|
</div>
|
||||||
) : isDestroyMode ? (
|
) : isDestroyMode ? (
|
||||||
|
<div className="space-y-6">
|
||||||
<div className="panel p-8 border-2 border-[var(--status-stopped)]">
|
<div className="panel p-8 border-2 border-[var(--status-stopped)]">
|
||||||
<h1 className="text-lg font-semibold text-[var(--status-stopped)] uppercase tracking-wider mb-4">
|
<h1 className="text-lg font-semibold text-[var(--status-stopped)] uppercase tracking-wider mb-4">
|
||||||
DESTROY SANDBOX
|
DESTROY SANDBOX
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-sm text-[var(--foreground-dim)] mb-4">
|
<p className="text-sm text-[var(--foreground-dim)] mb-4">
|
||||||
Click on any sandbox below to initiate destruction. All sandboxes are highlighted in red.
|
Click a sandbox below to destroy it.
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<button
|
<button
|
||||||
@@ -233,6 +234,37 @@ export default function Dashboard() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{lifecycleMessage && (
|
||||||
|
<div className="panel p-4 text-xs text-[var(--foreground-dim)] whitespace-pre-wrap" data-testid="sandbox-lifecycle-message">
|
||||||
|
{lifecycleMessage}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{inventoryEnabled && loading ? (
|
||||||
|
<div className="flex items-center justify-center h-64" data-testid="inventory-loading-state">
|
||||||
|
<div className="text-xs text-[var(--foreground-dim)] font-mono uppercase tracking-wider">
|
||||||
|
INITIALIZING...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : inventoryEnabled && error ? (
|
||||||
|
<div className="panel p-8 text-center" data-testid="inventory-error-state">
|
||||||
|
<h3 className="text-sm font-semibold text-[var(--status-stopped)] uppercase tracking-wider">Inventory Unavailable</h3>
|
||||||
|
<p className="text-xs text-[var(--foreground-dim)] mt-2 font-mono">{error}</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<SandboxList
|
||||||
|
sandboxes={sandboxes}
|
||||||
|
nemoclaw={nemoclaw}
|
||||||
|
dashboardSessionId={dashboardSession.dashboardSessionId}
|
||||||
|
selectedSandboxId={dashboardSession.selectedSandboxId}
|
||||||
|
selectedSandbox={selectedSandbox}
|
||||||
|
onSandboxSelect={handleSandboxSelect}
|
||||||
|
isDestroyMode={isDestroyMode}
|
||||||
|
onInventoryRefresh={refresh}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between mb-8">
|
<div className="flex items-center justify-between mb-8">
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ assert.match(pageSource, /fetch\('\/api\/sandbox\/delete'/, 'destroy workflow mu
|
|||||||
assert.match(pageSource, /refresh\(\{ force: true \}\)/, 'create and destroy workflows must force fresh inventory reads')
|
assert.match(pageSource, /refresh\(\{ force: true \}\)/, 'create and destroy workflows must force fresh inventory reads')
|
||||||
assert.match(pageSource, /refreshUntilSandboxVisible/, 'create workflow must wait for the new sandbox to appear in inventory')
|
assert.match(pageSource, /refreshUntilSandboxVisible/, 'create workflow must wait for the new sandbox to appear in inventory')
|
||||||
assert.match(pageSource, /refreshUntilSandboxGone/, 'destroy workflow must wait for deleted sandboxes to leave inventory')
|
assert.match(pageSource, /refreshUntilSandboxGone/, 'destroy workflow must wait for deleted sandboxes to leave inventory')
|
||||||
|
assert.match(
|
||||||
|
pageSource,
|
||||||
|
/isDestroyMode \? \([\s\S]*<SandboxList[\s\S]*isDestroyMode=\{isDestroyMode\}/,
|
||||||
|
'destroy mode must render the sandbox list so a sandbox can be selected'
|
||||||
|
)
|
||||||
assert.doesNotMatch(pageSource, /console\.log\('Destroying sandbox:'/, 'destroy workflow must not be a UI-only placeholder')
|
assert.doesNotMatch(pageSource, /console\.log\('Destroying sandbox:'/, 'destroy workflow must not be a UI-only placeholder')
|
||||||
assert.doesNotMatch(configPanelSource, /onInventoryRefresh/, 'create panel must leave post-create inventory orchestration to the parent')
|
assert.doesNotMatch(configPanelSource, /onInventoryRefresh/, 'create panel must leave post-create inventory orchestration to the parent')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user