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

Dominik Csapak d.csapak at proxmox.com
Fri Feb 5 15:26:18 CET 2021


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'),
+		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',
-- 
2.20.1






More information about the pbs-devel mailing list