ui: prune & gc: relay activate/deactivate events to sub panels

which allows us also to drop the initial manual load in the init,
which would also trigger if the tab isn't visible.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-05-31 10:02:10 +02:00
parent fbfc439372
commit 17b079918e
2 changed files with 14 additions and 1 deletions

View File

@ -41,7 +41,6 @@ Ext.define('PBS.config.PruneJobView', {
} }
view.getStore().rstore.getProxy().setExtraParams(params); view.getStore().rstore.getProxy().setExtraParams(params);
Proxmox.Utils.monStoreErrors(view, view.getStore().rstore); Proxmox.Utils.monStoreErrors(view, view.getStore().rstore);
this.reload();
}, },
addPruneJob: function() { addPruneJob: function() {

View File

@ -101,6 +101,7 @@ Ext.define('PBS.Datastore.PruneAndGC', {
{ {
xtype: 'pbsDatastoreGCOpts', xtype: 'pbsDatastoreGCOpts',
title: gettext('Garbage Collection'), title: gettext('Garbage Collection'),
itemId: 'datastore-gc',
nodename: 'localhost', nodename: 'localhost',
cbind: { cbind: {
datastore: '{datastore}', datastore: '{datastore}',
@ -109,6 +110,7 @@ Ext.define('PBS.Datastore.PruneAndGC', {
{ {
xtype: 'pbsPruneJobView', xtype: 'pbsPruneJobView',
nodename: 'localhost', nodename: 'localhost',
itemId: 'datastore-prune-jobs',
flex: 1, flex: 1,
minHeight: 200, minHeight: 200,
cbind: { cbind: {
@ -116,4 +118,16 @@ Ext.define('PBS.Datastore.PruneAndGC', {
}, },
}, },
], ],
initComponent: function() {
let me = this;
let subPanelIds = me.items.map(el => el.itemId);
me.callParent();
for (const itemId of subPanelIds) {
let component = me.getComponent(itemId);
component.relayEvents(me, ['activate', 'deactivate', 'destroy']);
}
},
}); });