add graph
This commit is contained in:
1 parent
64fdd04cc7
commit
651fbd7cbb
1 file changed
+21
-7
@@ -60,7 +60,7 @@ const UptimeDetailsPage = () => {
|
|||||||
} = useGet<MonitorDetailsResponse>(
|
} = useGet<MonitorDetailsResponse>(
|
||||||
monitorDetailsUrl,
|
monitorDetailsUrl,
|
||||||
{},
|
{},
|
||||||
{ refreshInterval: 10000, keepPreviousData: true }
|
{ refreshInterval: 10000, keepPreviousData: true, revalidateOnFocus: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
const monitorData = monitorDetailsData?.monitorData;
|
const monitorData = monitorDetailsData?.monitorData;
|
||||||
@@ -75,7 +75,11 @@ const UptimeDetailsPage = () => {
|
|||||||
return `/monitors/certificate/${monitorId}`;
|
return `/monitors/certificate/${monitorId}`;
|
||||||
}, [monitorId, monitor?.type]);
|
}, [monitorId, monitor?.type]);
|
||||||
|
|
||||||
const { data: certificateData } = useGet<CertificateResponse>(certificateUrl);
|
const { data: certificateData } = useGet<CertificateResponse>(
|
||||||
|
certificateUrl,
|
||||||
|
{},
|
||||||
|
{ revalidateOnFocus: false }
|
||||||
|
);
|
||||||
|
|
||||||
const certificateExpiry = useMemo(() => {
|
const certificateExpiry = useMemo(() => {
|
||||||
if (!certificateData?.certificateDate) {
|
if (!certificateData?.certificateDate) {
|
||||||
@@ -106,7 +110,7 @@ const UptimeDetailsPage = () => {
|
|||||||
const { data: checksData, isLoading: checksIsLoading } = useGet<ChecksResponse>(
|
const { data: checksData, isLoading: checksIsLoading } = useGet<ChecksResponse>(
|
||||||
checksUrl,
|
checksUrl,
|
||||||
{},
|
{},
|
||||||
{ keepPreviousData: true }
|
{ keepPreviousData: true, revalidateOnFocus: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Geo checks fetch - only for HTTP monitors with geo checks enabled
|
// Geo checks fetch - only for HTTP monitors with geo checks enabled
|
||||||
@@ -121,7 +125,13 @@ const UptimeDetailsPage = () => {
|
|||||||
}, [monitorId, monitor?.type, monitor?.geoCheckEnabled, dateRange, selectedLocation]);
|
}, [monitorId, monitor?.type, monitor?.geoCheckEnabled, dateRange, selectedLocation]);
|
||||||
|
|
||||||
const { data: _geoChecksData, isLoading: _geoChecksIsLoading } =
|
const { data: _geoChecksData, isLoading: _geoChecksIsLoading } =
|
||||||
useGet<GeoChecksResult>(geoChecksUrl, {}, { keepPreviousData: true });
|
useGet<GeoChecksResult>(
|
||||||
|
geoChecksUrl,
|
||||||
|
{},
|
||||||
|
{ keepPreviousData: true, revalidateOnFocus: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
const geoChecks = _geoChecksData?.groupedGeoChecks ?? [];
|
||||||
|
|
||||||
// Extract unique locations from geo checks data
|
// Extract unique locations from geo checks data
|
||||||
const geoLocations = monitor?.geoCheckLocations;
|
const geoLocations = monitor?.geoCheckLocations;
|
||||||
@@ -184,15 +194,19 @@ const UptimeDetailsPage = () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{monitor?.geoCheckEnabled && (
|
{monitor?.geoCheckEnabled && (
|
||||||
<Stack gap={theme.spacing(8)}>
|
<>
|
||||||
<Typography variant="h2">Location breakdown</Typography>
|
<Typography variant="h1">Location breakdown</Typography>
|
||||||
<HeaderGeoTabs
|
<HeaderGeoTabs
|
||||||
geoCheckEnabled={monitor?.geoCheckEnabled ?? false}
|
geoCheckEnabled={monitor?.geoCheckEnabled ?? false}
|
||||||
locations={geoLocations}
|
locations={geoLocations}
|
||||||
selectedLocation={selectedLocation}
|
selectedLocation={selectedLocation}
|
||||||
onLocationChange={setSelectedLocation}
|
onLocationChange={setSelectedLocation}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
<HistogramDetails
|
||||||
|
checks={geoChecks}
|
||||||
|
range={dateRange}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</BasePage>
|
</BasePage>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user