- Update infrastructure page based on figma
This commit is contained in:
1 parent
ffeb4d7991
commit
74eaf14c7c
1 file changed
+10
-10
@@ -3,8 +3,7 @@ import { Box, Button, ButtonGroup, Stack, Typography } from "@mui/material";
|
|||||||
import LoadingButton from "@mui/lab/LoadingButton";
|
import LoadingButton from "@mui/lab/LoadingButton";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { createInfrastructureMonitor, checkInfrastructureEndpointResolution } from "../../../Features/InfrastructureMonitors/infrastructureMonitorsSlice"
|
||||||
import { checkEndpointResolution } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
@@ -122,7 +121,7 @@ const CreateInfrastructureMonitor = () => {
|
|||||||
} else {
|
} else {
|
||||||
if (infrastructureMonitor.type === "http") {
|
if (infrastructureMonitor.type === "http") {
|
||||||
const checkEndpointAction = await dispatch(
|
const checkEndpointAction = await dispatch(
|
||||||
checkEndpointResolution({ authToken, monitorURL: form.url })
|
checkInfrastructureEndpointResolution({ authToken, monitorURL: form.url })
|
||||||
);
|
);
|
||||||
if (checkEndpointAction.meta.requestStatus === "rejected") {
|
if (checkEndpointAction.meta.requestStatus === "rejected") {
|
||||||
createToast({
|
createToast({
|
||||||
@@ -140,10 +139,10 @@ const CreateInfrastructureMonitor = () => {
|
|||||||
userId: user._id,
|
userId: user._id,
|
||||||
notifications: infrastructureMonitor.notifications,
|
notifications: infrastructureMonitor.notifications,
|
||||||
};
|
};
|
||||||
const action = await dispatch(createUptimeMonitor({ authToken, monitor: form }));
|
const action = await dispatch(createInfrastructureMonitor({ authToken, monitor: form }));
|
||||||
if (action.meta.requestStatus === "fulfilled") {
|
if (action.meta.requestStatus === "fulfilled") {
|
||||||
createToast({ body: "Monitor created successfully!" });
|
createToast({ body: "Infrastructure monitor created successfully!" });
|
||||||
navigate("/monitors");
|
navigate("/infrastructure-monitors");
|
||||||
} else {
|
} else {
|
||||||
createToast({ body: "Failed to create monitor." });
|
createToast({ body: "Failed to create monitor." });
|
||||||
}
|
}
|
||||||
@@ -152,11 +151,12 @@ const CreateInfrastructureMonitor = () => {
|
|||||||
|
|
||||||
//select values
|
//select values
|
||||||
const frequencies = [
|
const frequencies = [
|
||||||
{ _id: 1, name: "1 minute" },
|
{ _id: 1, name: "15 seconds" },
|
||||||
{ _id: 2, name: "2 minutes" },
|
{ _id: 2, name: "30 seconds" },
|
||||||
{ _id: 3, name: "3 minutes" },
|
{ _id: 3, name: "1 minute" },
|
||||||
{ _id: 4, name: "4 minutes" },
|
{ _id: 4, name: "2 minutes" },
|
||||||
{ _id: 5, name: "5 minutes" },
|
{ _id: 5, name: "5 minutes" },
|
||||||
|
{ _id: 6, name: "10 minutes" },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in new issue
Block a user