remove subconfigpanel related code
this removes all subconfigpanel related code, since it is not needed anymore we now have the treelist/cardpanel combo instead of tabpanels which means we can drop the whole subconfigpanel class and subclasses Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
7247077d0e
commit
f3bb7cf1a2
@ -97,10 +97,8 @@ JSSRC= \
|
||||
tree/ResourceTree.js \
|
||||
panel/IPSet.js \
|
||||
panel/ConfigPanel.js \
|
||||
panel/SubConfigPanel.js \
|
||||
grid/BackupView.js \
|
||||
panel/LogView.js \
|
||||
panel/Firewall.js \
|
||||
ceph/Pool.js \
|
||||
ceph/OSD.js \
|
||||
ceph/Disks.js \
|
||||
@ -185,7 +183,6 @@ JSSRC= \
|
||||
ha/GroupEdit.js \
|
||||
ha/Groups.js \
|
||||
ha/Fencing.js \
|
||||
ha/Config.js \
|
||||
dc/Summary.js \
|
||||
dc/OptionView.js \
|
||||
dc/StorageView.js \
|
||||
|
@ -70,75 +70,3 @@ Ext.define('PVE.node.CephConfigCrush', {
|
||||
me.callParent();
|
||||
}
|
||||
});
|
||||
|
||||
Ext.define('PVE.node.Ceph', {
|
||||
extend: 'PVE.panel.SubConfig',
|
||||
alias: 'widget.pveNodeCeph',
|
||||
|
||||
minTabWidth: 80,
|
||||
configPrefix: 'ceph',
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
var nodename = me.pveSelNode.data.node;
|
||||
if (!nodename) {
|
||||
throw "no node name specified";
|
||||
}
|
||||
|
||||
Ext.apply(me, {
|
||||
defaults: {
|
||||
border: false,
|
||||
pveSelNode: me.pveSelNode
|
||||
},
|
||||
plugins: {
|
||||
ptype: 'lazyitems',
|
||||
items: [
|
||||
{
|
||||
xtype: 'pveNodeCephStatus',
|
||||
title: gettext('Status'),
|
||||
itemId: 'status'
|
||||
},
|
||||
{
|
||||
xtype: 'pveNodeCephConfig',
|
||||
title: gettext('Config'),
|
||||
itemId: 'config'
|
||||
},
|
||||
{
|
||||
xtype: 'pveNodeCephMonList',
|
||||
title: gettext('Monitor'),
|
||||
itemId: 'monlist'
|
||||
},
|
||||
{
|
||||
xtype: 'pveNodeCephDiskList',
|
||||
title: gettext('Disks'),
|
||||
itemId: 'disklist'
|
||||
},
|
||||
{
|
||||
xtype: 'pveNodeCephOsdTree',
|
||||
title: 'OSD',
|
||||
itemId: 'osdtree'
|
||||
},
|
||||
{
|
||||
xtype: 'pveNodeCephPoolList',
|
||||
title: gettext('Pools'),
|
||||
itemId: 'pools'
|
||||
},
|
||||
{
|
||||
title: 'Crush',
|
||||
xtype: 'pveNodeCephCrushMap',
|
||||
itemId: 'crushmap'
|
||||
},
|
||||
{
|
||||
title: gettext('Log'),
|
||||
itemId: 'log',
|
||||
xtype: 'pveLogView',
|
||||
url: "/api2/extjs/nodes/" + nodename + "/ceph/log"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
||||
|
@ -1,47 +0,0 @@
|
||||
Ext.define('PVE.panel.HA', {
|
||||
extend: 'PVE.panel.SubConfig',
|
||||
alias: 'widget.pveHAPanel',
|
||||
|
||||
configPrefix: 'ha',
|
||||
|
||||
initComponent: function() {
|
||||
/*jslint confusion: true */
|
||||
var me = this;
|
||||
|
||||
var items = [
|
||||
{
|
||||
title: gettext('Status'),
|
||||
xtype: 'pveHAStatusView',
|
||||
itemId: 'status'
|
||||
},
|
||||
{
|
||||
title: gettext('Resources'),
|
||||
xtype: 'pveHAResourcesView',
|
||||
itemId: 'resources'
|
||||
},
|
||||
{
|
||||
title: gettext('Groups'),
|
||||
xtype: 'pveHAGroupsView',
|
||||
itemId: 'groups'
|
||||
},
|
||||
{
|
||||
title: gettext('Fencing'),
|
||||
xtype: 'pveFencingView',
|
||||
itemId: 'fencing'
|
||||
}
|
||||
];
|
||||
|
||||
Ext.apply(me, {
|
||||
defaults: {
|
||||
border: false,
|
||||
pveSelNode: me.pveSelNode
|
||||
},
|
||||
plugins: [{
|
||||
ptype: 'lazyitems',
|
||||
items: items
|
||||
}]
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
@ -1,100 +0,0 @@
|
||||
Ext.define('PVE.panel.Firewall', {
|
||||
extend: 'PVE.panel.SubConfig',
|
||||
alias: 'widget.pveFirewallPanel',
|
||||
|
||||
configPrefix: 'firewall',
|
||||
|
||||
fwtype: undefined, // 'dc', 'node' or 'vm'
|
||||
|
||||
base_url: undefined,
|
||||
|
||||
initComponent: function() {
|
||||
/*jslint confusion: true */
|
||||
var me = this;
|
||||
|
||||
if (!me.base_url) {
|
||||
throw "no base_url specified";
|
||||
}
|
||||
|
||||
if (!(me.fwtype === 'dc' || me.fwtype === 'node' || me.fwtype === 'vm')) {
|
||||
throw "unknown firewall panel type";
|
||||
}
|
||||
|
||||
var list_refs_url = me.fwtype === 'vm' ? (me.base_url + '/refs') :
|
||||
'/cluster/firewall/refs';
|
||||
|
||||
var items = [
|
||||
{
|
||||
xtype: 'pveFirewallRules',
|
||||
title: gettext('Rules'),
|
||||
allow_iface: true,
|
||||
base_url: me.base_url + '/rules',
|
||||
list_refs_url: list_refs_url,
|
||||
itemId: 'rules'
|
||||
}
|
||||
];
|
||||
|
||||
if (me.fwtype === 'dc') {
|
||||
items.push({
|
||||
xtype: 'pveSecurityGroups',
|
||||
title: gettext('Security Group'),
|
||||
itemId: 'sg'
|
||||
});
|
||||
items.push({
|
||||
xtype: 'pveFirewallAliases',
|
||||
base_url: '/cluster/firewall/aliases',
|
||||
itemId: 'aliases'
|
||||
});
|
||||
items.push({
|
||||
xtype: 'pveIPSet',
|
||||
base_url: '/cluster/firewall/ipset',
|
||||
list_refs_url: list_refs_url,
|
||||
itemId: 'ipset'
|
||||
});
|
||||
}
|
||||
|
||||
if (me.fwtype === 'vm') {
|
||||
items.push({
|
||||
xtype: 'pveFirewallAliases',
|
||||
base_url: me.base_url + '/aliases',
|
||||
itemId: 'aliases'
|
||||
});
|
||||
items.push({
|
||||
xtype: 'pveIPSet',
|
||||
base_url: me.base_url + '/ipset',
|
||||
list_refs_url: list_refs_url,
|
||||
itemId: 'ipset'
|
||||
});
|
||||
}
|
||||
|
||||
items.push({
|
||||
xtype: 'pveFirewallOptions',
|
||||
title: gettext('Options'),
|
||||
base_url: me.base_url + '/options',
|
||||
fwtype: me.fwtype,
|
||||
itemId: 'options'
|
||||
});
|
||||
|
||||
if (me.fwtype !== 'dc') {
|
||||
items.push({
|
||||
title: gettext('Log'),
|
||||
itemId: 'fwlog',
|
||||
xtype: 'pveLogView',
|
||||
url: '/api2/extjs' + me.base_url + '/log'
|
||||
});
|
||||
}
|
||||
|
||||
Ext.apply(me, {
|
||||
defaults: {
|
||||
border: false,
|
||||
pveSelNode: me.pveSelNode
|
||||
},
|
||||
plugins: [{
|
||||
ptype: 'lazyitems',
|
||||
items: items
|
||||
}]
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
}
|
||||
});
|
@ -1,89 +0,0 @@
|
||||
Ext.define('PVE.panel.SubConfig', {
|
||||
extend: 'Ext.tab.Panel',
|
||||
alias: ['widget.pvePanelSubConfig'],
|
||||
|
||||
configPrefix: undefined,
|
||||
tabPosition: 'left',
|
||||
tabRotation: 0,
|
||||
savedTab: undefined,
|
||||
|
||||
getHState: function(itemId) {
|
||||
/*jslint confusion: true */
|
||||
var me = this;
|
||||
|
||||
if (!itemId) {
|
||||
if (me.getActiveTab() === undefined) {
|
||||
me.setActiveTab(0);
|
||||
}
|
||||
itemId = me.getActiveTab().itemId;
|
||||
}
|
||||
|
||||
var first = me.items.get(0);
|
||||
var ntab;
|
||||
|
||||
// Note: '' is alias for first tab.
|
||||
if (itemId === first.itemId) {
|
||||
ntab = me.configPrefix;
|
||||
} else {
|
||||
ntab = me.configPrefix + '-' + itemId;
|
||||
}
|
||||
|
||||
return { value: ntab };
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
var me = this;
|
||||
|
||||
if (!me.phstateid) {
|
||||
throw "no parent history state specified";
|
||||
}
|
||||
|
||||
var sp = Ext.state.Manager.getProvider();
|
||||
var state = sp.get(me.phstateid);
|
||||
|
||||
var hsregex = /^([^\-\s]+)-(\S+)?$/;
|
||||
|
||||
if (state && state.value) {
|
||||
var res = hsregex.exec(state.value);
|
||||
if (res && res[1] && res[2] && res[1] === me.configPrefix) {
|
||||
me.activeTab = res[2]; // if we have lazy items, this does nothing
|
||||
me.savedTab = res[2]; // so we save it here
|
||||
}
|
||||
}
|
||||
|
||||
Ext.apply(me, {
|
||||
listeners: {
|
||||
afterrender: function(tp) {
|
||||
// if we have lazy items,
|
||||
// we saved the tabname in savedTab
|
||||
if (me.activeTab === undefined && me.savedTab) {
|
||||
me.setActiveTab(me.savedTab);
|
||||
} else if (me.activeTab === undefined) {
|
||||
// if we have nothing else, we set 0 as active
|
||||
me.setActiveTab(0);
|
||||
}
|
||||
},
|
||||
tabchange: function(tp, newcard, oldcard) {
|
||||
var state = me.getHState(newcard.itemId);
|
||||
sp.set(me.phstateid, state);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
me.callParent();
|
||||
|
||||
var statechange = function(sp, key, state) {
|
||||
if ((key === me.phstateid) && state) {
|
||||
var first = me.items.get(0);
|
||||
var atab = me.getActiveTab().itemId;
|
||||
var res = hsregex.exec(state.value);
|
||||
var ntab = (res && res[1]) ? res[1] : first.itemId;
|
||||
if (ntab && (atab != ntab)) {
|
||||
me.setActiveTab(ntab);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
me.mon(sp, 'statechange', statechange);
|
||||
}
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user