Changeset 758


Ignore:
Timestamp:
03/27/13 18:47:17 (8 years ago)
Author:
ramonb
Message:

graph.php,
overview.php:

  • display range in title
  • removed RRDs column count: now done via css

templates/overview.tpl:

  • removed RRDs column count: now done via css

index.php:

  • dont show range selector if no show hosts
Location:
branches/0.4/web/addons/job_monarch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4/web/addons/job_monarch/graph.php

    r751 r758  
    5858$load_color = escapeshellcmd( rawurldecode( $_GET["l"] ));
    5959$vlabel = escapeshellcmd( rawurldecode( $_GET["vl"] ));
     60$j_title = escapeshellcmd( rawurldecode( $_GET["t"] ));
    6061
    6162$cluster = $c;
     
    440441}
    441442
    442 $title = "$hostname";
     443if ($graph == "job_report")
     444{
     445    $title = "Last: $j_title";
     446}
     447else
     448{
     449    $title = "$hostname";
     450}
    443451
    444452function determineXGrid( $p_start, $p_stop )
  • branches/0.4/web/addons/job_monarch/index.php

    r754 r758  
    120120    global $JOB_ARCHIVE, $period_start, $period_stop, $h, $id;
    121121    global $job_start, $job_stop, $range, $r, $metricname;
    122     global $conf;
     122    global $conf, $show_hosts;
    123123    try
    124124       {
     
    182182
    183183    $tpl = new Dwoo_Template_File("templates/header.tpl");
    184     echo $tpl;
    185184    $tpl_data = new Dwoo_Data();
    186 
    187     if( $view != "search" )
    188     {
    189         $tpl_data->assign( "refresh", $default_refresh );
    190     }
    191185
    192186    $tpl_data->assign( "date", date("r") );
     
    375369    }
    376370
    377     if( $view != "search" )
    378     {
    379         $context_ranges[]="hour";
    380         $context_ranges[]="day";
    381         $context_ranges[]="week";
    382         $context_ranges[]="month";
    383         $context_ranges[]="year";
    384         $context_ranges[]="job";
    385 
    386         $range_menu = "<B>Last</B>&nbsp;&nbsp;" ."<SELECT NAME=\"r\" OnChange=\"toga_form.submit();\">\n";
    387         foreach ($context_ranges as $v)
    388         {
    389             $url=rawurlencode($v);
    390             $range_menu .= "<OPTION VALUE=\"$url\" ";
    391             if ($v == $range)
    392                 $range_menu .= "SELECTED";
    393             $range_menu .= ">$v\n";
     371    if( array_key_exists( "id", $filter ) or isset($hostname) )
     372    {
     373
     374        #$range = "job";
     375
     376        if( ( $page_call != "host_view" ) && ( $view != "search" ) )
     377        {
     378            $context_ranges[]="hour";
     379            $context_ranges[]="day";
     380            $context_ranges[]="week";
     381            $context_ranges[]="month";
     382            $context_ranges[]="year";
     383            $context_ranges[]="job";
     384
     385            $range_menu = "<B>Last</B>&nbsp;&nbsp;" ."<SELECT NAME=\"r\" OnChange=\"toga_form.submit();\">\n";
     386            foreach ($context_ranges as $v)
     387            {
     388                $url=rawurlencode($v);
     389                $range_menu .= "<OPTION VALUE=\"$url\" ";
     390                if ($v == $range)
     391                {
     392                    $range_menu .= "SELECTED";
     393                }
     394                $range_menu .= ">$v\n";
     395            }
     396            $range_menu .= "</SELECT>\n";
     397
     398            $tpl_data->assign("range_menu", $range_menu);
    394399        }
    395         $range_menu .= "</SELECT>\n";
    396 
    397         $tpl_data->assign("range_menu", $range_menu);
    398400
    399401    }
  • branches/0.4/web/addons/job_monarch/overview.php

    r757 r758  
    894894        {
    895895            $rjqj_end = time();
    896             $rjqj_graphargs .= "&period_start=$rjqj_start&period_stop=$rjqj_end";
     896            $rjqj_title = rawurlencode( makeTime( ($rjqj_end - $rjqj_start) ) );
     897            $rjqj_graphargs .= "&period_start=$rjqj_start&period_stop=$rjqj_end&t=$rjqj_title";
    897898        }
    898899        else
     
    983984    {
    984985        $tpl_data->assign( "showhosts", "yes" );
    985 
    986         # Present a width list
    987         $cols_menu     = "<SELECT NAME=\"hc\" OnChange=\"toga_form.submit();\">\n";
    988 
    989         $hostcols     = ($hc) ? $hc : 4;
    990 
    991         foreach( range( 1, 25 ) as $cols )
    992         {
    993             $cols_menu    .= "<OPTION VALUE=$cols ";
    994 
    995             if ($cols == $hostcols)
    996             {
    997                 $cols_menu    .= "SELECTED";
    998             }
    999             $cols_menu    .= ">$cols\n";
    1000         }
    1001         $cols_menu     .= "</SELECT>\n";
    1002 
    1003         $tpl_data->assign( "metric","$metricname $units" );
    1004         $tpl_data->assign( "id", $filter['id'] );
    1005 
    1006         # Host columns menu defined in header.php
    1007         $tpl_data->assign( "cols_menu", $cols_menu );
    1008986
    1009987        $showhosts     = isset($sh) ? $sh : $default_showhosts;
  • branches/0.4/web/addons/job_monarch/templates/overview.tpl

    r757 r758  
    234234  no<INPUT type=radio name="sh" value="0" OnClick="toga_form.submit();" {$checked0}>
    235235  </FONT>
    236   |
    237   job <strong>{$id}</strong> metric <strong>{$metric}</strong>
    238   |
    239    <FONT SIZE="-1">
    240    Columns&nbsp;&nbsp;{$cols_menu}
    241    </FONT>
    242236  </TD>
    243237</TR>
Note: See TracChangeset for help on using the changeset viewer.