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 0804adbed0
commit 2a923e4fb3
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*$/)) {
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;

View File

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