2025-08-02 03:53:11 -04:00
|
|
|
//Components
|
2025-09-27 14:54:55 -07:00
|
|
|
import Breadcrumbs from "@/Components/v1/Breadcrumbs/index.jsx";
|
|
|
|
|
import ConfigBox from "@/Components/v1/ConfigBox/index.jsx";
|
|
|
|
|
import FieldWrapper from "@/Components/v1/Inputs/FieldWrapper/index.jsx";
|
|
|
|
|
import Link from "@/Components/v1/Link/index.jsx";
|
|
|
|
|
import Select from "@/Components/v1/Inputs/Select/index.jsx";
|
|
|
|
|
import TextInput from "@/Components/v1/Inputs/TextInput/index.jsx";
|
2025-08-17 15:28:06 -04:00
|
|
|
import { Box, Stack, Typography, Button, ButtonGroup } from "@mui/material";
|
2025-09-27 14:54:55 -07:00
|
|
|
import { HttpAdornment } from "@/Components/v1/Inputs/TextInput/Adornments/index.jsx";
|
2025-09-25 10:11:41 -07:00
|
|
|
import MonitorStatusHeader from "./Components/MonitorStatusHeader.jsx";
|
|
|
|
|
import MonitorActionButtons from "./Components/MonitorActionButtons.jsx";
|
|
|
|
|
import CustomAlertsSection from "./Components/CustomAlertsSection.jsx";
|
2025-08-02 03:53:11 -04:00
|
|
|
// Utils
|
2025-09-27 14:54:55 -07:00
|
|
|
import NotificationsConfig from "@/Components/v1/NotificationConfig/index.jsx";
|
2025-09-25 10:11:41 -07:00
|
|
|
import { useGetNotificationsByTeamId } from "../../../../Hooks/v1/useNotifications.js";
|
2025-11-15 22:27:31 +00:00
|
|
|
import { useParams, useSearchParams } from "react-router-dom";
|
2025-08-02 03:53:11 -04:00
|
|
|
import { useState, useEffect } from "react";
|
|
|
|
|
import { useTheme } from "@emotion/react";
|
2025-03-12 00:56:28 +05:30
|
|
|
import { useTranslation } from "react-i18next";
|
2025-07-29 00:42:56 +05:30
|
|
|
import {
|
2025-08-02 03:53:11 -04:00
|
|
|
useDeleteMonitor,
|
2025-07-29 00:42:56 +05:30
|
|
|
useFetchGlobalSettings,
|
2025-08-02 03:53:11 -04:00
|
|
|
useFetchHardwareMonitorById,
|
|
|
|
|
usePauseMonitor,
|
2025-09-25 10:11:41 -07:00
|
|
|
} from "../../../../Hooks/v1/monitorHooks.js";
|
|
|
|
|
import useInfrastructureMonitorForm from "./hooks/useInfrastructureMonitorForm.jsx";
|
|
|
|
|
import useValidateInfrastructureForm from "./hooks/useValidateInfrastructureForm.jsx";
|
|
|
|
|
import useInfrastructureSubmit from "./hooks/useInfrastructureSubmit.jsx";
|
2024-12-09 13:35:48 +08:00
|
|
|
|
2024-10-31 15:19:57 -04:00
|
|
|
const CreateInfrastructureMonitor = () => {
|
2025-03-14 22:12:52 -04:00
|
|
|
const { monitorId } = useParams();
|
2025-11-15 22:27:31 +00:00
|
|
|
const [searchParams] = useSearchParams();
|
2025-03-14 22:12:52 -04:00
|
|
|
const isCreate = typeof monitorId === "undefined";
|
|
|
|
|
|
2025-08-02 03:53:11 -04:00
|
|
|
const theme = useTheme();
|
|
|
|
|
const { t } = useTranslation();
|
2024-12-09 13:35:48 +08:00
|
|
|
|
|
|
|
|
// State
|
|
|
|
|
const [https, setHttps] = useState(false);
|
2025-08-02 03:53:11 -04:00
|
|
|
const [updateTrigger, setUpdateTrigger] = useState(false);
|
2024-11-07 15:26:22 -05:00
|
|
|
|
2025-08-02 03:53:11 -04:00
|
|
|
// Fetch monitor details if editing
|
|
|
|
|
const [monitor, isLoading] = useFetchHardwareMonitorById({
|
|
|
|
|
monitorId,
|
|
|
|
|
updateTrigger,
|
|
|
|
|
});
|
2025-11-15 22:42:02 +00:00
|
|
|
|
|
|
|
|
// Determine monitor type: from query params when creating, from monitor object when editing
|
|
|
|
|
const monitorType = isCreate
|
|
|
|
|
? (searchParams.get("type") || "hardware")
|
|
|
|
|
: (monitor?.type || "hardware");
|
2025-08-02 03:53:11 -04:00
|
|
|
const [deleteMonitor, isDeleting] = useDeleteMonitor();
|
|
|
|
|
const [globalSettings, globalSettingsLoading] = useFetchGlobalSettings();
|
|
|
|
|
const [notifications, notificationsAreLoading] = useGetNotificationsByTeamId();
|
|
|
|
|
const [pauseMonitor, isPausing] = usePauseMonitor();
|
2025-08-17 15:28:06 -04:00
|
|
|
const {
|
|
|
|
|
infrastructureMonitor,
|
|
|
|
|
setInfrastructureMonitor,
|
|
|
|
|
onChangeForm,
|
|
|
|
|
handleCheckboxChange,
|
|
|
|
|
initializeInfrastructureMonitorForCreate,
|
|
|
|
|
initializeInfrastructureMonitorForUpdate,
|
|
|
|
|
} = useInfrastructureMonitorForm();
|
|
|
|
|
const { errors, validateField, validateForm } = useValidateInfrastructureForm();
|
|
|
|
|
const { buildForm, submitInfrastructureForm, isCreating, isUpdating } =
|
|
|
|
|
useInfrastructureSubmit();
|
2025-08-02 03:53:11 -04:00
|
|
|
|
2025-11-15 22:33:05 +00:00
|
|
|
const ALL_FREQUENCIES = [
|
2025-08-02 03:53:11 -04:00
|
|
|
{ _id: 0.25, name: t("time.fifteenSeconds") },
|
|
|
|
|
{ _id: 0.5, name: t("time.thirtySeconds") },
|
|
|
|
|
{ _id: 1, name: t("time.oneMinute") },
|
|
|
|
|
{ _id: 2, name: t("time.twoMinutes") },
|
|
|
|
|
{ _id: 5, name: t("time.fiveMinutes") },
|
|
|
|
|
{ _id: 10, name: t("time.tenMinutes") },
|
|
|
|
|
];
|
2025-11-15 22:33:05 +00:00
|
|
|
|
|
|
|
|
// Docker monitors require minimum 30 second interval
|
|
|
|
|
const FREQUENCIES =
|
|
|
|
|
monitorType === "docker"
|
|
|
|
|
? ALL_FREQUENCIES.filter((f) => f._id >= 0.5)
|
|
|
|
|
: ALL_FREQUENCIES;
|
2025-08-02 03:53:11 -04:00
|
|
|
const CRUMBS = [
|
|
|
|
|
{ name: "Infrastructure monitors", path: "/infrastructure" },
|
|
|
|
|
...(isCreate
|
|
|
|
|
? [{ name: "Create", path: "/infrastructure/create" }]
|
|
|
|
|
: [
|
|
|
|
|
{ name: "Details", path: `/infrastructure/${monitorId}` },
|
|
|
|
|
{ name: "Configure", path: `/infrastructure/configure/${monitorId}` },
|
|
|
|
|
]),
|
|
|
|
|
];
|
|
|
|
|
// Populate form fields if editing
|
2025-03-14 22:14:06 -04:00
|
|
|
useEffect(() => {
|
2025-07-30 19:18:24 +05:30
|
|
|
if (isCreate) {
|
|
|
|
|
if (globalSettingsLoading) return;
|
2025-07-31 16:04:41 +05:30
|
|
|
setHttps(false);
|
2025-11-15 22:42:02 +00:00
|
|
|
const typeFromQuery = searchParams.get("type") || "hardware";
|
|
|
|
|
initializeInfrastructureMonitorForCreate(globalSettings, typeFromQuery);
|
2025-07-30 19:18:24 +05:30
|
|
|
} else if (monitor) {
|
2025-07-31 16:04:41 +05:30
|
|
|
setHttps(monitor.url.startsWith("https"));
|
2025-08-17 15:28:06 -04:00
|
|
|
initializeInfrastructureMonitorForUpdate(monitor);
|
2025-07-30 19:18:24 +05:30
|
|
|
}
|
2025-09-19 00:06:31 +05:30
|
|
|
}, [
|
|
|
|
|
isCreate,
|
|
|
|
|
monitor,
|
|
|
|
|
globalSettings,
|
|
|
|
|
globalSettingsLoading,
|
2025-11-15 22:42:02 +00:00
|
|
|
searchParams,
|
2025-09-19 00:06:31 +05:30
|
|
|
initializeInfrastructureMonitorForCreate,
|
|
|
|
|
initializeInfrastructureMonitorForUpdate,
|
|
|
|
|
]);
|
2025-03-14 22:14:06 -04:00
|
|
|
|
2024-12-09 13:35:48 +08:00
|
|
|
// Handlers
|
2025-06-09 14:59:26 +08:00
|
|
|
const onSubmit = async (event) => {
|
2024-11-11 11:16:06 -05:00
|
|
|
event.preventDefault();
|
2025-11-15 22:33:05 +00:00
|
|
|
const form = buildForm(infrastructureMonitor, https, monitorType);
|
2025-08-17 15:28:06 -04:00
|
|
|
const error = validateForm(form);
|
2024-12-09 13:35:48 +08:00
|
|
|
if (error) {
|
|
|
|
|
return;
|
2024-10-31 15:19:57 -04:00
|
|
|
}
|
2025-11-15 22:33:05 +00:00
|
|
|
submitInfrastructureForm(infrastructureMonitor, form, isCreate, monitorId, monitorType);
|
2024-11-07 15:26:22 -05:00
|
|
|
};
|
2024-12-09 13:35:48 +08:00
|
|
|
|
2025-08-02 03:53:11 -04:00
|
|
|
const triggerUpdate = () => {
|
|
|
|
|
setUpdateTrigger(!updateTrigger);
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-09 14:59:26 +08:00
|
|
|
const onChange = (event) => {
|
2024-12-10 11:30:38 +08:00
|
|
|
const { value, name } = event.target;
|
2025-08-17 15:28:06 -04:00
|
|
|
onChangeForm(name, value);
|
|
|
|
|
validateField(name, value);
|
2024-12-09 13:35:48 +08:00
|
|
|
};
|
|
|
|
|
|
2025-08-02 03:53:11 -04:00
|
|
|
const handlePause = async () => {
|
|
|
|
|
await pauseMonitor({ monitorId, triggerUpdate });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleRemove = async (event) => {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
await deleteMonitor({ monitor, redirect: "/infrastructure" });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const isBusy =
|
|
|
|
|
isLoading ||
|
|
|
|
|
isUpdating ||
|
|
|
|
|
isCreating ||
|
|
|
|
|
isDeleting ||
|
|
|
|
|
isPausing ||
|
|
|
|
|
notificationsAreLoading;
|
|
|
|
|
|
2024-10-31 15:19:57 -04:00
|
|
|
return (
|
|
|
|
|
<Box className="create-infrastructure-monitor">
|
2025-08-02 03:53:11 -04:00
|
|
|
<Breadcrumbs list={CRUMBS} />
|
2024-10-31 15:19:57 -04:00
|
|
|
<Stack
|
|
|
|
|
component="form"
|
2025-06-09 14:59:26 +08:00
|
|
|
onSubmit={onSubmit}
|
2024-10-31 15:19:57 -04:00
|
|
|
noValidate
|
|
|
|
|
spellCheck="false"
|
|
|
|
|
gap={theme.spacing(12)}
|
|
|
|
|
mt={theme.spacing(6)}
|
|
|
|
|
>
|
2025-08-02 03:53:11 -04:00
|
|
|
<Stack
|
|
|
|
|
direction="row"
|
|
|
|
|
gap={theme.spacing(2)}
|
2024-10-31 15:19:57 -04:00
|
|
|
>
|
2025-08-02 03:53:11 -04:00
|
|
|
<Box>
|
|
|
|
|
<Typography
|
|
|
|
|
component="h1"
|
|
|
|
|
variant="h1"
|
|
|
|
|
>
|
|
|
|
|
<Typography
|
|
|
|
|
component="span"
|
|
|
|
|
fontSize="inherit"
|
|
|
|
|
color={
|
|
|
|
|
!isCreate ? theme.palette.primary.contrastTextSecondary : undefined
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{!isCreate ? infrastructureMonitor.name : t("createYour") + " "}
|
|
|
|
|
</Typography>
|
|
|
|
|
{isCreate ? (
|
|
|
|
|
<Typography
|
|
|
|
|
component="span"
|
|
|
|
|
fontSize="inherit"
|
|
|
|
|
fontWeight="inherit"
|
|
|
|
|
color={theme.palette.primary.contrastTextSecondary}
|
|
|
|
|
>
|
|
|
|
|
{t("monitor")}
|
|
|
|
|
</Typography>
|
|
|
|
|
) : (
|
|
|
|
|
<></>
|
|
|
|
|
)}
|
|
|
|
|
</Typography>
|
|
|
|
|
{!isCreate && (
|
2025-08-17 15:28:06 -04:00
|
|
|
<MonitorStatusHeader
|
|
|
|
|
monitor={monitor}
|
|
|
|
|
infrastructureMonitor={infrastructureMonitor}
|
|
|
|
|
/>
|
2025-08-02 03:53:11 -04:00
|
|
|
)}
|
|
|
|
|
</Box>
|
|
|
|
|
{!isCreate && (
|
2025-08-17 15:28:06 -04:00
|
|
|
<MonitorActionButtons
|
|
|
|
|
monitor={monitor}
|
|
|
|
|
isBusy={isBusy}
|
|
|
|
|
handlePause={handlePause}
|
|
|
|
|
handleRemove={handleRemove}
|
|
|
|
|
/>
|
2025-08-02 03:53:11 -04:00
|
|
|
)}
|
|
|
|
|
</Stack>
|
2024-10-31 15:19:57 -04:00
|
|
|
<ConfigBox>
|
2025-07-28 16:28:44 -04:00
|
|
|
<Stack>
|
2025-05-27 09:10:32 -07:00
|
|
|
<Typography
|
|
|
|
|
component="h2"
|
|
|
|
|
variant="h2"
|
|
|
|
|
>
|
|
|
|
|
{t("settingsGeneralSettings")}
|
|
|
|
|
</Typography>
|
2024-12-09 13:35:48 +08:00
|
|
|
<Typography component="p">
|
2025-11-15 22:33:05 +00:00
|
|
|
{monitorType === "docker"
|
|
|
|
|
? "Configure your Capture server to monitor Docker containers."
|
|
|
|
|
: t("infrastructureCreateGeneralSettingsDescription")}
|
2024-12-09 13:35:48 +08:00
|
|
|
</Typography>
|
|
|
|
|
<Typography component="p">
|
2025-11-15 22:33:05 +00:00
|
|
|
{monitorType === "docker" ? (
|
|
|
|
|
<>
|
|
|
|
|
Capture server endpoint: <code>/api/v1/metrics/docker</code>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
{t("infrastructureServerRequirement")}{" "}
|
|
|
|
|
<Link
|
|
|
|
|
level="primary"
|
|
|
|
|
url="https://github.com/bluewave-labs/checkmate-agent"
|
|
|
|
|
label={t("common.monitoringAgentName")}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
2024-12-09 13:35:48 +08:00
|
|
|
</Typography>
|
|
|
|
|
</Stack>
|
2025-07-13 20:23:10 -04:00
|
|
|
<Stack gap={theme.spacing(8)}>
|
2024-11-26 12:15:41 +08:00
|
|
|
<TextInput
|
2024-12-09 13:35:48 +08:00
|
|
|
type="url"
|
2024-11-07 15:26:22 -05:00
|
|
|
id="url"
|
2024-12-10 11:30:38 +08:00
|
|
|
name="url"
|
2024-12-09 13:35:48 +08:00
|
|
|
startAdornment={<HttpAdornment https={https} />}
|
2025-11-15 22:33:05 +00:00
|
|
|
placeholder={
|
|
|
|
|
monitorType === "docker"
|
|
|
|
|
? "192.168.1.100:59232"
|
|
|
|
|
: "localhost:59232/api/v1/metrics"
|
|
|
|
|
}
|
|
|
|
|
label={
|
|
|
|
|
monitorType === "docker"
|
|
|
|
|
? "Capture Server URL"
|
|
|
|
|
: t("infrastructureServerUrlLabel")
|
|
|
|
|
}
|
2024-12-09 13:35:48 +08:00
|
|
|
https={https}
|
2024-10-31 15:19:57 -04:00
|
|
|
value={infrastructureMonitor.url}
|
2025-06-09 14:59:26 +08:00
|
|
|
onChange={onChange}
|
2024-11-26 12:15:41 +08:00
|
|
|
error={errors["url"] ? true : false}
|
|
|
|
|
helperText={errors["url"]}
|
2025-03-15 00:30:00 -04:00
|
|
|
disabled={!isCreate}
|
2024-10-31 15:19:57 -04:00
|
|
|
/>
|
2025-03-15 00:30:00 -04:00
|
|
|
{isCreate && (
|
2025-07-13 20:23:10 -04:00
|
|
|
<FieldWrapper
|
|
|
|
|
label={t("infrastructureProtocol")}
|
|
|
|
|
labelVariant="p"
|
|
|
|
|
>
|
2025-05-27 09:10:32 -07:00
|
|
|
<ButtonGroup>
|
|
|
|
|
<Button
|
|
|
|
|
variant="group"
|
|
|
|
|
filled={https.toString()}
|
|
|
|
|
onClick={() => setHttps(true)}
|
|
|
|
|
>
|
|
|
|
|
{t("https")}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="group"
|
|
|
|
|
filled={(!https).toString()}
|
|
|
|
|
onClick={() => setHttps(false)}
|
|
|
|
|
>
|
|
|
|
|
{t("http")}
|
|
|
|
|
</Button>
|
|
|
|
|
</ButtonGroup>
|
2025-07-13 20:23:10 -04:00
|
|
|
</FieldWrapper>
|
2025-03-15 00:30:00 -04:00
|
|
|
)}
|
2024-11-26 12:15:41 +08:00
|
|
|
<TextInput
|
2024-10-31 15:19:57 -04:00
|
|
|
type="text"
|
2024-11-07 15:26:22 -05:00
|
|
|
id="name"
|
2024-12-10 11:30:38 +08:00
|
|
|
name="name"
|
2025-03-12 00:56:28 +05:30
|
|
|
label={t("infrastructureDisplayNameLabel")}
|
2024-11-29 10:17:09 -05:00
|
|
|
placeholder="Google"
|
2024-10-31 15:19:57 -04:00
|
|
|
isOptional={true}
|
|
|
|
|
value={infrastructureMonitor.name}
|
2025-06-09 14:59:26 +08:00
|
|
|
onChange={onChange}
|
2024-10-31 15:19:57 -04:00
|
|
|
error={errors["name"]}
|
|
|
|
|
/>
|
2024-11-26 12:15:41 +08:00
|
|
|
<TextInput
|
2024-11-04 10:06:00 -05:00
|
|
|
type="text"
|
2024-11-07 15:26:22 -05:00
|
|
|
id="secret"
|
2024-12-10 11:30:38 +08:00
|
|
|
name="secret"
|
2025-11-15 22:33:05 +00:00
|
|
|
label={
|
|
|
|
|
monitorType === "docker"
|
|
|
|
|
? "Capture API Secret"
|
|
|
|
|
: t("infrastructureAuthorizationSecretLabel")
|
|
|
|
|
}
|
|
|
|
|
placeholder={monitorType === "docker" ? "Bearer token for Capture API" : ""}
|
2024-11-04 10:06:00 -05:00
|
|
|
value={infrastructureMonitor.secret}
|
2025-06-09 14:59:26 +08:00
|
|
|
onChange={onChange}
|
2024-11-26 12:15:41 +08:00
|
|
|
error={errors["secret"] ? true : false}
|
|
|
|
|
helperText={errors["secret"]}
|
2024-10-31 15:19:57 -04:00
|
|
|
/>
|
|
|
|
|
</Stack>
|
|
|
|
|
</ConfigBox>
|
|
|
|
|
<ConfigBox>
|
|
|
|
|
<Box>
|
2025-07-28 16:28:44 -04:00
|
|
|
<Typography
|
|
|
|
|
component="h2"
|
|
|
|
|
variant="h2"
|
|
|
|
|
>
|
|
|
|
|
{t("notificationConfig.title")}
|
|
|
|
|
</Typography>
|
2025-06-09 14:59:26 +08:00
|
|
|
<Typography component="p">{t("notificationConfig.description")}</Typography>
|
2024-10-31 15:19:57 -04:00
|
|
|
</Box>
|
2025-06-09 14:59:26 +08:00
|
|
|
<NotificationsConfig
|
|
|
|
|
notifications={notifications}
|
|
|
|
|
setMonitor={setInfrastructureMonitor}
|
|
|
|
|
setNotifications={infrastructureMonitor.notifications}
|
|
|
|
|
/>
|
2024-11-04 21:02:28 -05:00
|
|
|
</ConfigBox>
|
2025-09-19 00:03:18 +05:30
|
|
|
<ConfigBox>
|
|
|
|
|
<Box>
|
|
|
|
|
<Typography
|
|
|
|
|
component="h2"
|
|
|
|
|
variant="h2"
|
|
|
|
|
>
|
|
|
|
|
{t("createMonitorPage.incidentConfigTitle")}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography component="p">
|
|
|
|
|
{t("createMonitorPage.incidentConfigDescription")}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Box>
|
|
|
|
|
<Stack gap={theme.spacing(20)}>
|
|
|
|
|
<TextInput
|
|
|
|
|
name="statusWindowSize"
|
|
|
|
|
label={t("createMonitorPage.incidentConfigStatusWindowLabel")}
|
|
|
|
|
type="number"
|
|
|
|
|
value={infrastructureMonitor.statusWindowSize}
|
|
|
|
|
onChange={onChange}
|
|
|
|
|
error={errors["statusWindowSize"] ? true : false}
|
|
|
|
|
helperText={errors["statusWindowSize"]}
|
|
|
|
|
/>
|
|
|
|
|
<TextInput
|
|
|
|
|
name="statusWindowThreshold"
|
|
|
|
|
label={t("createMonitorPage.incidentConfigStatusWindowThresholdLabel")}
|
|
|
|
|
type="number"
|
|
|
|
|
value={infrastructureMonitor.statusWindowThreshold}
|
|
|
|
|
onChange={onChange}
|
|
|
|
|
error={errors["statusWindowThreshold"] ? true : false}
|
|
|
|
|
helperText={errors["statusWindowThreshold"]}
|
|
|
|
|
/>
|
|
|
|
|
</Stack>
|
|
|
|
|
</ConfigBox>
|
2025-11-15 22:33:05 +00:00
|
|
|
{monitorType === "hardware" && (
|
|
|
|
|
<CustomAlertsSection
|
|
|
|
|
errors={errors}
|
|
|
|
|
onChange={onChange}
|
|
|
|
|
infrastructureMonitor={infrastructureMonitor}
|
|
|
|
|
handleCheckboxChange={handleCheckboxChange}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
2024-10-31 15:19:57 -04:00
|
|
|
<ConfigBox>
|
|
|
|
|
<Box>
|
2025-05-27 09:10:32 -07:00
|
|
|
<Typography
|
|
|
|
|
component="h2"
|
|
|
|
|
variant="h2"
|
|
|
|
|
>
|
|
|
|
|
{t("distributedUptimeCreateAdvancedSettings")}
|
|
|
|
|
</Typography>
|
2024-10-31 15:19:57 -04:00
|
|
|
</Box>
|
|
|
|
|
<Stack gap={theme.spacing(12)}>
|
|
|
|
|
<Select
|
2024-11-07 15:26:22 -05:00
|
|
|
id="interval"
|
2024-12-10 11:30:38 +08:00
|
|
|
name="interval"
|
2024-10-31 15:19:57 -04:00
|
|
|
label="Check frequency"
|
2024-11-07 15:27:40 -05:00
|
|
|
value={infrastructureMonitor.interval || 15}
|
2025-06-09 14:59:26 +08:00
|
|
|
onChange={onChange}
|
2025-08-02 03:53:11 -04:00
|
|
|
items={FREQUENCIES}
|
2024-10-31 15:19:57 -04:00
|
|
|
/>
|
|
|
|
|
</Stack>
|
|
|
|
|
</ConfigBox>
|
|
|
|
|
<Stack
|
|
|
|
|
direction="row"
|
|
|
|
|
justifyContent="flex-end"
|
|
|
|
|
>
|
2025-02-13 15:20:12 -08:00
|
|
|
<Button
|
2025-06-09 14:59:26 +08:00
|
|
|
type="submit"
|
2024-10-31 15:19:57 -04:00
|
|
|
variant="contained"
|
2025-01-14 08:09:03 -05:00
|
|
|
color="accent"
|
2025-08-02 03:53:11 -04:00
|
|
|
loading={isBusy}
|
2024-10-31 15:19:57 -04:00
|
|
|
>
|
2025-05-27 09:10:32 -07:00
|
|
|
{t(isCreate ? "infrastructureCreateMonitor" : "infrastructureEditMonitor")}
|
2025-02-13 15:20:12 -08:00
|
|
|
</Button>
|
2024-10-31 15:19:57 -04:00
|
|
|
</Stack>
|
|
|
|
|
</Stack>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default CreateInfrastructureMonitor;
|