[pve-devel] r5971 - in pve-manager/pve2/www/new: . grid node qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Fri May 13 06:25:23 CEST 2011


Author: dietmar
Date: 2011-05-13 06:25:22 +0200 (Fri, 13 May 2011)
New Revision: 5971

Modified:
   pve-manager/pve2/www/new/PVEUtils.js
   pve-manager/pve2/www/new/grid/ObjectGrid.js
   pve-manager/pve2/www/new/node/Config.js
   pve-manager/pve2/www/new/qemu/HardwareView.js
Log:
add 'required' config


Modified: pve-manager/pve2/www/new/PVEUtils.js
===================================================================
--- pve-manager/pve2/www/new/PVEUtils.js	2011-05-12 11:58:25 UTC (rev 5970)
+++ pve-manager/pve2/www/new/PVEUtils.js	2011-05-13 04:25:22 UTC (rev 5971)
@@ -274,10 +274,6 @@
 	var cpu = value;
 	var maxcpu = record.data.maxcpu;
 
-	console.log("TEST1 " + cpu);
-	console.log("TEST2 " + maxcpu);
-	console.dir(record);
-
 	if (!record.data.uptime)
 	    return '';
 

Modified: pve-manager/pve2/www/new/grid/ObjectGrid.js
===================================================================
--- pve-manager/pve2/www/new/grid/ObjectGrid.js	2011-05-12 11:58:25 UTC (rev 5970)
+++ pve-manager/pve2/www/new/grid/ObjectGrid.js	2011-05-13 04:25:22 UTC (rev 5971)
@@ -26,6 +26,31 @@
 	    }
 	});
 
+	var cond_add_item = function(data, olditem) {
+	    if (olditem) {
+		olditem.beginEdit()
+		olditem.set('value', data.value);
+		olditem.endEdit(true);
+		olditem.commit(); 
+	    } else {
+		var newrec = Ext.ModelMgr.create(
+		    data, store.model, data.key);
+		store.add(newrec);
+	    }
+	};
+
+	if (rows) {
+	    Ext.Object.each(rows, function(key, rowdef) {
+		if (Ext.isDefined(rowdef.defaultValue)) {
+		    var data = { key: key, value: rowdef.defaultValue };
+		    cond_add_item(data);
+		} else if (rowdef.required) {
+		    var data = { key: key, value: undefined };
+		    cond_add_item(data);
+		}
+	    });
+	}
+
 	var first_load_done = false;
 
 	var loadtask;
@@ -64,19 +89,6 @@
 		    
 		    // add/update items
 
-		    var cond_add_item = function(data, olditem) {
-			if (olditem) {
-			    olditem.beginEdit()
-			    olditem.set('value', data.value);
-			    olditem.endEdit(true);
-			    olditem.commit(); 
-			} else {
-			    var newrec = Ext.ModelMgr.create(
-				data, store.model, data.key);
-			    store.add(newrec);
-			}
-		    };
-
 		    if (rows) {
 			Ext.Object.each(rows, function(key, rowdef) {
 			    var olditem = (store.snapshot || store.data).get(key);

Modified: pve-manager/pve2/www/new/node/Config.js
===================================================================
--- pve-manager/pve2/www/new/node/Config.js	2011-05-12 11:58:25 UTC (rev 5970)
+++ pve-manager/pve2/www/new/node/Config.js	2011-05-13 04:25:22 UTC (rev 5971)
@@ -26,16 +26,16 @@
 	};
 
 	var rows = {
-	    uptime: { header: 'Uptime', renderer: PVE.Utils.format_duration_long },
-	    loadavg: { header: 'Load average', renderer: render_loadavg },
-	    cpuinfo: { header: 'CPUs', renderer: render_cpuinfo },
-	    cpu: { header: 'CPU usage', renderer: render_cpu },
-	    wait: { header: 'IO delay', renderer: render_cpu },
-	    memory: { header: 'RAM usage', renderer: render_meminfo },
-	    swap: { header: 'SWAP usage', renderer: render_meminfo },
-	    rootfs: { header: 'HD space (root)', renderer: render_meminfo },
-	    pveversion: { header: 'PVE Manager version' },
-	    kversion: { header: 'Kernel version' }
+	    uptime: { header: 'Uptime', required: true, renderer: PVE.Utils.format_duration_long },
+	    loadavg: { header: 'Load average', required: true, renderer: render_loadavg },
+	    cpuinfo: { header: 'CPUs', required: true, renderer: render_cpuinfo },
+	    cpu: { header: 'CPU usage',required: true,  renderer: render_cpu },
+	    wait: { header: 'IO delay', required: true, renderer: render_cpu },
+	    memory: { header: 'RAM usage', required: true, renderer: render_meminfo },
+	    swap: { header: 'SWAP usage', required: true, renderer: render_meminfo },
+	    rootfs: { header: 'HD space (root)', required: true, renderer: render_meminfo },
+	    pveversion: { header: 'PVE Manager version', required: true,},
+	    kversion: { header: 'Kernel version', required: true,}
 	};
 
 
@@ -57,24 +57,10 @@
 
 	Ext.applyIf(me, {
 	    url: "/api2/json/nodes/" + me.nodename + "/status",
-	    height: 320,
+	    //height: 320,
+	    cwidth1: 150,
 	    interval: 1000,
-	    rows: rows,
-	    columns: [
-		{
-		    header: 'Type',
-		    width: 150,
-		    dataIndex: 'key',
-		    renderer: render_key
-		},
-		{
-		    flex: 1,
-		    header: 'Value',
-		    dataIndex: 'value',
-		    renderer: render_value
-		}
-
-	    ]
+	    rows: rows
 	});
 
 	me.callParent();

Modified: pve-manager/pve2/www/new/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/new/qemu/HardwareView.js	2011-05-12 11:58:25 UTC (rev 5970)
+++ pve-manager/pve2/www/new/qemu/HardwareView.js	2011-05-13 04:25:22 UTC (rev 5971)
@@ -92,7 +92,6 @@
 
 	Ext.applyIf(me, {
 	    url: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/config",
-	    cwidth1: 150,
 	    interval: 1000,
 	    tbar: [ 
 		{




More information about the pve-devel mailing list