use new query in PageSpeed page
This commit is contained in:
1 parent
bde4269fd1
commit
7862f8d967
2 files changed
+4
-7
No files matched your search
@@ -267,7 +267,7 @@ const Card = ({ monitor }) => {
|
|||||||
sx={{ gridColumnStart: 1, gridColumnEnd: 4 }}
|
sx={{ gridColumnStart: 1, gridColumnEnd: 4 }}
|
||||||
>
|
>
|
||||||
<PagespeedAreaChart
|
<PagespeedAreaChart
|
||||||
data={monitor.checks}
|
data={monitor.checks.slice().reverse()}
|
||||||
status={monitorState}
|
status={monitorState}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const PageSpeed = () => {
|
|||||||
const { user, authToken } = useSelector((state) => state.auth);
|
const { user, authToken } = useSelector((state) => state.auth);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [monitors, setMonitors] = useState([]);
|
const [monitors, setMonitors] = useState([]);
|
||||||
const [monitorCount, setMonitorCount] = useState(0);
|
const [summary, setSummary] = useState({});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchMonitors = async () => {
|
const fetchMonitors = async () => {
|
||||||
@@ -30,9 +30,6 @@ const PageSpeed = () => {
|
|||||||
teamId: user.teamId,
|
teamId: user.teamId,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
types: ["pagespeed"],
|
types: ["pagespeed"],
|
||||||
status: null,
|
|
||||||
checkOrder: "desc",
|
|
||||||
normalize: true,
|
|
||||||
page: null,
|
page: null,
|
||||||
rowsPerPage: null,
|
rowsPerPage: null,
|
||||||
filter: null,
|
filter: null,
|
||||||
@@ -41,7 +38,7 @@ const PageSpeed = () => {
|
|||||||
});
|
});
|
||||||
if (res?.data?.data?.monitors) {
|
if (res?.data?.data?.monitors) {
|
||||||
setMonitors(res.data.data.monitors);
|
setMonitors(res.data.data.monitors);
|
||||||
setMonitorCount(res.data.data.monitorCount);
|
setSummary(res.data.data.summary);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -113,7 +110,7 @@ const PageSpeed = () => {
|
|||||||
borderColor={theme.palette.border.light}
|
borderColor={theme.palette.border.light}
|
||||||
backgroundColor={theme.palette.background.accent}
|
backgroundColor={theme.palette.background.accent}
|
||||||
>
|
>
|
||||||
{monitorCount}
|
{summary?.totalMonitors ?? 0}
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Grid
|
<Grid
|
||||||
|
|||||||
Reference in new issue
Block a user