import "./index.css"; import ConfigBox from "../../Components/ConfigBox"; import FlexibileTextField from "../../Components/TextFields/Flexibile/FlexibileTextField"; import React, { useState } from "react"; import RadioButton from "../../Components/RadioButton"; import Dropdown from "../../Components/Dropdown"; import CustomizableCheckBox from "../../Components/Checkbox/CustomizableCheckbox"; import Button from "../../Components/Button"; const CreateNewMonitor = () => { const [incidentEmail, setIncidentEmail] = useState(""); const [notifyViaSMS, setNotifyViaSMS] = useState(false); const [notifyViaEmail, setNotifyViaEmail] = useState(false); const [notifyViaCurrentEmail, setNotifyViaCurrentEmail] = useState(false); const [maxRetries, setMaxRetries] = useState(0); const [acceptCode, setAcceptCode] = useState(0); const [maxRedirects, setMaxRedirects] = useState(0); const [proxy, setProxy] = useState(false); const [proxyAddress, setProxyAddress] = useState(""); const [proxyPort, setProxyPort] = useState(""); const [selectedMonitorType, setSelectedMonitorType] = useState(""); const [urlToMonitor, setUrlToMonitor] = useState(""); const [friendlyName, setFriendlyName] = useState(""); const handleUrlToMonitor = (event) => { setUrlToMonitor(event.target.value); console.log(urlToMonitor); }; const handleFriendlyName = (event) => { setFriendlyName(event.target.value); console.log(friendlyName); }; const handleIncidentEmail = (event) => { setIncidentEmail(event.target.value); console.log(incidentEmail); }; const handleNotifyViaSMS = (event) => { setNotifyViaSMS(event.target.checked); }; const handleNotifyViaEmail = (event) => { setNotifyViaEmail(event.target.checked); }; const handleNotifyViaCurrentEmail = (event) => { setNotifyViaCurrentEmail(event.target.checked); }; const handleSetMaxRetries = (event) => { setMaxRetries(event.target.value); console.log(maxRetries); }; const handleSetAcceptCode = (event) => { setAcceptCode(event.target.value); console.log(acceptCode); }; const handleSetMaxRedirects = (event) => { setMaxRedirects(event.target.value); console.log(maxRedirects); }; const handleEnableProxy = (event) => { setProxy(event.target.value); console.log(proxy); }; const handleproxyAddress = (event) => { setProxyAddress(event.target.value); console.log(proxyAddress); }; const handleproxyPort = (event) => { setProxyPort(event.target.value); console.log(proxyPort); }; const handleMonitorTypeChange = (value) => { setSelectedMonitorType(value); console.log(value); }; const handleCreateNewMonitor = () => { console.log("Created"); }; return (
Create new monitor
General settings
Here you can select the URL of the host, together with the type of monitor.
} rightLayout={
} />
Checks to perform
You can always add or remove checks after adding your site.
} rightLayout={
handleMonitorTypeChange("http")} />
handleMonitorTypeChange("ping")} />
handleMonitorTypeChange("port")} />
} />
Incident notifications
When there is an incident, notify users.
} rightLayout={
When there is a new incident,
} />
Advanced settings
} rightLayout={
Check frequency
Maximum retries before the service is marked as down
Accepted status codes
Maximum redirects
} />
Proxy settings
} rightLayout={
Proxy protocol
Proxy address
Proxy port
} />
); }; export default CreateNewMonitor;