[pbs-devel] [PATCH v3 proxmox-backup 9/9] ui: add remove-button for directories/mount-units

Dominik Csapak d.csapak at proxmox.com
Fri Sep 11 13:08:54 CEST 2020


comment inline

On 8/28/20 10:46 AM, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
> ---
> add remove button to ui, all previous patches are needed for this one
> 
>   www/DirectoryList.js | 25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
> 
> diff --git a/www/DirectoryList.js b/www/DirectoryList.js
> index 00531fd0..51b30c78 100644
> --- a/www/DirectoryList.js
> +++ b/www/DirectoryList.js
> @@ -21,6 +21,24 @@ Ext.define('PBS.admin.Directorylist', {
>   	    }).show();
>   	},
>   
> +	removeDirectory: function() {
> +	    let me = this;
> +	    const view = me.getView();
> +	    const rec = view.getSelection()[0];
> +	    const id = rec.data.id;
> +	    Ext.create('Proxmox.window.SafeDestroy', {
> +		url: `/nodes/localhost/disks/directory/${id}`,
> +		item: {
> +		    id: id,
> +		},
> +		note: gettext('Data and partitions on the disk will be left untouched.'),
> +		taskName: 'dirremove',
> +		listeners: {
> +		    destroy: () => me.reload(),
> +		},
> +	    }).show();
> +	},
> +
>   	reload: function() {
>   	    let me = this;
>   	    let store = me.getView().getStore();
> @@ -49,6 +67,13 @@ Ext.define('PBS.admin.Directorylist', {
>   	    text: gettext('Create') + ': Directory',
>   	    handler: 'createDirectory',
>   	},
> +	{
> +	    xtype: 'proxmoxButton',
> +	    text: gettext('Remove'),
> +	    handler: 'removeDir',

the handler name is wrong and thus will not execute anything

> +	    disabled: true,
> +	    iconCls: 'fa fa-trash-o',
> +	},
>       ],
>   
>       columns: [
> 






More information about the pbs-devel mailing list