From d455270fa108185721aa7fa06e862b1a55aabfe1 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 26 May 2021 15:48:06 +0200 Subject: [PATCH] ui: tape: add MediaSetSelector so that we can let the user select a media-set Signed-off-by: Dominik Csapak --- www/tape/window/TapeRestore.js | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/www/tape/window/TapeRestore.js b/www/tape/window/TapeRestore.js index 883b8342..1afd57fe 100644 --- a/www/tape/window/TapeRestore.js +++ b/www/tape/window/TapeRestore.js @@ -666,3 +666,44 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', { me.mon(me.store, 'filterchange', () => me.checkChange()); }, }); + +Ext.define('PBS.TapeManagement.MediaSetSelector', { + extend: 'Proxmox.form.ComboGrid', + alias: 'widget.pbsMediaSetSelector', + + allowBlank: false, + displayField: 'media-set-name', + valueField: 'media-set-uuid', + autoSelect: false, + + store: { + proxy: { + type: 'proxmox', + url: '/api2/json/tape/media/media-sets', + }, + autoLoad: true, + idProperty: 'media-set-uuid', + sorters: ['pool', 'media-set-ctime'], + }, + + listConfig: { + width: 600, + columns: [ + { + text: gettext('Pool'), + dataIndex: 'pool', + flex: 1, + }, + { + text: gettext('Name'), + dataIndex: 'media-set-name', + width: 180, + }, + { + text: gettext('Media-Set UUID'), + dataIndex: 'media-set-uuid', + width: 280, + }, + ], + }, +});