[pve-devel] r5827 - in pve-manager/pve2/www/new: . panel tree

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Apr 19 12:10:24 CEST 2011


Author: dietmar
Date: 2011-04-19 12:10:24 +0200 (Tue, 19 Apr 2011)
New Revision: 5827

Added:
   pve-manager/pve2/www/new/panel/NodeConfig.js
Modified:
   pve-manager/pve2/www/new/Makefile.am
   pve-manager/pve2/www/new/Workspace.js
   pve-manager/pve2/www/new/panel/ConfigPanel.js
   pve-manager/pve2/www/new/tree/ResourceTree.js
Log:
start NodeConfig impl.


Modified: pve-manager/pve2/www/new/Makefile.am
===================================================================
--- pve-manager/pve2/www/new/Makefile.am	2011-04-19 09:17:33 UTC (rev 5826)
+++ pve-manager/pve2/www/new/Makefile.am	2011-04-19 10:10:24 UTC (rev 5827)
@@ -13,6 +13,7 @@
 	window/LoginWindow.js				\
 	grid/ResourceGrid.js				\
 	panel/ConfigPanel.js				\
+	panel/NodeConfig.js				\
 	tree/ResourceTree.js				\
 	Workspace.js
 

Modified: pve-manager/pve2/www/new/Workspace.js
===================================================================
--- pve-manager/pve2/www/new/Workspace.js	2011-04-19 09:17:33 UTC (rev 5826)
+++ pve-manager/pve2/www/new/Workspace.js	2011-04-19 10:10:24 UTC (rev 5827)
@@ -143,13 +143,21 @@
 		    split: true,
 		    selModel: new Ext.selection.TreeModel({
 			listeners: {
-			    select: function(sm, n) {		    
+			    select: function(sm, n) {
+				var tlckup = {
+				    node: 'pveNodeConfig'
+				};
+
 				var comp = { 
-				    xtype: 'pveConfigPanel',
+				    xtype: tlckup[n.data.type] || 'pveConfigPanel',
 				    layout: 'fit',
 				    border: false,
+				    showSearch: (n.data.id === 'root') ||
+					Ext.isDefined(n.data.groupbyid),
 				    pveSelNode: n 
 				};
+
+
 				self.setView(comp);
 			    }
 			}

Modified: pve-manager/pve2/www/new/panel/ConfigPanel.js
===================================================================
--- pve-manager/pve2/www/new/panel/ConfigPanel.js	2011-04-19 09:17:33 UTC (rev 5826)
+++ pve-manager/pve2/www/new/panel/ConfigPanel.js	2011-04-19 10:10:24 UTC (rev 5827)
@@ -15,29 +15,22 @@
 	var items = me.items || [];
 	me.items = null;
 
-	items.unshift({
-	    pveSelNode: me.pveSelNode,
-	    id: 'search',
-	    itemId: 'search', 
-	    border: false,
-	    xtype: 'pveResourceGrid'
+	Ext.applyIf(me, {
+	    title: me.pveSelNode.data.text,
+	    showSearch: true
 	});
 
-	items.push({
-	    border: false,
-	    itemId: 'tab1',
-	    title: "TAB1",
-	    html: "test1"	    
-	});
-	items.push({
-	    border: false,
-	    itemId: 'tab2',
-	    title: "TAB2",
-	    html: "test2"	    
-	});
+	if (me.showSearch) {
+	    items.unshift({
+		pveSelNode: me.pveSelNode,
+		id: 'search',
+		itemId: 'search', 
+		border: false,
+		xtype: 'pveResourceGrid'
+	    });
+	}
 
 	Ext.apply(me, {
-	    title: "NODE ID " + me.pveSelNode.data.id,
 	    listeners: {
 		tabchange: function() {
 		    var atab = me.getActiveTab().itemId;

Added: pve-manager/pve2/www/new/panel/NodeConfig.js
===================================================================
--- pve-manager/pve2/www/new/panel/NodeConfig.js	                        (rev 0)
+++ pve-manager/pve2/www/new/panel/NodeConfig.js	2011-04-19 10:10:24 UTC (rev 5827)
@@ -0,0 +1,58 @@
+Ext.define('PVE.panel.NodeConfig', {
+    extend: 'PVE.panel.ConfigPanel',
+    alias: 'widget.pveNodeConfig',
+
+    initComponent: function() {
+        var me = this;
+
+	var nodename = me.pveSelNode.data.node;
+	if (!nodename) 
+	    throw "no node name specified";
+
+	Ext.apply(me, {
+	    title: "Node '" + nodename + "'",
+	    items: [
+		{
+		    title: 'Summary',
+		    itemId: 'summary',
+		    //xtype: 'pveNodeSummaryView',
+		    html: 'summary'
+		},
+		{
+		    title: 'Services',
+		    itemId: 'services',
+		    //xtype: 'pveNodeServiceView',
+		    html: 'services'
+		},
+		{
+		    title: 'Network',
+		    id: 'network',
+		    html: 'network ' + nodename
+		},
+		{
+		    title: 'DNS',
+		    id: 'dns',
+		    //xtype: 'pveNodeDNSView',
+		    //nodename: nodename
+		    html: "DNS"
+		},
+		{
+		    title: 'Time',
+		    id: 'time',
+		    //xtype: 'pveNodeTimeView',
+		    //nodename: nodename
+		    html: "time"
+		},
+		{
+		    title: 'Tasks',
+		    id: 'tasks',
+		    //xtype: 'pveNodeTasks',
+		    //nodename: nodename
+		    html: "time"
+		}
+	    ]
+	});
+
+	me.callParent();
+   }
+});

Modified: pve-manager/pve2/www/new/tree/ResourceTree.js
===================================================================
--- pve-manager/pve2/www/new/tree/ResourceTree.js	2011-04-19 09:17:33 UTC (rev 5826)
+++ pve-manager/pve2/www/new/tree/ResourceTree.js	2011-04-19 10:10:24 UTC (rev 5827)
@@ -296,11 +296,17 @@
 		rootnode.collapse();
 		rootnode.removeAll(true);
 		pdata.dataIndex = {};
+		self.getSelectionModel().deselectAll();
 	    },
 	    applyState : function(state) {
 		if (state && state.value) {
 		    var rootnode = self.store.getRootNode();
-		    var node = rootnode.findChild('id', state.value, true);
+		    var node;
+		    if (state.value === 'root')
+			node = rootnode;
+		    else
+			node = rootnode.findChild('id', state.value, true);
+
 		    if (node) {
 			var sm = self.getSelectionModel();
 			if (!sm.isSelected(node)) {




More information about the pve-devel mailing list