ui: ct: fix displaying nic firewall if explicitly 0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-04-04 16:11:28 +02:00
parent 8b030d0848
commit 95e77b22cc
2 changed files with 7 additions and 4 deletions

View File

@ -379,12 +379,15 @@ Ext.define('PVE.Parser', { statics: {
if (!p || p.match(/^\s*$/)) { if (!p || p.match(/^\s*$/)) {
return; // continue return; // continue
} }
var match_res = p.match(/^(bridge|hwaddr|mtu|name|ip|ip6|gw|gw6|firewall|tag|rate)=(\S+)$/); var match_res = p.match(/^(bridge|hwaddr|mtu|name|ip|ip6|gw|gw6|tag|rate)=(\S+)$/);
if (!match_res) { 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 ? // todo: simply ignore errors ?
return; // continue return; // continue
} }
data[match_res[1]] = match_res[2];
}); });
return data; return data;

View File

@ -152,7 +152,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
xtype: 'proxmoxcheckbox', xtype: 'proxmoxcheckbox',
fieldLabel: gettext('Firewall'), fieldLabel: gettext('Firewall'),
name: 'firewall', name: 'firewall',
checked: cdata.firewall value: cdata.firewall
} }
]; ];