From: Andrew Lewis Date: Tue, 9 Aug 2016 14:49:14 +0000 (+0200) Subject: [WebUI] Retain history length on update (#829) X-Git-Tag: 1.3.3~41^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aa68c4952d83b254c837115a86f7769d7adf88cb;p=rspamd.git [WebUI] Retain history length on update (#829) --- diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 688715e24..6cfca7373 100644 --- a/interface/js/rspamd.js +++ b/interface/js/rspamd.js @@ -556,6 +556,12 @@ function getHistory() { if (history) { + var history_length = document.getElementsByName('historyLog_length')[0]; + if (history_length !== undefined) { + history_length = parseInt(history_length.value); + } else { + history_length = 10; + } history.destroy(); $('#historyLog').children('tbody').remove(); } @@ -608,7 +614,8 @@ }); $('', { html: items.join('') }).insertAfter('#historyLog thead'); history = $('#historyLog').DataTable({ - "order": [[ 0, "desc" ]] + "order": [[ 0, "desc" ]], + "pageLength": history_length }); } });