mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 11:13:26 +00:00
remove: Alert Configuration tab from settings modal
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -903,9 +903,6 @@
|
||||
<button class="settings-tab py-3 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 font-medium text-sm" data-tab="pbs">
|
||||
Backup Server
|
||||
</button>
|
||||
<button class="settings-tab py-3 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 font-medium text-sm" data-tab="alerts">
|
||||
Alert Configuration
|
||||
</button>
|
||||
<button class="settings-tab py-3 px-1 border-b-2 border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 font-medium text-sm" data-tab="system">
|
||||
System
|
||||
</button>
|
||||
|
||||
@@ -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")]');
|
||||
|
||||
Reference in New Issue
Block a user