diff --git a/pkg/web/static/js/settings.js b/pkg/web/static/js/settings.js
index 3d17021..fbe1d89 100644
--- a/pkg/web/static/js/settings.js
+++ b/pkg/web/static/js/settings.js
@@ -395,6 +395,25 @@ function loadPermanentBlockLog() {
});
}
+function renderPermanentBlockLogRow(block) {
+ const statusClass = block.status === 'blocked'
+ ? 'text-green-600'
+ : (block.status === 'unblocked' ? 'text-gray-500' : 'text-red-600');
+ const message = block.message ? escapeHtml(block.message) : '';
+ return ''
+ + '
'
+ + ' | ' + escapeHtml(block.ip) + ' | '
+ + ' ' + escapeHtml(block.integration) + ' | '
+ + ' ' + escapeHtml(block.status) + ' | '
+ + ' ' + (message || ' ') + ' | '
+ + ' ' + escapeHtml(block.serverId || '') + ' | '
+ + ' ' + (block.updatedAt ? new Date(block.updatedAt).toLocaleString() : '') + ' | '
+ + ' '
+ + ' '
+ + ' | '
+ + '
';
+}
+
function renderPermanentBlockLog(blocks) {
const container = document.getElementById('permanentBlockLog');
if (!container) return;
@@ -403,25 +422,14 @@ function renderPermanentBlockLog(blocks) {
if (typeof updateTranslations === 'function') updateTranslations();
return;
}
- let rows = blocks.map(block => {
- const statusClass = block.status === 'blocked'
- ? 'text-green-600'
- : (block.status === 'unblocked' ? 'text-gray-500' : 'text-red-600');
- const message = block.message ? escapeHtml(block.message) : '';
- return ''
- + ''
- + ' | ' + escapeHtml(block.ip) + ' | '
- + ' ' + escapeHtml(block.integration) + ' | '
- + ' ' + escapeHtml(block.status) + ' | '
- + ' ' + (message || ' ') + ' | '
- + ' ' + escapeHtml(block.serverId || '') + ' | '
- + ' ' + (block.updatedAt ? new Date(block.updatedAt).toLocaleString() : '') + ' | '
- + ' '
- + ' '
- + ' | '
- + '
';
- }).join('');
- container.innerHTML = ''
+ const maxVisible = 10;
+ const visible = blocks.slice(0, maxVisible);
+ const hidden = blocks.slice(maxVisible);
+
+ let visibleRows = visible.map(renderPermanentBlockLogRow).join('');
+ let hiddenRows = hidden.map(renderPermanentBlockLogRow).join('');
+
+ let html = ''
+ ''
+ ' '
+ ' '
@@ -434,8 +442,30 @@ function renderPermanentBlockLog(blocks) {
+ ' | Actions | '
+ '
'
+ ' '
- + ' ' + rows + ''
- + '
';
+ + ' ' + visibleRows + '';
+
+ if (hidden.length > 0) {
+ const hiddenId = 'permanentBlockLog-hidden';
+ const toggleId = 'permanentBlockLog-toggle';
+ const moreLabel = (typeof t === 'function' ? t('dashboard.banned.show_more', 'Show more') : 'Show more') + ' +' + hidden.length;
+ const lessLabel = typeof t === 'function' ? t('dashboard.banned.show_less', 'Hide extra') : 'Hide extra';
+ html += ''
+ + ' ' + hiddenRows + ''
+ + ''
+ + '';
+ } else {
+ html += '';
+ }
+
+ container.innerHTML = html;
if (typeof updateTranslations === 'function') updateTranslations();
}