Add temperature threshold to create infrastructure monitor page

This commit is contained in:
Alex Holliday committed 2024-11-25 11:20:52 +08:00
1 parent 24d5a38527
commit 71cde317a7
4 files changed
+20 -10

No files matched your search

+7 -2
View File
@@ -37,8 +37,13 @@ const hasValidationErrors = (form, validation, setErrors) => {
if (!form.disk || form.usage_disk) {
newErrors["usage_disk"] = null;
}
if (!form.temperature || form.usage_temperature) {
newErrors["usage_temperature"] = null;
}
});
if (Object.values(newErrors).some(v=> v)) {
console.log("newErrors", newErrors);
if (Object.values(newErrors).some((v) => v)) {
setErrors(newErrors);
return true;
} else {
@@ -48,4 +53,4 @@ const hasValidationErrors = (form, validation, setErrors) => {
}
return false;
};
export { buildErrors, hasValidationErrors };
export { buildErrors, hasValidationErrors };