From 61e128f7340d921235db50a6329ead0f30103a87 Mon Sep 17 00:00:00 2001 From: evilhero <evilhero@gmail.com> Date: Fri, 8 Jun 2018 11:41:49 -0400 Subject: [PATCH] FIX: fixed Logs tab taking forever to load in GUI when dealing with large logs --- data/interfaces/default/logs.html | 64 +++++++++++++++---------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index 87ab0155..4f4c9c82 100755 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -57,43 +57,41 @@ <script> $(document).ready(function() { initActions(); - - $('#log_table').dataTable( { - "bProcessing": true, - "bServerSide": true, - "sAjaxSource": 'getLog', - "sPaginationType": "full_numbers", - "aaSorting": [[0, 'desc']], - "iDisplayLength": 25, - "bStateSave": true, - "oLanguage": { - "sSearch":"Filter:", - "sLengthMenu":"Show _MENU_ lines per page", - "sEmptyTable": "No log information available", - "sInfo":"Showing _START_ to _END_ of _TOTAL_ lines", - "sInfoEmpty":"Showing 0 to 0 of 0 lines", - "sInfoFiltered":"(filtered from _MAX_ total lines)"}, - "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) { - if (aData[1] === "ERROR") { - $('td', nRow).closest('tr').addClass("gradeX"); - } else if (aData[1] === "WARNING") { - $('td', nRow).closest('tr').addClass("gradeW"); - } else { - $('td', nRow).closest('tr').addClass("gradeZ"); - } - - return nRow; - }, - "fnDrawCallback": function (o) { - // Jump to top of page - $('html,body').scrollTop(0); - }, - "fnServerData": function ( sSource, aoData, fnCallback ) { + $('#log_table').dataTable( { + "bProcessing": true, + "bServerSide": true, + "sAjaxSource": 'getLog', + "sPaginationType": "full_numbers", + "aaSorting": [[0, 'desc']], + "iDisplayLength": 25, + "bStateSave": true, + "oLanguage": { + "sSearch":"Filter:", + "sLengthMenu":"Show _MENU_ lines per page", + "sEmptyTable": "No log information available", + "sInfo":"Showing _START_ to _END_ of _TOTAL_ lines", + "sInfoEmpty":"Showing 0 to 0 of 0 lines", + "sInfoFiltered":"(filtered from _MAX_ total lines)"}, + "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) { + if (aData[1] === "ERROR") { + $('td', nRow).closest('tr').addClass("gradeX"); + } else if (aData[1] === "WARNING") { + $('td', nRow).closest('tr').addClass("gradeW"); + } else { + $('td', nRow).closest('tr').addClass("gradeZ"); + } + return nRow; + }, + "fnDrawCallback": function (o) { + // Jump to top of page + $('html,body').scrollTop(0); + }, + "fnServerData": function ( sSource, aoData, fnCallback ) { /* Add some extra data to the sender */ $.getJSON(sSource, aoData, function (json) { fnCallback(json) }); - } + } }); }); </script>