]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Retain history length on update (#829) 830/head
authorAndrew Lewis <nerf@judo.za.org>
Tue, 9 Aug 2016 14:49:14 +0000 (16:49 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 9 Aug 2016 14:49:14 +0000 (16:49 +0200)
interface/js/rspamd.js

index 688715e24f97f0a07348f516a4e14ec077bc43a5..6cfca7373d8656e53a1bcb5e941757eaf4e2807e 100644 (file)
         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();
             }
                     });
                     $('<tbody/>', { html: items.join('') }).insertAfter('#historyLog thead');
                     history = $('#historyLog').DataTable({
-                        "order": [[ 0, "desc" ]]
+                        "order": [[ 0, "desc" ]],
+                        "pageLength": history_length
                     });
                 }
             });