diff --git a/ui/app/mirrors/[mirrorId]/handlers.ts b/ui/app/mirrors/[mirrorId]/handlers.ts index f8e1d8a0ab..d382d47345 100644 --- a/ui/app/mirrors/[mirrorId]/handlers.ts +++ b/ui/app/mirrors/[mirrorId]/handlers.ts @@ -27,13 +27,14 @@ export async function getCurrentIdleTimeout(mirrorName: string) { export async function changeFlowState( mirrorName: string, flowState: FlowStatus, - dropStats?: boolean + dropStats?: boolean, + skipDestDrop?: boolean ): Promise { const req: FlowStateChangeRequest = { flowJobName: mirrorName, requestedFlowState: flowState, dropMirrorStats: dropStats ?? false, - skipDestinationDrop: false, + skipDestinationDrop: skipDestDrop ?? false, }; const res = await fetch('/api/v1/mirrors/state_change', { method: 'POST', diff --git a/ui/components/DropDialog.tsx b/ui/components/DropDialog.tsx index b71c2284c8..fed6bb5169 100644 --- a/ui/components/DropDialog.tsx +++ b/ui/components/DropDialog.tsx @@ -31,13 +31,15 @@ async function handleDropMirror( dropArgs: dropMirrorArgs, setLoading: Dispatch>, setMsg: Dispatch>, - dropStats: boolean + dropStats: boolean, + skipDestDrop: boolean ) { setLoading(true); const res = await changeFlowState( dropArgs.flowJobName, FlowStatus.STATUS_TERMINATING, - dropStats + dropStats, + skipDestDrop ); setLoading(false); if (res.status !== 200) { @@ -60,6 +62,7 @@ export default function DropDialog({ const [loading, setLoading] = useState(false); const [msg, setMsg] = useState(''); const [dropStats, setDropStats] = useState(true); + const [skipDestDrop, setSkipDestDrop] = useState(false); const handleDropPeer = async (dropArgs: dropPeerArgs) => { if (!dropArgs.peerName) { @@ -133,7 +136,8 @@ export default function DropDialog({ dropArgs as dropMirrorArgs, setLoading, setMsg, - dropStats + dropStats, + skipDestDrop ); case 'PEER': return handleDropPeer(dropArgs as dropPeerArgs); @@ -179,6 +183,19 @@ export default function DropDialog({ } /> )} + {mode === 'MIRROR' && ( + Skip destination metadata (such as _peerdb_raw table) + } + action={ + setSkipDestDrop(state)} + /> + } + /> + )}