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
+25 -18

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,20 +33,29 @@ const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
{connectionStatus === "up" ? "Connected" : "No connection"} {connectionStatus === "up" ? "Connected" : "No connection"}
</Typography> </Typography>
</Stack> </Stack>
<table> <div
style={{
overflowX: "auto",
maxWidth: "100%",
// Optional: add a max height if you want vertical scrolling too
// maxHeight: '400px',
// overflowY: 'auto'
}}
>
<table style={{ width: "100%" }}>
<thead> <thead>
<tr> <tr>
<th style={{ textAlign: "left" }}> <th style={{ textAlign: "left", paddingLeft: theme.spacing(4) }}>
<Typography>COUNTRY</Typography> <Typography>COUNTRY</Typography>
</th> </th>
<th style={{ textAlign: "left" }}> <th style={{ textAlign: "left", paddingLeft: theme.spacing(4) }}>
<Typography>CITY</Typography> <Typography>CITY</Typography>
</th> </th>
<th style={{ textAlign: "right" }}> <th style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
<Typography>RESPONSE</Typography> <Typography>RESPONSE</Typography>
</th> </th>
<th style={{ textAlign: "right" }}> <th style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
<Typography>{isSmallScreen ? "UPT" : "UPT BURNED"}</Typography> <Typography sx={{ whiteSpace: "nowrap" }}>{"UPT BURNED"}</Typography>
</th> </th>
</tr> </tr>
</thead> </thead>
@@ -57,24 +66,21 @@ const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
const city = dataPoint?.city !== "" ? dataPoint?.city : "Unknown"; const city = dataPoint?.city !== "" ? dataPoint?.city : "Unknown";
return ( return (
<tr key={Math.random()}> <tr key={Math.random()}>
<td style={{ padding: theme.spacing(4) }}> <td style={{ paddingLeft: theme.spacing(4) }}>
<Typography> <Typography>
{flag ? <span className={flag} /> : null}{" "} {flag ? <span className={flag} /> : null}{" "}
{countryCode?.toUpperCase() ?? "N/A"} {countryCode?.toUpperCase() ?? "N/A"}
</Typography> </Typography>
</td> </td>
<td> <td style={{ paddingLeft: theme.spacing(4) }}>
<Typography>{city}</Typography> <Typography>{city}</Typography>
</td> </td>
<td style={{ textAlign: "right" }}> <td style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
<Typography>{Math.floor(dataPoint.responseTime)} ms</Typography> <Typography>{Math.floor(dataPoint.responseTime)} ms</Typography>
</td> </td>
<td style={{ textAlign: "right" }}> <td style={{ textAlign: "right", paddingLeft: theme.spacing(4) }}>
<Typography color={theme.palette.warning.main}> <Typography color={theme.palette.warning.main}>
+ +{dataPoint.uptBurnt}
{isSmallScreen
? safelyParseFloat(dataPoint.uptBurnt).toFixed(4)
: dataPoint.uptBurnt}
</Typography> </Typography>
</td> </td>
</tr> </tr>
@@ -82,6 +88,7 @@ const DeviceTicker = ({ data, width = "100%", connectionStatus }) => {
})} })}
</tbody> </tbody>
</table> </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}