Changeset 149


Ignore:
Timestamp:
06/20/05 14:50:55 (19 years ago)
Author:
bastiaans
Message:

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

  • First checkin of host_view template

web/addons/toga/host_view.php:

  • Modified host view for toga (archive)
  • Will parse same periods as search

web/addons/toga/templates/search.tpl, web/addons/toga/search.php, web/addons/toga/graph.php:

  • Renamed start and stop to period_start and period_stop

web/addons/toga/index.php:

  • Added inclusion of host_view if specified
Location:
trunk/web/addons/toga
Files:
2 added
4 edited

Legend:

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

    r145 r149  
    4848
    4949if (isset($graph)) {
    50         $rrd_dirs = $trd->getRrdDirs( $start, $stop );
     50        $rrd_dirs = $trd->getRrdDirs( $period_start, $period_stop );
    5151        $series = '';
    5252
     
    332332# Generate the rrdtool graph command.
    333333#
    334 $command = RRDTOOL . " graph - --start $start --end $stop ".
     334$command = RRDTOOL . " graph - --start $period_start --end $period_stop ".
    335335        "--width $width --height $height $upper_limit $lower_limit ".
    336336        "--title '$title' $vertical_label $extras $background ".
  • trunk/web/addons/toga/index.php

    r145 r149  
    3838        global $metrics, $reports, $m, $default_metric;
    3939        global $default_refresh, $filterorder, $view;
    40         global $TARCHD;
     40        global $TARCHD, $period_start, $period_stop, $h, $id;
    4141       
    4242        if( isset($default_metric) and !isset($m) )
     
    189189
    190190        if( $view == "search" ) {
     191
    191192                $node_menu .= "<B>&gt;</B>\n";
    192193                $node_menu .= "<B>Jobarchive</B> ";
    193194                $tpl->assign("view", "search" );
    194195                $form_name = "archive_search_form";
    195                 $tpl->assign("form_name", $form_name );
     196                $tpl->assignGlobal("form_name", $form_name );
     197
    196198        } else {
    197199                $form_name = "toga_form";
    198                 $tpl->assign("form_name", $form_name );
     200                $tpl->assignGlobal("form_name", $form_name );
    199201                $tpl->assign("view", "overview" );
    200202        }
     
    218220                        $metric_menu .= "</SELECT>\n";
    219221
    220                         $tpl->assign("metric_menu", $metric_menu );
    221222                }
     223
     224                $tpl->assign("metric_menu", $metric_menu );
    222225        }
    223226        $m = $metricname;
     
    269272}
    270273
     274function includeHostPage() {
     275
     276        global $tpl;
     277
     278        $tpl->assignInclude( "main", "templates/host_view.tpl" );
     279}
     280
    271281$tpl = new TemplatePower( "templates/index.tpl" );
    272282
    273283$tpl->assignInclude( "header", "templates/header.tpl" );
    274284
     285if( isset( $h ) and $h != '' ) {
     286        $hostname = $h;
     287        $view = "host";
     288}
     289
    275290switch( $view ) {
    276291
     
    283298
    284299                includeSearchPage();
     300                break;
     301
     302        case "host":
     303
     304                includeHostPage();
    285305                break;
    286306
     
    313333                break;
    314334
     335        case "host":
     336
     337                include "./host_view.php";
     338                makeHostView();
     339                break;
     340
    315341        default:
    316342
  • trunk/web/addons/toga/search.php

    r145 r149  
    164164        global $clustername, $tpl, $id, $user, $name, $start_from_time, $start_to_time, $queue;
    165165        global $end_from_time, $end_to_time, $filter, $default_showhosts, $m, $hosts_up;
    166         global $start, $stop;
     166        global $period_start, $period_stop;
    167167
    168168        $metricname = $m;
     
    269269                                //printf("start = %s stop = %s\n", $start, $stop );
    270270
    271                                 if( !$start ) // Add an additional 5 minutes before
    272                                         $start = intval( $job_start - 600 );
     271                                if( !$period_start ) // Add an additional 5 minutes before
     272                                        $period_start = intval( $job_start - (intval( $runningtime * 0.10 ) ) );
    273273                                else
    274                                         $start = datetimeToEpoch( $start );
    275 
    276                                 if( !$stop ) // Add an additional 5 minutes after
    277                                         $stop = intval( $job_stop + 600 );
     274                                        $period_start = datetimeToEpoch( $period_start );
     275
     276                                if( !$period_stop ) // Add an additional 5 minutes after
     277                                        $period_stop = intval( $job_stop + (intval( $runningtime * 0.10 ) ) );
    278278                                else
    279                                         $stop = datetimeToEpoch( $stop );
     279                                        $period_stop = datetimeToEpoch( $period_stop );
    280280
    281281                                //printf("start = %s stop = %s\n", $start, $stop );
    282282
    283                                 $tpl->assign("j_start", epochToDatetime( $start ) );
    284                                 $tpl->assign("j_stop", epochToDatetime( $stop ) );
     283                                $tpl->assign("period_start", epochToDatetime( $period_start ) );
     284                                $tpl->assign("period_stop", epochToDatetime( $period_stop ) );
    285285
    286286                                $hosts_up = array();
     
    340340                                        $val = $metrics[$host][$metricname];
    341341                                        $class = "metric";
    342                                         $host_link="\"?c=$cluster_url&h=$host_url&job_start=$job_start&job_stop=$job_stop&start=$start&stop=$stop\"";
     342                                        $host_link="\"?c=$cluster_url&h=$host_url&job_start=$job_start&job_stop=$job_stop&period_start=$period_start&period_stop=$period_stop\"";
    343343
    344344                                        if ($val[TYPE]=="timestamp" or $always_timestamp[$metricname]) {
     
    347347                                                $textval = "$val[VAL] $val[UNITS]";
    348348                                        } else {
    349                                                 $graphargs = "z=small&c=$cluster_url&m=$metricname&h=$host_url&v=$val[VAL]&x=$max&n=$min&job_start=$job_start&job_stop=$job_stop&start=$start&stop=$stop";
     349                                                $graphargs = "z=small&c=$cluster_url&m=$metricname&h=$host_url&v=$val[VAL]&x=$max&n=$min&job_start=$job_start&job_stop=$job_stop&period_start=$period_start&period_stop=$period_stop";
    350350                                        }
    351351                                        if ($textval) {
  • trunk/web/addons/toga/templates/search.tpl

    r145 r149  
    5252        function setPeriodTimestamps() {
    5353
    54                 document.archive_search_form.start.value = document.archive_search_form.period_start_pick.value;
    55                 document.archive_search_form.stop.value = document.archive_search_form.period_stop_pick.value;
     54                document.archive_search_form.period_start.value = document.archive_search_form.period_start_pick.value;
     55                document.archive_search_form.period_stop.value = document.archive_search_form.period_stop_pick.value;
    5656        }
    5757
     
    258258   Columns&nbsp;&nbsp;{cols_menu}
    259259   </FONT><BR>
    260    <FONT SIZE="-1">
    261     <INPUT TYPE="HIDDEN" NAME="start" VALUE="{j_start}">
    262     <INPUT TYPE="HIDDEN" NAME="stop" VALUE="{j_stop}">
     260<FONT SIZE="-1">
     261    <INPUT TYPE="HIDDEN" NAME="period_start" VALUE="{period_start}">
     262    <INPUT TYPE="HIDDEN" NAME="period_stop" VALUE="{period_stop}">
    263263    Graph timeperiod from
    264     <INPUT TYPE="text" NAME="period_start_pick" VALUE="{j_start}" ALT="Start time" DISABLED="TRUE">
     264    <INPUT TYPE="text" NAME="period_start_pick" VALUE="{period_start}" ALT="Start time" DISABLED="TRUE">
    265265    <a href="javascript:show_calendar('document.archive_search_form.period_start_pick', document.archive_search_form.period_start_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
    266266    <img src="cal.gif" width="16" height="16" border="0"></a>
    267267    <a href="#" onClick="javascript: document.archive_search_form.period_start_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
    268268    <IMG SRC="redcross.jpg" BORDER=0></A>
    269     to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{j_stop}" ALT="Stop time" DISABLED="TRUE">
     269    to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{period_stop}" ALT="Stop time" DISABLED="TRUE">
    270270    <a href="javascript:show_calendar('document.archive_search_form.period_stop_pick', document.archive_search_form.period_stop_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
    271271    <img src="cal.gif" width="16" height="16" border="0"></a>
Note: See TracChangeset for help on using the changeset viewer.