[pbs-devel] [PATCH proxmox-backup 3/5] ui: tape/ChangerStatus: add inventory button

Dominik Csapak d.csapak at proxmox.com
Fri Feb 5 15:27:58 CET 2021


On 2/5/21 15:26, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>   www/tape/ChangerStatus.js | 39 +++++++++++++++++++++++++++++++++++++++
>   1 file changed, 39 insertions(+)
> 
> diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
> index abe652b9..c80c63cd 100644
> --- a/www/tape/ChangerStatus.js
> +++ b/www/tape/ChangerStatus.js
> @@ -341,6 +341,36 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
>   	    }).show();
>   	},
>   
> +	inventory: function() {
> +	    let me = this;
> +	    let vm = me.getViewModel();
> +	    let changer = vm.get('changer');
> +	    if (changer === '') {
> +		return;
> +	    }
> +
> +	    Ext.create('Proxmox.window.Edit', {
> +		title: gettext('Barcode Label'),

that should ofc be 'Inventory' instead ...
i can send a v2 or a fixup...

> +		showTaskViewer: true,
> +		method: 'PUT',
> +		url: '/api2/extjs/tape/drive',
> +		submitUrl: function(url, values) {
> +		    let drive = values.drive;
> +		    delete values.drive;
> +		    return `${url}/${encodeURIComponent(drive)}/inventory`;
> +		},
> +
> +		items: [
> +		    {
> +			xtype: 'pbsDriveSelector',
> +			fieldLabel: gettext('Drive'),
> +			name: 'drive',
> +			changer: changer,
> +		    },
> +		],
> +	    }).show();
> +	},
> +
>   	reload: async function() {
>   	    let me = this;
>   	    let view = me.getView();
> @@ -440,6 +470,15 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
>   		disabled: '{!changerSelected}',
>   	    },
>   	},
> +	{
> +	    text: gettext('Inventory'),
> +	    xtype: 'proxmoxButton',
> +	    handler: 'inventory',
> +	    iconCls: 'fa fa-book',
> +	    bind: {
> +		disabled: '{!changerSelected}',
> +	    },
> +	},
>       ],
>   
>       layout: 'auto',
> 






More information about the pbs-devel mailing list