add validation

This commit is contained in:
Alex Holliday committed 2025-06-09 12:59:02 +08:00
1 parent f2000ffe56
commit 4c3ea2fd65
1 file changed
+3 -3
+3 -3
View File
@@ -193,7 +193,7 @@ const createMonitorBodyValidation = joi.object({
usage_disk: joi.number(), usage_disk: joi.number(),
usage_temperature: joi.number(), usage_temperature: joi.number(),
}), }),
notifications: joi.array().items(joi.object()), notifications: joi.array().items(joi.string()),
secret: joi.string(), secret: joi.string(),
jsonPath: joi.string().allow(""), jsonPath: joi.string().allow(""),
expectedValue: joi.string().allow(""), expectedValue: joi.string().allow(""),
@@ -206,12 +206,12 @@ const editMonitorBodyValidation = joi.object({
name: joi.string(), name: joi.string(),
description: joi.string(), description: joi.string(),
interval: joi.number(), interval: joi.number(),
notifications: joi.array().items(joi.object()), notifications: joi.array().items(joi.string()),
secret: joi.string(), secret: joi.string(),
ignoreTlsErrors: joi.boolean(), ignoreTlsErrors: joi.boolean(),
jsonPath: joi.string().allow(""), jsonPath: joi.string().allow(""),
expectedValue: joi.string().allow(""), expectedValue: joi.string().allow(""),
matchMethod: joi.string(), matchMethod: joi.string().allow(null, ""),
port: joi.number().min(1).max(65535), port: joi.number().min(1).max(65535),
thresholds: joi.object().keys({ thresholds: joi.object().keys({
usage_cpu: joi.number(), usage_cpu: joi.number(),