Updated default https value and disabled multiple emails field

This commit is contained in:
Daniel Cojocea committed 2024-07-31 16:41:04 -04:00
1 parent 6eac076847
commit 73310422da
1 file changed
+16 -36
@@ -36,7 +36,7 @@ const CreateMonitor = () => {
notifications: [], notifications: [],
interval: 1, interval: 1,
}); });
const [https, setHttps] = useState(false); const [https, setHttps] = useState(true);
const [errors, setErrors] = useState({}); const [errors, setErrors] = useState({});
const handleChange = (event, name) => { const handleChange = (event, name) => {
@@ -217,15 +217,6 @@ const CreateMonitor = () => {
/> />
{monitor.type === "http" ? ( {monitor.type === "http" ? (
<ButtonGroup sx={{ ml: "32px" }}> <ButtonGroup sx={{ ml: "32px" }}>
<Button
level="secondary"
label="HTTP"
onClick={() => setHttps(false)}
sx={{
backgroundColor:
!https && theme.palette.otherColors.fillGray,
}}
/>
<Button <Button
level="secondary" level="secondary"
label="HTTPS" label="HTTPS"
@@ -235,6 +226,15 @@ const CreateMonitor = () => {
https && theme.palette.otherColors.fillGray, https && theme.palette.otherColors.fillGray,
}} }}
/> />
<Button
level="secondary"
label="HTTP"
onClick={() => setHttps(false)}
sx={{
backgroundColor:
!https && theme.palette.otherColors.fillGray,
}}
/>
</ButtonGroup> </ButtonGroup>
) : ( ) : (
"" ""
@@ -249,32 +249,6 @@ const CreateMonitor = () => {
checked={monitor.type === "ping"} checked={monitor.type === "ping"}
onChange={(event) => handleChange(event)} onChange={(event) => handleChange(event)}
/> />
{/* TODO */}
{/* <RadioButton
id="monitor-checks-port"
title="Port monitoring"
desc="Monitor a specific service on your server."
value="port"
checked={checks.type === "port"}
onChange={(event) => handleChange(event, "type", setChecks)}
/>
<div className="monitors-dropdown-holder">
<Select
id="monitor-ports"
value={checks.port || "placeholder"}
inputProps={{ id: "monitor-ports-select" }}
onChange={(event) => handleChange(event, "port", setChecks)}
>
<MenuItem id="port-placeholder" value="placeholder">
Select a port to check
</MenuItem>
{ports.map((port, index) => (
<MenuItem key={`port-${index}`} value={port}>
{port}
</MenuItem>
))}
</Select>
</div> */}
<Box className="error-container"> <Box className="error-container">
{errors["type"] ? ( {errors["type"] ? (
<Typography component="p" className="input-error"> <Typography component="p" className="input-error">
@@ -322,6 +296,9 @@ const CreateMonitor = () => {
onChange={() => console.log("disabled")} onChange={() => console.log("disabled")}
isDisabled={true} isDisabled={true}
/> />
{monitor.notifications.some(
(notification) => notification.type === "emails"
) ? (
<Box mx={`calc(${theme.gap.ml} * 2)`}> <Box mx={`calc(${theme.gap.ml} * 2)`}>
<Field <Field
id="notify-email-list" id="notify-email-list"
@@ -334,6 +311,9 @@ const CreateMonitor = () => {
You can separate multiple emails with a comma You can separate multiple emails with a comma
</Typography> </Typography>
</Box> </Box>
) : (
""
)}
</Stack> </Stack>
</Stack> </Stack>
<Stack className="config-box"> <Stack className="config-box">