Merge pull request #3234 from bluewave-labs/fix/validation

Fix validation
This commit is contained in:
Alexander Holliday
2026-02-03 09:42:32 -08:00
committed by GitHub
+8 -12
View File
@@ -162,12 +162,10 @@ const createMonitorBodyValidation = joi.object({
port: joi.number(),
isActive: joi.boolean(),
interval: joi.number(),
thresholds: joi.object().keys({
usage_cpu: joi.number(),
usage_memory: joi.number(),
usage_disk: joi.number(),
usage_temperature: joi.number(),
}),
cpuAlertThreshold: joi.number(),
memoryAlertThreshold: joi.number(),
diskAlertThreshold: joi.number(),
tempAlertThreshold: joi.number(),
notifications: joi.array().items(joi.string()),
secret: joi.string(),
jsonPath: joi.string().allow(""),
@@ -200,12 +198,10 @@ const editMonitorBodyValidation = joi
expectedValue: joi.string().allow(""),
matchMethod: joi.string().allow(null, ""),
port: joi.number().min(1).max(65535),
thresholds: joi.object().keys({
usage_cpu: joi.number(),
usage_memory: joi.number(),
usage_disk: joi.number(),
usage_temperature: joi.number(),
}),
cpuAlertThreshold: joi.number(),
memoryAlertThreshold: joi.number(),
diskAlertThreshold: joi.number(),
tempAlertThreshold: joi.number(),
gameId: joi.string().allow(""),
selectedDisks: joi.array().items(joi.string()).optional(),
group: joi.string().max(50).trim().allow(null, "").optional(),