]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: ct: fix displaying nic firewall if explicitly 0
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 4 Apr 2019 14:11:28 +0000 (16:11 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 4 Apr 2019 14:11:28 +0000 (16:11 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/Parser.js
www/manager6/lxc/Network.js

index b5fb5a4e0751f940a44aeb440b6694cb7205e4e1..0416cd6332217cfc2080d8a31f49364d377380f9 100644 (file)
@@ -379,12 +379,15 @@ Ext.define('PVE.Parser', { statics: {
            if (!p || p.match(/^\s*$/)) {
                return; // continue
            }
-           var match_res = p.match(/^(bridge|hwaddr|mtu|name|ip|ip6|gw|gw6|firewall|tag|rate)=(\S+)$/);
-           if (!match_res) {
+           var match_res = p.match(/^(bridge|hwaddr|mtu|name|ip|ip6|gw|gw6|tag|rate)=(\S+)$/);
+           if (match_res) {
+               data[match_res[1]] = match_res[2];
+           } else if ((match_res = p.match(/^firewall=(\d+)$/)) !== null) {
+               data.firewall = match_res[1] !== "0" && match_res[1];
+           } else {
                // todo: simply ignore errors ?
                return; // continue
            }
-           data[match_res[1]] = match_res[2];
        });
 
        return data;
index 1e11539dc4ac018c0d469be2b007f65243145da1..be40a8fa65c6b99f5e3ce17f4ac6adb55ef84cf2 100644 (file)
@@ -152,7 +152,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
                xtype: 'proxmoxcheckbox',
                fieldLabel: gettext('Firewall'),
                name: 'firewall',
-               checked: cdata.firewall
+               value: cdata.firewall
            }
        ];