- WIP
This commit is contained in:
1 parent
cabc7a75df
commit
bb8cfa7985
1 file changed
+141
-89
@@ -232,69 +232,6 @@ const CreateInfrastructureMonitor = () => {
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
<ConfigBox>
|
|
||||||
<Box>
|
|
||||||
<Typography component="h2">Checks to perform</Typography>
|
|
||||||
<Typography component="p">
|
|
||||||
You can always add or remove checks after adding your site.
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
<Stack gap={theme.spacing(12)}>
|
|
||||||
<Stack gap={theme.spacing(6)}>
|
|
||||||
<Radio
|
|
||||||
id="monitor-checks-http"
|
|
||||||
title="Website monitoring"
|
|
||||||
desc="Use HTTP(s) to monitor your website or API endpoint."
|
|
||||||
size="small"
|
|
||||||
value="http"
|
|
||||||
checked={infrastructureMonitor.type === "http"}
|
|
||||||
onChange={(event) => handleChange(event)}
|
|
||||||
/>
|
|
||||||
{infrastructureMonitor.type === "http" ? (
|
|
||||||
<ButtonGroup sx={{ ml: theme.spacing(16) }}>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={https.toString()}
|
|
||||||
onClick={() => setHttps(true)}
|
|
||||||
>
|
|
||||||
HTTPS
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant="group"
|
|
||||||
filled={(!https).toString()}
|
|
||||||
onClick={() => setHttps(false)}
|
|
||||||
>
|
|
||||||
HTTP
|
|
||||||
</Button>
|
|
||||||
</ButtonGroup>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
<Radio
|
|
||||||
id="monitor-checks-ping"
|
|
||||||
title="Ping monitoring"
|
|
||||||
desc="Check whether your server is available or not."
|
|
||||||
size="small"
|
|
||||||
value="ping"
|
|
||||||
checked={infrastructureMonitor.type === "ping"}
|
|
||||||
onChange={(event) => handleChange(event)}
|
|
||||||
/>
|
|
||||||
{errors["type"] ? (
|
|
||||||
<Box className="error-container">
|
|
||||||
<Typography
|
|
||||||
component="p"
|
|
||||||
className="input-error"
|
|
||||||
color={theme.palette.error.text}
|
|
||||||
>
|
|
||||||
{errors["type"]}
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Stack>
|
|
||||||
</ConfigBox>
|
|
||||||
<ConfigBox>
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">Incident notifications</Typography>
|
<Typography component="h2">Incident notifications</Typography>
|
||||||
@@ -304,14 +241,6 @@ const CreateInfrastructureMonitor = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.spacing(6)}>
|
<Stack gap={theme.spacing(6)}>
|
||||||
<Typography component="p">When there is a new incident,</Typography>
|
<Typography component="p">When there is a new incident,</Typography>
|
||||||
<Checkbox
|
|
||||||
id="notify-sms"
|
|
||||||
label="Notify via SMS (coming soon)"
|
|
||||||
isChecked={false}
|
|
||||||
value=""
|
|
||||||
onChange={() => logger.warn("disabled")}
|
|
||||||
isDisabled={true}
|
|
||||||
/>
|
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="notify-email-default"
|
id="notify-email-default"
|
||||||
label={`Notify via email (to ${user.email})`}
|
label={`Notify via email (to ${user.email})`}
|
||||||
@@ -329,26 +258,149 @@ const CreateInfrastructureMonitor = () => {
|
|||||||
onChange={() => logger.warn("disabled")}
|
onChange={() => logger.warn("disabled")}
|
||||||
isDisabled={true}
|
isDisabled={true}
|
||||||
/>
|
/>
|
||||||
{infrastructureMonitor.notifications.some(
|
<Box mx={theme.spacing(16)}>
|
||||||
(notification) => notification.type === "emails"
|
<Field
|
||||||
) ? (
|
id="notify-email-list"
|
||||||
<Box mx={theme.spacing(16)}>
|
type="text"
|
||||||
<Field
|
placeholder="name@gmail.com"
|
||||||
id="notify-email-list"
|
value=""
|
||||||
type="text"
|
onChange={() => logger.warn("disabled")}
|
||||||
placeholder="name@gmail.com"
|
/>
|
||||||
value=""
|
<Typography mt={theme.spacing(4)}>
|
||||||
onChange={() => logger.warn("disabled")}
|
You can separate multiple emails with a comma
|
||||||
/>
|
</Typography>
|
||||||
<Typography mt={theme.spacing(4)}>
|
</Box>
|
||||||
You can separate multiple emails with a comma
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</ConfigBox>
|
</ConfigBox>
|
||||||
|
|
||||||
|
<ConfigBox>
|
||||||
|
<Box>
|
||||||
|
<Typography component="h2">Customize alerts</Typography>
|
||||||
|
<Typography component="p">
|
||||||
|
Send a notification to user(s) When the theresholds exceed a certain number
|
||||||
|
or percentage.
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
<Stack
|
||||||
|
gap={theme.spacing(6)}
|
||||||
|
>
|
||||||
|
<Stack direction={"row"}
|
||||||
|
sx={{
|
||||||
|
justifyContent: "space-between",
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box>
|
||||||
|
<Checkbox
|
||||||
|
id="customize-cpu"
|
||||||
|
label={`CPU`}
|
||||||
|
value={user?.email}
|
||||||
|
onChange={(event) => handleChange(event)}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<Stack
|
||||||
|
direction={"row"}
|
||||||
|
sx={{
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Field type="text"></Field>
|
||||||
|
<Typography
|
||||||
|
component="p"
|
||||||
|
m={theme.spacing(3)}
|
||||||
|
>
|
||||||
|
%
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
<Stack direction={"row"}
|
||||||
|
sx={{
|
||||||
|
justifyContent: "space-between",
|
||||||
|
|
||||||
|
}}>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Checkbox
|
||||||
|
id="customize-memory"
|
||||||
|
label={`Memory`}
|
||||||
|
value={user?.email}
|
||||||
|
onChange={(event) => handleChange(event)}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<Stack
|
||||||
|
direction={"row"}
|
||||||
|
sx={{
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Field type="text" sx={{flexGrow:3}}></Field>
|
||||||
|
<Typography
|
||||||
|
component="p"
|
||||||
|
m={theme.spacing(3)}
|
||||||
|
>
|
||||||
|
%
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
<Stack
|
||||||
|
direction={"row"}
|
||||||
|
flexGrow={1}
|
||||||
|
>
|
||||||
|
<Box flex={0.1}>
|
||||||
|
<Checkbox
|
||||||
|
id="customize-disk"
|
||||||
|
label={`Disk`}
|
||||||
|
value={user?.email}
|
||||||
|
onChange={(event) => handleChange(event)}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<Field type="text"></Field>
|
||||||
|
<Typography
|
||||||
|
component="p"
|
||||||
|
m={theme.spacing(3)}
|
||||||
|
>
|
||||||
|
%
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
<Stack direction={"row"}>
|
||||||
|
<Box flex={0.1}>
|
||||||
|
<Checkbox
|
||||||
|
id="customize-temparature"
|
||||||
|
label={`Temparature`}
|
||||||
|
value={user?.email}
|
||||||
|
onChange={(event) => handleChange(event)}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<Field type="text"></Field>
|
||||||
|
<Typography
|
||||||
|
component="p"
|
||||||
|
m={theme.spacing(3)}
|
||||||
|
>
|
||||||
|
°C
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
<Stack direction={"row"}>
|
||||||
|
<Box flex={0.1}>
|
||||||
|
<Checkbox
|
||||||
|
id="customize-systemload"
|
||||||
|
label={`System load`}
|
||||||
|
value={user?.email}
|
||||||
|
onChange={(event) => handleChange(event)}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<Field type="text"></Field>
|
||||||
|
<Typography
|
||||||
|
component="p"
|
||||||
|
m={theme.spacing(3)}
|
||||||
|
>
|
||||||
|
%
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</ConfigBox>
|
||||||
|
|
||||||
<ConfigBox>
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">Advanced settings</Typography>
|
<Typography component="h2">Advanced settings</Typography>
|
||||||
|
|||||||
Reference in new issue
Block a user