From 9283890b5fc5aa89b544e286430abe5e728dccce Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 19 Feb 2026 18:01:15 +0000 Subject: [PATCH] 0 handling --- client/src/Validation/settings.ts | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/client/src/Validation/settings.ts b/client/src/Validation/settings.ts index 5f6a06fd1..f292222d0 100644 --- a/client/src/Validation/settings.ts +++ b/client/src/Validation/settings.ts @@ -42,10 +42,30 @@ export const settingsSchema = z.object({ .optional(), globalThresholds: z .object({ - cpu: z.number().int().min(0).max(100), - memory: z.number().int().min(0).max(100), - disk: z.number().int().min(0).max(100), - temperature: z.number().int().min(0).max(150), + cpu: z + .number() + .int() + .min(1, "Please enter a value") + .max(100, "Maximum value is 100") + .optional(), + memory: z + .number() + .int() + .min(1, "Please enter a value") + .max(100, "Maximum value is 100") + .optional(), + disk: z + .number() + .int() + .min(1, "Please enter a value") + .max(100, "Maximum value is 100") + .optional(), + temperature: z + .number() + .int() + .min(1, "Please enter a value") + .max(150, "Maximum value is 150") + .optional(), }) .optional(), });