[pve-devel] [PATCH manager v2 2/2] ui: fw: Show warning only if some rule is enabled

Dominic Jäger d.jaeger at proxmox.com
Wed Jun 24 11:32:32 CEST 2020


Fixup for #2815: The existence of a rule alone should NOT yet trigger the
warning. Only if it is enabled but the whole firewall for that level is not.

Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
Didn't exist in v1. Not sure if we want this. If yes you can just apply both or
squash. Of course, I can also send it as v3.

 www/manager6/grid/FirewallRules.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
index 99f85fb6..9bf723e1 100644
--- a/www/manager6/grid/FirewallRules.js
+++ b/www/manager6/grid/FirewallRules.js
@@ -491,7 +491,8 @@ Ext.define('PVE.FirewallRules', {
 		    Ext.Msg.alert(gettext('Error'), response.htmlStatus);
 		},
 		success: function (response) {
-		    let warningRequired = me.store.getCount() != 0 && !response.result.data.enable;
+		    let warningRequired = !response.result.data.enable
+			&& me.store.findExact('enable', true) >= 0;
 		    me.down('displayfield[name=fw-warning]').setVisible(warningRequired)
 		},
 	    });
-- 
2.20.1




More information about the pve-devel mailing list