[pve-devel] r6336 - in pve-manager/pve2: . www/manager/panel www/manager/qemu www/manager/window

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jul 21 08:03:59 CEST 2011


Author: dietmar
Date: 2011-07-21 08:03:58 +0200 (Thu, 21 Jul 2011)
New Revision: 6336

Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/www/manager/panel/InputPanel.js
   pve-manager/pve2/www/manager/qemu/CreateWizard.js
   pve-manager/pve2/www/manager/qemu/HDEdit.js
   pve-manager/pve2/www/manager/window/Edit.js
   pve-manager/pve2/www/manager/window/Wizard.js
Log:
	* www/manager/qemu/CreateWizard.js: allow to select HD device 

	* www/manager/window/Edit.js: always mark invalid fields



Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-07-20 11:20:34 UTC (rev 6335)
+++ pve-manager/pve2/ChangeLog	2011-07-21 06:03:58 UTC (rev 6336)
@@ -1,3 +1,9 @@
+2011-07-21  Proxmox Support Team  <support at proxmox.com>
+
+	* www/manager/qemu/CreateWizard.js: allow to select HD device 
+
+	* www/manager/window/Edit.js: always mark invalid fields
+
 2011-07-20  Proxmox Support Team  <support at proxmox.com>
 
 	* www/manager/Utils.js: impl. 'StorageID' vtype

Modified: pve-manager/pve2/www/manager/panel/InputPanel.js
===================================================================
--- pve-manager/pve2/www/manager/panel/InputPanel.js	2011-07-20 11:20:34 UTC (rev 6335)
+++ pve-manager/pve2/www/manager/panel/InputPanel.js	2011-07-21 06:03:58 UTC (rev 6336)
@@ -38,7 +38,7 @@
         Ext.iterate(values, function(fieldId, val) {
 	    var field = me.query('[isFormField][name=' + fieldId + ']')[0];
             if (field) {
-               field.setValue(val);
+		field.setValue(val);
                 if (form.trackResetOnLoad) {
                     field.resetOriginalValue();
                 }

Modified: pve-manager/pve2/www/manager/qemu/CreateWizard.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/CreateWizard.js	2011-07-20 11:20:34 UTC (rev 6335)
+++ pve-manager/pve2/www/manager/qemu/CreateWizard.js	2011-07-21 06:03:58 UTC (rev 6336)
@@ -30,19 +30,10 @@
 
 	var hdpanel = Ext.create('PVE.qemu.HDInputPanel', {
 	    title: 'Harddisk',
-	    confid: 'ide0',
 	    create: true,
 	    insideWizard: true
 	});
 
-	var hdstoragesel = Ext.create('PVE.form.StorageSelector', {
-	    name: 'hdstorage',
-	    fieldLabel: 'Storage',
-	    labelAlign: 'right',
-	    storageContent: 'images',
-	    allowBlank: false
-	});
-
 	var networkpanel =  Ext.create('PVE.qemu.NetworkInputPanel', {
 	    title: 'Network',
 	    insideWizard: true

Modified: pve-manager/pve2/www/manager/qemu/HDEdit.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/HDEdit.js	2011-07-20 11:20:34 UTC (rev 6335)
+++ pve-manager/pve2/www/manager/qemu/HDEdit.js	2011-07-21 06:03:58 UTC (rev 6336)
@@ -95,7 +95,9 @@
 	me.column2 = [];
 
 	if (!me.confid || me.unused) {
-	    me.bussel = Ext.createWidget('PVE.form.ControllerSelector', {});
+	    me.bussel = Ext.createWidget('PVE.form.ControllerSelector', {
+		vmconfig: me.insideWizard ? {ide2: 'cdrom'} : undefined
+	    });
 	    me.column1.push(me.bussel);
 	}
 

Modified: pve-manager/pve2/www/manager/window/Edit.js
===================================================================
--- pve-manager/pve2/www/manager/window/Edit.js	2011-07-20 11:20:34 UTC (rev 6335)
+++ pve-manager/pve2/www/manager/window/Edit.js	2011-07-21 06:03:58 UTC (rev 6336)
@@ -10,6 +10,13 @@
     // OK and RESET) 
     create: false, 
 
+    isValid: function() {
+	var me = this;
+
+	var form = me.formPanel.getForm();
+	return form.isValid();
+    },
+
     getValues: function(dirtyOnly) {
 	var me = this;
 
@@ -173,6 +180,7 @@
 	    colwidth += me.fieldDefaults.labelWidth - 100;
 	}
 	
+
 	var twoColumn = items[0].column1 || items[0].column2;
 
 	Ext.applyIf(me, {
@@ -186,9 +194,9 @@
 
 	me.callParent();
 
-	if (me.create) {
-	    // trigger field validations to mark invalid fields
-	    form.isValid();
-	}
+	// always mark invalid fields
+	me.on('afterlayout', function() {
+	    me.isValid();
+	});
     }
 });

Modified: pve-manager/pve2/www/manager/window/Wizard.js
===================================================================
--- pve-manager/pve2/www/manager/window/Wizard.js	2011-07-20 11:20:34 UTC (rev 6335)
+++ pve-manager/pve2/www/manager/window/Wizard.js	2011-07-21 06:03:58 UTC (rev 6336)
@@ -49,7 +49,8 @@
 		fields.unshift(card);
 	    }
 	    Ext.Array.each(fields, function(field) {
-		if (!field.isValid()) {
+		// Note: not all fielcontainer have isValid()
+		if (Ext.isFunction(field.isValid) && !field.isValid()) {
 		    valid = false;
 		}
 	    });




More information about the pve-devel mailing list