7a23a7ca5d
before, this was only used where the top list was a fixed size and only for one datastore (which limits the number of prune jobs a bit) since now we show gc jobs for all datastores here too and all their prune jobs, this panel can get much bigger. To improve it's scrolling sizing behavior, make the prune jobs panel `flex: 1`, so it fills out the rest of the view, and add a splitter between them so one can resize them on the fly. To prevent making one of the panels too small, set an appropriate minHeight for both and make the surrounding panel scrollable. To not save the height into it's state, we have to filter that out for the GCView. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
61 lines
1.3 KiB
JavaScript
61 lines
1.3 KiB
JavaScript
Ext.define('PBS.config.PruneAndGC', {
|
|
extend: 'Ext.panel.Panel',
|
|
alias: 'widget.pbsPruneAndGC',
|
|
title: gettext('Prune & GC Jobs'),
|
|
|
|
mixins: ['Proxmox.Mixin.CBind'],
|
|
|
|
layout: {
|
|
type: 'vbox',
|
|
align: 'stretch',
|
|
multi: true,
|
|
},
|
|
defaults: {
|
|
collapsible: false,
|
|
margin: '7 10 3 10',
|
|
},
|
|
scrollable: true,
|
|
items: [
|
|
{
|
|
xtype: 'pbsGCJobView',
|
|
itemId: 'gcjobs',
|
|
nodename: 'localhost',
|
|
cbind: {
|
|
datastore: '{datastore}',
|
|
},
|
|
minHeight: 125, // shows at least one line of content
|
|
},
|
|
{
|
|
xtype: 'splitter',
|
|
performCollapse: false,
|
|
},
|
|
{
|
|
xtype: 'pbsPruneJobView',
|
|
nodename: 'localhost',
|
|
itemId: 'prunejobs',
|
|
cbind: {
|
|
datastore: '{datastore}',
|
|
},
|
|
flex: 1,
|
|
minHeight: 160, // shows at least one line of content
|
|
},
|
|
],
|
|
initComponent: function() {
|
|
let me = this;
|
|
|
|
let subPanelIds = me.items.map(el => el.itemId).filter(id => !!id);
|
|
|
|
me.callParent();
|
|
|
|
for (const itemId of subPanelIds) {
|
|
let component = me.getComponent(itemId);
|
|
component.relayEvents(me, ['activate', 'deactivate', 'destroy']);
|
|
}
|
|
},
|
|
|
|
cbindData: function(initalConfig) {
|
|
let me = this;
|
|
me.datastore = initalConfig.datastore ? initalConfig.datastore : undefined;
|
|
},
|
|
});
|