Merge pull request #3286 from bluewave-labs/feat/infra-thresholds
feat: infra thresholds
This commit is contained in:
3 files changed
+106
-2
No files matched your search
@@ -41,7 +41,10 @@ export const SliderInput = forwardRef<HTMLSpanElement, SliderInputProps>(
|
|||||||
"& .MuiSlider-thumb": {
|
"& .MuiSlider-thumb": {
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
"&:hover, &.Mui-focusVisible": {
|
"&:hover, &.Mui-focusVisible": {
|
||||||
boxShadow: `0 0 0 8px ${theme.palette.primary.main}20`,
|
boxShadow: "none",
|
||||||
|
},
|
||||||
|
"&:active": {
|
||||||
|
boxShadow: "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"& .MuiSlider-valueLabel": {
|
"& .MuiSlider-valueLabel": {
|
||||||
|
|||||||
@@ -489,6 +489,90 @@ const CreateMonitorPage = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Alert Thresholds - only for hardware type */}
|
||||||
|
{generalSettingsConfig.showSecret && (
|
||||||
|
<ConfigBox
|
||||||
|
title={t("pages.createMonitor.form.thresholds.title")}
|
||||||
|
subtitle={t("pages.createMonitor.form.thresholds.description")}
|
||||||
|
rightContent={
|
||||||
|
<Stack spacing={theme.spacing(8)}>
|
||||||
|
<Controller
|
||||||
|
name="cpuAlertThreshold"
|
||||||
|
control={control}
|
||||||
|
render={({ field }) => (
|
||||||
|
<SliderWithLabel
|
||||||
|
{...field}
|
||||||
|
sliderMaxWidth={{ xs: "100%", md: "50%" }}
|
||||||
|
fieldLabel={t(
|
||||||
|
"pages.createMonitor.form.thresholds.option.cpuThreshold.label"
|
||||||
|
)}
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
step={1}
|
||||||
|
valueLabelDisplay="auto"
|
||||||
|
valueLabelFormat={(value) => `${value}%`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Controller
|
||||||
|
name="memoryAlertThreshold"
|
||||||
|
control={control}
|
||||||
|
render={({ field }) => (
|
||||||
|
<SliderWithLabel
|
||||||
|
{...field}
|
||||||
|
sliderMaxWidth={{ xs: "100%", md: "50%" }}
|
||||||
|
fieldLabel={t(
|
||||||
|
"pages.createMonitor.form.thresholds.option.memoryThreshold.label"
|
||||||
|
)}
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
step={1}
|
||||||
|
valueLabelDisplay="auto"
|
||||||
|
valueLabelFormat={(value) => `${value}%`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Controller
|
||||||
|
name="diskAlertThreshold"
|
||||||
|
control={control}
|
||||||
|
render={({ field }) => (
|
||||||
|
<SliderWithLabel
|
||||||
|
{...field}
|
||||||
|
sliderMaxWidth={{ xs: "100%", md: "50%" }}
|
||||||
|
fieldLabel={t(
|
||||||
|
"pages.createMonitor.form.thresholds.option.diskThreshold.label"
|
||||||
|
)}
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
step={1}
|
||||||
|
valueLabelDisplay="auto"
|
||||||
|
valueLabelFormat={(value) => `${value}%`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Controller
|
||||||
|
name="tempAlertThreshold"
|
||||||
|
control={control}
|
||||||
|
render={({ field }) => (
|
||||||
|
<SliderWithLabel
|
||||||
|
{...field}
|
||||||
|
sliderMaxWidth={{ xs: "100%", md: "50%" }}
|
||||||
|
fieldLabel={t(
|
||||||
|
"pages.createMonitor.form.thresholds.option.tempThreshold.label"
|
||||||
|
)}
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
step={1}
|
||||||
|
valueLabelDisplay="auto"
|
||||||
|
valueLabelFormat={(value) => `${value}°C`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<ConfigBox
|
<ConfigBox
|
||||||
title={t("pages.createMonitor.form.incidents.title")}
|
title={t("pages.createMonitor.form.incidents.title")}
|
||||||
subtitle={t("pages.createMonitor.form.incidents.description")}
|
subtitle={t("pages.createMonitor.form.incidents.description")}
|
||||||
|
|||||||
@@ -187,7 +187,6 @@
|
|||||||
"description": "See the latest releases and help grow the community on GitHub"
|
"description": "See the latest releases and help grow the community on GitHub"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"pages": {
|
"pages": {
|
||||||
"notFound": {
|
"notFound": {
|
||||||
"title": "Oh no! You dropped your sushi!",
|
"title": "Oh no! You dropped your sushi!",
|
||||||
@@ -521,6 +520,24 @@
|
|||||||
"optionPort": "Port",
|
"optionPort": "Port",
|
||||||
"optionPortDescription": "Monitor if a specific port on a server is open.",
|
"optionPortDescription": "Monitor if a specific port on a server is open.",
|
||||||
"title": "Type"
|
"title": "Type"
|
||||||
|
},
|
||||||
|
"thresholds": {
|
||||||
|
"title": "Alert thresholds",
|
||||||
|
"description": "Define the thresholds at which alerts should be triggered for this hardware monitor.",
|
||||||
|
"option": {
|
||||||
|
"cpuThreshold": {
|
||||||
|
"label": "CPU alert threshold (%)"
|
||||||
|
},
|
||||||
|
"memoryThreshold": {
|
||||||
|
"label": "Memory alert threshold (%)"
|
||||||
|
},
|
||||||
|
"diskThreshold": {
|
||||||
|
"label": "Disk alert threshold (%)"
|
||||||
|
},
|
||||||
|
"tempThreshold": {
|
||||||
|
"label": "Temperature alert threshold (°C)"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user