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

Alwin Antreich a.antreich at proxmox.com
Wed Jul 4 12:43:27 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 | 59 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 www/manager6/storage/CephFSEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 3cc6990f..1351964c 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -164,6 +164,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 ad5a0a61..f41a9562 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -427,6 +427,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..810e415a
--- /dev/null
+++ b/www/manager6/storage/CephFSEdit.js
@@ -0,0 +1,59 @@
+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',
+		    name: 'monhost',
+		    vtype: 'HostList',
+		    value: '',
+		    fieldLabel: 'Monitor(s)',
+		    allowBlank: false
+		},
+		{
+		    xtype: me.isCreate ? 'textfield' : 'displayfield',
+		    name: 'username',
+		    value: '',
+		    emptyText: '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',
+		cts: ['backup', 'iso', 'vztmpl'],
+		fieldLabel: gettext('Content'),
+		name: 'content',
+		value: ['backup'],
+		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