[pve-devel] [PATCH manager 09/17] use DiskStorageSelector in qemu/HDEfi.js

Dominik Csapak d.csapak at proxmox.com
Wed Jul 19 15:45:21 CEST 2017


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/qemu/HDEfi.js | 67 +++-------------------------------------------
 1 file changed, 4 insertions(+), 63 deletions(-)

diff --git a/www/manager6/qemu/HDEfi.js b/www/manager6/qemu/HDEfi.js
index 45c9d706..344cbc79 100644
--- a/www/manager6/qemu/HDEfi.js
+++ b/www/manager6/qemu/HDEfi.js
@@ -8,42 +8,6 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
 
     vmconfig: {}, // used to select usused disks
 
-    controller: {
-
-	xclass: 'Ext.app.ViewController',
-
-	control: {
-	    'field[name=hdstorage]': {
-		change: function(f, value) {
-		    if (!value) { // initial store loading fires an unwanted 'change'
-			return;
-		    }
-		    var me = this.getView();
-		    var rec = f.store.getById(value);
-
-		    var rawArray = ['iscsi', 'lvm', 'lvmthin', 'drbd', 'rbd', 'sheepdog', 'zfs', 'zfspool'];
-
-		    me.hdfilesel.setDisabled(true);
-		    me.hdfilesel.setVisible(false);
-		    me.formatsel.setValue('qcow2');
-		    me.formatsel.setDisabled(false);
-
-		    // if rec.data.type exists in the array
-		    if (rawArray.indexOf(rec.data.type) !== -1) {
-			me.formatsel.setValue('raw');
-			me.formatsel.setDisabled(true);
-		    }
-
-		    if (rec.data.type === 'iscsi') {
-			me.hdfilesel.setStorage(value);
-			me.hdfilesel.setDisabled(false);
-			me.hdfilesel.setVisible(true);
-		    }
-		}
-	    }
-	}
-    },
-
     onGetValues: function(values) {
 	var me = this;
 
@@ -75,35 +39,12 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
 
 	me.items= [];
 
-	me.formatsel = Ext.create('PVE.form.DiskFormatSelector', {
-	    name: 'diskformat',
-	    fieldLabel: gettext('Format'),
-	    value: 'qcow2',
-	    allowBlank: false
-	});
-
-	me.hdfilesel = Ext.create('PVE.form.FileSelector', {
-	    name: 'hdimage',
+	me.items.push({
+	    xtype: 'pveDiskStorageSelector',
+	    name: 'efidisk0',
 	    nodename: me.nodename,
-	    storageContent: 'images',
-	    fieldLabel: gettext('Disk image'),
-	    disabled: true,
-	    hidden: true,
-	    allowBlank: false
+	    hideSize: true
 	});
-
-	me.hdstoragesel = Ext.create('PVE.form.StorageSelector', {
-	    name: 'hdstorage',
-	    nodename: me.nodename,
-	    fieldLabel: gettext('Storage'),
-	    storageContent: 'images',
-	    autoSelect: me.insideWizard,
-	    allowBlank: false
-	});
-	me.items.push(me.hdstoragesel);
-	me.items.push(me.hdfilesel);
-	me.items.push(me.formatsel);
-
 	me.callParent();
     }
 });
-- 
2.11.0





More information about the pve-devel mailing list