feat(web/topology): hide DELETE on running topologies

The DELETE path on a topology whose containers are still up is a
footgun — even if the backend rejects the delete, surfacing the
button invites mistakes. Gate it so DELETE only shows for pending,
failed, and torn-down topologies. Active/degraded/deploying topologies
must be torn down first, which then reveals DELETE again.
This commit is contained in:
2026-04-22 17:14:17 -04:00
parent 6f537f52c2
commit dca6eddd5f

View File

@@ -222,15 +222,17 @@ const TopologyList: React.FC = () => {
<Power size={10} /> {armed === `td:${r.id}` ? 'CONFIRM?' : 'TEARDOWN'}
</button>
)}
<button
type="button"
className={`tlist-btn small danger ${armed === r.id ? 'armed' : ''}`}
disabled={busy === r.id}
onClick={() => armed === r.id ? onDelete(r.id) : arm(r.id)}
title={armed === r.id ? 'Click again to confirm' : 'Delete'}
>
<Trash2 size={10} /> {armed === r.id ? 'CONFIRM?' : 'DELETE'}
</button>
{!['active', 'degraded', 'deploying'].includes(r.status) && (
<button
type="button"
className={`tlist-btn small danger ${armed === r.id ? 'armed' : ''}`}
disabled={busy === r.id}
onClick={() => armed === r.id ? onDelete(r.id) : arm(r.id)}
title={armed === r.id ? 'Click again to confirm' : 'Delete'}
>
<Trash2 size={10} /> {armed === r.id ? 'CONFIRM?' : 'DELETE'}
</button>
)}
</div>
</div>
))}