Changeset 129


Ignore:
Timestamp:
06/07/05 15:31:15 (17 years ago)
Author:
bastiaans
Message:

web/templates/toga/cluster_extra.tpl:

  • Renamed link to joblist

web/addons/toga/templates/header.tpl:

  • Inclusion to archivelink template

web/addons/toga/index.php:

  • Misc cleanup
  • Setup skeleton for search

web/addons/toga/overview.php:

  • Fixed showhosts bugs

web/addons/toga/conf.php:

  • Cleanup
  • Added TARCHD option for if a archive is present

web/addons/toga/libtoga.php:

  • Don't use Ganglia's get_context, it messes stuff up
Location:
trunk/web
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/toga/conf.php

    r115 r129  
    11<?php
     2// Show hosts in a jobview by default?
     3//
     4$default_showhosts = 1;
    25
    36// Path to Ganglia's web frontend root
     
    1518
    1619// How to mark nodes with a job in clusterimage
    17 // allcpus when all cpu's are in use
    18 // singlecpu when less than all cpus are in use
    1920//
    20 //$JOB_NODE_MARKING_ALLCPUS = "J";
    21 //$JOB_NODE_MARKING_SINGLECPU = "j";
    2221$JOB_NODE_MARKING = "J";
    2322
     
    2726$DATA_SOURCE = '127.0.0.1:8649';
    2827
     28// Is there a jobarchive?
     29//
     30$TARCHD = 1;
     31
    2932?>
  • trunk/web/addons/toga/index.php

    r126 r129  
    3737        global $self, $filter, $cluster_url, $get_metric_string;
    3838        global $metrics, $reports, $m, $default_metric;
     39        global $default_refresh;
    3940
    4041        if( isset($default_metric) and !isset($m) )
     
    4647                        $metricname = "load_one";
    4748
    48         //$metricname = ($m) ? $m : $default_metric;
    49         //printf( "m = %s, metricname = %s, default_metric = %s\n", $m, $metricname, $default_metric );
    50         if ( $context == "control" && $controlroom < 0 )
    51                 $header = "header-nobanner";
    52         else
    53                 $header = "header";
     49        $header = "header";
    5450
    5551        # Maintain our path through the grid tree.
    5652        $me = $self . "@" . $grid[$self][AUTHORITY];
    5753
    58         if ($initgrid) {
    59                 $gridstack = array();
    60                 $gridstack[] = $me;
    61         } else if ($gridwalk=="fwd") {
     54        $gridstack = array();
     55        $gridstack[] = $me;
     56
     57        if ($gridwalk=="fwd") {
    6258                # push our info on gridstack, format is "name@url>name2@url".
    6359                if (end($gridstack) != $me) {
     
    9995
    10096        # The page to go to when "Get Fresh Data" is pressed.
    101         if (isset($page))
    102                 $tpl->assign("page",$page);
    103         else
    104                 $tpl->assign("page","./");
     97        $tpl->assign("page","./");
    10598
    10699        # Templated Logo image
     
    169162
    170163        if( array_key_exists( "id", $filter ) ) {
    171                 //$context_ranges[]="hour";
    172                 //$context_ranges[]="day";
    173                 //$context_ranges[]="week";
    174                 //$context_ranges[]="month";
    175                 //$context_ranges[]="year";
    176                 //if ($jobrange)
    177                 //      $context_ranges[]="job";
    178 
    179                 //$range_menu = "<B>Last</B>&nbsp;&nbsp;"
    180                 //      ."<SELECT NAME=\"r\" OnChange=\"toga_form.submit();\">\n";
    181                 //foreach ($context_ranges as $v) {
    182                 //      $url=rawurlencode($v);
    183         //              $range_menu .= "<OPTION VALUE=\"$url\" ";
    184         //              if ($v == $range)
    185         //                       $range_menu .= "SELECTED";
    186         //              $range_menu .= ">$v\n";
    187         //      }
    188         //      $range_menu .= "</SELECT>\n";
    189 
    190         //      $tpl->assign("range_menu", $range_menu);
    191 
    192                 //$metricname = $m;
    193164
    194165                if (is_array($context_metrics) ) {
     
    237208}
    238209
    239 function includeJobview() {
     210function includeSearchpage() {
    240211        global $tpl;
    241212
    242         $tpl->assignInclude( "main", "templates/jobview.tpl" );
     213        $tpl->assignInclude( "main", "templates/search.tpl" );
     214
     215}
     216
     217function includeSearchThumb() {
     218        global $tpl;
     219
     220        $tpl->assignInclude( "archive", "templates/inc_search.tpl" );
     221
    243222}
    244223
     
    249228}
    250229
    251 function makeJobview() {
    252 
    253 }
    254 
    255230$tpl = new TemplatePower( "templates/index.tpl" );
    256231
     
    262237
    263238                includeOverview();
    264                 break;
    265 
    266         //case "jobview":
    267 
    268         //      includeJobview();
    269         //      break;
     239                if( $TARCHD )
     240                        includeSearchThumb();
     241                break;
     242
     243        case "search":
     244
     245                includeSearchPage();
     246                break;
    270247
    271248        default:
     
    280257$title = "Torque Report";
    281258makeHeader();
     259$tpl->assign("cluster_url", rawurlencode($clustername) );
     260$tpl->assign("cluster", $clustername );
    282261
    283262switch( $view ) {
     
    289268                break;
    290269
    291         //case "jobview":
    292 
    293         //      makeJobview();
    294         //      break;
     270        case "search":
     271
     272                include "./search.php";
     273                makeSearchPage();
     274                break;
    295275
    296276        default:
  • trunk/web/addons/toga/libtoga.php

    r126 r129  
    6060chdir( $GANGLIA_PATH );
    6161
     62$context = 'cluster';
     63
    6264include_once "./conf.php";
    6365include_once "./functions.php";
    6466include_once "./ganglia.php";
    65 include_once "./get_context.php";
     67//include_once "./get_context.php";
    6668include_once "./get_ganglia.php";
    6769
     
    7678//
    7779global $context, $clustername, $reports;
     80
    7881//$clustername = $httpvars->getClusterName();
    79 //$context = 'cluster';
    80 
    8182
    8283global $default_metric;
  • trunk/web/addons/toga/overview.php

    r128 r129  
    77//$tpl->assign( "self", "./index.php" );
    88$tpl->assign( "clustername", $clustername );
     9
     10if( $TARCHD )
     11        $tpl->assign( "cluster_url", rawurlencode($clustername) );
    912
    1013$data_gatherer->parseXML();
     
    426429        global $sortorder, $sortby, $filter, $sh, $hc, $m;
    427430        global $cluster_url, $get_metric_string, $host_url, $metrics;
    428         global $start, $end, $reports, $gnodes;
     431        global $start, $end, $reports, $gnodes, $default_showhosts;
    429432
    430433        $metricname = $m;
     
    523526        $tpl->assignGlobal("f_jobs_nr", $f_jobs );
    524527
    525         if( array_key_exists( "id", $filter ) ) {
     528        if( array_key_exists( "id", $filter ) and $start_time ) {
    526529                $tpl->newBlock( "showhosts" );
    527530
     
    545548                $tpl->assign("cols_menu", $cols_menu);
    546549
    547                 if( $sh) $showhosts = $sh;
    548                 if( !$showhosts) $showhosts = 0;
     550                $showhosts = isset($sh) ? $sh : $default_showhosts;
     551                //if( !$showhosts) $showhosts = $default_showhosts;
    549552                $tpl->assign("checked$showhosts", "checked");
    550553
  • trunk/web/addons/toga/templates/header.tpl

    r126 r129  
    2929     <INPUT TYPE="SUBMIT" VALUE="Get Fresh Data">
    3030     </TD>
     31     <TD></TD>
    3132  </TR>
    3233  <TR>
    33      <TD COLSPAN="1">
     34     <TD COLSPAN=1>
    3435     {metric_menu} &nbsp;&nbsp;
    3536     {range_menu}&nbsp;&nbsp;
     
    3940      <B>{alt_view}</B>
    4041     </TD>
     42<!-- INCLUDE BLOCK : archive -->
    4143  </TR>
    4244  </TABLE>
  • trunk/web/templates/toga/cluster_extra.tpl

    r113 r129  
    33<tr>
    44 <td valign=center>
    5   <a href="./addons/toga/?c={cluster}"><b>Torque Job's</b></a>
     5  <a href="./addons/toga/?c={cluster}"><b>Joblist</b></a>
    66 </td>
    77</tr>
Note: See TracChangeset for help on using the changeset viewer.