Commit dddcb33f authored by Dietmar Maurer's avatar Dietmar Maurer

ceph GUI: fix state handling

parent c04392c7
......@@ -875,6 +875,26 @@ Ext.define('PVE.node.Ceph', {
extend: 'Ext.tab.Panel',
alias: 'widget.pveNodeCeph',
getHState: function(itemId) {
var me = this;
if (!itemId) {
itemId = me.getActiveTab().itemId;
}
var first = me.items.get(0);
var ntab;
// Note: '' is alias for first tab.
if (itemId === first.itemId) {
ntab = 'ceph';
} else {
ntab = 'ceph-' + itemId;
}
return { value: ntab };
},
initComponent: function() {
var me = this;
......@@ -956,17 +976,7 @@ Ext.define('PVE.node.Ceph', {
}
},
tabchange: function(tp, newcard, oldcard) {
var first = tp.items.get(0);
var ntab;
// Note: '' is alias for first tab.
if (newcard.itemId === first.itemId) {
ntab = 'ceph';
} else {
ntab = 'ceph-' + newcard.itemId;
}
var state = { value: ntab };
var state = me.getHState(newcard.itemId);
sp.set(me.phstateid, state);
}
}
......
......@@ -81,9 +81,12 @@ Ext.define('PVE.panel.Config', {
if (newcard.itemId === items[0].itemId) {
ntab = '';
}
var state = { value: ntab };
if (stateid && !newcard.phstateid) {
sp.set(stateid, state);
if (stateid) {
if (newcard.phstateid) {
sp.set(newcard.phstateid, newcard.getHState());
} else {
sp.set(stateid, { value: ntab });
}
}
}
}
......
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