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:
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user