From 13c921531c6e77616c531bf55f3927f1936ae199 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 28 Jul 2026 11:13:50 -0700 Subject: [PATCH] update types, add skeleton for stacked timing phase chart --- .../charts/HistogramDetailsStacked.tsx | 39 +++++++++++++++++++ client/src/Pages/Uptime/Details/index.tsx | 16 +++++++- client/src/Types/Check.ts | 9 +++++ client/src/Types/Monitor.ts | 4 +- 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 client/src/Components/monitors/charts/HistogramDetailsStacked.tsx diff --git a/client/src/Components/monitors/charts/HistogramDetailsStacked.tsx b/client/src/Components/monitors/charts/HistogramDetailsStacked.tsx new file mode 100644 index 000000000..a47af1a0d --- /dev/null +++ b/client/src/Components/monitors/charts/HistogramDetailsStacked.tsx @@ -0,0 +1,39 @@ +import type { GroupedUptimeCheck } from "@/Types/Check"; +import { Area, AreaChart, CartesianGrid, ResponsiveContainer } from "recharts"; + +import { useTheme } from "@mui/material"; + +export const HistogramDetailsStacked = ({ + checks = [], + range, +}: { + checks: GroupedUptimeCheck[]; + range: string; +}) => { + const theme = useTheme(); + + console.log(JSON.stringify(checks, null, 2)); + + return ( + + + + + + + ); +}; diff --git a/client/src/Pages/Uptime/Details/index.tsx b/client/src/Pages/Uptime/Details/index.tsx index 8828aa29a..7aa0b1046 100644 --- a/client/src/Pages/Uptime/Details/index.tsx +++ b/client/src/Pages/Uptime/Details/index.tsx @@ -31,6 +31,7 @@ import type { RootState } from "@/Types/state"; import { formatDateWithTz } from "@/Utils/TimeUtils"; import { t } from "i18next"; import { Typography } from "@mui/material"; +import { HistogramDetailsStacked } from "@/Components/monitors/charts/HistogramDetailsStacked"; const certificateDateFormat = "MMM D, YYYY h A"; @@ -72,6 +73,7 @@ const UptimeDetailsPage = () => { ); const monitorData = monitorDetailsData?.monitorData; + const monitor = monitorData?.monitor; const monitorStats = monitorDetailsData?.monitorStats ?? null; @@ -165,10 +167,18 @@ const UptimeDetailsPage = () => { { keepPreviousData: true, revalidateOnFocus: false } ); + if (!monitorData) { + return null; + } + + if (!monitor) { + return null; + } + const geoChecksForTable = geoChecksTableData?.geoChecks ?? []; const geoChecksCount = geoChecksTableData?.geoChecksCount ?? 0; - const geoLocations = monitor?.geoCheckLocations; + const geoLocations = monitor.geoCheckLocations; const checks = checksData?.checks ?? []; const checksCount = checksData?.checksCount ?? 0; @@ -218,6 +228,10 @@ const UptimeDetailsPage = () => { checks={monitorData?.groupedChecks || []} range={dateRange} /> +