From 235ec2fdefaecd719c8481ed69c72e0e41c18fbb Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Thu, 5 Jun 2025 13:33:42 +0100 Subject: [PATCH] remove: Alert Configuration tab from settings modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removed Alert Configuration tab from settings navigation - Updated remaining alert references to redirect to alert management modal - Cleaned up hasSignificantConfiguration function alert case - Settings modal now focuses on system config only 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/public/index.html | 3 --- src/public/js/ui/settings.js | 29 ++++++++++++++--------------- 2 files changed, 14 insertions(+), 18 deletions(-) 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")]');