Commit 88f2567f authored by Dietmar Maurer's avatar Dietmar Maurer

copy StatusPanel.js from manager to manager5

parent 1ef8cfff
Ext.define('PVE.panel.StatusPanel', {
extend: 'Ext.tab.Panel',
alias: 'widget.pveStatusPanel',
//title: "Logs",
//tabPosition: 'bottom',
initComponent: function() {
var me = this;
var stateid = 'ltab';
var sp = Ext.state.Manager.getProvider();
var state = sp.get(stateid);
if (state && state.value) {
me.activeTab = state.value;
}
Ext.apply(me, {
listeners: {
tabchange: function() {
var atab = me.getActiveTab().itemId;
var state = { value: atab };
sp.set(stateid, state);
}
},
items: [
{
itemId: 'tasks',
title: gettext('Tasks'),
xtype: 'pveClusterTasks'
},
{
itemId: 'clog',
title: gettext('Cluster log'),
xtype: 'pveClusterLog'
}
]
});
me.callParent();
me.items.get(0).fireEvent('show', me.items.get(0));
var statechange = function(sp, key, state) {
if (key === stateid) {
var atab = me.getActiveTab().itemId;
var ntab = state.value;
if (state && ntab && (atab != ntab)) {
me.setActiveTab(ntab);
}
}
};
sp.on('statechange', statechange);
me.on('destroy', function() {
sp.un('statechange', statechange);
});
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment