[pve-devel] [PATCH manager 1/1] Cephfs storage wizard

Alwin Antreich a.antreich at proxmox.com
Fri Apr 20 15:32:37 CEST 2018


 Add internal and external storage wizard for cephfs

Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
---
 www/manager6/Makefile              |  1 +
 www/manager6/Utils.js              | 10 ++++++
 www/manager6/storage/CephFSEdit.js | 68 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 79 insertions(+)
 create mode 100644 www/manager6/storage/CephFSEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 60e8103e..093c78f5 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -158,6 +158,7 @@ JSSRC= 				                 	\
 	storage/IScsiEdit.js				\
 	storage/LVMEdit.js				\
 	storage/LvmThinEdit.js				\
+	storage/CephFSEdit.js				\
 	storage/RBDEdit.js				\
 	storage/SheepdogEdit.js				\
 	storage/ZFSEdit.js				\
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index af03958c..f9902652 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -424,6 +424,16 @@ Ext.define('PVE.Utils', { utilities: {
 	    hideAdd: true,
 	    faIcon: 'building'
 	},
+	cephfs: {
+	    name: 'CephFS (PVE)',
+	    ipanel: 'PVECephFSInputPanel',
+	    faIcon: 'building'
+	},
+	cephfs_ext: {
+	    name: 'CephFS (external)',
+	    ipanel: 'CephFSInputPanel',
+	    faIcon: 'building'
+	},
 	rbd: {
 	    name: 'RBD',
 	    ipanel: 'RBDInputPanel',
diff --git a/www/manager6/storage/CephFSEdit.js b/www/manager6/storage/CephFSEdit.js
new file mode 100644
index 00000000..a7aedbbf
--- /dev/null
+++ b/www/manager6/storage/CephFSEdit.js
@@ -0,0 +1,68 @@
+Ext.define('PVE.storage.CephFSInputPanel', {
+    extend: 'PVE.panel.StorageBase',
+
+    initComponent : function() {
+	var me = this;
+
+	if (!me.nodename) {
+	    me.nodename = 'localhost';
+	}
+	me.type = 'cephfs';
+
+	me.column1 = [];
+
+	if (me.pveceph) {
+	    me.column1.push(
+		{
+		    xtype: me.isCreate ? 'textfield' : 'displayfield',
+		    nodename: me.nodename,
+		    name: 'username',
+		    value: me.isCreate ? 'admin': '',
+		    fieldLabel: gettext('User name'),
+		    allowBlank: true
+		}
+	    );
+	} else {
+	    me.column1.push(
+		{
+		    xtype: me.isCreate ? 'textfield' : 'displayfield',
+		    name: 'monhost',
+		    vtype: 'HostList',
+		    value: '',
+		    fieldLabel: 'Monitor(s)',
+		    allowBlank: false
+		},
+		{
+		    xtype: me.isCreate ? 'textfield' : 'displayfield',
+		    name: 'username',
+		    value: me.isCreate ? 'admin': '',
+		    fieldLabel: gettext('User name'),
+		    allowBlank: true
+		}
+	    );
+	}
+
+	// here value is an array,
+	// while before it was a string
+	/*jslint confusion: true*/
+	me.column2 = [
+	    {
+		xtype: 'pveContentTypeSelector',
+		fieldLabel: gettext('Content'),
+		name: 'content',
+		value: ['images'],
+		multiSelect: true,
+		allowBlank: false
+	    }
+	];
+	/*jslint confusion: false*/
+
+	me.callParent();
+    }
+});
+
+Ext.define('PVE.storage.PVECephFSInputPanel', {
+    extend: 'PVE.storage.CephFSInputPanel',
+
+    pveceph: 1
+});
-- 
2.11.0





More information about the pve-devel mailing list