fix: statusPageMonitor removal of infrastructureMonitors[]
This commit is contained in:
1 parent
115fcc67f6
commit
5a12105c3d
3 files changed
+9
-11
No files matched your search
@@ -35,6 +35,14 @@ import { useNavigate, useParams } from "react-router-dom";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { HeaderConfigStatusControls } from "./Components/HeaderConfigStatusControls";
|
import { HeaderConfigStatusControls } from "./Components/HeaderConfigStatusControls";
|
||||||
|
|
||||||
|
const monitorsUrl = (() => {
|
||||||
|
const params = new URLSearchParams();
|
||||||
|
["http", "ping", "port", "docker", "game", "grpc", "websocket", "hardware"].forEach(
|
||||||
|
(type) => params.append("type", type)
|
||||||
|
);
|
||||||
|
return `/monitors/team?${params.toString()}`;
|
||||||
|
})();
|
||||||
|
|
||||||
interface TimezoneOption {
|
interface TimezoneOption {
|
||||||
_id: string;
|
_id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -54,14 +62,6 @@ const CreateStatusPage = () => {
|
|||||||
isCreate ? null : `/status-page/${url}?type=uptime&type=infrastructure`
|
isCreate ? null : `/status-page/${url}?type=uptime&type=infrastructure`
|
||||||
);
|
);
|
||||||
|
|
||||||
const monitorsUrl = useMemo(() => {
|
|
||||||
const params = new URLSearchParams();
|
|
||||||
["http", "ping", "port", "docker", "game", "grpc", "websocket", "hardware"].forEach(
|
|
||||||
(type) => params.append("type", type)
|
|
||||||
);
|
|
||||||
return `/monitors/team?${params.toString()}`;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const { data: monitorsResponse } = useGet<Monitor[]>(monitorsUrl);
|
const { data: monitorsResponse } = useGet<Monitor[]>(monitorsUrl);
|
||||||
const monitors = monitorsResponse ?? [];
|
const monitors = monitorsResponse ?? [];
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,10 @@ const StatusPageView = () => {
|
|||||||
|
|
||||||
const statusPage = data?.statusPage;
|
const statusPage = data?.statusPage;
|
||||||
const monitors = data?.monitors ?? [];
|
const monitors = data?.monitors ?? [];
|
||||||
const infrastructureMonitors = data?.infrastructureMonitors ?? [];
|
|
||||||
|
|
||||||
if (!statusPage) return null;
|
if (!statusPage) return null;
|
||||||
|
|
||||||
if (monitors?.length === 0 && infrastructureMonitors?.length === 0) {
|
if (monitors.length === 0) {
|
||||||
return (
|
return (
|
||||||
<BasePage
|
<BasePage
|
||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
|
|||||||
@@ -50,5 +50,4 @@ export interface StatusPage {
|
|||||||
export interface StatusPageResponse {
|
export interface StatusPageResponse {
|
||||||
statusPage: StatusPage;
|
statusPage: StatusPage;
|
||||||
monitors: Monitor[];
|
monitors: Monitor[];
|
||||||
infrastructureMonitors: Monitor[];
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user