[pve-devel] [PATCH 3/6] Gui storage: bind ZFSPoolEdit.js and set defaults

Wolfgang Link w.link at proxmox.com
Mon Jan 26 12:35:11 CET 2015


Signed-off-by: Wolfgang Link <w.link at proxmox.com>
---
 www/manager/Makefile          |    1 +
 www/manager/Utils.js          |    2 ++
 www/manager/dc/StorageView.js |   14 +++++++++++++-
 www/manager/qemu/Clone.js     |    3 ++-
 www/manager/qemu/HDEdit.js    |    3 ++-
 www/manager/qemu/HDMove.js    |    4 ++--
 6 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/www/manager/Makefile b/www/manager/Makefile
index 76d2ab3..ba6ca73 100644
--- a/www/manager/Makefile
+++ b/www/manager/Makefile
@@ -161,6 +161,7 @@ JSSRC= 				                 	\
 	storage/RBDEdit.js				\
 	storage/SheepdogEdit.js				\
 	storage/ZFSEdit.js				\
+	storage/ZFSPoolEdit.js				\
 	dc/Summary.js					\
 	dc/OptionView.js				\
 	dc/StorageView.js				\
diff --git a/www/manager/Utils.js b/www/manager/Utils.js
index 93bd90b..0b25b2b 100644
--- a/www/manager/Utils.js
+++ b/www/manager/Utils.js
@@ -714,6 +714,8 @@ Ext.define('PVE.Utils', { statics: {
 	    return 'Sheepdog';
 	} else if (value === 'zfs') {
 	    return 'ZFS';
+	} else if (value === 'zfspool') {
+	    return 'ZFSPool';
 	} else if (value === 'iscsidirect') {
 	    return 'iSCSIDirect';
 	} else {
diff --git a/www/manager/dc/StorageView.js b/www/manager/dc/StorageView.js
index b351ef1..4bcf3b7 100644
--- a/www/manager/dc/StorageView.js
+++ b/www/manager/dc/StorageView.js
@@ -49,6 +49,8 @@ Ext.define('PVE.dc.StorageView', {
 		editor = 'PVE.storage.SheepdogEdit';
 	    } else if (type === 'zfs') {
 		editor = 'PVE.storage.ZFSEdit';
+	    } else if (type === 'zfspool') {
+		editor = 'PVE.storage.ZFSPoolEdit';
 	    } else {
 		return;
 	    }
@@ -165,7 +167,17 @@ Ext.define('PVE.dc.StorageView', {
 				    win.on('destroy', reload);
 				    win.show();
 				}
-			    }
+			    },
+			    {
+                                text: PVE.Utils.format_storage_type('zfspool'),
+                                iconCls: 'pve-itype-icon-storage',
+                                handler: function() {
+                                    var win = Ext.create('PVE.storage.ZFSPoolEdit', {});
+                                    win.on('destroy', reload);
+                                    win.show();
+                                }
+                            },
+
 /* the following type are conidered unstable
  * so we do not enable that on the GUI for now
 			    {
diff --git a/www/manager/qemu/Clone.js b/www/manager/qemu/Clone.js
index 7f41487..de0c95a 100644
--- a/www/manager/qemu/Clone.js
+++ b/www/manager/qemu/Clone.js
@@ -69,7 +69,8 @@ Ext.define('PVE.window.Clone', {
             rec.data.type === 'rbd' ||
             rec.data.type === 'iscsi' ||
             rec.data.type === 'sheepdog' ||
-	    rec.data.type === 'zfs'
+	    rec.data.type === 'zfs' ||
+	    rec.data.type === 'zfspool'
            ) {
             me.formatsel.setValue('raw');
             me.formatsel.setDisabled(true);
diff --git a/www/manager/qemu/HDEdit.js b/www/manager/qemu/HDEdit.js
index 0faa3c5..b2785b1 100644
--- a/www/manager/qemu/HDEdit.js
+++ b/www/manager/qemu/HDEdit.js
@@ -174,7 +174,8 @@ Ext.define('PVE.qemu.HDInputPanel', {
 			} else if (rec.data.type === 'lvm' || 
 				   rec.data.type === 'rbd' ||
 				   rec.data.type === 'sheepdog' ||
-				   rec.data.type === 'zfs') {
+				   rec.data.type === 'zfs' ||
+				   rec.data.type === 'zfspool') {
 			    me.hdfilesel.setDisabled(true);
 			    me.hdfilesel.setVisible(false);
 			    me.formatsel.setValue('raw');
diff --git a/www/manager/qemu/HDMove.js b/www/manager/qemu/HDMove.js
index 68d7e92..6c16a36 100644
--- a/www/manager/qemu/HDMove.js
+++ b/www/manager/qemu/HDMove.js
@@ -77,8 +77,8 @@ Ext.define('PVE.window.HDMove', {
                         } else if (rec.data.type === 'lvm' ||
                                    rec.data.type === 'rbd' ||
                                    rec.data.type === 'sheepdog' ||
-                                   rec.data.type === 'zfs'
-
+                                   rec.data.type === 'zfs' ||
+				   rec.data.type === 'zfspool'
                         ) {
                             me.formatsel.setValue('raw');
                             me.formatsel.setDisabled(true);
-- 
1.7.10.4




More information about the pve-devel mailing list