Changeset 120 for trunk


Ignore:
Timestamp:
06/01/05 10:35:56 (19 years ago)
Author:
bastiaans
Message:

toga/overview.php:

  • Requested CPU time is now also in human readable format
File:
1 edited

Legend:

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

    r119 r120  
    2222$pie = drawPie();
    2323$tpl->assign("pie", $pie );
     24
     25function timeToEpoch( $time ) {
     26
     27        $time_fields = explode( ':', $time );
     28
     29        if( count($time_fields) == 3 ) {
     30
     31                $hours = $time_fields[0];
     32                $minutes = $time_fields[1];
     33                $seconds = $time_fields[2];
     34
     35                $myepoch = intval( $seconds + (intval( $minutes * 60 )) + (intval( $hours * 3600 )) );
     36                return $myepoch;
     37        }
     38}
    2439
    2540function makeTime( $time ) {
     
    330345                                $tpl->assign("queue", $jobs[$jobid][queue] );
    331346                                $tpl->assign("name", $jobs[$jobid][name] );
    332                                 $tpl->assign("req_cpu", $jobs[$jobid][requested_time] );
     347                                $tpl->assign("req_cpu", makeTime( timeToEpoch( $jobs[$jobid][requested_time] ) ) );
    333348                                $tpl->assign("req_memory", $jobs[$jobid][requested_memory] );
    334349                                $nodes = count( $jobs[$jobid][nodes] );
Note: See TracChangeset for help on using the changeset viewer.