From 667dc55fc89437d3627228a68fe4072e9e00e076 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Tue, 3 Feb 2026 23:30:23 +0000 Subject: [PATCH] types --- .../v2/common/charts/HeatmapResponseTimeTooltip.tsx | 10 ++++------ client/src/Pages/Settings/DummyChart.tsx | 4 +++- client/src/Types/Check.ts | 4 +++- client/src/Types/Monitor.ts | 3 +-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/client/src/Components/v2/common/charts/HeatmapResponseTimeTooltip.tsx b/client/src/Components/v2/common/charts/HeatmapResponseTimeTooltip.tsx index ec9ad4d26..c046e05b5 100644 --- a/client/src/Components/v2/common/charts/HeatmapResponseTimeTooltip.tsx +++ b/client/src/Components/v2/common/charts/HeatmapResponseTimeTooltip.tsx @@ -7,6 +7,7 @@ import { useTheme } from "@mui/material/styles"; import { useSelector } from "react-redux"; import type { RootState } from "@/Types/state"; import { useTranslation } from "react-i18next"; + type HeatmapCheck = | CheckSnapshot | { status: "placeholder"; responseTime: 0; createdAt: "" }; @@ -55,12 +56,9 @@ export const HeatmapResponseTimeTooltip = ({ {formatDateWithTz(check?.createdAt, "ddd, MMMM D, YYYY, HH:mm A", uiTimezone)} - {check?.responseTime && ( - - {t("common.labels.responseTime")}: {check.responseTime.toFixed()} ms - - )} - + + {t("common.labels.responseTime")}: {check.originalResponseTime.toFixed()} ms + Status:{" "} diff --git a/client/src/Pages/Settings/DummyChart.tsx b/client/src/Pages/Settings/DummyChart.tsx index 39323522e..df7cd5603 100644 --- a/client/src/Pages/Settings/DummyChart.tsx +++ b/client/src/Pages/Settings/DummyChart.tsx @@ -12,11 +12,13 @@ const generateDummyChecks = (): CheckSnapshot[] => { const checks: CheckSnapshot[] = []; for (let i = 0; i < 25; i++) { const isUp = Math.random() > 0.1; + const responseTime = Math.floor(Math.random() * 80) + 20; checks.push({ id: `dummy-${i}`, status: isUp, statusCode: isUp ? 200 : 500, - responseTime: Math.floor(Math.random() * 80) + 20, + responseTime: responseTime, + originalResponseTime: responseTime, message: "", createdAt: new Date(Date.now() - i * 60000).toISOString(), }); diff --git a/client/src/Types/Check.ts b/client/src/Types/Check.ts index 9b903207c..f204ab2ca 100644 --- a/client/src/Types/Check.ts +++ b/client/src/Types/Check.ts @@ -237,7 +237,9 @@ export interface ChecksSummary { export type CheckSnapshot = Omit< Check, "metadata" | "ack" | "ackAt" | "expiry" | "__v" | "updatedAt" ->; +> & { + originalResponseTime: number; +}; export interface HasResponseTime { responseTime: number; diff --git a/client/src/Types/Monitor.ts b/client/src/Types/Monitor.ts index 02d4ccf2d..2a0272fdc 100644 --- a/client/src/Types/Monitor.ts +++ b/client/src/Types/Monitor.ts @@ -1,5 +1,4 @@ -import type { GroupedCheck } from "@/Types/Check"; -import type { CheckSnapshot } from "@/Types/Check"; +import type { GroupedCheck, CheckSnapshot } from "@/Types/Check"; export type MonitorStatus = boolean | undefined; export const MonitorTypes = [