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