Files
AetherForge/server/web/src/components/Fleet/FleetDeleteConfirmModal.tsx
AetherForge 07fdb39b63
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Add fleet registry removal with confirm modal and agent_removed WS.
Operators can remove machines from Crucible and dashboard rosters with honest messaging that deletion is registry-only; bulk select, oath ledger entries, and Go/Vitest coverage included.
2026-06-07 18:23:41 -07:00

62 lines
1.8 KiB
TypeScript

import { useModalAmbientDuck } from '../../context/AmbientMusicContext';
import { HelpTip } from '../HelpTip';
import './FleetDeleteConfirmModal.css';
interface Props {
open: boolean;
count: number;
agentName?: string;
onConfirm: () => void;
onCancel: () => void;
}
export default function FleetDeleteConfirmModal({
open,
count,
agentName,
onConfirm,
onCancel,
}: Props) {
useModalAmbientDuck(open);
if (!open || count < 1) return null;
const title =
count === 1 && agentName
? `Remove "${agentName}" from fleet?`
: `Remove ${count} machine${count === 1 ? '' : 's'} from fleet?`;
return (
<div className="fleet-delete-modal-backdrop" role="presentation" onClick={onCancel}>
<div
className="fleet-delete-modal card"
role="dialog"
aria-labelledby="fleet-delete-modal-title"
onClick={(e) => e.stopPropagation()}
>
<h2 id="fleet-delete-modal-title" className="font-display">
Remove from fleet
<HelpTip field="fl_delete_roster" />
</h2>
<p className="fleet-delete-modal-lead">{title}</p>
<p className="form-hint fleet-delete-modal-honest">
Removes the record from the server fleet registry only does not uninstall the agent on
the host. Use Remote Actions Uninstall if you need to remove the miner binary.
</p>
<div className="fleet-delete-modal-actions">
<button type="button" className="btn btn-outline" onClick={onCancel}>
Cancel
</button>
<button
type="button"
className="btn btn-sm fleet-delete-modal-confirm"
onClick={onConfirm}
>
Remove from fleet
</button>
</div>
</div>
</div>
);
}