[pve-devel] [PATCH manager 11/17] use DiskStorageSelector in qemu/HDMove.js

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


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/qemu/HDMove.js | 55 ++++++++-------------------------------------
 1 file changed, 9 insertions(+), 46 deletions(-)

diff --git a/www/manager6/qemu/HDMove.js b/www/manager6/qemu/HDMove.js
index 745c7911..8e38b53c 100644
--- a/www/manager6/qemu/HDMove.js
+++ b/www/manager6/qemu/HDMove.js
@@ -59,54 +59,13 @@ Ext.define('PVE.window.HDMove', {
             }
         ];
 
-        me.hdstoragesel = Ext.create('PVE.form.StorageSelector', {
-                name: 'hdstorage',
-                nodename: me.nodename,
-                fieldLabel: gettext('Target Storage'),
-                storageContent: 'images',
-                autoSelect: me.insideWizard,
-                allowBlank: true,
-                disabled: false,
-                hidden: false,
-                listeners: {
-                    change: function(f, value) {
-			if (!value) { // initial store loading fires an unwanted 'change
-			    return;
-			}
-                        var rec = f.store.getById(value);
-			if (rec.data.type === 'iscsi' ||
-			    rec.data.type === 'lvm' ||
-			    rec.data.type === 'lvmthin' ||
-			    rec.data.type === 'rbd' ||
-			    rec.data.type === 'sheepdog' ||
-			    rec.data.type === 'zfs' ||
-			    rec.data.type === 'zfspool'
-                        ) {
-                            me.formatsel.setValue('raw');
-                            me.formatsel.setDisabled(true);
-                        } else {
-                            me.formatsel.setDisabled(false);
-                        }
-
-                    }
-                }
-
-	});
-
-	me.formatsel = Ext.create('PVE.form.DiskFormatSelector', {
-		name: 'diskformat',
-		fieldLabel: gettext('Format'),
-		value: 'raw',
-                disabled: true,
-                hidden: false,
-		allowBlank: false
+	items.push({
+	    xtype: 'pveDiskStorageSelector',
+	    storageLabel: gettext('Target Storage'),
+	    nodename: me.nodename,
+	    hideSize: true
 	});
 
-
-   
-	items.push(me.hdstoragesel);
-	items.push(me.formatsel);
-
 	items.push({
 	    xtype: 'pvecheckbox',
 	    fieldLabel: gettext('Delete source'),
@@ -153,6 +112,10 @@ Ext.define('PVE.window.HDMove', {
 
 	me.callParent();
 
+	me.mon(me.formPanel, 'validitychange', function(fp, isValid) {
+	    submitBtn.setDisabled(!isValid);
+	});
 
+	me.formPanel.isValid();
     }
 });
-- 
2.11.0





More information about the pve-devel mailing list