[pve-devel] [PATCH pve-manager 2/2] fix #1499 Implement a combobox for Permissions paths

Thomas Lamprecht t.lamprecht at proxmox.com
Mon May 7 11:43:22 CEST 2018


Am 05/04/2018 um 04:06 PM schrieb René Jochum:

looks OK, even if it's a bit less than I hope to encourage with this 
RFE[1], but it's a start :) Maybe note that it's a partial fix.

I can fixup the nits (indentation (1/2) and naming (2/2) if you agree
with them, else just send a v2 please :)

[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=1499

> Signed-off-by: René Jochum <r.jochum at proxmox.com>
> ---
>   www/manager6/Makefile                 |  1 +
>   www/manager6/dc/ACLView.js            |  2 +-
>   www/manager6/form/PermPathSelector.js | 24 ++++++++++++++++++++++++
>   3 files changed, 26 insertions(+), 1 deletion(-)
>   create mode 100644 www/manager6/form/PermPathSelector.js
> 
> diff --git a/www/manager6/Makefile b/www/manager6/Makefile
> index 60e8103e..04bb4f58 100644
> --- a/www/manager6/Makefile
> +++ b/www/manager6/Makefile
> @@ -58,6 +58,7 @@ JSSRC= 				                 	\
>   	form/USBSelector.js				\
>   	form/CalendarEvent.js				\
>   	form/CephPoolSelector.js				\
> +	form/PermPathSelector.js				\
>   	dc/Tasks.js					\
>   	dc/Log.js					\
>   	panel/StatusPanel.js				\
> diff --git a/www/manager6/dc/ACLView.js b/www/manager6/dc/ACLView.js
> index e12c83f2..1322f952 100644
> --- a/www/manager6/dc/ACLView.js
> +++ b/www/manager6/dc/ACLView.js
> @@ -12,7 +12,7 @@ Ext.define('PVE.dc.ACLAdd', {
>   
>   	var items = [
>   	    {
> -		xtype: me.path ? 'hiddenfield' : 'textfield',
> +		xtype: me.path ? 'hiddenfield' : 'pvePermPathSelector',
>   		name: 'path',
>   		value: me.path,
>   		allowBlank: false,
> diff --git a/www/manager6/form/PermPathSelector.js b/www/manager6/form/PermPathSelector.js
> new file mode 100644
> index 00000000..d461c6c3
> --- /dev/null
> +++ b/www/manager6/form/PermPathSelector.js
> @@ -0,0 +1,24 @@
> +Ext.define('pve-permpath', {
> +    extend: 'Ext.data.Store',
> +    alias: 'store.permpathstore',

I'd omit the trailing 'store', normally this name is used in context
where it's clear that this is a store, so maybe use: permissionpaths
(or camel cased if you like that better).

> +    fields: [ 'value' ],
> +    data: [
> +	{'value':  '/access'},
> +	{'value': '/nodes'},
> +	{'value': '/pool'},
> +	{'value': '/storage'},
> +	{'value': '/vms'}
> +    ]
> +});
> +
> +Ext.define('PVE.form.PermPathSelector', {
> +    extend: 'Ext.form.field.ComboBox',
> +    xtype: 'pvePermPathSelector',
> +
> +    valueField: 'value',
> +    displayField: 'value',
> +    typeAhead: true,
> +    store: {
> +	    type: 'permpathstore'
> +    }
> +});
> 





More information about the pve-devel mailing list