fix(ui): shorten URL label and resize notification button (#2470)
This commit is contained in:
1 parent
36d8e8c0cf
commit
df42932e0c
2 files changed
+66
-59
No files matched your search
@@ -56,46 +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={{
|
||||||
{t("sendTestNotifications")}
|
whiteSpace: 'nowrap',
|
||||||
</Button>
|
}}
|
||||||
<Button
|
>
|
||||||
variant="contained"
|
{t("sendTestNotifications")}
|
||||||
color="secondary"
|
</Button>
|
||||||
onClick={(e) => {
|
<Button
|
||||||
navigate(`/incidents/${monitor?._id}`);
|
variant="contained"
|
||||||
}}
|
color="secondary"
|
||||||
>
|
onClick={(e) => {
|
||||||
{t("menu.incidents")}
|
navigate(`/incidents/${monitor?._id}`);
|
||||||
</Button>
|
}}
|
||||||
<Button
|
>
|
||||||
variant="contained"
|
{t("menu.incidents")}
|
||||||
color="secondary"
|
</Button>
|
||||||
loading={isPausing}
|
<Button
|
||||||
startIcon={
|
variant="contained"
|
||||||
monitor?.isActive ? <PauseOutlinedIcon /> : <PlayArrowOutlinedIcon />
|
color="secondary"
|
||||||
}
|
loading={isPausing}
|
||||||
onClick={() => {
|
startIcon={
|
||||||
pauseMonitor({
|
monitor?.isActive ? <PauseOutlinedIcon /> : <PlayArrowOutlinedIcon />
|
||||||
monitorId: monitor?._id,
|
}
|
||||||
triggerUpdate,
|
onClick={() => {
|
||||||
});
|
pauseMonitor({
|
||||||
}}
|
monitorId: monitor?._id,
|
||||||
>
|
triggerUpdate,
|
||||||
{monitor?.isActive ? "Pause" : "Resume"}
|
});
|
||||||
</Button>
|
}}
|
||||||
|
>
|
||||||
|
{monitor?.isActive ? "Pause" : "Resume"}
|
||||||
|
</Button>
|
||||||
|
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -24,25 +24,29 @@ const Status = ({ monitor }) => {
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { statusColor, determineState } = useMonitorUtils();
|
const { statusColor, determineState } = useMonitorUtils();
|
||||||
|
|
||||||
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">
|
<Typography variant="monitorUrl" noWrap>
|
||||||
{monitor?.url?.replace(/^https?:\/\//, "") || "..."}
|
{monitor?.url ? (
|
||||||
</Typography>
|
monitor.url?.length > 55
|
||||||
<Dot />
|
? `${monitor.url.replace(/^https?:\/\//, "")?.slice(0, 55)}…`
|
||||||
<Typography>
|
: monitor.url.replace(/^https?:\/\//, "")
|
||||||
Checking every {formatDurationRounded(monitor?.interval)}.
|
) : "…"}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
<Dot />
|
||||||
</Stack>
|
<Typography>
|
||||||
);
|
Checking every {formatDurationRounded(monitor?.interval)}.
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Status.propTypes = {
|
Status.propTypes = {
|
||||||
|
|||||||
Reference in new issue
Block a user