fe
This commit is contained in:
1 parent
910c675a49
commit
f2c88cfd23
4 files changed
+20
-6
No files matched your search
@@ -12,7 +12,7 @@ import {
|
|||||||
import { HistogramPageSpeedScoresTooltip } from "@/Components/monitors";
|
import { HistogramPageSpeedScoresTooltip } from "@/Components/monitors";
|
||||||
|
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import type { CheckSnapshot } from "@/Types/Check";
|
import type { PageSpeedGroupedCheck } from "@/Types/Check";
|
||||||
import type { Palette } from "@mui/material/styles";
|
import type { Palette } from "@mui/material/styles";
|
||||||
type PaletteColorKey = Extract<
|
type PaletteColorKey = Extract<
|
||||||
keyof Palette,
|
keyof Palette,
|
||||||
@@ -52,7 +52,7 @@ export const HistogramPageSpeedDetails = ({
|
|||||||
checks,
|
checks,
|
||||||
range,
|
range,
|
||||||
}: {
|
}: {
|
||||||
checks: CheckSnapshot[];
|
checks: PageSpeedGroupedCheck[];
|
||||||
range: string;
|
range: string;
|
||||||
}) => {
|
}) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@@ -73,7 +73,7 @@ export const HistogramPageSpeedDetails = ({
|
|||||||
>
|
>
|
||||||
<AreaChart data={checks}>
|
<AreaChart data={checks}>
|
||||||
<XAxis
|
<XAxis
|
||||||
dataKey={"createdAt"}
|
dataKey={"bucketDate"}
|
||||||
tick={(props) => (
|
tick={(props) => (
|
||||||
<XTick
|
<XTick
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ const PageSpeedDetails = () => {
|
|||||||
{ keepPreviousData: true, refreshInterval: 30000 }
|
{ keepPreviousData: true, refreshInterval: 30000 }
|
||||||
);
|
);
|
||||||
|
|
||||||
const monitor = monitorData?.monitor;
|
const monitor = monitorData?.monitorData?.monitor;
|
||||||
|
const groupedChecks = monitorData?.monitorData?.groupedChecks || [];
|
||||||
const monitorStats = monitorData?.monitorStats || null;
|
const monitorStats = monitorData?.monitorStats || null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -67,7 +68,7 @@ const PageSpeedDetails = () => {
|
|||||||
setDateRange={setDateRange}
|
setDateRange={setDateRange}
|
||||||
/>
|
/>
|
||||||
<HistogramPageSpeedDetails
|
<HistogramPageSpeedDetails
|
||||||
checks={monitor?.recentChecks || []}
|
checks={groupedChecks}
|
||||||
range={dateRange}
|
range={dateRange}
|
||||||
/>
|
/>
|
||||||
<Stack
|
<Stack
|
||||||
|
|||||||
@@ -151,6 +151,15 @@ export interface GroupedCheck {
|
|||||||
totalChecks: number;
|
totalChecks: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PageSpeedGroupedCheck {
|
||||||
|
bucketDate: string;
|
||||||
|
performance: number;
|
||||||
|
accessibility: number;
|
||||||
|
bestPractices: number;
|
||||||
|
seo: number;
|
||||||
|
totalChecks: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface LatestCheck {
|
export interface LatestCheck {
|
||||||
status: boolean;
|
status: boolean;
|
||||||
responseTime: number;
|
responseTime: number;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { GroupedCheck, CheckSnapshot } from "@/Types/Check";
|
import type { GroupedCheck, CheckSnapshot } from "@/Types/Check";
|
||||||
|
import type { PageSpeedGroupedCheck } from "@/Types/Check";
|
||||||
|
|
||||||
export const MonitorTypes = [
|
export const MonitorTypes = [
|
||||||
"http",
|
"http",
|
||||||
@@ -112,7 +113,10 @@ export interface MonitorDetailsResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface PageSpeedDetailsResponse {
|
export interface PageSpeedDetailsResponse {
|
||||||
monitor: MonitorWithChecks;
|
monitorData: {
|
||||||
|
monitor: Monitor;
|
||||||
|
groupedChecks: PageSpeedGroupedCheck[];
|
||||||
|
};
|
||||||
monitorStats: MonitorStats | null;
|
monitorStats: MonitorStats | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user