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,6 +222,7 @@ const TopologyList: React.FC = () => {
<Power size={10} /> {armed === `td:${r.id}` ? 'CONFIRM?' : 'TEARDOWN'} <Power size={10} /> {armed === `td:${r.id}` ? 'CONFIRM?' : 'TEARDOWN'}
</button> </button>
)} )}
{!['active', 'degraded', 'deploying'].includes(r.status) && (
<button <button
type="button" type="button"
className={`tlist-btn small danger ${armed === r.id ? 'armed' : ''}`} className={`tlist-btn small danger ${armed === r.id ? 'armed' : ''}`}
@@ -231,6 +232,7 @@ const TopologyList: React.FC = () => {
> >
<Trash2 size={10} /> {armed === r.id ? 'CONFIRM?' : 'DELETE'} <Trash2 size={10} /> {armed === r.id ? 'CONFIRM?' : 'DELETE'}
</button> </button>
)}
</div> </div>
</div> </div>
))} ))}