infra
This commit is contained in:
1 parent
25d1039376
commit
2b0a51520a
2 files changed
+13
-9
No files matched your search
@@ -13,7 +13,11 @@ import { useTheme } from "@emotion/react";
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useIsAdmin } from "@/Hooks/useIsAdmin.js";
|
import { useIsAdmin } from "@/Hooks/useIsAdmin.js";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useFetchMonitorsByTeamId } from "../../../Hooks/monitorHooks.js";
|
import {
|
||||||
|
useFetchMonitorsByTeamId,
|
||||||
|
useFetchMonitorsWithChecks,
|
||||||
|
} from "@/Hooks/monitorHooks.js";
|
||||||
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { setRowsPerPage } from "../../../Features/UI/uiSlice.js";
|
import { setRowsPerPage } from "../../../Features/UI/uiSlice.js";
|
||||||
// Constants
|
// Constants
|
||||||
@@ -70,14 +74,14 @@ const InfrastructureMonitors = () => {
|
|||||||
|
|
||||||
const field = toFilterStatus !== undefined ? "status" : undefined;
|
const field = toFilterStatus !== undefined ? "status" : undefined;
|
||||||
|
|
||||||
const [monitors, summary, isLoading, networkError] = useFetchMonitorsByTeamId({
|
const [monitors, count, isLoading, networkError] = useFetchMonitorsWithChecks({
|
||||||
limit: 1,
|
|
||||||
types: TYPES,
|
types: TYPES,
|
||||||
page,
|
limit: 1,
|
||||||
|
page: page,
|
||||||
field: field,
|
field: field,
|
||||||
filter: toFilterStatus ?? search,
|
filter: toFilterStatus ?? search,
|
||||||
rowsPerPage,
|
rowsPerPage: rowsPerPage,
|
||||||
updateTrigger,
|
monitorUpdateTrigger: updateTrigger,
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -99,7 +103,7 @@ const InfrastructureMonitors = () => {
|
|||||||
<Stack direction={"row"}>
|
<Stack direction={"row"}>
|
||||||
<MonitorCountHeader
|
<MonitorCountHeader
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
monitorCount={summary?.totalMonitors ?? 0}
|
monitorCount={count || 0}
|
||||||
/>
|
/>
|
||||||
<Filter
|
<Filter
|
||||||
selectedStatus={selectedStatus}
|
selectedStatus={selectedStatus}
|
||||||
@@ -122,7 +126,7 @@ const InfrastructureMonitors = () => {
|
|||||||
isSearching={isSearching}
|
isSearching={isSearching}
|
||||||
/>
|
/>
|
||||||
<Pagination
|
<Pagination
|
||||||
itemCount={summary?.totalMonitors}
|
itemCount={count || 0}
|
||||||
paginationLabel={t("monitors")}
|
paginationLabel={t("monitors")}
|
||||||
page={page}
|
page={page}
|
||||||
rowsPerPage={rowsPerPage}
|
rowsPerPage={rowsPerPage}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import PropTypes from "prop-types";
|
|||||||
import {
|
import {
|
||||||
useFetchMonitorsWithSummary,
|
useFetchMonitorsWithSummary,
|
||||||
useFetchMonitorsWithChecks,
|
useFetchMonitorsWithChecks,
|
||||||
} from "../../../Hooks/monitorHooks.js";
|
} from "@/Hooks/monitorHooks.js";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const TYPES = ["http", "ping", "docker", "port", "game"];
|
const TYPES = ["http", "ping", "docker", "port", "game"];
|
||||||
|
|||||||
Reference in new issue
Block a user