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