Added new clear function-calls for the recent-stored-events and as well the permanent-block list

This commit is contained in:
2026-02-21 17:23:33 +01:00
parent c85d51edd6
commit 3e06cfc1ab
12 changed files with 138 additions and 11 deletions

View File

@@ -479,6 +479,23 @@ function refreshPermanentBlockLog() {
loadPermanentBlockLog();
}
function clearPermanentBlockLog() {
var msg = t('settings.advanced.clear_log_confirm',
'This will permanently delete the entire block log. Fail2ban UI will assume that no IPs are currently blocked on the external firewall.\n\nThis action cannot be undone. Continue?');
if (!confirm(msg)) return;
fetch('/api/advanced-actions/blocks', { method: 'DELETE', headers: serverHeaders() })
.then(function(res) { return res.json(); })
.then(function(data) {
if (data.error) {
showToast(data.error, 'error');
return;
}
showToast(t('settings.advanced.clear_log_success', 'Permanent block log cleared.'), 'success');
loadPermanentBlockLog();
})
.catch(function(err) { showToast(String(err), 'error'); });
}
// =========================================================================
// Advanced Test
// =========================================================================