You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2012/03/15 15:55:02 UTC

svn commit: r1301020 - /incubator/vcl/trunk/web/js/dashboard.js

Author: jfthomps
Date: Thu Mar 15 14:55:01 2012
New Revision: 1301020

URL: http://svn.apache.org/viewvc?rev=1301020&view=rev
Log:
VCL-399
add a dashboard where admins can see current state of VCL system

modified updateDashboardCB to handle added section to see currently loading reservations
added updateNewReservations

Modified:
    incubator/vcl/trunk/web/js/dashboard.js

Modified: incubator/vcl/trunk/web/js/dashboard.js
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/dashboard.js?rev=1301020&r1=1301019&r2=1301020&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/dashboard.js (original)
+++ incubator/vcl/trunk/web/js/dashboard.js Thu Mar 15 14:55:01 2012
@@ -59,6 +59,8 @@ function updateDashboardCB(data, ioArgs)
 	updateTopFailedComputers(data.items.topfailedcomputers);
 	updateResChart(data.items.reschart);
 	updateBlockAllocation(data.items.blockallocation);
+	if(dojo.byId('newreservations'))
+		updateNewReservations(data.items.newreservations);
 	setTimeout(updateDashboard, 15000);
 }
 
@@ -205,6 +207,43 @@ function updateResChart(data) {
 	graph.render();
 }
 
+function updateNewReservations(data) {
+	var obj = dojo.byId('newreservations');
+	var txt = '<table>';
+	txt += '<tr>'
+	    +  '<th>Start</th>'
+	    +  '<th>ReqID</th>'
+	    +  '<th>Computer</th>'
+	    +  '<th>States</th>'
+	    +  '<th>Image</th>'
+	    +  '<th>Install Type</th>'
+	    +  '<th>Management Node</th>'
+	    +  '</tr>';
+	for(var i = 0; i < data.length; i++) {
+		if(i % 2)
+			txt += '<tr style=\"background-color: #D8D8D8;\">';
+		else
+			txt += '<tr style=\"background-color: #EEEEEE;\">';
+		txt += '<td style=\"padding: 1px; border-right: 1px solid;\">'
+		    + data[i].start
+		    + '</td><td style=\"padding: 1px; border-right: 1px solid;\">'
+		    + data[i].id
+		    + '</td><td style=\"padding: 1px; border-right: 1px solid;\">'
+		    + data[i].computer
+		    + '</td><td style=\"padding: 1px; border-right: 1px solid;\">'
+		    + data[i].state
+		    + '</td><td style=\"padding: 1px; border-right: 1px solid;\">'
+		    + data[i].image
+		    + '</td><td style=\"padding: 1px; border-right: 1px solid;\">'
+		    + data[i].installtype
+		    + '</td><td style=\"padding: 1px; border-right: 1px solid;\">'
+		    + data[i].managementnode
+		    + '</td></tr>';
+	}
+	txt += '</table>';
+	obj.innerHTML = txt;
+}
+
 function timestampToTime(val) {
 	if(! dijit.byId('reschart').chart.labeldata)
 		return '';