Changeset 780


Ignore:
Timestamp:
03/29/13 22:05:27 (8 years ago)
Author:
ramonb
Message:
  • another change to search
Location:
branches/0.4/web/addons/job_monarch
Files:
3 edited

Legend:

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

    r776 r780  
    236236    }
    237237
    238     if (!count($metrics) && $view!='search')
     238    if (!count($metrics) && $view!='search' && $view!='host')
    239239    {
    240240        echo "<h4>Cannot find any metrics for selected cluster \"$clustername\", exiting.</h4>\n";
     
    344344        $tpl_data->assign("metric_menu", $metric_menu );
    345345
    346         if( $view == "search" or $view == "host" or $view == "overview-host" )
     346        if( $view == "host" or $view == "overview-host" )
    347347        {
    348348            $tpl_data->assign("timeperiod", "yes" );
  • branches/0.4/web/addons/job_monarch/search.php

    r779 r780  
    304304            $node_list["req_cpu"]= makeTime( TimeToEpoch( $job['requested_time'] ) );
    305305
    306             if( $COLUMN_REQUESTED_MEMORY ) {
     306            if( $COLUMN_REQUESTED_MEMORY )
     307            {
    307308                $node_list["column_req_mem"] = "yes";
    308309                $node_list["req_memory"]= $job['requested_memory'];
    309310            }
    310             if( $COLUMN_NODES) {
     311            if( $COLUMN_NODES)
     312            {
    311313
    312314                $job_nodes    = array();
    313315
    314316                foreach( $nodes[$foundid] as $mynode )
    315                     $job_nodes[] = $mynode['hostname'];
    316 
    317                 $node_list["column_nodes"] = "yes";
     317                {
     318                    if( strpos( $mynode['hostname'], "." ) !== false )
     319                    {
     320                        $shorthost = explode( '.', $mynode['hostname'] );
     321                        $job_nodes[] = $shorthost[0];
     322                    }
     323                    else
     324                    {
     325                        $job_nodes[] = $mynode['hostname'];
     326                    }
     327                }
     328
     329                $node_list["column_nodes_hostnames"] = "yes";
    318330                $nodes_hostnames = implode( " ", $job_nodes );
    319331                $node_list["nodes_hostnames"]= $nodes_hostnames;
     
    357369            $tpl_data->assign("checked$showhosts", "checked");
    358370
    359             # Present a width list
    360             $cols_menu = "<SELECT NAME=\"hc\" OnChange=\"archive_search_form.submit();\">\n";
    361 
    362             $hostcols = ($hc) ? $hc : 4;
    363 
    364             foreach(range(1,25) as $cols) {
    365                 $cols_menu .= "<OPTION VALUE=$cols ";
    366                 if ($cols == $hostcols)
    367                     $cols_menu .= "SELECTED";
    368                 $cols_menu .= ">$cols\n";
    369             }
    370             $cols_menu .= "</SELECT>\n";
    371 
    372             $tpl_data->assign("metric","$metricname $units");
    373             $tpl_data->assign("id", $id);
    374             # Host columns menu defined in header.php
    375             $tpl_data->assign("cols_menu", $cols_menu);
    376 
    377371            if( $showhosts ) {
    378372
     
    387381                    $period_stop = datetimeToEpoch( $period_stop );
    388382
    389                 #        $tpl_data->gotoBlock( "timeperiod" );
    390 
    391                 #$tpl_data->assign("period_start", epochToDatetime( $period_start ) );
    392                 #$tpl_data->assign("period_stop", epochToDatetime( $period_stop ) );
     383                $tpl_data->assign( "timeperiod", "yes" );
     384
     385                $tpl_data->assign("period_start", epochToDatetime( $period_start ) );
     386                $tpl_data->assign("period_stop", epochToDatetime( $period_stop ) );
    393387
    394388                $hosts_up = array();
     
    447441                        $textval = $val['VAL']." ".$val['UNITS'];
    448442                    } else {
    449                         $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&min=$min&max=$max";
     443                        $graphargs = "z=medium&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&min=$min&max=$max";
    450444                    }
    451445                    if ($textval) {
  • branches/0.4/web/addons/job_monarch/templates/search.tpl

    r778 r780  
    243243{/if}
    244244    <TD>{$nodes}/{$cpus}</TD>
    245 {if "$column_req_mem" == "yes"}
     245{if "$column_nodes_hostnames" == "yes"}
    246246    <TD>{$nodes_hostnames}</TD>
    247247{/if}
     
    263263  no<INPUT type=radio name="sh" value="0" OnClick="archive_search_form.submit();" {$checked0}>
    264264  </FONT>
    265   |
    266   job <strong>{$id}</strong> metric <strong>{$metric}</strong>
    267   |
    268    <FONT SIZE="-1">
    269    Columns&nbsp;&nbsp;{$cols_menu}
    270    </FONT><BR>
     265{if "$timeperiod" == "yes"}
     266    <INPUT TYPE="HIDDEN" NAME="period_start" VALUE="{$period_start}">
     267    <INPUT TYPE="HIDDEN" NAME="period_stop" VALUE="{$period_stop}">
     268    <BR><BR><B>Graph/ from
     269    <INPUT TYPE="text" NAME="period_start_pick" VALUE="{$period_start}" ALT="Start time" DISABLED="TRUE">
     270    <a href="javascript:show_calendar('document.{$form_name}.period_start_pick', document.{$form_name}.period_start_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
     271    <img src="cal.gif" width="16" height="16" border="0"></a>
     272    <a href="#" onClick="javascript: document.{$form_name}.period_start_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
     273    <IMG SRC="redcross.jpg" BORDER=0></A>
     274    to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{$period_stop}" ALT="Stop time" DISABLED="TRUE">
     275    <a href="javascript:show_calendar('document.{$form_name}.period_stop_pick', document.{$form_name}.period_stop_pick.value);" alt="Click to select a date/time" title="Click to select a date/time">
     276    <img src="cal.gif" width="16" height="16" border="0"></a>
     277    <a href="#" onClick="javascript: document.{$form_name}.period_stop_pick.value=''" alt="Click here to clear field" title="Click here to clear field">
     278    </B>
     279    <IMG SRC="redcross.jpg" BORDER=0></A>
     280
     281{if "$hostview" == "yes"}
     282    <INPUT TYPE="HIDDEN" NAME="job_start" VALUE="{$job_start}">
     283    <INPUT TYPE="HIDDEN" NAME="job_stop" VALUE="{$job_stop}">
     284{/if}
     285    <INPUT TYPE="submit" onClick="setPeriodTimestamps();" VALUE="Refresh graphs">
     286{/if}
    271287  </TD>
    272288</TR>
     
    275291
    276292<CENTER>
    277 <TABLE>
    278 <TR>
     293
     294<div id="monarchimage">
    279295{loop $sorted_list}
    280296{$metric_image}{$br}
    281297{/loop}
    282 </TR>
    283 </TABLE>
     298</div>
    284299
    285300</CENTER>
Note: See TracChangeset for help on using the changeset viewer.