Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
},[])
const[open, setOpen] = React.useState(false);
const[openApprove, setOpenApprove] = React.useState(false);
const[openPause, setOpenPause] = React.useState(false);
const[openResume, setOpenResume] = React.useState(false);
const[openKillWarn, setOpenKillWarn] = React.useState(false);
const[openApproveWarn, setOpenApproveWarn] = React.useState(false);
const[openPauseWarn, setOpenPauseWarn] = React.useState(false);
const[openResumeWarn, setOpenResumeWarn] = React.useState(false);
const[openUpdatePriority,setOpenUpdatePriority] = React.useState(false);
const [openUpatePriorityWarn, setUpdatePriorityWarn] = React.useState(false);
const { clusters } = React.useContext(ClusterContext);
const [currentJob, setCurrentJob] = React.useState({jobId:'',cluster:'',priority: 100});
const deleteUrl = `/api/clusters/`;
const requestDelete = useFetch(deleteUrl);
const killJob = async () => {
const body = {"status":"killing"};
const data = await requestDelete.put(`${currentJob.cluster}/jobs/${currentJob.jobId}/status/`,body);
return data;
}
const approveJob = async () => {
const body = {"status":"approved"};
const data = await requestDelete.put(`${currentJob.cluster}/jobs/${currentJob.jobId}/status/`,body);
return data;
}
const pauseJob = async () => {
const body = {"status":"pausing"};
const data = await requestDelete.put(`${currentJob.cluster}/jobs/${currentJob.jobId}/status/`,body);
return data;
}
const resumeJob = async () => {