From 95e77b22cc7832e1f5ecac7e4a2ee39aaf8d9b7c Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 4 Apr 2019 16:11:28 +0200 Subject: [PATCH] ui: ct: fix displaying nic firewall if explicitly 0 Signed-off-by: Thomas Lamprecht --- www/manager6/Parser.js | 9 ++++++--- www/manager6/lxc/Network.js | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js index b5fb5a4e..0416cd63 100644 --- a/www/manager6/Parser.js +++ b/www/manager6/Parser.js @@ -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; diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js index 1e11539d..be40a8fa 100644 --- a/www/manager6/lxc/Network.js +++ b/www/manager6/lxc/Network.js @@ -152,7 +152,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', { xtype: 'proxmoxcheckbox', fieldLabel: gettext('Firewall'), name: 'firewall', - checked: cdata.firewall + value: cdata.firewall } ];