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

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jun 20 12:52:27 CEST 2018


On 6/18/18 7:49 PM, Alwin Antreich wrote:
>  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 | 71 ++++++++++++++++++++++++++++++++++++++
>  3 files changed, 82 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..42e89b17
> --- /dev/null
> +++ b/www/manager6/storage/CephFSEdit.js
> @@ -0,0 +1,71 @@
> +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: '',
> +		    emptyText: admin,

put this in quotes, as now this does not work...
> ReferenceError: admin is not defined


> +		    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: '',
> +		    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
> +});
> 





More information about the pve-devel mailing list