From b0b51baefcbe7a98dff7b01cc09c6097be1590c3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 8 May 2019 20:16:19 +0200 Subject: [PATCH] firewall: move no rules info to top into info box Also experiment with "warning" and "success" coloring to further leaverage bootstrap magic. The colors need tweaking or reverting, but let's just see how this looks and feels for the time being. --- src/www/firewall_rules.php | 47 +++++++++++++++++++------------------- src/www/guiconfig.inc | 4 ++-- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/www/firewall_rules.php b/src/www/firewall_rules.php index 55de3497c..1c6a0129a 100644 --- a/src/www/firewall_rules.php +++ b/src/www/firewall_rules.php @@ -533,7 +533,7 @@ $( document ).ready(function() { - @@ -543,10 +543,31 @@ $( document ).ready(function() {
- +

- You must apply the changes in order for them to take effect."));?> + You must apply the changes in order for them to take effect."), 'warning') ?> + $filterent) { + if ((!isset($filterent['floating']) && $selected_if == $filterent['interface']) || + ((isset($filterent['floating']) || empty($filterent['interface'])) && $selected_if == 'FloatingRules')) { + $interface_has_rules = true; + break; + } + } ?> + + + + + + +

@@ -641,7 +662,6 @@ $( document ).ready(function() { endif; endforeach;?> $filterent): if ( (!isset($filterent['floating']) && $selected_if == $filterent['interface']) || @@ -653,7 +673,6 @@ $( document ).ready(function() { // calculate a hash so we can track these records in the ruleset, new style (mvc) code will // automatically provide us with a uuid, this is a workaround to provide some help with tracking issues. $rule_hash = OPNsense\Firewall\Util::calcRuleHash($filterent); - $interface_has_rules = true; ?> " data-category=""> @@ -803,25 +822,7 @@ $( document ).ready(function() { endif; endforeach; $i++; - if (!$interface_has_rules): ?> - - - - - - - - - - - - diff --git a/src/www/guiconfig.inc b/src/www/guiconfig.inc index bb3005295..1882b71aa 100644 --- a/src/www/guiconfig.inc +++ b/src/www/guiconfig.inc @@ -219,7 +219,7 @@ function print_content_box($msg) EOFnp; } -function print_info_box_apply($msg) +function print_info_box_apply($msg, $alert = 'info') { $iface = !empty($_POST['if']) ? $_POST['if'] : (!empty($_GET['if']) ? $_GET['if'] : ''); $label = gettext('Apply changes'); @@ -242,7 +242,7 @@ function print_info_box_apply($msg) } $savebutton .= '
'; - print_alert_box($msg, 'info', $savebutton); + print_alert_box($msg, $alert, $savebutton); } function print_info_box($msg)