Merge pull request #3156 from bluewave-labs/fix/monitor/pause-button
Fix: Configure Pause Button
This commit is contained in:
2 files changed
+9
-8
No files matched your search
@@ -124,7 +124,7 @@ const MonitorDetailsControlHeader = ({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{monitor?.isActive ? "Pause" : "Resume"}
|
{monitor?.isActive ? t("pause") : t("resume")}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
|
|||||||
@@ -80,13 +80,13 @@ const UptimeCreate = ({ isClone = false }) => {
|
|||||||
const [isFetchingMonitor] = useFetchMonitorById({
|
const [isFetchingMonitor] = useFetchMonitorById({
|
||||||
monitorId,
|
monitorId,
|
||||||
setMonitor,
|
setMonitor,
|
||||||
updateTrigger: true,
|
updateTrigger,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fetch games
|
// Fetch games
|
||||||
const [isFetchingGames] = useFetchMonitorGames({
|
const [isFetchingGames] = useFetchMonitorGames({
|
||||||
setGames,
|
setGames,
|
||||||
triggerUpdate: true,
|
updateTrigger,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Combine the loading states
|
// Combine the loading states
|
||||||
@@ -283,10 +283,6 @@ const UptimeCreate = ({ isClone = false }) => {
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePause = async () => {
|
|
||||||
await pauseMonitor({ monitorId, triggerUpdate });
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleRemove = async (event) => {
|
const handleRemove = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const TEMP_MONITOR = { id: monitor.id };
|
const TEMP_MONITOR = { id: monitor.id };
|
||||||
@@ -438,7 +434,12 @@ const UptimeCreate = ({ isClone = false }) => {
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
onClick={handlePause}
|
onClick={() => {
|
||||||
|
pauseMonitor({
|
||||||
|
monitorId: monitor?.id,
|
||||||
|
triggerUpdate,
|
||||||
|
});
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{monitor?.isActive ? t("pause") : t("resume")}
|
{monitor?.isActive ? t("pause") : t("resume")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in new issue
Block a user