[pbs-devel] [PATCH proxmox-backup 8/9] ui: tape/TapeRestore: allow preselecting a datastore

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


for that we need to split the prefilter additions, else
we always filter the snaphots too and giving 'undefined' filters
all snapshots...

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/tape/BackupOverview.js     |  5 +++++
 www/tape/window/TapeRestore.js | 33 ++++++++++++++++++++-------------
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/www/tape/BackupOverview.js b/www/tape/BackupOverview.js
index e8273f86..690836c3 100644
--- a/www/tape/BackupOverview.js
+++ b/www/tape/BackupOverview.js
@@ -161,6 +161,11 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
 			    text: store,
 			    'media-set-uuid': entry['media-set-uuid'],
 			    iconCls: 'fa fa-database',
+			    restore: true,
+			    'media-set': media_set,
+			    prefilter: {
+				store,
+			    },
 			    tapes: {},
 			};
 		    }
diff --git a/www/tape/window/TapeRestore.js b/www/tape/window/TapeRestore.js
index 35619957..bc513632 100644
--- a/www/tape/window/TapeRestore.js
+++ b/www/tape/window/TapeRestore.js
@@ -732,19 +732,26 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', {
 	let me = this;
 	me.callParent();
 	if (me.prefilter !== undefined) {
-	    me.store.filters.add(
-		{
-		    id: 'x-gridfilter-store',
-		    property: 'store',
-		    operator: 'in',
-		    value: [me.prefilter.store],
-		},
-		{
-		    id: 'x-gridfilter-snapshot',
-		    property: 'snapshot',
-		    value: me.prefilter.snapshot,
-		},
-	    );
+	    if (me.prefilter.store !== undefined) {
+		me.store.filters.add(
+		    {
+			id: 'x-gridfilter-store',
+			property: 'store',
+			operator: 'in',
+			value: [me.prefilter.store],
+		    },
+		);
+	    }
+
+	    if (me.prefilter.snapshot !== undefined) {
+		me.store.filters.add(
+		    {
+			id: 'x-gridfilter-snapshot',
+			property: 'snapshot',
+			value: me.prefilter.snapshot,
+		    },
+		);
+	    }
 	}
 
 	me.mon(me.store, 'filterchange', () => me.checkChange());
-- 
2.20.1






More information about the pbs-devel mailing list