Skip to content

Commit

Permalink
for #3594 align overview icons in firewall_rules.php
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Jul 29, 2019
1 parent 0000f93 commit ca36dcc
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions src/www/firewall_rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function firewall_rule_item_proto($filterent)
function firewall_rule_item_icons($filterent)
{
$result = "";
if (!empty($filterent['direction']) && $filterent['direction'] == "in") {
if (empty($filterent['direction']) || $filterent['direction'] == "in") {
$result .= sprintf(
"<i class=\"fa fa-long-arrow-right fa-fw text-info\" data-toggle=\"tooltip\" title=\"%s\"></i>",
gettext("in")
Expand All @@ -150,20 +150,32 @@ function firewall_rule_item_icons($filterent)
"<i class=\"fa fa-long-arrow-left fa-fw\" data-toggle=\"tooltip\" title=\"%s\"></i>",
gettext("out")
);
} else {
$result .= sprintf(
"<i class=\"fa fa-exchange fa-fw\" data-toggle=\"tooltip\" title=\"%s\"></i>",
gettext("any")
);
}
if (!empty($filterent['floating'])) {
if (isset($filterent['quick']) && $filterent['quick'] === 'yes') {
$result .= sprintf(
"<i class=\"fa fa-flash fa-fw text-warning\" data-toggle=\"tooltip\" title=\"%s\"></i>",
gettext('first match')
);
} else {
$result .= sprintf(
"<i class=\"fa fa-flash fa-fw text-muted\" data-toggle=\"tooltip\" title=\"%s\"></i>",
gettext('last match')
);
}
if (empty($filterent['floating']) && $filterent['quick'] == null){
$is_quick = true;
} elseif (!empty($filterent['floating']) && $filterent['quick'] == null) {
$is_quick = false;
} else {
$is_quick = $filterent['quick'];
}

if ($is_quick) {
$result .= sprintf(
"<i class=\"fa fa-flash fa-fw text-warning\" data-toggle=\"tooltip\" title=\"%s\"></i>",
gettext('first match')
);
} else {
$result .= sprintf(
"<i class=\"fa fa-flash fa-fw text-muted\" data-toggle=\"tooltip\" title=\"%s\"></i>",
gettext('last match')
);
}

if (isset($filterent['log'])) {
$result .= sprintf(
"<i class=\"fa fa-info-circle fa-fw %s\"></i>",
Expand Down Expand Up @@ -882,10 +894,8 @@ function firewall_rule_item_action($filterent)
<td style="width:100px"><?=gettext("log");?></td>
<td style="width:16px"><span class="fa fa-long-arrow-right text-info"></span></td>
<td style="width:100px"><?=gettext("in");?></td>
<?php if ($selected_if == 'FloatingRules'): ?>
<td style="width:16px"><span class="fa fa-flash text-warning"></span></td>
<td style="width:100px"><?=gettext("first match");?></td>
<?php endif ?>
</tr>
<tr>
<td><span class="fa fa-play text-muted"></span></td>
Expand All @@ -901,10 +911,8 @@ function firewall_rule_item_action($filterent)
<td class="nowrap"><?=gettext("log (disabled)");?></td>
<td style="width:16px"><span class="fa fa-long-arrow-left"></span></td>
<td style="width:100px"><?=gettext("out");?></td>
<?php if ($selected_if == 'FloatingRules'): ?>
<td style="width:16px"><span class="fa fa-flash text-muted"></span></td>
<td style="width:100px"><?=gettext("last match");?></td>
<?php endif ?>
</tr>
</table>
</td>
Expand Down

0 comments on commit ca36dcc

Please sign in to comment.