merge charts
This commit is contained in:
1 parent
58f1ae7fe9
commit
0e0cace676
6 files changed
+178
-251
No files matched your search
@@ -13,6 +13,7 @@ type BaseChartProps = React.PropsWithChildren<{
|
|||||||
width?: number | string;
|
width?: number | string;
|
||||||
maxWidth?: number | string;
|
maxWidth?: number | string;
|
||||||
padding?: number | string | ResponsiveStyleValue<number | string>;
|
padding?: number | string | ResponsiveStyleValue<number | string>;
|
||||||
|
onClick?: () => void;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export const BaseChart = ({
|
export const BaseChart = ({
|
||||||
@@ -21,16 +22,22 @@ export const BaseChart = ({
|
|||||||
width = "100%",
|
width = "100%",
|
||||||
maxWidth = "100%",
|
maxWidth = "100%",
|
||||||
padding,
|
padding,
|
||||||
|
onClick,
|
||||||
}: BaseChartProps) => {
|
}: BaseChartProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
<BaseBox
|
<BaseBox
|
||||||
|
onClick={onClick}
|
||||||
sx={{
|
sx={{
|
||||||
padding: padding ?? theme.spacing(LAYOUT.MD),
|
padding: padding ?? theme.spacing(LAYOUT.MD),
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
width: width,
|
width: width,
|
||||||
maxWidth: maxWidth,
|
maxWidth: maxWidth,
|
||||||
|
...(onClick && {
|
||||||
|
cursor: "pointer",
|
||||||
|
"& .recharts-wrapper": { cursor: "pointer !important" },
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
export const computeYAxisCap = (values: number[]): number | undefined => {
|
||||||
|
const sorted = values.slice().sort((a, b) => a - b);
|
||||||
|
if (sorted.length < 2) return undefined;
|
||||||
|
const p95 = sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * 0.95))];
|
||||||
|
return p95 > 0 ? Math.ceil(p95 * 2) : undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const PHASE_KEYS = [
|
||||||
|
"avgDns",
|
||||||
|
"avgTcp",
|
||||||
|
"avgTls",
|
||||||
|
"avgRequest",
|
||||||
|
"avgFirstByte",
|
||||||
|
"avgDownload",
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export const PHASE_COLOR_KEYS = {
|
||||||
|
avgDns: "dns",
|
||||||
|
avgTcp: "tcp",
|
||||||
|
avgTls: "tls",
|
||||||
|
avgRequest: "request",
|
||||||
|
avgFirstByte: "firstByte",
|
||||||
|
avgDownload: "download",
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export const PHASE_LABELS: Record<(typeof PHASE_KEYS)[number], string> = {
|
||||||
|
avgDns: "DNS",
|
||||||
|
avgTcp: "TCP",
|
||||||
|
avgTls: "TLS",
|
||||||
|
avgRequest: "Request",
|
||||||
|
avgFirstByte: "First byte",
|
||||||
|
avgDownload: "Download",
|
||||||
|
};
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export const computeYAxisCap = (values: number[]): number | undefined => {
|
|
||||||
const sorted = values.slice().sort((a, b) => a - b);
|
|
||||||
if (sorted.length < 2) return undefined;
|
|
||||||
const p95 = sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * 0.95))];
|
|
||||||
return p95 > 0 ? Math.ceil(p95 * 2) : undefined;
|
|
||||||
};
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
import Stack from "@mui/material/Stack";
|
||||||
import { BaseChart, BaseBox } from "@/Components/design-elements";
|
import { BaseChart, BaseBox } from "@/Components/design-elements";
|
||||||
import { Clock } from "lucide-react";
|
import { Clock } from "lucide-react";
|
||||||
|
import { Dot } from "@/Components/design-elements";
|
||||||
import {
|
import {
|
||||||
AreaChart,
|
AreaChart,
|
||||||
Area,
|
Area,
|
||||||
@@ -18,11 +20,21 @@ import { useSelector } from "react-redux";
|
|||||||
import { formatDateWithTz, tooltipDateFormatLookup } from "@/Utils/TimeUtils";
|
import { formatDateWithTz, tooltipDateFormatLookup } from "@/Utils/TimeUtils";
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import type { Theme } from "@mui/material/styles";
|
import type { Theme } from "@mui/material/styles";
|
||||||
import type { GroupedCheck } from "@/Types/Check";
|
import type { GroupedCheck, GroupedUptimeCheck } from "@/Types/Check";
|
||||||
import type { RootState } from "@/Types/state";
|
import type { RootState } from "@/Types/state";
|
||||||
import { useMemo } from "react";
|
|
||||||
import { computeYAxisCap } from "@/Components/monitors/charts/ChartUtils";
|
import { computeYAxisCap } from "@/Components/monitors/charts/ChartUtils";
|
||||||
|
|
||||||
|
import { useMemo, useState } from "react";
|
||||||
|
import { SPACING } from "@/Utils/Theme/constants";
|
||||||
|
import {
|
||||||
|
PHASE_COLOR_KEYS,
|
||||||
|
PHASE_KEYS,
|
||||||
|
PHASE_LABELS,
|
||||||
|
} from "@/Components/monitors/charts/ChartUtils";
|
||||||
|
|
||||||
|
type DetailsCheck = GroupedCheck &
|
||||||
|
Partial<Pick<GroupedUptimeCheck, (typeof PHASE_KEYS)[number]>>;
|
||||||
|
|
||||||
type ResponseTimeToolTipProps = TooltipProps<ValueType, NameType> & {
|
type ResponseTimeToolTipProps = TooltipProps<ValueType, NameType> & {
|
||||||
range: string;
|
range: string;
|
||||||
theme: Theme;
|
theme: Theme;
|
||||||
@@ -54,19 +66,71 @@ const ResponseTimeToolTip = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type TimingPhaseToolTipProps = TooltipProps<ValueType, NameType> & {
|
||||||
|
range: string;
|
||||||
|
theme: Theme;
|
||||||
|
uiTimezone: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const TimingPhasesToolTip = ({
|
||||||
|
active,
|
||||||
|
payload,
|
||||||
|
range,
|
||||||
|
theme,
|
||||||
|
uiTimezone,
|
||||||
|
}: TimingPhaseToolTipProps) => {
|
||||||
|
if (!active || !payload?.length) return null;
|
||||||
|
const bucket = payload[0].payload as GroupedUptimeCheck;
|
||||||
|
const total = PHASE_KEYS.reduce((sum, key) => sum + bucket[key], 0);
|
||||||
|
const format = tooltipDateFormatLookup(range);
|
||||||
|
return (
|
||||||
|
<BaseBox sx={{ py: theme.spacing(2), px: theme.spacing(4) }}>
|
||||||
|
<Typography>{formatDateWithTz(bucket.bucketDate, format, uiTimezone)}</Typography>
|
||||||
|
<Typography>Total: {prettyMilliseconds(total)}</Typography>
|
||||||
|
{PHASE_KEYS.map((key) => (
|
||||||
|
<Stack
|
||||||
|
alignItems={"center"}
|
||||||
|
direction="row"
|
||||||
|
key={key}
|
||||||
|
gap={SPACING.LG}
|
||||||
|
>
|
||||||
|
<Dot
|
||||||
|
size={"12px"}
|
||||||
|
color={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
||||||
|
/>
|
||||||
|
<Typography>
|
||||||
|
{PHASE_LABELS[key]}:{" "}
|
||||||
|
{prettyMilliseconds(bucket[key], {
|
||||||
|
formatSubMilliseconds: true,
|
||||||
|
compact: true,
|
||||||
|
})}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
))}
|
||||||
|
</BaseBox>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const HistogramDetails = ({
|
export const HistogramDetails = ({
|
||||||
checks,
|
checks,
|
||||||
range,
|
range,
|
||||||
}: {
|
}: {
|
||||||
checks: GroupedCheck[];
|
checks: DetailsCheck[];
|
||||||
range: string;
|
range: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
const [showTimingPhases, setShowTimingPhases] = useState(false);
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const uiTimezone = useSelector((state: RootState) => state.ui.timezone);
|
const uiTimezone = useSelector((state: RootState) => state.ui.timezone);
|
||||||
const yMax = useMemo(() => {
|
const yMax = useMemo(() => {
|
||||||
const totals = checks.map((check) => check.avgResponseTime || 0);
|
const totals = checks.map((check) => check.avgResponseTime || 0);
|
||||||
return computeYAxisCap(totals);
|
return computeYAxisCap(totals);
|
||||||
}, [checks]);
|
}, [checks]);
|
||||||
|
|
||||||
|
const hasTimingPhases = useMemo(
|
||||||
|
() => (checks ?? []).some((check) => PHASE_KEYS.some((key) => (check[key] ?? 0) > 0)),
|
||||||
|
[checks]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseChart
|
<BaseChart
|
||||||
icon={
|
icon={
|
||||||
@@ -75,7 +139,11 @@ export const HistogramDetails = ({
|
|||||||
strokeWidth={1.5}
|
strokeWidth={1.5}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
title="Average response time (First byte)"
|
title={showTimingPhases ? "Timing Phases" : "Response Time"}
|
||||||
|
onClick={() => {
|
||||||
|
if (!hasTimingPhases) return;
|
||||||
|
setShowTimingPhases((prev) => !prev);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<ResponsiveContainer
|
<ResponsiveContainer
|
||||||
width="100%"
|
width="100%"
|
||||||
@@ -108,6 +176,27 @@ export const HistogramDetails = ({
|
|||||||
stopOpacity={0}
|
stopOpacity={0}
|
||||||
/>
|
/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
|
{PHASE_KEYS.map((key) => (
|
||||||
|
<linearGradient
|
||||||
|
key={key}
|
||||||
|
id={`phaseGradient-${key}`}
|
||||||
|
x1="0"
|
||||||
|
y1="0"
|
||||||
|
x2="0"
|
||||||
|
y2="1"
|
||||||
|
>
|
||||||
|
<stop
|
||||||
|
offset="0%"
|
||||||
|
stopColor={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
||||||
|
stopOpacity={0.8}
|
||||||
|
/>
|
||||||
|
<stop
|
||||||
|
offset="100%"
|
||||||
|
stopColor={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
||||||
|
stopOpacity={0.2}
|
||||||
|
/>
|
||||||
|
</linearGradient>
|
||||||
|
))}
|
||||||
</defs>
|
</defs>
|
||||||
<YAxis
|
<YAxis
|
||||||
hide
|
hide
|
||||||
@@ -127,22 +216,51 @@ export const HistogramDetails = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Tooltip
|
{showTimingPhases ? (
|
||||||
content={(props) => (
|
<Tooltip
|
||||||
<ResponseTimeToolTip
|
content={(props) => (
|
||||||
{...props}
|
<TimingPhasesToolTip
|
||||||
range={range}
|
{...props}
|
||||||
theme={theme}
|
range={range}
|
||||||
uiTimezone={uiTimezone}
|
theme={theme}
|
||||||
/>
|
uiTimezone={uiTimezone}
|
||||||
)}
|
/>
|
||||||
/>
|
)}
|
||||||
<Area
|
/>
|
||||||
type="monotone"
|
) : (
|
||||||
dataKey="avgResponseTime"
|
<Tooltip
|
||||||
stroke={theme.palette.primary.main}
|
content={(props) => (
|
||||||
fill="url(#colorUv)"
|
<ResponseTimeToolTip
|
||||||
/>
|
{...props}
|
||||||
|
range={range}
|
||||||
|
theme={theme}
|
||||||
|
uiTimezone={uiTimezone}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{!showTimingPhases && (
|
||||||
|
<Area
|
||||||
|
type="monotone"
|
||||||
|
dataKey="avgResponseTime"
|
||||||
|
stroke={theme.palette.primary.main}
|
||||||
|
fill="url(#colorUv)"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{hasTimingPhases &&
|
||||||
|
showTimingPhases &&
|
||||||
|
PHASE_KEYS.map((key) => {
|
||||||
|
return (
|
||||||
|
<Area
|
||||||
|
key={key}
|
||||||
|
type="monotone"
|
||||||
|
stackId={1}
|
||||||
|
dataKey={key}
|
||||||
|
stroke={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
||||||
|
fill={`url(#phaseGradient-${key})`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</AreaChart>
|
</AreaChart>
|
||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
</BaseChart>
|
</BaseChart>
|
||||||
|
|||||||
@@ -1,207 +0,0 @@
|
|||||||
import type { GroupedUptimeCheck } from "@/Types/Check";
|
|
||||||
import type { TooltipProps } from "recharts";
|
|
||||||
import type { NameType, ValueType } from "recharts/types/component/DefaultTooltipContent";
|
|
||||||
import type { Theme } from "@mui/material/styles";
|
|
||||||
import type { RootState } from "@/Types/state";
|
|
||||||
import { Clock } from "lucide-react";
|
|
||||||
import prettyMilliseconds from "pretty-ms";
|
|
||||||
|
|
||||||
import Stack from "@mui/material/Stack";
|
|
||||||
import {
|
|
||||||
Area,
|
|
||||||
AreaChart,
|
|
||||||
CartesianGrid,
|
|
||||||
ResponsiveContainer,
|
|
||||||
YAxis,
|
|
||||||
XAxis,
|
|
||||||
Tooltip,
|
|
||||||
} from "recharts";
|
|
||||||
import { BaseBox, BaseChart, Dot } from "@/Components/design-elements";
|
|
||||||
import Typography from "@mui/material/Typography";
|
|
||||||
import { XTick } from "@/Components/monitors/charts/XTick";
|
|
||||||
|
|
||||||
import { formatDateWithTz, tooltipDateFormatLookup } from "@/Utils/TimeUtils";
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import { useMemo } from "react";
|
|
||||||
import { useTheme } from "@mui/material";
|
|
||||||
import { SPACING } from "@/Utils/Theme/constants";
|
|
||||||
import { computeYAxisCap } from "@/Components/monitors/charts/ChartUtils";
|
|
||||||
|
|
||||||
export const PHASE_KEYS = [
|
|
||||||
"avgDns",
|
|
||||||
"avgTcp",
|
|
||||||
"avgTls",
|
|
||||||
"avgRequest",
|
|
||||||
"avgFirstByte",
|
|
||||||
"avgDownload",
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
const PHASE_COLOR_KEYS = {
|
|
||||||
avgDns: "dns",
|
|
||||||
avgTcp: "tcp",
|
|
||||||
avgTls: "tls",
|
|
||||||
avgRequest: "request",
|
|
||||||
avgFirstByte: "firstByte",
|
|
||||||
avgDownload: "download",
|
|
||||||
} as const;
|
|
||||||
|
|
||||||
const PHASE_LABELS: Record<(typeof PHASE_KEYS)[number], string> = {
|
|
||||||
avgDns: "DNS",
|
|
||||||
avgTcp: "TCP",
|
|
||||||
avgTls: "TLS",
|
|
||||||
avgRequest: "Request",
|
|
||||||
avgFirstByte: "First byte",
|
|
||||||
avgDownload: "Download",
|
|
||||||
};
|
|
||||||
|
|
||||||
type TimingPhaseToolTipProps = TooltipProps<ValueType, NameType> & {
|
|
||||||
range: string;
|
|
||||||
theme: Theme;
|
|
||||||
uiTimezone: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const TimingPhasesToolTip = ({
|
|
||||||
active,
|
|
||||||
payload,
|
|
||||||
range,
|
|
||||||
theme,
|
|
||||||
uiTimezone,
|
|
||||||
}: TimingPhaseToolTipProps) => {
|
|
||||||
if (!active || !payload?.length) return null;
|
|
||||||
const bucket = payload[0].payload as GroupedUptimeCheck;
|
|
||||||
const total = PHASE_KEYS.reduce((sum, key) => sum + bucket[key], 0);
|
|
||||||
const format = tooltipDateFormatLookup(range);
|
|
||||||
return (
|
|
||||||
<BaseBox sx={{ py: theme.spacing(2), px: theme.spacing(4) }}>
|
|
||||||
<Typography>{formatDateWithTz(bucket.bucketDate, format, uiTimezone)}</Typography>
|
|
||||||
<Typography>Total: {prettyMilliseconds(total)}</Typography>
|
|
||||||
{PHASE_KEYS.map((key) => (
|
|
||||||
<Stack
|
|
||||||
alignItems={"center"}
|
|
||||||
direction="row"
|
|
||||||
key={key}
|
|
||||||
gap={SPACING.LG}
|
|
||||||
>
|
|
||||||
<Dot
|
|
||||||
size={"12px"}
|
|
||||||
color={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
|
||||||
/>
|
|
||||||
<Typography>
|
|
||||||
{PHASE_LABELS[key]}:{" "}
|
|
||||||
{prettyMilliseconds(bucket[key], {
|
|
||||||
formatSubMilliseconds: true,
|
|
||||||
compact: true,
|
|
||||||
})}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
|
||||||
))}
|
|
||||||
</BaseBox>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const HistogramDetailsStacked = ({
|
|
||||||
checks = [],
|
|
||||||
range,
|
|
||||||
}: {
|
|
||||||
checks: GroupedUptimeCheck[];
|
|
||||||
range: string;
|
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const uiTimezone = useSelector((state: RootState) => state.ui.timezone);
|
|
||||||
|
|
||||||
// Cap the y domain at 2x the p95 of bucket totals, so typical stacks sit
|
|
||||||
// around mid-height with headroom above
|
|
||||||
const yMax = useMemo(() => {
|
|
||||||
const totals = checks.map((check) =>
|
|
||||||
PHASE_KEYS.reduce((sum, key) => sum + check[key], 0)
|
|
||||||
);
|
|
||||||
return computeYAxisCap(totals);
|
|
||||||
}, [checks]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<BaseChart
|
|
||||||
icon={
|
|
||||||
<Clock
|
|
||||||
size={20}
|
|
||||||
strokeWidth={1.5}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
title="Timing phases"
|
|
||||||
>
|
|
||||||
<ResponsiveContainer
|
|
||||||
width="100%"
|
|
||||||
height={300}
|
|
||||||
>
|
|
||||||
<AreaChart data={checks.slice()}>
|
|
||||||
<CartesianGrid
|
|
||||||
stroke={theme.palette.divider}
|
|
||||||
strokeWidth={1}
|
|
||||||
strokeOpacity={1}
|
|
||||||
fill="transparent"
|
|
||||||
vertical={false}
|
|
||||||
/>
|
|
||||||
<defs>
|
|
||||||
{PHASE_KEYS.map((key) => (
|
|
||||||
<linearGradient
|
|
||||||
key={key}
|
|
||||||
id={`phaseGradient-${key}`}
|
|
||||||
x1="0"
|
|
||||||
y1="0"
|
|
||||||
x2="0"
|
|
||||||
y2="1"
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
offset="0%"
|
|
||||||
stopColor={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
|
||||||
stopOpacity={0.8}
|
|
||||||
/>
|
|
||||||
<stop
|
|
||||||
offset="100%"
|
|
||||||
stopColor={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
|
||||||
stopOpacity={0.2}
|
|
||||||
/>
|
|
||||||
</linearGradient>
|
|
||||||
))}
|
|
||||||
</defs>
|
|
||||||
<YAxis
|
|
||||||
hide
|
|
||||||
// scale="sqrt"
|
|
||||||
domain={[0, yMax ?? "auto"]}
|
|
||||||
allowDataOverflow
|
|
||||||
/>
|
|
||||||
<XAxis
|
|
||||||
axisLine={false}
|
|
||||||
tickLine={false}
|
|
||||||
dataKey="bucketDate"
|
|
||||||
tick={(props) => (
|
|
||||||
<XTick
|
|
||||||
{...props}
|
|
||||||
range={range}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<Tooltip
|
|
||||||
content={(props) => (
|
|
||||||
<TimingPhasesToolTip
|
|
||||||
{...props}
|
|
||||||
range={range}
|
|
||||||
theme={theme}
|
|
||||||
uiTimezone={uiTimezone}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
{PHASE_KEYS.map((key) => (
|
|
||||||
<Area
|
|
||||||
key={key}
|
|
||||||
type="monotone"
|
|
||||||
stackId={1}
|
|
||||||
dataKey={key}
|
|
||||||
stroke={theme.palette.chart.phases[PHASE_COLOR_KEYS[key]]}
|
|
||||||
fill={`url(#phaseGradient-${key})`}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</AreaChart>
|
|
||||||
</ResponsiveContainer>
|
|
||||||
</BaseChart>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -31,10 +31,6 @@ import type { RootState } from "@/Types/state";
|
|||||||
import { formatDateWithTz } from "@/Utils/TimeUtils";
|
import { formatDateWithTz } from "@/Utils/TimeUtils";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { Typography } from "@mui/material";
|
import { Typography } from "@mui/material";
|
||||||
import {
|
|
||||||
HistogramDetailsStacked,
|
|
||||||
PHASE_KEYS,
|
|
||||||
} from "@/Components/monitors/charts/HistogramDetailsStacked";
|
|
||||||
|
|
||||||
const certificateDateFormat = "MMM D, YYYY h A";
|
const certificateDateFormat = "MMM D, YYYY h A";
|
||||||
|
|
||||||
@@ -79,14 +75,6 @@ const UptimeDetailsPage = () => {
|
|||||||
const monitor = monitorData?.monitor;
|
const monitor = monitorData?.monitor;
|
||||||
const monitorStats = monitorDetailsData?.monitorStats ?? null;
|
const monitorStats = monitorDetailsData?.monitorStats ?? null;
|
||||||
|
|
||||||
const hasTimingPhases = useMemo(
|
|
||||||
() =>
|
|
||||||
(monitorData?.groupedChecks ?? []).some((check) =>
|
|
||||||
PHASE_KEYS.some((key) => check[key] > 0)
|
|
||||||
),
|
|
||||||
[monitorData]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Certificate fetch - only for HTTP monitors
|
// Certificate fetch - only for HTTP monitors
|
||||||
const certificateUrl = useMemo(() => {
|
const certificateUrl = useMemo(() => {
|
||||||
if (!monitorId || monitor?.type !== "http") {
|
if (!monitorId || monitor?.type !== "http") {
|
||||||
@@ -238,12 +226,6 @@ const UptimeDetailsPage = () => {
|
|||||||
checks={monitorData.groupedChecks}
|
checks={monitorData.groupedChecks}
|
||||||
range={dateRange}
|
range={dateRange}
|
||||||
/>
|
/>
|
||||||
{hasTimingPhases && (
|
|
||||||
<HistogramDetailsStacked
|
|
||||||
checks={monitorData.groupedChecks}
|
|
||||||
range={dateRange}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<ChecksTable
|
<ChecksTable
|
||||||
checks={checks}
|
checks={checks}
|
||||||
count={checksCount}
|
count={checksCount}
|
||||||
|
|||||||
Reference in new issue
Block a user