Index: /trunk/web/addons/toga/image.php
===================================================================
--- /trunk/web/addons/toga/image.php	(revision 123)
+++ /trunk/web/addons/toga/image.php	(revision 124)
@@ -10,8 +10,8 @@
 $clustername = $httpvars->getClusterName();
 
-if( isset($id) && ($id!='')) $filter = 'id';
-else if( isset($state) && ($state!='')) $filter='state';
-else if( isset($user) && ($user!='')) $filter='user';
-else if( isset($queue) && ($queue!='')) $filter='queue';
+if( isset($id) && ($id!='')) $filter[id]=$id;
+if( isset($state) && ($state!='')) $filter[state]=$state;
+if( isset($user) && ($user!='')) $filter[user]=$user;
+if( isset($queue) && ($queue!='')) $filter[queue]=$queue;
 
 function drawSmallClusterImage() {
@@ -23,20 +23,26 @@
 function drawBigClusterImage() {
 
-	global $filter, $queue, $id, $user;
+	global $filter;
 
 	$ic = new ClusterImage( $clustername );
-	switch( $filter ) {
+	foreach( $filter as $filtername=>$filtervalue ) {
+		//printf("filter %s,%s\n", $filtername, $filtervalue);
+		switch( $filtername ) {
 
-		case "id":
-			$ic->setFilter( 'jobid', $id );
-			break;
-		case "user":
-			$ic->setFilter( 'owner', $user);
-			break;
-		case "queue":
-			$ic->setFilter( 'queue', $queue);
-			break;
-		default:
-			break;
+			case "id":
+				$ic->setFilter( 'jobid', $filtervalue );
+				break;
+			case "user":
+				$ic->setFilter( 'owner', $filtervalue);
+				break;
+			case "queue":
+				$ic->setFilter( 'queue', $filtervalue);
+				break;
+			case "state":
+				$ic->setFilter( 'status', $filtervalue);
+				break;
+			default:
+				break;
+		}
 	}
 	$ic->draw();
Index: /trunk/web/addons/toga/index.php
===================================================================
--- /trunk/web/addons/toga/index.php	(revision 123)
+++ /trunk/web/addons/toga/index.php	(revision 124)
@@ -24,8 +24,8 @@
 if( !isset($sortorder) ) $sortorder = "asc";
 if( !isset($sortby) ) $sortby = "id";
-if( isset($id) && ($id!='')) $filter[id]=$id;
+if( isset($queue) && ($queue!='')) $filter[queue]=$queue;
 if( isset($state) && ($state!='')) $filter[state]=$state;
 if( isset($user) && ($user!='')) $filter[user]=$user;
-if( isset($queue) && ($queue!='')) $filter[queue]=$queue;
+if( isset($id) && ($id!='')) $filter[id]=$id;
 
 function makeHeader() {
Index: /trunk/web/addons/toga/libtoga.php
===================================================================
--- /trunk/web/addons/toga/libtoga.php	(revision 123)
+++ /trunk/web/addons/toga/libtoga.php	(revision 124)
@@ -156,4 +156,9 @@
 	}
 
+	function getCpus() {
+		$handler = $this->xmlhandler;
+		return $handler->getCpus();
+	}
+
 	function getJobs() {
 		$handler = $this->xmlhandler;
@@ -176,4 +181,18 @@
 		$nodes = array();
 		$heartbeat = array();
+	}
+
+	function getCpus() {
+
+		$cpus = 0;
+
+		foreach( $this->jobs as $jobid=>$jobattrs ) {
+
+			$nodes = count( $jobattrs[nodes] );
+			$ppn = (int) $jobattrs[ppn] ? $jobattrs[ppn] : 1;
+			$mycpus = $nodes * $ppn;
+
+			$cpus = $cpus + $mycpus;
+		}
 	}
 
@@ -485,5 +504,5 @@
 
 	var $dataget, $image, $clustername;
-	var $filtername, $filtervalue;
+	var $filtername, $filters;
 
 	function ClusterImage( $clustername ) {
@@ -491,13 +510,13 @@
 		$this->dataget = new DataGatherer();
 		$this->clustername = $clustername;
-		$this->filtername = null;
-		$this->filtervalue = null;
+		$this->filters = array();
 	}
 
 	function setFilter( $filtername, $filtervalue ) {
 
+		//printf("filter %s = %s\n", $filtername, $filtervalue );
 		//printf( "filter set to %s = %s\n", $filtername, $filtervalue );
-		$this->filtername = $filtername;
-		$this->filtervalue = $filtervalue;
+		$this->filters[$filtername] = $filtervalue;
+		//print_r($this->filters);
 	}
 
@@ -508,15 +527,40 @@
 		foreach( $nodes as $node ) {
 
-			$mynjobs = $node->getJobs();
 			$hostname = $node->getHostname();
 
-			if( $this->filtername ) {
-				foreach( $mynjobs as $myjob )
-
-					if( $this->filtername == 'jobid' && $node->hasJob( $this->filtervalue) )
-						$filtered_nodes[] = $hostname;
-					else if( $jobs[$myjob][$this->filtername] == $this->filtervalue  && !in_array( $hostname, $filtered_nodes  ) )
-						$filtered_nodes[] = $hostname;
-			} else
+			$addhost = 1;
+
+			if( count( $this->filters ) > 0 ) {
+
+				$mynjobs = $node->getJobs();
+
+				if( count( $mynjobs ) > 0 ) {
+
+					foreach( $mynjobs as $myjob ) {
+
+						foreach( $this->filters as $filtername => $filtervalue ) {
+
+							//printf("filter bla %s = %s\n", $filtername,$filtervalue );
+
+							if( $filtername!=null && $filtername!='' ) {
+
+								if( $filtername == 'jobid' && !$node->hasJob( $filtervalue) ) {
+									$addhost = 0;
+									//printf("host %s has no job %s\n", $hostname, $filtervalue);
+								} else if( $filtername != 'jobid' ) {
+									//printf("myjob is %s\n", $myjob );
+									if( $jobs[$myjob][$filtername] != $filtervalue ) {
+										//printf("host %s has no job with %s=%s\n", $hostname, $filtername, $filtervalue);
+										$addhost = 0;
+									}
+								}
+							}
+						}
+					}
+				} else
+					$addhost = 0;
+			}
+
+			if( $addhost )
 				$filtered_nodes[] = $hostname;
 		}
@@ -526,4 +570,7 @@
 
 	function draw() {
+
+		//printf("stopt met uitvoer");
+		//return;
 
 		global $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH;
Index: /trunk/web/addons/toga/overview.php
===================================================================
--- /trunk/web/addons/toga/overview.php	(revision 123)
+++ /trunk/web/addons/toga/overview.php	(revision 124)
@@ -12,4 +12,5 @@
 $jobs = $data_gatherer->getJobs();
 $nodes = $data_gatherer->getNodes();
+$cpus = $data_gatherer->getCpus();
 
 $filter_image_url = "";
@@ -22,7 +23,6 @@
 $tpl->assign( "clusterimage", "./image.php?c=".rawurlencode($clustername)."&view=big-clusterimage".$filter_image_url );
 
-$tpl->assign("heartbeat", makeDate( $heartbeat ) );
-
-$pie = drawPie();
+
+$pie = drawClusterPie();
 $tpl->assign("pie", $pie );
 
@@ -170,9 +170,11 @@
 }
 
-function drawPie() {
+
+
+function drawClusterPie() {
 
 	global $jobs, $nodes;
 
-	$pie_args = "title=" . rawurlencode("Cluster Jobload");
+	$pie_args = "title=" . rawurlencode("Cluster queue usage");
 	$pie_args .= "&size=250x150";
 
@@ -333,28 +335,39 @@
 	$even = 1;
 
+	$overview_jobs = count( $sorted_jobs );
+	$overview_nodes = count( $nodes );
+	$overview_cpus = 0;
+
+	$f_cpus = 0;
+	$f_jobs = 0;
+
 	foreach( $sorted_jobs as $jobid => $sortdec ) {
 
 		$report_time = $jobs[$jobid][reported];
 
+		$nodes = count( $jobs[$jobid][nodes] );
+		$ppn = (int) $jobs[$jobid][ppn] ? $jobs[$jobid][ppn] : 1;
+		$cpus = $nodes * $ppn;
+
+		$overview_cpus = $overview_cpus + $cpus;
+
 		if( $report_time == $heartbeat ) {
 
-			if( count( $filter ) == 0 )
-				$display_job = 1;
-			else
-				$display_job = 0;
+			$display_job = 1;
 
 			foreach( $filter as $filtername=>$filtervalue ) {
 
-				if( $filtername == 'id' && $jobid == $filtervalue )
-					$display_job = 1;
-				else if( $filtername == 'state' && $jobs[$jobid][status] == $filtervalue )
-					$display_job = 1;
-				else if( $filtername == 'queue' && $jobs[$jobid][queue] == $filtervalue )
-					$display_job = 1;
-				else if( $filtername == 'user' && $jobs[$jobid][owner] == $filtervalue )
-					$display_job = 1;
+				if( $filtername == 'id' && $jobid != $filtervalue )
+					$display_job = 0;
+				else if( $filtername == 'state' && $jobs[$jobid][status] != $filtervalue )
+					$display_job = 0;
+				else if( $filtername == 'queue' && $jobs[$jobid][queue] != $filtervalue )
+					$display_job = 0;
+				else if( $filtername == 'user' && $jobs[$jobid][owner] != $filtervalue )
+					$display_job = 0;
 			}
 
 			if( $display_job ) {
+
 
 				$tpl->newBlock("node");
@@ -374,4 +387,7 @@
 				$start_time = (int) $jobs[$jobid][start_timestamp];
 
+				$f_cpus = $f_cpus + $cpus;
+				$f_jobs++;
+
 				if( $even ) {
 
@@ -393,4 +409,12 @@
 		}
 	}
+
+	$tpl->assignGlobal("cpus_nr", $overview_cpus );
+	$tpl->assignGlobal("jobs_nr", $overview_jobs );
+	$tpl->assignGlobal("nodes_nr", $overview_nodes );
+	$tpl->assignGlobal("report_time", makeDate( $heartbeat));
+	
+	$tpl->assignGlobal("f_cpus_nr", $f_cpus );
+	$tpl->assignGlobal("f_jobs_nr", $f_jobs );
 }
 ?>
Index: /trunk/web/addons/toga/templates/overview.tpl
===================================================================
--- /trunk/web/addons/toga/templates/overview.tpl	(revision 123)
+++ /trunk/web/addons/toga/templates/overview.tpl	(revision 124)
@@ -6,5 +6,6 @@
   <TD ALIGN="CENTER">
     <IMG SRC="{clusterimage}"><BR>
-    reported: {heartbeat}
+    {nodes_nr} nodes total: {jobs_nr} jobs with {cpus_nr} CPU's (at {report_time}).<BR>
+    current view: {f_jobs_nr} jobs with {f_cpus_nr} CPU's{lag_msg}.
   </TD>
   <TD ALIGN="CENTER">
@@ -37,8 +38,8 @@
 	function setFilter( filtername, filterval ) {
 
-		document.toga_form.id.value = '';
-		document.toga_form.queue.value = '';
-		document.toga_form.state.value = '';
-		document.toga_form.user.value = '';
+		//document.toga_form.id.value = '';
+		//document.toga_form.queue.value = '';
+		//document.toga_form.state.value = '';
+		//document.toga_form.user.value = '';
 
 		if( document.toga_form.elements[filtername] ) {
@@ -55,8 +56,8 @@
 <INPUT TYPE="HIDDEN" NAME="sortorder" VALUE="{sortorder}">
 <INPUT TYPE="HIDDEN" NAME="c" VALUE="{clustername}">
-<INPUT TYPE="HIDDEN" NAME="id" VALUE="{f_id}">
 <INPUT TYPE="HIDDEN" NAME="queue" VALUE="{f_queue}">
 <INPUT TYPE="HIDDEN" NAME="state" VALUE="{f_state}">
 <INPUT TYPE="HIDDEN" NAME="user" VALUE="{f_user}">
+<INPUT TYPE="HIDDEN" NAME="id" VALUE="{f_id}">
 
 </FORM>
@@ -69,6 +70,6 @@
 <TH><B><A HREF="#" onClick="setSort( 'queue' )">Queue</A></B></TH>
 <TH><B><A HREF="#" onClick="setSort( 'name' )">Name</A></B></TH>
-<TH><B><A HREF="#" onClick="setSort( 'req_cpu' )">Requested CPU</A></B></TH>
-<TH><B><A HREF="#" onClick="setSort( 'req_mem' )">Requested Memory</A></B></TH>
+<TH><B><A HREF="#" onClick="setSort( 'req_cpu' )">Req. CPU time</A></B></TH>
+<TH><B><A HREF="#" onClick="setSort( 'req_mem' )">Req. Memory</A></B></TH>
 <TH><B><A HREF="#" onClick="setSort( 'nodes' )">Nodes</A>/<A HREF="#" onClick="setSort( 'cpus' )">Cpus</A></B></TH>
 <TH><B><A HREF="#" onClick="setSort( 'start' )">Started</A></B></TH>
