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