remove pause from uptime config page
This commit is contained in:
1 parent
54db96a03e
commit
f9fcd4ff3a
1 file changed
-49
@@ -158,23 +158,6 @@ const Configure = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePause = async () => {
|
|
||||||
try {
|
|
||||||
const action = await dispatch(pauseUptimeMonitor({ monitorId }));
|
|
||||||
if (pauseUptimeMonitor.fulfilled.match(action)) {
|
|
||||||
const monitor = action.payload.data;
|
|
||||||
setMonitor(monitor);
|
|
||||||
const state = action?.payload?.data.isActive === false ? "paused" : "resumed";
|
|
||||||
createToast({ body: `Monitor ${state} successfully.` });
|
|
||||||
} else if (pauseUptimeMonitor.rejected.match(action)) {
|
|
||||||
throw new Error(action.error.message);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
logger.error("Error pausing monitor: " + monitorId);
|
|
||||||
createToast({ body: "Failed to pause monitor" });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = async (event) => {
|
const handleSubmit = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const action = await dispatch(updateUptimeMonitor({ monitor: monitor }));
|
const action = await dispatch(updateUptimeMonitor({ monitor: monitor }));
|
||||||
@@ -329,38 +312,6 @@ const Configure = () => {
|
|||||||
ml: "auto",
|
ml: "auto",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
color="secondary"
|
|
||||||
loading={isLoading}
|
|
||||||
sx={{
|
|
||||||
pl: theme.spacing(4),
|
|
||||||
pr: theme.spacing(6),
|
|
||||||
mr: theme.spacing(6),
|
|
||||||
"& svg": {
|
|
||||||
mr: theme.spacing(2),
|
|
||||||
width: 22,
|
|
||||||
height: 22,
|
|
||||||
"& path": {
|
|
||||||
stroke: theme.palette.primary.contrastTextTertiary,
|
|
||||||
strokeWidth: 1.7,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
onClick={handlePause}
|
|
||||||
>
|
|
||||||
{monitor?.isActive ? (
|
|
||||||
<>
|
|
||||||
<PauseIcon />
|
|
||||||
{t("pause")}
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<ResumeIcon />
|
|
||||||
{t("resume")}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
|
|||||||
Reference in new issue
Block a user