Merge pull request #2317 from bluewave-labs/Pause-button-addition-on-configuration
Added pause button in configuration page.
This commit is contained in:
3 files changed
+52
-17
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import { useCallback } from "react";
|
||||
import { useTheme } from "@mui/material";
|
||||
|
||||
const useMonitorUtils = () => {
|
||||
|
||||
const getMonitorWithPercentage = useCallback((monitor, theme) => {
|
||||
let uptimePercentage = "";
|
||||
let percentageColor = "";
|
||||
@@ -36,7 +38,16 @@ const useMonitorUtils = () => {
|
||||
return monitor?.status == true ? "up" : "down";
|
||||
}, []);
|
||||
|
||||
return { getMonitorWithPercentage, determineState };
|
||||
const theme = useTheme();
|
||||
|
||||
const statusColor = {
|
||||
up: theme.palette.success.lowContrast,
|
||||
down: theme.palette.error.lowContrast,
|
||||
paused: theme.palette.warning.lowContrast,
|
||||
pending: theme.palette.warning.lowContrast,
|
||||
};
|
||||
|
||||
return { getMonitorWithPercentage, determineState, statusColor };
|
||||
};
|
||||
|
||||
export { useMonitorUtils };
|
||||
Reference in new issue
Block a user