From c31973804803a06e98efba60d620f94bcf97b985 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Sat, 14 Feb 2026 00:40:59 +0000 Subject: [PATCH] add config box for thresholds --- client/src/Pages/CreateMonitor/index.tsx | 108 +++++++++++++++++++++++ client/src/locales/en.json | 23 ++++- 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/client/src/Pages/CreateMonitor/index.tsx b/client/src/Pages/CreateMonitor/index.tsx index e7ceb52b1..76848d269 100644 --- a/client/src/Pages/CreateMonitor/index.tsx +++ b/client/src/Pages/CreateMonitor/index.tsx @@ -486,6 +486,114 @@ const CreateMonitorPage = () => { } /> + {/* Alert Thresholds - only for hardware type */} + {generalSettingsConfig.showSecret && ( + + ( + { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} + type="number" + fieldLabel={t( + "pages.createMonitor.form.thresholds.option.cpuThreshold.label" + )} + placeholder={t( + "pages.createMonitor.form.thresholds.option.cpuThreshold.placeholder" + )} + fullWidth + error={!!fieldState.error} + helperText={fieldState.error?.message ?? ""} + /> + )} + /> + ( + { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} + type="number" + fieldLabel={t( + "pages.createMonitor.form.thresholds.option.memoryThreshold.label" + )} + placeholder={t( + "pages.createMonitor.form.thresholds.option.memoryThreshold.placeholder" + )} + fullWidth + error={!!fieldState.error} + helperText={fieldState.error?.message ?? ""} + /> + )} + /> + ( + { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} + type="number" + fieldLabel={t( + "pages.createMonitor.form.thresholds.option.diskThreshold.label" + )} + placeholder={t( + "pages.createMonitor.form.thresholds.option.diskThreshold.placeholder" + )} + fullWidth + error={!!fieldState.error} + helperText={fieldState.error?.message ?? ""} + /> + )} + /> + ( + { + const val = e.target.value; + field.onChange(val === "" ? 0 : Number(val)); + }} + type="number" + fieldLabel={t( + "pages.createMonitor.form.thresholds.option.tempThreshold.label" + )} + placeholder={t( + "pages.createMonitor.form.thresholds.option.tempThreshold.placeholder" + )} + fullWidth + error={!!fieldState.error} + helperText={fieldState.error?.message ?? ""} + /> + )} + /> + + } + /> + )} +