Changeset 406


Ignore:
Timestamp:
07/05/07 17:49:25 (14 years ago)
Author:
bastiaans
Message:

web/addons/job_monarch/index.php:

  • moved (duplicate) makeHeader when overview
  • fix for metrics compilation list

web/addons/job_monarch/overview.php:

  • added makeHeader call
Location:
trunk/web/addons/job_monarch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/job_monarch/index.php

    r399 r406  
    9292}
    9393
    94 function makeHeader( $page_call ) {
     94function makeHeader( $page_call, $title, $longtitle ) {
    9595
    9696        global $tpl, $grid, $context, $initgrid;
    97         global $jobrange, $jobstart, $title, $longtitle;
     97        global $jobrange, $jobstart;
    9898        global $page, $gridwalk, $clustername;
    9999        global $parentgrid, $physical, $hostname;
     
    154154                exit;
    155155        }
     156        $tpl->gotoBlock( "_ROOT" );
    156157
    157158        if( $view != "search" )
     
    159160
    160161        $tpl->assign( "date", date("r") );
     162        //printf("lg %s\n", $longtitle );
     163        //printf("title %s\n", $title );
    161164        $tpl->assign( "longpage_title", $longtitle );
    162165        $tpl->assign( "page_title", $title );
     
    207210
    208211        if (!count($metrics)) {
    209                 echo "<h4>Cannot find any metrics for selected cluster \"$clustername\", exiting.</h4>\n";       echo "Check ganglia XML tree (telnet $ganglia_ip $ganglia_port)\n";
     212                echo "<h4>Cannot find any metrics for selected cluster \"$clustername\", exiting.</h4>\n";
     213                echo "Check ganglia XML tree (telnet $ganglia_ip $ganglia_port)\n";
    210214                exit;
    211215        }
     216        reset($metrics);
    212217        $firsthost = key($metrics);
    213         foreach ($metrics[$firsthost] as $m => $foo)
    214                 $context_metrics[] = $m;
    215 
    216         foreach ($reports as $r => $foo)
    217                 $context_metrics[] = $r;
     218
     219        $mmfh   = array();
     220
     221        $mmfh   = $metrics[$firsthost];
     222
     223        $context_metrics        = array();
     224
     225        //foreach ($mmfh as $mm => $mfoo)
     226        foreach( $mmfh as $mm => $bla )
     227        {
     228                $context_metrics[] = $mm;
     229        }
     230
     231        foreach ($reports as $mr => $mfoo)
     232                $context_metrics[] = $mr;
    218233
    219234        $node_menu .= "<B><A HREF=\"./?c=".rawurlencode($clustername)."\">Joblist</A></B> ";
     
    329344        }
    330345
    331         if( $JOB_ARCHIVE && $page_call == 'index' ) {
     346        if( $JOB_ARCHIVE && $page_call == 'overview' ) {
    332347                $tpl->newBlock( "search" );
    333348                $tpl->assignGlobal( "cluster_url", rawurlencode($clustername) );
     
    420435$longtitle = "Batch Report :: Powered by Job Monarch!";
    421436$title = "Batch Report";
    422 makeHeader( 'index' );
     437//makeHeader( 'index' );
    423438$tpl->assign("cluster_url", rawurlencode($clustername) );
    424439$tpl->assign("cluster", $clustername );
  • trunk/web/addons/job_monarch/overview.php

    r402 r406  
    2525global $GANGLIA_PATH, $clustername, $tpl, $filter, $cluster, $get_metric_string, $cluster_url, $sh;
    2626global $hosts_up, $m, $start, $end, $filterorder, $COLUMN_REQUESTED_MEMORY, $COLUMN_QUEUED, $COLUMN_NODES, $hostname, $piefilter;
     27global $longtitle, $title;
    2728
    2829$tpl->assign( "clustername", $clustername );
     
    6263        session_start();
    6364
     65        unset( $_SESSION["data"] );
    6466        $_SESSION["data"]       = &$myxml_data;
    6567
     
    565567        $last_displayed_job     = null;
    566568
     569        foreach( $metrics as $bhost => $bmetric )
     570        {
     571                foreach( $bmetric as $mname => $mval )
     572                {
     573                        if( ( $mname == 'MONARCH-RJ' ) || ($mname == 'MONARCH-QJ') )
     574                        {
     575                                $rjqj_host      = $bhost;
     576                        }
     577                }
     578        }
     579        //$rjqj_str =  "<IMG SRC=\"../../graph.php?z=small&c=$cluster_url&h=$rjqj_host&m=MONARCH-QJ&r=job&jr=$jobrange&js=$jobstart\">";
     580        //printf( $rjqj_str, '' );
     581
    567582        foreach( $sorted_jobs as $jobid => $sortdec )
    568583        {
     
    869884        }
    870885
    871         makeHeader( 'overview' );
     886        //print_r( $metrics );
     887
     888        global $longtitle, $title;
     889
     890        $longtitle = "Batch Report :: Powered by Job Monarch!";
     891        $title = "Batch Report";
     892
     893        makeHeader( 'overview', $title, $longtitle );
    872894
    873895        setupFilterSettings();
Note: See TracChangeset for help on using the changeset viewer.