Merge branch 'develop' into feat/create-monitor-display-name-v2

This commit is contained in:
Peter Carl Pardo committed 2024-11-30 23:06:06 +08:00
commit 0adc8fd037
39 files changed
+345 -744

No files matched your search

@@ -1,5 +1,5 @@
import { Box, Stack, Typography } from "@mui/material";
import Field from "../../../../Components/Inputs/Field";
import TextInput from "../../../../Components/Inputs/TextInput";
import Checkbox from "../../../../Components/Inputs/Checkbox";
import { useTheme } from "@emotion/react";
import PropTypes from "prop-types";
@@ -57,17 +57,17 @@ export const CustomThreshold = ({
justifyContent: "flex-end",
}}
>
<Field
<TextInput
maxWidth="var(--env-var-width-4)"
type="number"
className="field-infrastructure-alert"
id={fieldId}
value={infrastructureMonitor[fieldId]}
onBlur={onFieldBlur}
onChange={onFieldChange}
error={errors[fieldId]}
error={errors[fieldId] ? true : false}
disabled={!infrastructureMonitor[checkboxId]}
hideErrorText={true}
></Field>
/>
<Typography
component="p"
m={theme.spacing(3)}
@@ -12,9 +12,8 @@ import { useNavigate } from "react-router-dom";
import { useTheme } from "@emotion/react";
import { createToast } from "../../../Utils/toastUtils";
import Link from "../../../Components/Link";
import { ConfigBox } from "../../Monitors/styled";
import Field from "../../../Components/Inputs/Field";
import TextInput from "../../../Components/Inputs/TextInput";
import Select from "../../../Components/Inputs/Select";
import Checkbox from "../../../Components/Inputs/Checkbox";
import Breadcrumbs from "../../../Components/Breadcrumbs";
@@ -106,7 +105,6 @@ const CreateInfrastructureMonitor = () => {
event.preventDefault();
const { value, id } = event.target;
let name = appendedId ?? idMap[id] ?? id;
if (name.includes("notification-")) {
name = name.replace("notification-", "");
let hasNotif = infrastructureMonitor.notifications.some(
@@ -263,7 +261,7 @@ const CreateInfrastructureMonitor = () => {
</Stack>
</Box>
<Stack gap={theme.spacing(15)}>
<Field
<TextInput
type="text"
id="url"
label="Server URL"
@@ -271,9 +269,10 @@ const CreateInfrastructureMonitor = () => {
value={infrastructureMonitor.url}
onBlur={handleBlur}
onChange={handleChange}
error={errors["url"]}
error={errors["url"] ? true : false}
helperText={errors["url"]}
/>
<Field
<TextInput
type="text"
id="name"
label="Friendly name"
@@ -283,14 +282,15 @@ const CreateInfrastructureMonitor = () => {
onChange={handleChange}
error={errors["name"]}
/>
<Field
<TextInput
type="text"
id="secret"
label="Authorization secret"
value={infrastructureMonitor.secret}
onBlur={handleBlur}
onChange={handleChange}
error={errors["secret"]}
error={errors["secret"] ? true : false}
helperText={errors["secret"]}
/>
</Stack>
</ConfigBox>
@@ -378,15 +378,6 @@ const CreateInfrastructureMonitor = () => {
onBlur={(e) => handleBlur(e, "interval")}
items={frequencies}
/>
{/* <Field
type={"number"}
id="monitor-retries"
label="Maximum retries before the service is marked as down"
value={infrastructureMonitor.url}
onChange={handleChange}
onBlur={handleBlur}
error={errors["url"]}
/> */}
</Stack>
</ConfigBox>
<Stack