[pve-devel] [PATCH] gui : enable qemu network card firewall option

Alexandre Derumier aderumier at odiso.com
Fri May 9 11:09:27 CEST 2014


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 www/manager/Parser.js           |    5 +++++
 www/manager/qemu/NetworkEdit.js |    9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/www/manager/Parser.js b/www/manager/Parser.js
index 38a50d8..db4242a 100644
--- a/www/manager/Parser.js
+++ b/www/manager/Parser.js
@@ -31,6 +31,8 @@ Ext.define('PVE.Parser', { statics: {
 		res.rate = match_res[1];
 	    } else if ((match_res = p.match(/^tag=(\d+(\.\d+)?)$/)) !== null) {
                 res.tag = match_res[1];
+	    } else if ((match_res = p.match(/^firewall=(\d+)$/)) !== null) {
+                res.firewall = match_res[1];
 	    } else {
 		errors = true;
 		return false; // break
@@ -55,6 +57,9 @@ Ext.define('PVE.Parser', { statics: {
 	    if (net.tag) {
 		netstr += ",tag=" + net.tag;
 	    }
+	    if (net.firewall) {
+		netstr += ",firewall=" + net.firewall;
+	    }
 	}
 	if (net.rate) {
 	    netstr += ",rate=" + net.rate;
diff --git a/www/manager/qemu/NetworkEdit.js b/www/manager/qemu/NetworkEdit.js
index a7bbd64..1e5b97b 100644
--- a/www/manager/qemu/NetworkEdit.js
+++ b/www/manager/qemu/NetworkEdit.js
@@ -13,6 +13,7 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
 	} else if (values.networkmode === 'bridge') {
 	    me.network.bridge = values.bridge;
 	    me.network.tag = values.tag;
+	    me.network.firewall = values.firewall;
 	} else {
 	    me.network.bridge = undefined;
 	}
@@ -84,6 +85,7 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
 			me.down('field[name=bridge]').setDisabled(!value);
 			me.down('field[name=bridge]').validate();
 			me.down('field[name=tag]').setDisabled(!value);
+			me.down('field[name=firewall]').setDisabled(!value);
 		    }
 		}
 	    },
@@ -94,6 +96,13 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
 		value: '',
 		labelAlign: 'right'
 	    },
+	    me.bridgesel,
+	    {
+		xtype: 'pvecheckbox',
+		fieldLabel: gettext('Firewall'),
+		name: 'firewall',
+		labelAlign: 'right'
+	    },
 	    {
 		xtype: 'radiofield',
 		name: 'networkmode',
-- 
1.7.10.4




More information about the pve-devel mailing list