[pbs-devel] [PATCH proxmox-backup 4/9] ui: tape: add MediaSetSelector

Dominik Csapak d.csapak at proxmox.com
Wed May 26 15:48:06 CEST 2021


so that we can let the user select a media-set

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 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,
+	    },
+	],
+    },
+});
-- 
2.20.1






More information about the pbs-devel mailing list