summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/filter_log.inc10
-rw-r--r--src/usr/local/www/diag_logs_filter.php39
-rwxr-xr-xsrc/usr/local/www/diag_logs_filter_dynamic.php22
3 files changed, 36 insertions, 35 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";
}
}
diff --git a/src/usr/local/www/diag_logs_filter.php b/src/usr/local/www/diag_logs_filter.php
index 9f6bb27..46ec120 100644
--- a/src/usr/local/www/diag_logs_filter.php
+++ b/src/usr/local/www/diag_logs_filter.php
@@ -367,6 +367,7 @@ if (!isset($config['syslog']['rawfilter'])) {
<div class="table-responsive">
<table class="table table striped table-hover table-compact">
<tr>
+ <th><?=gettext("Act")?></th>
<th><?=gettext("Time")?></th>
<th><?=gettext("IF")?></th>
<?php
@@ -381,7 +382,6 @@ if (!isset($config['syslog']['rawfilter'])) {
<th><?=gettext("Source")?></th>
<th><?=gettext("Destination")?></th>
<th><?=gettext("Proto")?></th>
- <th><?=gettext("Act")?></th>
</tr>
<?php
if ($config['syslog']['filterdescriptions'])
@@ -391,6 +391,24 @@ if (!isset($config['syslog']['rawfilter'])) {
?>
<tr>
<td>
+<?php
+ if ($filterent['act'] == "block") {
+?>
+ <i class="fa fa-times icon-danger icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
+<?php
+ }
+ else {
+?>
+ <i class="fa fa-check icon-success icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
+<?php
+ }
+?>
+<?php
+ if ($filterent['count'])
+ echo $filterent['count'];
+?>
+ </td>
+ <td>
<?=htmlspecialchars($filterent['time'])?>
</td>
<td>
@@ -449,25 +467,6 @@ if (!isset($config['syslog']['rawfilter'])) {
<td>
<?=htmlspecialchars($filterent['proto'])?>
</td>
-
- <td>
-<?php
- if ($filterent['act'] == "block") {
-?>
- <i class="fa fa-times icon-danger icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
-<?php
- }
- else {
-?>
- <i class="fa fa-check icon-success icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
-<?php
- }
-?>
-<?php
- if ($filterent['count'])
- echo $filterent['count'];
-?>
- </td>
</tr>
<?php
if (isset($config['syslog']['filterdescriptions']) && $config['syslog']['filterdescriptions'] === "2") {
diff --git a/src/usr/local/www/diag_logs_filter_dynamic.php b/src/usr/local/www/diag_logs_filter_dynamic.php
index 03ab0e1..0ed1ca4 100755
--- a/src/usr/local/www/diag_logs_filter_dynamic.php
+++ b/src/usr/local/www/diag_logs_filter_dynamic.php
@@ -355,12 +355,12 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
<table class="table table-striped table-hover table-condensed">
<thead>
<tr>
+ <th><?=gettext("Act")?></th>
<th><?=gettext("Time")?></th>
<th><?=gettext("IF")?></th>
<th><?=gettext("Source")?></th>
<th><?=gettext("Destination")?></th>
<th><?=gettext("Proto")?></th>
- <th><?=gettext("Act")?></th> <!-- For the "Block" buttons-->
</tr>
</thead>
<tbody id="filter-log-entries">
@@ -390,6 +390,16 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
$dstPort = "";
?>
<tr>
+ <td>
+<?php
+ if ($filterent['act'] == "block") {
+ $icon_act = "fa-times icon-danger";
+ } else {
+ $icon_act = "fa-check icon-success";
+ }
+?>
+ <i class="fa <?php echo $icon_act;?> icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
+ </td>
<td><?=htmlspecialchars($filterent['time'])?></td>
<td><?=htmlspecialchars($filterent['interface'])?></td>
<td><?=$srcIP . $srcPort?></td>
@@ -401,16 +411,6 @@ display_top_tabs($tab_array, false, 'nav nav-tabs');
}
?>
<td><?=htmlspecialchars($filterent['proto'])?></td>
- <td>
-<?php
- if ($filterent['act'] == "block") {
- $icon_act = "fa-times icon-danger";
- } else {
- $icon_act = "fa-check icon-success";
- }
-?>
- <i class="fa <?php echo $icon_act;?> icon-pointer" title="<?php echo $filterent['act'] .'/'. $filterent['tracker'];?>" onclick="javascript:getURL('diag_logs_filter.php?getrulenum=<?="{$filterent['rulenum']},{$filterent['tracker']},{$filterent['act']}"; ?>', outputrule);"></i>
- </td>
</tr>
<?php
} // e-o-foreach()
OpenPOWER on IntegriCloud