Feat: Ignore TLS/SSL Error Option in Config

This commit is contained in:
Br0wnHammer committed 2025-05-09 01:35:27 +05:30
1 parent c466edb751
commit 4d9e47d93a
3 files changed
+42 -20

No files matched your search

+35 -4
View File
@@ -2,7 +2,15 @@ import { useNavigate, useParams } from "react-router";
import { useTheme } from "@emotion/react";
import { useDispatch, useSelector } from "react-redux";
import { useEffect, useState } from "react";
import { Box, Stack, Tooltip, Typography, Button } from "@mui/material";
import {
Box,
Stack,
Tooltip,
Typography,
Button,
FormControlLabel,
Switch,
} from "@mui/material";
import { monitorValidation } from "../../../Validation/validation";
import { createToast } from "../../../Utils/toastUtils";
import { logger } from "../../../Utils/Logger";
@@ -95,7 +103,7 @@ const Configure = () => {
}, [monitorId, navigate]);
const handleChange = (event, name) => {
let { value, id } = event.target;
let { checked, value, id } = event.target;
if (!name) name = idMap[id];
if (name.includes("notification-")) {
@@ -127,6 +135,9 @@ const Configure = () => {
if (name === "interval") {
value = value * MS_PER_MINUTE;
}
if (name === "ignoreTlsErrors") {
value = checked;
}
setMonitor((prev) => ({
...prev,
[name]: value,
@@ -208,7 +219,6 @@ const Configure = () => {
setIsNotificationModalOpen(false);
};
const statusColor = {
true: theme.palette.success.main,
false: theme.palette.error.main,
@@ -476,7 +486,28 @@ const Configure = () => {
</ConfigBox>
<ConfigBox>
<Box>
<Typography component="h2">{t("distributedUptimeCreateAdvancedSettings")}</Typography>
<Typography component="h2">{t("ignoreTLSError")}</Typography>
<Typography component="p">{t("ignoreTLSErrorDescription")}</Typography>
</Box>
<Stack>
<FormControlLabel
control={
<Switch
name="ignore-error"
checked={monitor.ignoreTlsErrors}
onChange={(event) => handleChange(event, "ignoreTlsErrors")}
sx={{ mr: theme.spacing(2) }}
/>
}
label={t("tlsErrorIgnored")}
/>
</Stack>
</ConfigBox>
<ConfigBox>
<Box>
<Typography component="h2">
{t("distributedUptimeCreateAdvancedSettings")}
</Typography>
</Box>
<Stack gap={theme.spacing(20)}>
<Select