- Minor updates based on meeting discussion.

- fix typo, remove retention log section
- change to use ms per minute for frequency etc
This commit is contained in:
Shemy Gan committed 2024-11-18 22:06:18 -05:00
1 parent 49f95f1a71
commit 7251c6c06d
1 file changed
+14 -14
@@ -25,7 +25,7 @@ const CreateInfrastructureMonitor = () => {
url: "", url: "",
name: "", name: "",
notifications: [], notifications: [],
interval: 15, interval: 0.25,
cpu: false, cpu: false,
usage_cpu: "", usage_cpu: "",
memory: false, memory: false,
@@ -35,7 +35,7 @@ const CreateInfrastructureMonitor = () => {
secret: "", secret: "",
}); });
const MS_PER_SECOND = 1000; const MS_PER_MINUTE = 60000;
const THRESHOLD_FIELD_PREFIX = "usage_"; const THRESHOLD_FIELD_PREFIX = "usage_";
const HARDWARE_MONITOR_TYPES = ["cpu", "memory", "disk"]; const HARDWARE_MONITOR_TYPES = ["cpu", "memory", "disk"];
const { user, authToken } = useSelector((state) => state.auth); const { user, authToken } = useSelector((state) => state.auth);
@@ -156,7 +156,7 @@ const CreateInfrastructureMonitor = () => {
infrastructureMonitor.name === "" infrastructureMonitor.name === ""
? infrastructureMonitor.url ? infrastructureMonitor.url
: infrastructureMonitor.name, : infrastructureMonitor.name,
interval: infrastructureMonitor.interval * MS_PER_SECOND, interval: infrastructureMonitor.interval * MS_PER_MINUTE,
}; };
delete form.notifications; delete form.notifications;
if (hasValidationErrors(form, infrastructureMonitorValidation, setErrors)) { if (hasValidationErrors(form, infrastructureMonitorValidation, setErrors)) {
@@ -186,12 +186,12 @@ const CreateInfrastructureMonitor = () => {
//select values //select values
const frequencies = [ const frequencies = [
{ _id: 15, name: "15 seconds" }, { _id: 0.25, name: "15 seconds" },
{ _id: 30, name: "30 seconds" }, { _id: 0.5, name: "30 seconds" },
{ _id: 60, name: "1 minute" }, { _id: 1, name: "1 minute" },
{ _id: 120, name: "2 minutes" }, { _id: 2, name: "2 minutes" },
{ _id: 300, name: "5 minutes" }, { _id: 5, name: "5 minutes" },
{ _id: 600, name: "10 minutes" }, { _id: 10, name: "10 minutes" },
]; ];
const NOTIFY_MULTIPLE_EMAIL_LABEL = ( const NOTIFY_MULTIPLE_EMAIL_LABEL = (
@@ -270,7 +270,7 @@ const CreateInfrastructureMonitor = () => {
<Field <Field
type="text" type="text"
id="name" id="name"
label="Friendly name(optional)" label="Friendly name"
isOptional={true} isOptional={true}
value={infrastructureMonitor.name} value={infrastructureMonitor.name}
onBlur={handleBlur} onBlur={handleBlur}
@@ -323,7 +323,7 @@ const CreateInfrastructureMonitor = () => {
<Box> <Box>
<Typography component="h2">Customize alerts</Typography> <Typography component="h2">Customize alerts</Typography>
<Typography component="p"> <Typography component="p">
Send a notification to user(s) When the theresholds exceed a certain number Send a notification to user(s) When the thresholds exceed a certain number
or percentage. or percentage.
</Typography> </Typography>
</Box> </Box>
@@ -368,7 +368,7 @@ const CreateInfrastructureMonitor = () => {
)} )}
</Stack> </Stack>
</ConfigBox> </ConfigBox>
<ConfigBox> {/* <ConfigBox>
<Box> <Box>
<Typography component="h2">Logging retention</Typography> <Typography component="h2">Logging retention</Typography>
<Typography component="p"> <Typography component="p">
@@ -386,8 +386,8 @@ const CreateInfrastructureMonitor = () => {
onBlur={handleBlur} onBlur={handleBlur}
alertUnit="days" alertUnit="days"
/> />
</Stack> */} </Stack>
</ConfigBox> </ConfigBox> */}
<ConfigBox> <ConfigBox>
<Box> <Box>
<Typography component="h2">Advanced settings</Typography> <Typography component="h2">Advanced settings</Typography>