[pve-devel] [PATCH] implement the disconnect nic button on the network edit pannel.

Wolfgang Link wolfgang at linksystems.org
Mon Dec 22 13:35:59 CET 2014


Signed-off-by: Wolfgang Link <wolfgang at linksystems.org>
---
 www/manager/Parser.js           |    5 +++++
 www/manager/qemu/NetworkEdit.js |    8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/www/manager/Parser.js b/www/manager/Parser.js
index 11fbe49..3494637 100644
--- a/www/manager/Parser.js
+++ b/www/manager/Parser.js
@@ -33,6 +33,8 @@ Ext.define('PVE.Parser', { statics: {
                 res.tag = match_res[1];
 	    } else if ((match_res = p.match(/^firewall=(\d+)$/)) !== null) {
                 res.firewall = match_res[1];
+	    } else if ((match_res = p.match(/^link_down=(\d+)$/)) !== null) {
+                res.disconnect = match_res[1];
 	    } else {
 		errors = true;
 		return false; // break
@@ -64,6 +66,9 @@ Ext.define('PVE.Parser', { statics: {
 	if (net.rate) {
 	    netstr += ",rate=" + net.rate;
 	}
+	if (net.disconnect) {
+	    netstr += ",link_down=" + net.disconnect;
+	}
 	return netstr;
     },
 
diff --git a/www/manager/qemu/NetworkEdit.js b/www/manager/qemu/NetworkEdit.js
index 1e5b97b..ae3147e 100644
--- a/www/manager/qemu/NetworkEdit.js
+++ b/www/manager/qemu/NetworkEdit.js
@@ -18,6 +18,7 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
 	    me.network.bridge = undefined;
 	}
 	me.network.macaddr = values.macaddr;
+	me.network.disconnect = values.disconnect;
 
 	if (values.rate) {
 	    me.network.rate = values.rate;
@@ -147,7 +148,12 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
 		value: '',
 		emptyText: 'unlimited',
 		allowBlank: true
-	    }
+	    },
+	    {
+		xtype: 'pvecheckbox',
+		fieldLabel: gettext('Disconnect'),
+		name: 'disconnect'
+	    },
 	];
 
 	me.callParent();
-- 
1.7.10.4





More information about the pve-devel mailing list