[pve-devel] r6359 - in pve-manager/pve2: . www/css www/images www/manager www/manager/data www/manager/grid www/manager/tree

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Jul 25 13:47:49 CEST 2011


Author: dietmar
Date: 2011-07-25 13:47:49 +0200 (Mon, 25 Jul 2011)
New Revision: 6359

Added:
   pve-manager/pve2/www/images/computer-on.png
Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/www/css/ext-pve.css
   pve-manager/pve2/www/images/Makefile.am
   pve-manager/pve2/www/manager/Utils.js
   pve-manager/pve2/www/manager/data/ResourceStore.js
   pve-manager/pve2/www/manager/grid/ResourceGrid.js
   pve-manager/pve2/www/manager/tree/ResourceTree.js
Log:
use other icon for running VMs


Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-07-25 05:33:28 UTC (rev 6358)
+++ pve-manager/pve2/ChangeLog	2011-07-25 11:47:49 UTC (rev 6359)
@@ -1,3 +1,11 @@
+2011-07-25  Proxmox Support Team  <support at proxmox.com>
+
+	* www/manager/tree/ResourceTree.js (addChildSorted): use other
+	icon for running VMs.
+
+	* www/manager/Utils.js (render_resource_type): use other icon for
+	running VMs.
+
 2011-07-22  Proxmox Support Team  <support at proxmox.com>
 
 	* www/manager/storage/NFSEdit.js: impl. PVE.storage.NFSScan

Modified: pve-manager/pve2/www/css/ext-pve.css
===================================================================
--- pve-manager/pve2/www/css/ext-pve.css	2011-07-25 05:33:28 UTC (rev 6358)
+++ pve-manager/pve2/www/css/ext-pve.css	2011-07-25 11:47:49 UTC (rev 6359)
@@ -21,7 +21,9 @@
 .pve-itype-icon-keyboard,
 .pve-itype-icon-cdrom,
 .pve-itype-icon-qemu,
+.pve-itype-icon-qemu-running,
 .pve-itype-icon-openvz,
+.pve-itype-icon-openvz-running,
 .pve-itype-icon-node,
 .pve-itype-icon-storage,
 .pve-itype-icon-itype
@@ -39,6 +41,14 @@
     background-image:url(../images/computer.png);
 }
 
+.pve-itype-icon-qemu-running,
+.pve-itype-icon-openvz-running,
+.x-tree-node-computer-running,
+.x-grid-tree-node-expanded .x-tree-node-computer-running
+{
+    background-image:url(../images/computer-on.png);
+}
+
 .pve-itype-icon-node,
 .x-tree-node-server,
 .x-grid-tree-node-expanded .x-tree-node-server

Modified: pve-manager/pve2/www/images/Makefile.am
===================================================================
--- pve-manager/pve2/www/images/Makefile.am	2011-07-25 05:33:28 UTC (rev 6358)
+++ pve-manager/pve2/www/images/Makefile.am	2011-07-25 11:47:49 UTC (rev 6359)
@@ -10,6 +10,7 @@
 	computer.png
 
 images_DATA = ${GNOME_IMAGES}	\
+	computer-on.png		\
 	memory.png		\
 	processor.png		\
 	proxmox_logo.png	\

Added: pve-manager/pve2/www/images/computer-on.png
===================================================================
(Binary files differ)


Property changes on: pve-manager/pve2/www/images/computer-on.png
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Modified: pve-manager/pve2/www/manager/Utils.js
===================================================================
--- pve-manager/pve2/www/manager/Utils.js	2011-07-25 05:33:28 UTC (rev 6358)
+++ pve-manager/pve2/www/manager/Utils.js	2011-07-25 11:47:49 UTC (rev 6359)
@@ -593,7 +593,13 @@
     render_resource_type: function(value, metaData, record, rowIndex, colIndex, store) {
 
 	var cls = 'pve-itype-icon-' + value;
-	metaData.tdCls = cls;
+
+	if (record.data.running) {
+	    metaData.tdCls = cls + "-running";
+	} else {
+	    metaData.tdCls = cls;
+	}
+
 	return value;
     },
 

Modified: pve-manager/pve2/www/manager/data/ResourceStore.js
===================================================================
--- pve-manager/pve2/www/manager/data/ResourceStore.js	2011-07-25 05:33:28 UTC (rev 6358)
+++ pve-manager/pve2/www/manager/data/ResourceStore.js	2011-07-25 11:47:49 UTC (rev 6359)
@@ -44,6 +44,18 @@
 		sortable: true,
 		width: 80
 	    },
+	    running: {
+		type: 'boolean',
+		hidden: true,
+		convert: function(value, record) {
+		    var info = record.data;
+		    if (info.type === 'qemu' || info.type === 'openvz') {
+			return (Ext.isNumeric(info.uptime) && (info.uptime > 0));
+		    } else {
+			return false;
+		    }
+		}
+	    },
 	    text: {
 		header: 'Text',
 		type: 'text',
@@ -158,7 +170,7 @@
 	    if (!Ext.isDefined(value.convert)) {
 		fields.push({name: key, type: value.type});
 		fieldNames.push(key);
-	    } else if (key === 'text') { 
+	    } else if (key === 'text' || key === 'running') { 
 		fields.push({name: key, type: value.type, convert: value.convert});
 		fieldNames.push(key);
 	    }		
@@ -189,7 +201,6 @@
 		    var fi = Ext.apply({ dataIndex: field }, info);
 		    res.push(fi);
 		});
-
 		return res;
 	    },
 	    fieldNames: fieldNames

Modified: pve-manager/pve2/www/manager/grid/ResourceGrid.js
===================================================================
--- pve-manager/pve2/www/manager/grid/ResourceGrid.js	2011-07-25 05:33:28 UTC (rev 6358)
+++ pve-manager/pve2/www/manager/grid/ResourceGrid.js	2011-07-25 11:47:49 UTC (rev 6359)
@@ -76,9 +76,14 @@
 
 	    var nodeidx = {};
 	    var gather_child_nodes = function(cn) {
-                var cs = cn.childNodes,
-		len = cs.length,
-                i = 0, n, res;
+		if (!cn) {
+		    return;
+		}
+                var cs = cn.childNodes;
+		if (!cs) {
+		    return;
+		}
+		var len = cs.length, i = 0, n, res;
 
                 for (; i < len; i++) {
 		    var child = cs[i];

Modified: pve-manager/pve2/www/manager/tree/ResourceTree.js
===================================================================
--- pve-manager/pve2/www/manager/tree/ResourceTree.js	2011-07-25 05:33:28 UTC (rev 6358)
+++ pve-manager/pve2/www/manager/tree/ResourceTree.js	2011-07-25 11:47:49 UTC (rev 6359)
@@ -87,8 +87,13 @@
 
 	var defaults = PVE.tree.ResourceTree.typeDefaults[info.type];
 	if (defaults && defaults.iconCls) {
-	    info.iconCls = defaults.iconCls;
+	    if (info.running) {
+		info.iconCls = defaults.iconCls + "-running";
+	    } else {
+		info.iconCls = defaults.iconCls;
+	    }
 	}
+
 	if (info.groupbyid) {
 	    info.text = info.groupbyid;	    
 	    if (info.type === 'type') {
@@ -225,8 +230,9 @@
 				break;
 			    }
 			}
-			if (item.data.text != olditem.data.text) {
-			    //console.log("changed text");
+			if ((item.data.text !== olditem.data.text) ||
+			    (item.data.running !== olditem.data.running)) {
+			    //console.log("changed text/running");
 			    changed = true;
 			}
 



More information about the pve-devel mailing list