[pve-devel] [PATCH manager 08/10] remove subconfigpanel related code

Dominik Csapak d.csapak at proxmox.com
Mon Aug 22 17:13:40 CEST 2016


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 at proxmox.com>
---
 www/manager6/Makefile                |   3 --
 www/manager6/ceph/Config.js          |  72 -------------------------
 www/manager6/ha/Config.js            |  47 ----------------
 www/manager6/panel/Firewall.js       | 100 -----------------------------------
 www/manager6/panel/SubConfigPanel.js |  89 -------------------------------
 5 files changed, 311 deletions(-)
 delete mode 100644 www/manager6/ha/Config.js
 delete mode 100644 www/manager6/panel/Firewall.js
 delete mode 100644 www/manager6/panel/SubConfigPanel.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 7f6c60d..41c564f 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -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				\
diff --git a/www/manager6/ceph/Config.js b/www/manager6/ceph/Config.js
index 372c9cf..87a87c9 100644
--- a/www/manager6/ceph/Config.js
+++ b/www/manager6/ceph/Config.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();
-    }
-});
diff --git a/www/manager6/ha/Config.js b/www/manager6/ha/Config.js
deleted file mode 100644
index 3572527..0000000
--- a/www/manager6/ha/Config.js
+++ /dev/null
@@ -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();
-    }
-});
diff --git a/www/manager6/panel/Firewall.js b/www/manager6/panel/Firewall.js
deleted file mode 100644
index d37eb29..0000000
--- a/www/manager6/panel/Firewall.js
+++ /dev/null
@@ -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();
-    }
-});
diff --git a/www/manager6/panel/SubConfigPanel.js b/www/manager6/panel/SubConfigPanel.js
deleted file mode 100644
index 4c3b871..0000000
--- a/www/manager6/panel/SubConfigPanel.js
+++ /dev/null
@@ -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);
-    }
-});
-- 
2.1.4





More information about the pve-devel mailing list