Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ui/app/mirrors/[mirrorId]/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response> {
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',
Expand Down
23 changes: 20 additions & 3 deletions ui/components/DropDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ async function handleDropMirror(
dropArgs: dropMirrorArgs,
setLoading: Dispatch<SetStateAction<boolean>>,
setMsg: Dispatch<SetStateAction<string>>,
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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -133,7 +136,8 @@ export default function DropDialog({
dropArgs as dropMirrorArgs,
setLoading,
setMsg,
dropStats
dropStats,
skipDestDrop
);
case 'PEER':
return handleDropPeer(dropArgs as dropPeerArgs);
Expand Down Expand Up @@ -179,6 +183,19 @@ export default function DropDialog({
}
/>
)}
{mode === 'MIRROR' && (
<RowWithCheckbox
label={
<Label>Skip destination metadata (such as _peerdb_raw table)</Label>
}
action={
<Checkbox
checked={skipDestDrop}
onCheckedChange={(state: boolean) => setSkipDestDrop(state)}
/>
}
/>
)}
<div style={{ display: 'flex', marginTop: '1rem' }}>
<DialogClose>
<Button variant='normal'>Cancel</Button>
Expand Down
Loading