Changeset 263
- Timestamp:
- 06/23/06 17:44:29 (17 years ago)
- Location:
- trunk/web/addons/job_monarch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/index.php
r231 r263 303 303 } 304 304 305 //$ex_fn = $tpl->getVarValue( "_ROOT", "form_name" ); 306 305 307 if( $view == "search" or $view == "host" ) { 306 308 … … 375 377 if( isset( $h ) and $h != '' ) { 376 378 $hostname = $h; 377 $view = "host";379 //$view = "host"; 378 380 } 379 381 … … 390 392 break; 391 393 392 case "host":393 394 includeHostPage();395 break;394 //case "host": 395 396 // includeHostPage(); 397 // break; 396 398 397 399 default: … … 423 425 break; 424 426 425 case "host":426 427 include "./host_view.php";428 makeHostView();429 break;427 //case "host": 428 429 // include "./host_view.php"; 430 // makeHostView(); 431 // break; 430 432 431 433 default: -
trunk/web/addons/job_monarch/overview.php
r250 r263 24 24 25 25 global $GANGLIA_PATH, $clustername, $tpl, $filter, $cluster, $get_metric_string, $cluster_url, $sh; 26 global $hosts_up, $m, $start, $end, $filterorder, $COLUMN_REQUESTED_MEMORY, $COLUMN_QUEUED; 27 28 //$tpl->assign("_ROOT.summary", "" ); 26 global $hosts_up, $m, $start, $end, $filterorder, $COLUMN_REQUESTED_MEMORY, $COLUMN_QUEUED, $hostname, $piefilter; 29 27 30 28 $data_gatherer = new DataGatherer( $clustername ); 31 29 32 //$tpl->assign( "self", "./index.php" );33 30 $tpl->assign( "clustername", $clustername ); 34 31 … … 43 40 $cpus = $data_gatherer->getCpus(); 44 41 45 $filter_image_url = ""; 46 47 foreach( $filter as $filtername => $filtervalue ) { 48 $tpl->assign( "f_".$filtername, $filtervalue ); 49 $filter_image_url .= "&$filtername=$filtervalue"; 50 } 51 52 $tpl->assign( "clusterimage", "./image.php?c=".rawurlencode($clustername)."&view=big-clusterimage".$filter_image_url ); 53 $tpl->assign( "f_order", $filterorder ); 54 55 if( array_key_exists( "id", $filter ) ) 56 $piefilter = 'id'; 57 else if( array_key_exists( "user", $filter ) ) 58 $piefilter = 'user'; 59 else if( array_key_exists( "queue", $filter ) ) 60 $piefilter = 'queue'; 61 62 $pie = drawPie(); 63 $tpl->assign("pie", $pie ); 64 65 //if( !array_key_exists( 'id', $filter ) ) { 66 67 // $graph_args = "c=$cluster_url&$get_metric_string&st=$cluster[LOCALTIME]"; 68 // $tpl->newBlock( "average_graphs" ); 69 // $tpl->assign( "graph_args", $graph_args ); 70 //} 42 function setupFilterSettings() { 43 global $tpl, $filter, $clustername, $piefilter; 44 45 $filter_image_url = ""; 46 47 $tpl->gotoBlock( "_ROOT" ); 48 49 foreach( $filter as $filtername => $filtervalue ) { 50 $tpl->assign( "f_".$filtername, $filtervalue ); 51 $filter_image_url .= "&$filtername=$filtervalue"; 52 } 53 54 $tpl->assign( "clusterimage", "./image.php?c=".rawurlencode($clustername)."&view=big-clusterimage".$filter_image_url ); 55 $tpl->assign( "f_order", $filterorder ); 56 57 if( array_key_exists( "id", $filter ) ) 58 $piefilter = 'id'; 59 else if( array_key_exists( "user", $filter ) ) 60 $piefilter = 'user'; 61 else if( array_key_exists( "queue", $filter ) ) 62 $piefilter = 'queue'; 63 64 $pie = drawPie(); 65 $tpl->assign("pie", $pie ); 66 } 71 67 72 68 function timeToEpoch( $time ) { … … 470 466 global $cluster_url, $get_metric_string, $host_url, $metrics; 471 467 global $start, $end, $reports, $gnodes, $default_showhosts; 472 global $COLUMN_QUEUED, $COLUMN_REQUESTED_MEMORY ;468 global $COLUMN_QUEUED, $COLUMN_REQUESTED_MEMORY, $hostname; 473 469 $metricname = $m; 474 470 … … 521 517 $tpl->newBlock( "column_header_queued" ); 522 518 } 519 520 $last_displayed_job = null; 523 521 524 522 foreach( $sorted_jobs as $jobid => $sortdec ) { … … 547 545 $running_jobs++; 548 546 549 foreach( $jobs[$jobid][nodes] as $tempnode ) 547 foreach( $jobs[$jobid][nodes] as $tempnode ) { 550 548 $running_name_nodes[] = $tempnode; 549 550 if( isset( $hostname ) && $hostname != '' ) 551 //$filter[host] = $hostname; 552 553 $domain_len = 0 - strlen( $jobs[$jobid][domain] ); 554 $hostnode = $tempnode; 555 if( substr( $hostnode, $domain_len ) != $jobs[$jobid][domain] ) { 556 $hostnode = $hostnode. '.'. $jobs[$jobid][domain]; 557 } 558 559 if( isset($hostname) && $hostname != '' && $hostname != $hostnode ) 560 $display_job = 0; 561 } 551 562 } 552 563 553 564 if( $jobs[$jobid][status] == 'Q' ) { 565 if( isset( $hostname ) && $hostname != '' ) 566 $display_job = 0; 567 554 568 $queued_cpus += $cpus; 555 569 $queued_nodes += $nodes; … … 574 588 $tpl->assign( "clustername", $clustername ); 575 589 $tpl->assign("id", $jobid ); 590 591 $last_displayed_job = $jobid; 592 576 593 $tpl->assign("state", $jobs[$jobid][status] ); 577 594 … … 672 689 $total_jobs = $queued_jobs + $running_jobs; 673 690 674 //$tpl->assignGlobal("cpus_nr", $overview_cpus );675 //$tpl->assignGlobal("jobs_nr", $overview_jobs );676 677 691 $tpl->assignGlobal("avail_nodes", $avail_nodes ); 678 692 $tpl->assignGlobal("avail_cpus", $avail_cpus ); … … 705 719 706 720 $tpl->assignGlobal("report_time", makeDate( $heartbeat)); 707 708 //$tpl->assignGlobal("f_cpus_nr", $f_cpus ); 709 //$tpl->assignGlobal("f_jobs_nr", $f_jobs ); 721 722 //if( intval($view_jobs) == 1 and $start_time ) 723 // if( $last_displayed_job != null ) 724 // $filter[id] = $last_displayed_job; 725 726 //makeHeader(); 727 setupFilterSettings(); 710 728 711 729 if( intval($view_jobs) == 1 and $start_time ) { 730 712 731 $tpl->newBlock( "showhosts" ); 713 732 714 733 # Present a width list 715 734 $cols_menu = "<SELECT NAME=\"hc\" OnChange=\"toga_form.submit();\">\n"; 735 716 736 717 737 $hostcols = ($hc) ? $hc : 4; … … 755 775 else 756 776 $metricval = "m"; 757 777 758 778 foreach ($hosts_up as $host ) { 759 779
Note: See TracChangeset
for help on using the changeset viewer.