From bbf80b2424bd1a7561531a4c383b8265d079b847 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 3 Nov 2015 08:24:41 +0545 Subject: Filter log dynamic pass/block button This should fix up the last bits here: 1) Make the button be red cross, green tick depending and block or pass rule. 2) Put all the necessary bits in the getURL - now the rule display popup works when the button is clicked. --- src/etc/inc/filter_log.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/etc/inc') diff --git a/src/etc/inc/filter_log.inc b/src/etc/inc/filter_log.inc index 24b30fa..3b6ebd5 100644 --- a/src/etc/inc/filter_log.inc +++ b/src/etc/inc/filter_log.inc @@ -445,16 +445,18 @@ function handle_ajax($nentries, $tail = 50) { $filterlog = isset($config['syslog']['reverse']) ? array_reverse($filterlog) : $filterlog; foreach ($filterlog as $log_row) { $row_time = strtotime($log_row['time']); - $img = '"'; if ($row_time > $lastsawtime) { if ($log_row['proto'] == "TCP") { $log_row['proto'] .= ":{$log_row['tcpflags']}"; } + if ($log_row['act'] == "block") { + $icon_act = "fa-times icon-danger"; + } else { + $icon_act = "fa-check icon-success"; + } - $btn = ''; - -// $btn = "" . gettext("Block") . " "; + $btn = ''; $new_rules .= "{$btn}||{$log_row['time']}||{$log_row['interface']}||{$log_row['srcip']}||{$log_row['srcport']}||{$log_row['dstip']}||{$log_row['dstport']}||{$log_row['proto']}||{$log_row['version']}||" . time() . "||\n"; } } -- cgit v1.1