diff --git a/src/public/index.html b/src/public/index.html
index bccc303cb..f3ddeef45 100644
--- a/src/public/index.html
+++ b/src/public/index.html
@@ -903,9 +903,6 @@
-
diff --git a/src/public/js/ui/settings.js b/src/public/js/ui/settings.js
index 341b5099b..3abd32c1e 100644
--- a/src/public/js/ui/settings.js
+++ b/src/public/js/ui/settings.js
@@ -1214,16 +1214,6 @@ PulseApp.ui.settings = (() => {
return !!(data.PBS_HOST && data.PBS_HOST.trim()) ||
!!(data.PBS_HOST_2 && data.PBS_HOST_2.trim()) ||
!!(data.PBS_HOST_3 && data.PBS_HOST_3.trim());
- } else if (tabName === 'alerts') {
- // For alerts tab, any threshold value or email/webhook config is significant
- return Object.keys(data).some(key => {
- const value = data[key];
- if (typeof value === 'string' && value.trim()) return true;
- if (typeof value === 'boolean' && value) return true;
- if (typeof value === 'number' && value > 0) return true;
- return false;
- });
- }
// For other tabs, check if any field has a non-empty value
return Object.values(data).some(value => {
@@ -3347,8 +3337,11 @@ PulseApp.ui.settings = (() => {
if (addCustomBtn) {
addCustomBtn.addEventListener('click', () => {
- // Switch to alerts tab to add custom threshold
- switchTab('alerts');
+ // Open alert management modal instead
+ if (window.PulseApp && window.PulseApp.ui && window.PulseApp.ui.alertManagementModal) {
+ closeModal();
+ window.PulseApp.ui.alertManagementModal.openModal();
+ }
setTimeout(() => {
// Scroll to the custom threshold section
const customSection = document.querySelector('h3:contains("Custom Threshold Configurations")');
@@ -3562,7 +3555,11 @@ PulseApp.ui.settings = (() => {
const gotoBtn = document.getElementById('goto-custom-thresholds');
if (gotoBtn) {
- gotoBtn.addEventListener('click', () => switchTab('alerts'));
+ gotoBtn.addEventListener('click', () => {
+ if (window.PulseApp && window.PulseApp.ui && window.PulseApp.ui.alertManagementModal) {
+ window.PulseApp.ui.alertManagementModal.openModal();
+ }
+ });
}
} else {
// Display the custom thresholds
@@ -3684,8 +3681,10 @@ PulseApp.ui.settings = (() => {
};
window.editCustomThreshold = function(endpointId, nodeId, vmid) {
- // Switch to alerts tab to edit
- switchTab('alerts');
+ // Open alert management modal instead
+ if (window.PulseApp && window.PulseApp.ui && window.PulseApp.ui.alertManagementModal) {
+ window.PulseApp.ui.alertManagementModal.openModal();
+ }
setTimeout(() => {
// Scroll to custom threshold section and highlight it
const customSection = document.querySelector('h3[contains("Custom Threshold Configurations")]');