chore: fix formatting
This commit is contained in:
1 parent
df42932e0c
commit
e818f1cd61
2 files changed
+70
-66
No files matched your search
@@ -56,49 +56,49 @@ const MonitorDetailsControlHeader = ({
|
|||||||
>
|
>
|
||||||
<Status monitor={monitor} />
|
<Status monitor={monitor} />
|
||||||
|
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.spacing(2)}
|
gap={theme.spacing(2)}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
loading={isSending}
|
loading={isSending}
|
||||||
startIcon={<EmailIcon />}
|
startIcon={<EmailIcon />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
testAllNotifications({ monitorId: monitor?._id });
|
testAllNotifications({ monitorId: monitor?._id });
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: "nowrap",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("sendTestNotifications")}
|
{t("sendTestNotifications")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
navigate(`/incidents/${monitor?._id}`);
|
navigate(`/incidents/${monitor?._id}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("menu.incidents")}
|
{t("menu.incidents")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
loading={isPausing}
|
loading={isPausing}
|
||||||
startIcon={
|
startIcon={
|
||||||
monitor?.isActive ? <PauseOutlinedIcon /> : <PlayArrowOutlinedIcon />
|
monitor?.isActive ? <PauseOutlinedIcon /> : <PlayArrowOutlinedIcon />
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
pauseMonitor({
|
pauseMonitor({
|
||||||
monitorId: monitor?._id,
|
monitorId: monitor?._id,
|
||||||
triggerUpdate,
|
triggerUpdate,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{monitor?.isActive ? "Pause" : "Resume"}
|
{monitor?.isActive ? "Pause" : "Resume"}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -23,30 +23,34 @@ import { useMonitorUtils } from "../../Hooks/useMonitorUtils";
|
|||||||
const Status = ({ monitor }) => {
|
const Status = ({ monitor }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { statusColor, determineState } = useMonitorUtils();
|
const { statusColor, determineState } = useMonitorUtils();
|
||||||
|
const URL_TRUNCATION_LENGTH = 55;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Typography variant="monitorName">{monitor?.name}</Typography>
|
<Typography variant="monitorName">{monitor?.name}</Typography>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
alignItems={"center"}
|
alignItems={"center"}
|
||||||
gap={theme.spacing(4)}
|
gap={theme.spacing(4)}
|
||||||
>
|
>
|
||||||
<PulseDot color={statusColor[determineState(monitor)]} />
|
<PulseDot color={statusColor[determineState(monitor)]} />
|
||||||
<Typography variant="monitorUrl" noWrap>
|
<Typography
|
||||||
{monitor?.url ? (
|
variant="monitorUrl"
|
||||||
monitor.url?.length > 55
|
noWrap
|
||||||
? `${monitor.url.replace(/^https?:\/\//, "")?.slice(0, 55)}…`
|
>
|
||||||
: monitor.url.replace(/^https?:\/\//, "")
|
{monitor?.url
|
||||||
) : "…"}
|
? monitor.url?.length > URL_TRUNCATION_LENGTH
|
||||||
</Typography>
|
? `${monitor.url.replace(/^https?:\/\//, "")?.slice(0, URL_TRUNCATION_LENGTH)}…`
|
||||||
<Dot />
|
: monitor.url.replace(/^https?:\/\//, "")
|
||||||
<Typography>
|
: "…"}
|
||||||
Checking every {formatDurationRounded(monitor?.interval)}.
|
</Typography>
|
||||||
</Typography>
|
<Dot />
|
||||||
</Stack>
|
<Typography>
|
||||||
</Stack>
|
Checking every {formatDurationRounded(monitor?.interval)}.
|
||||||
);
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Status.propTypes = {
|
Status.propTypes = {
|
||||||
|
|||||||
Reference in new issue
Block a user