Merge pull request #1834 from bluewave-labs/feat/responsive-status

feat: status page update
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-02-26 15:54:20 -08:00
commit 1cadb2c45f
2 files changed
+60 -53

No files matched your search

@@ -18,7 +18,7 @@ const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
}; };
return ( return (
<ColContainer> <ColContainer sx={{ height: "100%" }}>
<Stack <Stack
direction="row" direction="row"
gap={theme.spacing(4)} gap={theme.spacing(4)}
@@ -33,55 +33,62 @@ const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
{connectionStatus === "up" ? "Connected" : "No connection"} {connectionStatus === "up" ? "Connected" : "No connection"}
</Typography> </Typography>
</Stack> </Stack>
<table> <div
<thead> style={{
<tr> overflowX: "auto",
<th style={{ textAlign: "left" }}> maxWidth: "100%",
<Typography>COUNTRY</Typography> // Optional: add a max height if you want vertical scrolling too
</th> // maxHeight: '400px',
<th style={{ textAlign: "left" }}> // overflowY: 'auto'
<Typography>CITY</Typography> }}
</th> >
<th style={{ textAlign: "right" }}> <table style={{ width: "100%" }}>
<Typography>RESPONSE</Typography> <thead>
</th> <tr>
<th style={{ textAlign: "right" }}> <th style={{ textAlign: "left", paddingLeft: theme.spacing(4) }}>
<Typography>{isSmallScreen ? "UPT" : "UPT BURNED"}</Typography> <Typography>COUNTRY</Typography>
</th> </th>
</tr> <th style={{ textAlign: "left", paddingLeft: theme.spacing(4) }}>
</thead> <Typography>CITY</Typography>
<tbody> </th>
{data.map((dataPoint) => { <th style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
const countryCode = dataPoint?.countryCode?.toLowerCase() ?? null; <Typography>RESPONSE</Typography>
const flag = countryCode ? `fi fi-${countryCode}` : null; </th>
const city = dataPoint?.city !== "" ? dataPoint?.city : "Unknown"; <th style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
return ( <Typography sx={{ whiteSpace: "nowrap" }}>{"UPT BURNED"}</Typography>
<tr key={Math.random()}> </th>
<td style={{ padding: theme.spacing(4) }}> </tr>
<Typography> </thead>
{flag ? <span className={flag} /> : null}{" "} <tbody>
{countryCode?.toUpperCase() ?? "N/A"} {data.map((dataPoint) => {
</Typography> const countryCode = dataPoint?.countryCode?.toLowerCase() ?? null;
</td> const flag = countryCode ? `fi fi-${countryCode}` : null;
<td> const city = dataPoint?.city !== "" ? dataPoint?.city : "Unknown";
<Typography>{city}</Typography> return (
</td> <tr key={Math.random()}>
<td style={{ textAlign: "right" }}> <td style={{ paddingLeft: theme.spacing(4) }}>
<Typography>{Math.floor(dataPoint.responseTime)} ms</Typography> <Typography>
</td> {flag ? <span className={flag} /> : null}{" "}
<td style={{ textAlign: "right" }}> {countryCode?.toUpperCase() ?? "N/A"}
<Typography color={theme.palette.warning.main}> </Typography>
+ </td>
{isSmallScreen <td style={{ paddingLeft: theme.spacing(4) }}>
? safelyParseFloat(dataPoint.uptBurnt).toFixed(4) <Typography>{city}</Typography>
: dataPoint.uptBurnt} </td>
</Typography> <td style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
</td> <Typography>{Math.floor(dataPoint.responseTime)} ms</Typography>
</tr> </td>
); <td style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
})} <Typography color={theme.palette.warning.main}>
</tbody> +{dataPoint.uptBurnt}
</table> </Typography>
</td>
</tr>
);
})}
</tbody>
</table>
</div>
</ColContainer> </ColContainer>
); );
}; };
@@ -94,9 +94,9 @@ const ControlsHeader = ({
alignItems="flex-end" alignItems="flex-end"
> >
<Stack <Stack
direction={{ s: "column", md: "row" }} direction="row"
gap={theme.spacing(8)} gap={theme.spacing(8)}
alignItems={{ s: "flex-start", md: "flex-end" }} alignItems="flex-end"
> >
<Image <Image
shouldRender={statusPage?.logo?.data ? true : false} shouldRender={statusPage?.logo?.data ? true : false}
@@ -105,7 +105,7 @@ const ControlsHeader = ({
maxHeight={"50px"} maxHeight={"50px"}
base64={statusPage?.logo?.data} base64={statusPage?.logo?.data}
/> />
<Typography variant="h2">{statusPage?.companyName}</Typography> <Typography variant="h1">{statusPage?.companyName}</Typography>
</Stack> </Stack>
<Controls <Controls
isDeleting={isDeleting} isDeleting={isDeleting}