diff options
author | Phil Davis <phil.davis@inf.org> | 2015-11-03 08:24:41 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-11-03 08:24:41 +0545 |
commit | bbf80b2424bd1a7561531a4c383b8265d079b847 (patch) | |
tree | b4dd8fb6647705a898208372864b592d2451a5a6 /src/etc/inc | |
parent | f0ac86217ca827ee0203cabfe50bca80a50bb185 (diff) | |
download | pfsense-bbf80b2424bd1a7561531a4c383b8265d079b847.zip pfsense-bbf80b2424bd1a7561531a4c383b8265d079b847.tar.gz |
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.
Diffstat (limited to 'src/etc/inc')
-rw-r--r-- | src/etc/inc/filter_log.inc | 10 |
1 files changed, 6 insertions, 4 deletions
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 = '<i class="icon-large ' . find_action_image($log_row['act']) . '" alt={$log_row[\'act\']}/{$log_row[\'tracker\']} title={$log_row[\'act\']}/{$log_row[\'tracker\']} ></i>"'; 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 = '<i class="fa fa-times icon-danger icon-pointer" title="' . $log_row['act'] . '/' . $log_row['tracker'] . '" onclick="javascript:getURL(\'diag_logs_filter.php?getrulenum="' . $filterent['rulenum'] . ',' . $filterent['tracker'] . ',' . $filterent['act'] . '\'"; , outputrule);" ></i>'; - -// $btn = "<a href=\"#\" class=\"btn btn-danger btn-xs\" onClick=\"javascript:getURL('diag_logs_filter.php?getrulenum={$log_row['rulenum']},{$log_row['tracker']},{$log_row['act']}', outputrule);\">" . gettext("Block") . " </a>"; + $btn = '<i class="fa ' . $icon_act . ' icon-pointer" title="' . $log_row['act'] . '/' . $log_row['tracker'] . '" onclick="javascript:getURL(\'diag_logs_filter.php?getrulenum=' . $log_row['rulenum'] . ',' . $log_row['tracker'] . ',' . $log_row['act'] . '\', outputrule);"></i>'; $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"; } } |