Changeset 880 for branches/1.0/web/addons/job_monarch/search.php
- Timestamp:
- 05/18/13 18:25:10 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/web/addons/job_monarch/search.php
r817 r880 226 226 global $end_from_time, $end_to_time, $filter, $default_showhosts, $m, $hosts_up, $hc; 227 227 global $period_start, $period_stop, $sortby, $sortorder, $COLUMN_REQUESTED_MEMORY; 228 global $SEARCH_RESULT_LIMIT, $COLUMN_NODES, $metricname, $self, $conf; 228 global $SEARCH_RESULT_LIMIT, $COLUMN_NODES, $metricname, $self, $conf, $include_running; 229 229 230 230 231 $longtitle = "Batch Archive Search :: Powered by Job Monarch!"; … … 236 237 $tpl_data = new Dwoo_Data(); 237 238 239 if( in_array( $include_running, array('on','checked','true','yes') ) ) 240 { 241 $include_running = true; 242 $tpl_data->assign( "running_checked", "checked='on'" ); 243 } 238 244 $tpl_data->assign( "self", $self ); 239 245 $tpl_data->assign( "cluster", $clustername ); … … 264 270 if( $end_from_time ) $end_from_time = datetimeToEpoch( $end_from_time ); 265 271 if( $end_to_time ) $end_to_time = datetimeToEpoch( $end_to_time ); 266 $search_ids = $tdb->searchDbase( $id, $queue, $owner, $name, $start_from_time, $start_to_time, $end_from_time, $end_to_time );272 $search_ids = $tdb->searchDbase( $id, $queue, $owner, $name, $start_from_time, $start_to_time, $end_from_time, $end_to_time, $include_running ); 267 273 268 274 //print_r( $search_ids ); … … 354 360 $job_start = $job['start_timestamp']; 355 361 $job_stop = $job['stop_timestamp']; 356 $runningtime = intval( $job_stop - $job_start ); 362 363 if( $job['status'] == 'R' ) 364 { 365 $period_stop = time(); 366 $runningtime = $period_stop - intval( $job_start ); 367 $period_start = intval( $job_start - (intval( $runningtime * 0.10 ) ) ); 368 $node_list["finished"]= ''; 369 } 370 else 371 { 372 $runningtime = intval( $job_stop - $job_start ); 373 $node_list["finished"]= makeDate( $job_stop ); 374 } 375 357 376 $node_list["started"]= makeDate( $job_start ); 358 $node_list["finished"]= makeDate( $job_stop );359 377 $node_list["runningtime"]= makeTime( $runningtime ); 360 378 … … 371 389 $tpl_data->assign("checked$showhosts", "checked"); 372 390 373 if( $showhosts ) { 374 375 if( !$period_start ) // Add an extra 10% to graphstart 391 if( $showhosts ) 392 { 393 if( $job['status'] == 'R' ) 394 { 395 $period_stop = time(); 396 $runningtime = $period_stop - intval( $job_start ); 376 397 $period_start = intval( $job_start - (intval( $runningtime * 0.10 ) ) ); 398 } 377 399 else 378 $period_start = datetimeToEpoch( $period_start ); 379 380 if( !$period_stop ) // Add an extra 10% to graphend 381 $period_stop = intval( $job_stop + (intval( $runningtime * 0.10 ) ) ); 382 else 383 $period_stop = datetimeToEpoch( $period_stop ); 400 { 401 if( !$period_start ) // Add an extra 10% to graphstart 402 { 403 $period_start = intval( $job_start - (intval( $runningtime * 0.10 ) ) ); 404 } 405 else 406 { 407 $period_start = datetimeToEpoch( $period_start ); 408 } 409 410 if( !$period_stop ) // Add an extra 10% to graphend 411 { 412 $period_stop = intval( $job_stop + (intval( $runningtime * 0.10 ) ) ); 413 } 414 else 415 { 416 $period_stop = datetimeToEpoch( $period_stop ); 417 } 418 } 419 384 420 385 421 $tpl_data->assign( "timeperiod", "yes" );
Note: See TracChangeset
for help on using the changeset viewer.