Move up/down chips next to the monitor name

This commit is contained in:
Sajan committed 2025-11-12 09:58:38 -06:00
1 parent d157e200f6
commit 69dbc2fe7a
3 files changed
+26 -21

No files matched your search

+22 -5
View File
@@ -2,6 +2,7 @@ import { Stack, Typography } from "@mui/material";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { useTheme } from "@emotion/react"; import { useTheme } from "@emotion/react";
import Dot from "../Dot/index.jsx"; import Dot from "../Dot/index.jsx";
import { StatusLabel } from "@/Components/v1/Label/index.jsx";
/** /**
* Host component. * Host component.
* This subcomponent receives a params object and displays the host details. * This subcomponent receives a params object and displays the host details.
@@ -14,7 +15,7 @@ import Dot from "../Dot/index.jsx";
* @param {number} params.percentage - The percentage to display. * @param {number} params.percentage - The percentage to display.
* @returns {React.ElementType} Returns a div element with the host details. * @returns {React.ElementType} Returns a div element with the host details.
*/ */
const Host = ({ url, title, percentageColor, percentage, showURL }) => { const Host = ({ url, title, percentageColor, percentage, showURL, status }) => {
const theme = useTheme(); const theme = useTheme();
return ( return (
<Stack> <Stack>
@@ -22,21 +23,36 @@ const Host = ({ url, title, percentageColor, percentage, showURL }) => {
direction="row" direction="row"
position="relative" position="relative"
alignItems="center" alignItems="center"
gap={theme.spacing(4)} gap={theme.spacing(5)}
> >
{title} <Typography
variant="h6"
sx={{
fontWeight: 600,
fontSize: "1.1rem",
}}
>
{title}
</Typography>
{percentageColor && percentage && ( {percentageColor && percentage && (
<> <>
<Dot /> <Dot />
<Typography <Typography
component="span" variant="h6"
sx={{ sx={{
fontWeight: 600,
fontSize: "1.1rem",
color: percentageColor, color: percentageColor,
fontWeight: 500,
}} }}
> >
{percentage}% {percentage}%
</Typography> </Typography>
<StatusLabel
status={status}
text={status}
customStyles={{ textTransform: "capitalize" }}
/>
</> </>
)} )}
</Stack> </Stack>
@@ -51,6 +67,7 @@ Host.propTypes = {
percentage: PropTypes.string, percentage: PropTypes.string,
url: PropTypes.string, url: PropTypes.string,
showURL: PropTypes.bool, showURL: PropTypes.bool,
status: PropTypes.string,
}; };
export default Host; export default Host;
+2 -4
View File
@@ -147,11 +147,9 @@ const StatusLabel = ({ status, text, customStyles }) => {
}} }}
> >
<Box <Box
width={7}
height={7}
bgcolor={theme.palette[themeColor].lowContrast} bgcolor={theme.palette[themeColor].lowContrast}
borderRadius="50%" borderRadius="0%"
marginRight="5px" marginRight="1px"
/> />
</BaseLabel> </BaseLabel>
); );
@@ -30,7 +30,7 @@ const MonitorsList = ({
<Stack <Stack
key={monitor._id} key={monitor._id}
width="100%" width="100%"
gap={theme.spacing(3)} gap={theme.spacing(10)}
margin="0 auto" margin="0 auto"
maxWidth="95%" maxWidth="95%"
> >
@@ -41,6 +41,7 @@ const MonitorsList = ({
percentageColor={monitor.percentageColor} percentageColor={monitor.percentageColor}
percentage={monitor.percentage} percentage={monitor.percentage}
showURL={showURL} showURL={showURL}
status={status}
/> />
<Stack <Stack
direction="row" direction="row"
@@ -52,17 +53,6 @@ const MonitorsList = ({
<StatusPageBarChart checks={monitor?.checks?.slice().reverse()} /> <StatusPageBarChart checks={monitor?.checks?.slice().reverse()} />
</Box> </Box>
)} )}
<Box
flex={statusPage.showCharts !== false ? 1 : 10}
display="flex"
justifyContent="flex-end"
>
<StatusLabel
status={status}
text={status}
customStyles={{ textTransform: "capitalize" }}
/>
</Box>
</Stack> </Stack>
</Stack> </Stack>
); );