Ignore:
Timestamp:
07/13/08 17:50:40 (16 years ago)
Author:
ramonb
Message:

job_monarch/overview.php:

job_monarch/libtoga.php:

job_monarch/js/jobgrid.js:

job_monarch/jobstore.php:

  • use session

job_monarch/templates/header.tpl:

job_monarch/image.php:

Location:
trunk/web2/addons/job_monarch
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/web2/addons/job_monarch/image.php

    r532 r549  
    5353$httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET );
    5454$view = $httpvars->getHttpVar( "view" );
     55$host = $httpvars->getHttpVar( "host" );
    5556$clustername = $httpvars->getClusterName();
    5657
    57 //printf("clustername = %s\n", $clustername );
    5858if( isset($id) && ($id!='')) $filter[id]=$id;
    5959if( isset($state) && ($state!='')) $filter[state]=$state;
    6060if( isset($user) && ($user!='')) $filter[user]=$user;
    6161if( isset($queue) && ($queue!='')) $filter[queue]=$queue;
     62if( isset($host) && ($host!='')) $filter[host]=$host;
     63//printf("host = %s\n", $filter[host] );
    6264
    6365function drawHostImage() {
     
    127129                                        $ic->setFilter( 'status', $filtervalue);
    128130                                        break;
     131                                case "host":
     132                                        $ic->setFilter( 'host', $filtervalue);
     133                                        break;
    129134                                default:
    130135                                        break;
  • trunk/web2/addons/job_monarch/jobstore.php

    r543 r549  
    4242$ds             = new DataSource();
    4343$myxml_data     = &$ds->getData();
     44
     45session_start();
     46unset( $_SESSION["data"] );
     47$_SESSION["data"]       = &$myxml_data;
    4448
    4549global $jobs;
  • trunk/web2/addons/job_monarch/js/jobgrid.js

    r547 r549  
    66var myfilters = { };
    77var myparams = { };
     8var ClusterImageArgs = { };
    89
    910var filterfields = [ "jid", "queue", "name", "owner" ];
    1011
     12function makeArrayURL( somearr )
     13{
     14  filter_url = '';
     15  filter_sep = '';
     16
     17  for( filtername in somearr )
     18  {
     19    filter_url = filter_url + filter_sep + filtername + '=' + somearr[filtername];
     20    filter_sep = '&';
     21  }
     22
     23  return filter_url;
     24}
     25
     26
     27function isset( somevar )
     28{
     29  try
     30  {
     31    if( eval( somevar ) ) { }
     32  }
     33  catch( err )
     34  {
     35    return false;
     36  }
     37  return true;
     38}
     39
     40function inMyArray( arr, someval )
     41{
     42  for( arval in arr )
     43  {
     44    if( arval == someval )
     45    {
     46      return true;
     47    }
     48  }
     49  return false;
     50}
     51
     52function inMyArrayValues( arr, someval )
     53{
     54  for( arkey in arr )
     55  {
     56    if( arr[arkey] == someval )
     57    {
     58      return true;
     59    }
     60  }
     61  return false;
     62}
     63
     64function inMyArrayKeys( arr, someval )
     65{
     66  for( arkey in arr )
     67  {
     68    if( arkey == someval )
     69    {
     70      return true;
     71    }
     72  }
     73  return false;
     74}
     75
     76function joinMyArray( arr1, arr2 )
     77{
     78  for( arkey in arr2 )
     79  {
     80    arr1[arkey] = arr2[arkey];
     81  }
     82
     83  return arr1;
     84}
     85
    1186function ClusterImageSelectHost( somehost )
    1287{
    13  // reload clusterimage with somehost as arg
    14 }
    15 
    16 function isset( somevar )
    17 {
    18   try
    19   {
    20     if( eval( somevar ) ) { }
    21   }
    22   catch( err )
    23   {
    24     return false;
    25   }
    26   return true;
    27 }
    28 
    29 function inMyArray( arr, someval )
    30 {
    31   for( arval in arr )
    32   {
    33     if( arval == someval )
    34     {
    35       return true;
    36     }
    37   }
     88
     89  if( !inMyArrayKeys( myfilters, 'host' ) )
     90  {
     91    myfilters['host'] = somehost;
     92  }
     93  else
     94  {
     95    delete myfilters['host'];
     96  }
     97
     98  ClusterImageArgs['view'] = 'big-clusterimage';
     99
     100  filt_url = makeArrayURL( myfilters );
     101  imag_url = makeArrayURL( ClusterImageArgs );
     102
     103  document.getElementById( 'clusterimage' ).src = './image.php?' + filt_url + '&' + imag_url;
     104
    38105  return false;
    39 }
    40 
    41 function inMyArrayValues( arr, someval )
    42 {
    43   for( arkey in arr )
    44   {
    45     if( arr[arkey] == someval )
    46     {
    47       return true;
    48     }
    49   }
    50   return false;
    51 }
    52 
    53 function inMyArrayKeys( arr, someval )
    54 {
    55   for( arkey in arr )
    56   {
    57     if( arkey == someval )
    58     {
    59       return true;
    60     }
    61   }
    62   return false;
    63 }
    64 
    65 function joinMyArray( arr1, arr2 )
    66 {
    67   for( arkey in arr2 )
    68   {
    69     arr1[arkey] = arr2[arkey];
    70   }
    71 
    72   return arr1;
    73106}
    74107
  • trunk/web2/addons/job_monarch/libtoga.php

    r548 r549  
    13651365                                                                        $addhost = 0;
    13661366                                                                }
    1367                                                                 else if( $filtername != 'jobid' )
     1367                                                                if( $filtername == 'host' && $hostname != $filtervalue )
     1368                                                                {
     1369                                                                        $addhost = 0;
     1370                                                                }
     1371                                                                if( $filtername != 'jobid' && $filtername != 'host' )
    13681372                                                                {
    13691373                                                                        if( $jobs[$myjob][$filtername] != $filtervalue )
  • trunk/web2/addons/job_monarch/overview.php

    r547 r549  
    7676        $ic->draw();
    7777
     78        $tpl->assign( "session_name", session_name() );
     79        $tpl->assign( "session_id", session_id() );
    7880        $tpl->assign( "clusterimage", "./image.php?". session_name() . "=" . session_id() ."&c=".rawurlencode($clustername)."&view=big-clusterimage".$filter_image_url );
    7981
  • trunk/web2/addons/job_monarch/templates/header.tpl

    r547 r549  
    2323        params = newparams;
    2424    });
    25   ClusterImageWindow.html = '<IMG SRC="{clusterimage}" USEMAP="#MONARCH_CLUSTER_BIG" BORDER="0">';
     25  ClusterImageArgs['{session_name}'] = '{session_id}';
     26  ClusterImageArgs['c'] = '{cluster}';
     27  ClusterImageWindow.html = '<IMG ID="clusterimage" SRC="{clusterimage}" USEMAP="#MONARCH_CLUSTER_BIG" BORDER="0">';
    2628  ClusterImageWindow.height = '{clusterimage_height}';
    2729  ClusterImageWindow.width = '{clusterimage_width}';
Note: See TracChangeset for help on using the changeset viewer.