ui: tape/TapeRestore: allow preselecting a datastore

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-05-26 15:48:10 +02:00 committed by Thomas Lamprecht
parent 68ac8976eb
commit e01689978e
2 changed files with 25 additions and 13 deletions

View File

@ -161,6 +161,11 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
text: store, text: store,
'media-set-uuid': entry['media-set-uuid'], 'media-set-uuid': entry['media-set-uuid'],
iconCls: 'fa fa-database', iconCls: 'fa fa-database',
restore: true,
'media-set': media_set,
prefilter: {
store,
},
tapes: {}, tapes: {},
}; };
} }

View File

@ -732,6 +732,7 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', {
let me = this; let me = this;
me.callParent(); me.callParent();
if (me.prefilter !== undefined) { if (me.prefilter !== undefined) {
if (me.prefilter.store !== undefined) {
me.store.filters.add( me.store.filters.add(
{ {
id: 'x-gridfilter-store', id: 'x-gridfilter-store',
@ -739,6 +740,11 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', {
operator: 'in', operator: 'in',
value: [me.prefilter.store], value: [me.prefilter.store],
}, },
);
}
if (me.prefilter.snapshot !== undefined) {
me.store.filters.add(
{ {
id: 'x-gridfilter-snapshot', id: 'x-gridfilter-snapshot',
property: 'snapshot', property: 'snapshot',
@ -746,6 +752,7 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', {
}, },
); );
} }
}
me.mon(me.store, 'filterchange', () => me.checkChange()); me.mon(me.store, 'filterchange', () => me.checkChange());
}, },