Adding Global Threshold Settings

This commit is contained in:
singh-kanwarpreet
2025-07-26 15:24:25 +05:30
parent 0c6d635b67
commit bf5d7f3c53
7 changed files with 203 additions and 26 deletions
+7 -1
View File
@@ -65,7 +65,13 @@ const AppSettingsSchema = mongoose.Schema(
type: Number,
default: 1,
},
},
globalThresholds: {
cpu: { type: Number },
memory: { type: Number},
disk: { type: Number},
temperature: { type: Number},
}
},
{
timestamps: true,
}
+8
View File
@@ -416,8 +416,16 @@ const updateAppSettingsBodyValidation = joi.object({
systemEmailIgnoreTLS: joi.boolean(),
systemEmailRequireTLS: joi.boolean(),
systemEmailRejectUnauthorized: joi.boolean(),
globalThresholds: joi.object({
cpu: joi.number().min(1).max(100).allow("").optional(),
memory: joi.number().min(1).max(100).allow("").optional(),
disk: joi.number().min(1).max(100).allow("").optional(),
temperature: joi.number().min(1).max(150).allow("").optional(),
}).optional(),
});
//****************************************
// Status Page Validation
//****************************************