From 3022f92e27897cc8dde15f0959a50078c841c2ad Mon Sep 17 00:00:00 2001 From: master3395 Date: Mon, 16 Feb 2026 00:20:57 +0100 Subject: [PATCH] fix(firewall): banned IPs search, modify modal, export/import, Tracking Prevention - Add searchBannedIPFilter for searching banned IPs by IP, reason, or status - Add openModifyModal, closeModifyModal, saveModifyBannedIP for modify modal - Add exportBannedIPs and importBannedIPs for export/import buttons - Wrap localStorage in try-catch in base template to handle Tracking Prevention (Firefox/Safari blocking storage access for cross-site context) - Fixes firewall banned IPs page search and functionality --- .../templates/baseTemplate/index.html | 25 +++-- firewall/static/firewall/firewall.js | 105 ++++++++++++++++++ static/firewall/firewall.js | 105 ++++++++++++++++++ 3 files changed, 224 insertions(+), 11 deletions(-) diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index 940fc8fa8..bef27a093 100644 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -2440,12 +2440,13 @@ // .htaccess Feature Notification Functions function checkHtaccessStatus() { // Check if user has dismissed the notification permanently (localStorage for longer persistence) - if (localStorage.getItem('htaccessNotificationDismissed') === 'true') { - return; - } + try { + if (localStorage.getItem('htaccessNotificationDismissed') === 'true') return; + } catch (e) { return; } // Check if notification has been shown today - const lastShown = localStorage.getItem('htaccessNotificationLastShown'); + var lastShown; + try { lastShown = localStorage.getItem('htaccessNotificationLastShown'); } catch (e) { return; } const today = new Date().toDateString(); if (lastShown === today) { @@ -2454,7 +2455,7 @@ // Show the notification showHtaccessNotification(); - localStorage.setItem('htaccessNotificationLastShown', today); + try { localStorage.setItem('htaccessNotificationLastShown', today); } catch (e) {} } function showHtaccessNotification() { @@ -2470,7 +2471,7 @@ banner.classList.remove('show'); body.classList.remove('htaccess-shown'); // Remember dismissal permanently - localStorage.setItem('htaccessNotificationDismissed', 'true'); + try { localStorage.setItem('htaccessNotificationDismissed', 'true'); } catch (e) {} } function isNotificationDismissed(notificationKey) { @@ -2481,7 +2482,7 @@ return {% if ai_scanner_notification_dismissed %}true{% else %}false{% endif %}; } if (notificationKey === 'htaccess-notification') { - return localStorage.getItem('htaccessNotificationDismissed') === 'true'; + try { return localStorage.getItem('htaccessNotificationDismissed') === 'true'; } catch (e) { return false; } } return false; } @@ -2604,10 +2605,12 @@