[pve-devel] [PATCH manager 1/4] correctly delete name of a qemu vm

Dominik Csapak d.csapak at proxmox.com
Tue Jul 5 17:06:54 CEST 2016


we mistakenly sent
'name:'
instead of:
'delete:name'

in case of an empty name of qemu guest
which lead to an error message that it is
not a valid dns name

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/qemu/Options.js | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index 95d6eb1..9f2bd07 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -28,12 +28,24 @@ Ext.define('PVE.qemu.Options', {
 		    xtype: 'pveWindowEdit',
 		    subject: gettext('Name'),
 		    items: {
-			xtype: 'textfield',
-			name: 'name',
-			vtype: 'DnsName',
-			value: '',
-			fieldLabel: gettext('Name'),
-			allowBlank: true
+			xtype: 'inputpanel',
+			items:{
+			    xtype: 'textfield',
+			    name: 'name',
+			    vtype: 'DnsName',
+			    value: '',
+			    fieldLabel: gettext('Name'),
+			    allowBlank: true
+			},
+			onGetValues: function(values) {
+			    var params = values;
+			    if (values.name === undefined ||
+				values.name === null ||
+				values.name === '') {
+				params = { 'delete':'name'};
+			    }
+			    return params;
+			}
 		    }
 		} : undefined
 	    },
-- 
2.1.4





More information about the pve-devel mailing list