Index: /trunk/web2/addons/job_monarch/image.php
===================================================================
--- /trunk/web2/addons/job_monarch/image.php (revision 548)
+++ /trunk/web2/addons/job_monarch/image.php (revision 549)
@@ -53,11 +53,13 @@
$httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET );
$view = $httpvars->getHttpVar( "view" );
+$host = $httpvars->getHttpVar( "host" );
$clustername = $httpvars->getClusterName();
-//printf("clustername = %s\n", $clustername );
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;
+if( isset($host) && ($host!='')) $filter[host]=$host;
+//printf("host = %s\n", $filter[host] );
function drawHostImage() {
@@ -127,4 +129,7 @@
$ic->setFilter( 'status', $filtervalue);
break;
+ case "host":
+ $ic->setFilter( 'host', $filtervalue);
+ break;
default:
break;
Index: /trunk/web2/addons/job_monarch/jobstore.php
===================================================================
--- /trunk/web2/addons/job_monarch/jobstore.php (revision 548)
+++ /trunk/web2/addons/job_monarch/jobstore.php (revision 549)
@@ -42,4 +42,8 @@
$ds = new DataSource();
$myxml_data = &$ds->getData();
+
+session_start();
+unset( $_SESSION["data"] );
+$_SESSION["data"] = &$myxml_data;
global $jobs;
Index: /trunk/web2/addons/job_monarch/js/jobgrid.js
===================================================================
--- /trunk/web2/addons/job_monarch/js/jobgrid.js (revision 548)
+++ /trunk/web2/addons/job_monarch/js/jobgrid.js (revision 549)
@@ -6,69 +6,102 @@
var myfilters = { };
var myparams = { };
+var ClusterImageArgs = { };
var filterfields = [ "jid", "queue", "name", "owner" ];
+function makeArrayURL( somearr )
+{
+ filter_url = '';
+ filter_sep = '';
+
+ for( filtername in somearr )
+ {
+ filter_url = filter_url + filter_sep + filtername + '=' + somearr[filtername];
+ filter_sep = '&';
+ }
+
+ return filter_url;
+}
+
+
+function isset( somevar )
+{
+ try
+ {
+ if( eval( somevar ) ) { }
+ }
+ catch( err )
+ {
+ return false;
+ }
+ return true;
+}
+
+function inMyArray( arr, someval )
+{
+ for( arval in arr )
+ {
+ if( arval == someval )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+function inMyArrayValues( arr, someval )
+{
+ for( arkey in arr )
+ {
+ if( arr[arkey] == someval )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+function inMyArrayKeys( arr, someval )
+{
+ for( arkey in arr )
+ {
+ if( arkey == someval )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+function joinMyArray( arr1, arr2 )
+{
+ for( arkey in arr2 )
+ {
+ arr1[arkey] = arr2[arkey];
+ }
+
+ return arr1;
+}
+
function ClusterImageSelectHost( somehost )
{
- // reload clusterimage with somehost as arg
-}
-
-function isset( somevar )
-{
- try
- {
- if( eval( somevar ) ) { }
- }
- catch( err )
- {
- return false;
- }
- return true;
-}
-
-function inMyArray( arr, someval )
-{
- for( arval in arr )
- {
- if( arval == someval )
- {
- return true;
- }
- }
+
+ if( !inMyArrayKeys( myfilters, 'host' ) )
+ {
+ myfilters['host'] = somehost;
+ }
+ else
+ {
+ delete myfilters['host'];
+ }
+
+ ClusterImageArgs['view'] = 'big-clusterimage';
+
+ filt_url = makeArrayURL( myfilters );
+ imag_url = makeArrayURL( ClusterImageArgs );
+
+ document.getElementById( 'clusterimage' ).src = './image.php?' + filt_url + '&' + imag_url;
+
return false;
-}
-
-function inMyArrayValues( arr, someval )
-{
- for( arkey in arr )
- {
- if( arr[arkey] == someval )
- {
- return true;
- }
- }
- return false;
-}
-
-function inMyArrayKeys( arr, someval )
-{
- for( arkey in arr )
- {
- if( arkey == someval )
- {
- return true;
- }
- }
- return false;
-}
-
-function joinMyArray( arr1, arr2 )
-{
- for( arkey in arr2 )
- {
- arr1[arkey] = arr2[arkey];
- }
-
- return arr1;
}
Index: /trunk/web2/addons/job_monarch/libtoga.php
===================================================================
--- /trunk/web2/addons/job_monarch/libtoga.php (revision 548)
+++ /trunk/web2/addons/job_monarch/libtoga.php (revision 549)
@@ -1365,5 +1365,9 @@
$addhost = 0;
}
- else if( $filtername != 'jobid' )
+ if( $filtername == 'host' && $hostname != $filtervalue )
+ {
+ $addhost = 0;
+ }
+ if( $filtername != 'jobid' && $filtername != 'host' )
{
if( $jobs[$myjob][$filtername] != $filtervalue )
Index: /trunk/web2/addons/job_monarch/overview.php
===================================================================
--- /trunk/web2/addons/job_monarch/overview.php (revision 548)
+++ /trunk/web2/addons/job_monarch/overview.php (revision 549)
@@ -76,4 +76,6 @@
$ic->draw();
+ $tpl->assign( "session_name", session_name() );
+ $tpl->assign( "session_id", session_id() );
$tpl->assign( "clusterimage", "./image.php?". session_name() . "=" . session_id() ."&c=".rawurlencode($clustername)."&view=big-clusterimage".$filter_image_url );
Index: /trunk/web2/addons/job_monarch/templates/header.tpl
===================================================================
--- /trunk/web2/addons/job_monarch/templates/header.tpl (revision 548)
+++ /trunk/web2/addons/job_monarch/templates/header.tpl (revision 549)
@@ -23,5 +23,7 @@
params = newparams;
});
- ClusterImageWindow.html = '';
+ ClusterImageArgs['{session_name}'] = '{session_id}';
+ ClusterImageArgs['c'] = '{cluster}';
+ ClusterImageWindow.html = '';
ClusterImageWindow.height = '{clusterimage_height}';
ClusterImageWindow.width = '{clusterimage_width}';