From fe48e6d7a8697d9c1521795df0e68ab83bbed602 Mon Sep 17 00:00:00 2001 From: NOYB Date: Sun, 24 Jan 2016 00:16:44 -0800 Subject: Status / System Logs / Firewall / Dynamic View - Tweaks Don't run through the update table rows routine unless there are new rows to be added. Handle special case when beginning with zero rows. Remove classes listMRodd and listMReven. They don't exist and are handled by the table-striped class. Add class text-nowrap to rows (consistent with the source html). Add no logs to display info box. --- src/usr/local/www/status_logs_filter_dynamic.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php index 7c6085b..a092669 100755 --- a/src/usr/local/www/status_logs_filter_dynamic.php +++ b/src/usr/local/www/status_logs_filter_dynamic.php @@ -298,7 +298,7 @@ function in_arrayi(needle, haystack) { } function update_table_rows(data) { - if (isPaused) { + if ((isPaused) || (data.length < 1)) { return; } @@ -328,6 +328,10 @@ function update_table_rows(data) { move = 0; } + if (($("#count").text() == 0) && (data.length < nentries)){ + move += rows.length; + } + if (isReverse == false) { for (var i = move; i < rows.length; i++) { $(rows[i - move]).html($(rows[i]).html()); @@ -363,7 +367,7 @@ function update_table_rows(data) { // Much easier to go through each of the rows once they've all be added. rows = $('#filter-log-entries>tr'); for (var i = 0; i < rows.length; i++) { - rows[i].className = i % 2 == 0 ? 'listMRodd' : 'listMReven'; + rows[i].className = 'text-nowrap'; } $("#count").html(rows.length); @@ -429,7 +433,6 @@ function toggleListDescriptions() { $tcpcnt = 0; foreach ($filterlog as $filterent) { - $evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd"; $rowIndex++; if ($filterent['version'] == '6') { $srcIP = "[" . htmlspecialchars($filterent['srcip']) . "]"; @@ -477,6 +480,13 @@ function toggleListDescriptions() { +'; + print_info_box(gettext('No logs to display')); + print ''; + } +?> -- cgit v1.1