Changeset 753
- Timestamp:
- 03/26/13 21:38:02 (11 years ago)
- Location:
- branches/0.4/web/addons/job_monarch
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/web/addons/job_monarch/index.php
r738 r753 4 4 * This file is part of Jobmonarch 5 5 * 6 * Copyright (C) 2006 Ramon Bastiaans6 * Copyright (C) 2006-2013 Ramon Bastiaans 7 7 * 8 8 * Jobmonarch is free software; you can redistribute it and/or modify … … 29 29 30 30 include_once "./libtoga.php"; 31 include_once "./dwoo/dwooAutoload.php"; 31 32 32 33 $r = escapeshellcmd( rawurldecode( $_GET["r"] )); … … 34 35 if( !isset($range) or $range == '') $range= "job"; 35 36 37 global $context; 38 39 #$context = 'cluster'; 40 41 #chdir( $GANGLIA_PATH ); 42 43 #include "./ganglia.php"; 44 #include "./get_ganglia.php"; 45 46 #chdir( $my_dir ); 47 36 48 if ( !empty( $_GET ) ) 37 49 { … … 41 53 global $GANGLIA_PATH; 42 54 43 include_once "./class.TemplatePower.inc.php";55 //include_once "./class.TemplatePower.inc.php"; 44 56 45 57 $httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET ); … … 99 111 function makeHeader( $page_call, $title, $longtitle ) 100 112 { 101 102 global $tpl, $grid, $context, $initgrid; 113 global $dwoo, $grid, $context, $initgrid; 103 114 global $jobrange, $jobstart; 104 115 global $page, $gridwalk, $clustername; … … 109 120 global $JOB_ARCHIVE, $period_start, $period_stop, $h, $id; 110 121 global $job_start, $job_stop, $range, $r, $metricname; 122 global $conf; 123 try 124 { 125 //$dwoo = new Dwoo($conf['dwoo_compiled_dir'], $conf['dwoo_cache_dir']); 126 $dwoo = new Dwoo( 'dwoo/compiled', 'dwoo/cache' ); 127 } 128 catch (Exception $e) 129 { 130 print "<H4>There was an error initializing the Dwoo PHP Templating Engine: ". 131 $e->getMessage() . "<br><br>The compile directory should be owned and writable by the apache user.</H4>"; 132 exit; 133 } 134 111 135 112 136 if( isset($conf['default_metric']) and !isset($m) ) … … 157 181 list($parentgrid, $parentlink) = explode("@", $gridstack[count($gridstack)-2]); 158 182 159 # Setup a redirect to a remote server if you choose a grid from pulldown menu. Tell 160 # destination server that we're walking foward in the grid tree. 161 if (strstr($clustername, "http://")) 162 { 163 $tpl->assign("refresh", "0"); 164 $tpl->assign("redirect", ";URL=$clustername?gw=fwd&gs=$gridstack_url"); 165 echo "<h2>Redirecting, please wait...</h2>"; 166 $tpl->printToScreen(); 167 exit; 168 } 169 $tpl->gotoBlock( "_ROOT" ); 183 $tpl = new Dwoo_Template_File("templates/header.tpl"); 184 echo $tpl; 185 $tpl_data = new Dwoo_Data(); 170 186 171 187 if( $view != "search" ) 172 188 { 173 $tpl ->assign( "refresh", $default_refresh );174 } 175 176 $tpl ->assign( "date", date("r") );177 $tpl ->assign( "longpage_title", $longtitle );178 $tpl ->assign( "page_title", $title );189 $tpl_data->assign( "refresh", $default_refresh ); 190 } 191 192 $tpl_data->assign( "date", date("r") ); 193 $tpl_data->assign( "longpage_title", $longtitle ); 194 $tpl_data->assign( "page_title", $title ); 179 195 180 196 # The page to go to when "Get Fresh Data" is pressed. 181 $tpl ->assign("page","./");197 $tpl_data->assign("page","./"); 182 198 183 199 # Templated Logo image 184 $tpl ->assign("images","./templates/$template_name/images");200 $tpl_data->assign("images","./templates/$template_name/images"); 185 201 186 202 # … … 198 214 199 215 # Make some information available to templates. 200 $tpl ->assign("cluster_url", $cluster_url);216 $tpl_data->assign("cluster_url", $cluster_url); 201 217 # Build the node_menu 202 218 $node_menu = ""; … … 303 319 } 304 320 305 $tpl->gotoBlock( "_ROOT" ); 306 $tpl->assignGlobal("view", $view); 307 321 $tpl_data->assign("view", $view); 308 322 309 323 if( array_key_exists( "id", $filter ) or isset($hostname) ) … … 334 348 } 335 349 336 $tpl ->assign("metric_menu", $metric_menu );350 $tpl_data->assign("metric_menu", $metric_menu ); 337 351 338 352 if( $view == "search" or $view == "host" or $view == "overview-host" ) 339 353 { 340 $tpl ->newBlock("timeperiod");354 $tpl_data->assign("timeperiod", "yes" ); 341 355 if( is_numeric( $period_start ) ) 342 356 { … … 347 361 $period_stop = epochToDatetime( $period_stop ); 348 362 } 349 $tpl ->assign("period_start", $period_start );350 $tpl ->assign("period_stop", $period_stop );351 $tpl ->assign("hostname", $hostname );363 $tpl_data->assign("period_start", $period_start ); 364 $tpl_data->assign("period_stop", $period_stop ); 365 $tpl_data->assign("hostname", $hostname ); 352 366 353 367 if( $view == "host" or $view == "overview-host" ) 354 368 { 355 $tpl ->newBlock("hostview");356 $tpl ->assign("job_start", $job_start );357 $tpl ->assign("job_stop", $job_stop );369 $tpl_data->assign("hostview", "yes"); 370 $tpl_data->assign("job_start", $job_start ); 371 $tpl_data->assign("job_stop", $job_stop ); 358 372 } 359 373 } … … 381 395 $range_menu .= "</SELECT>\n"; 382 396 383 $tpl ->assign("range_menu", $range_menu);397 $tpl_data->assign("range_menu", $range_menu); 384 398 385 399 } … … 391 405 $node_menu .= "<B>Jobarchive</B> "; 392 406 $form_name = "archive_search_form"; 393 $tpl ->assignGlobal("form_name", $form_name );407 $tpl_data->assign("form_name", $form_name ); 394 408 395 409 } … … 397 411 { 398 412 $form_name = "toga_form"; 399 $tpl ->assignGlobal("form_name", $form_name );413 $tpl_data->assign("form_name", $form_name ); 400 414 } 401 415 402 416 if( $JOB_ARCHIVE && $page_call == 'overview' ) 403 417 { 404 $tpl->newBlock( "search" ); 405 $tpl->assignGlobal( "cluster_url", rawurlencode($clustername) ); 406 $tpl->assignGlobal( "cluster", $clustername ); 407 } 408 $tpl->gotoBlock( "_ROOT" ); 409 $tpl->assignGlobal( "cluster", $clustername ); 410 $tpl->assign("node_menu", $node_menu); 418 $tpl_data->assign( "search", "yes" ); 419 $tpl_data->assign( "cluster_url", rawurlencode($clustername) ); 420 $tpl_data->assign( "cluster", $clustername ); 421 } 422 $tpl_data->assign( "cluster", $clustername ); 423 $tpl_data->assign("node_menu", $node_menu); 411 424 412 425 # Make sure that no data is cached.. 413 header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Date in the past 414 header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); # always modified 415 header ("Cache-Control: no-cache, must-revalidate"); # HTTP/1.1 416 header ("Pragma: no-cache"); # HTTP/1.0 426 //header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Date in the past 427 //header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); # always modified 428 //header ("Cache-Control: no-cache, must-revalidate"); # HTTP/1.1 429 //header ("Pragma: no-cache"); # HTTP/1.0 430 431 $dwoo->output($tpl, $tpl_data); 417 432 } 418 433 419 434 function makeFooter() 420 435 { 421 global $tpl, $version, $parsetime, $monarchversion; 422 423 $tpl->gotoBlock( "_ROOT" ); 424 $tpl->assign("webfrontend-version",$version["webfrontend"]); 425 $tpl->assign("monarch-version", $monarchversion); 436 global $dwoo, $version, $parsetime, $monarchversion; 437 438 $tpl = new Dwoo_Template_File("templates/footer.tpl"); 439 $tpl_data = new Dwoo_Data(); 440 441 $tpl_data->assign("webfrontendversion",$version["webfrontend"]); 442 $tpl_data->assign("monarchversion", $monarchversion); 426 443 427 444 if ($version["gmetad"]) 428 445 { 429 $tpl ->assign("webbackend-component", "gmetad");430 $tpl ->assign("webbackend-version",$version["gmetad"]);446 $tpl_data->assign("webbackendcomponent", "gmetad"); 447 $tpl_data->assign("webbackendversion",$version["gmetad"]); 431 448 } 432 449 else if ($version["gmond"]) 433 450 { 434 $tpl->assign("webbackend-component", "gmond"); 435 $tpl->assign("webbackend-version", $version["gmond"]); 436 } 437 438 $tpl->assign("parsetime", sprintf("%.4f", $parsetime) . "s"); 439 } 440 441 function includeSearchpage() 442 { 443 global $tpl; 444 445 $tpl->assignInclude( "main", "templates/search.tpl" ); 446 447 } 448 449 function includeOverview() 450 { 451 global $tpl; 452 453 $tpl->assignInclude( "main", "templates/overview.tpl" ); 454 } 455 456 function includeHostPage() 457 { 458 459 global $tpl; 460 461 $tpl->assignInclude( "main", "templates/host_view.tpl" ); 462 } 463 464 $tpl = new TemplatePower( "templates/index.tpl" ); 465 466 $tpl->assignInclude( "header", "templates/header.tpl" ); 451 $tpl_data->assign("webbackendcomponent", "gmond"); 452 $tpl_data->assign("webbackendversion", $version["gmond"]); 453 } 454 455 $tpl_data->assign("parsetime", sprintf("%.4f", $parsetime) . "s"); 456 457 $dwoo->output($tpl, $tpl_data); 458 } 467 459 468 460 if( isset( $h ) and $h != '' ) … … 471 463 } 472 464 473 switch( $view ) 474 { 475 476 case "overview": 477 478 includeOverview(); 479 break; 480 481 case "search": 482 483 includeSearchPage(); 484 break; 485 486 case "host": 487 488 includeHostPage(); 489 break; 490 491 case "overview-host": 492 493 includeHostPage(); 494 break; 495 496 default: 497 498 includeOverview(); 499 break; 500 } 501 502 $tpl->assignInclude( "footer", "templates/footer.tpl" ); 503 $tpl->prepare(); 465 //$tpl_data->assign( "footer", template( "templates/footer.tpl" ) ); 504 466 505 467 $longtitle = "Batch Report :: Powered by Job Monarch!"; 506 468 $title = "Batch Report"; 507 $tpl->assign("cluster_url", rawurlencode($clustername) ); 508 $tpl->assign("cluster", $clustername ); 469 //$tpl_data->assign("cluster_url", rawurlencode($clustername) ); 470 //$tpl_data->assign("cluster", $clustername ); 471 472 #makeHeader(); 509 473 510 474 switch( $view ) … … 537 501 default: 538 502 503 include "./overview.php"; 539 504 makeOverview(); 540 505 break; … … 542 507 543 508 makeFooter(); 544 $tpl->printToScreen();545 509 ?> -
branches/0.4/web/addons/job_monarch/overview.php
r743 r753 23 23 */ 24 24 25 global $GANGLIA_PATH, $clustername, $tpl , $filter, $cluster, $get_metric_string, $cluster_url, $sh;25 global $GANGLIA_PATH, $clustername, $tpl_data, $filter, $cluster, $get_metric_string, $cluster_url, $sh; 26 26 global $hosts_up, $m, $start, $end, $filterorder, $COLUMN_REQUESTED_MEMORY, $COLUMN_QUEUED, $COLUMN_NODES, $hostname, $piefilter; 27 27 global $longtitle, $title, $range; 28 28 29 $tpl->assign( "clustername", $clustername ); 29 include_once "./dwoo/dwooAutoload.php"; 30 31 global $dwoo; 32 33 $tpl = new Dwoo_Template_File("templates/overview.tpl"); 34 $tpl_data = new Dwoo_Data(); 35 36 $tpl_data->assign( "clustername", $clustername ); 30 37 31 38 if( $JOB_ARCHIVE ) 32 39 { 33 $tpl ->assign( "cluster_url", rawurlencode($clustername) );40 $tpl_data->assign( "cluster_url", rawurlencode($clustername) ); 34 41 } 35 42 … … 52 59 { 53 60 54 global $tpl , $filter, $clustername, $piefilter, $data_gatherer, $myxml_data, $filterorder;61 global $tpl_data, $filter, $clustername, $piefilter, $data_gatherer, $myxml_data, $filterorder, $_SESSION; 55 62 56 63 $filter_image_url = ""; 57 64 58 $tpl->gotoBlock( "_ROOT" );59 60 65 foreach( $filter as $filtername => $filtervalue ) 61 66 { 62 $tpl ->assign( $filtername, $filtervalue );67 $tpl_data->assign( $filtername, $filtervalue ); 63 68 64 69 $filter_image_url .= "&$filtername=$filtervalue"; … … 78 83 $ic->draw(); 79 84 80 $tpl->assign( "clusterimage", "./image.php?". session_name() . "=" . session_id() ."&c=".rawurlencode($clustername)."&j_view=big-clusterimage".$filter_image_url ); 81 82 $tpl->newBlock( "node_clustermap" ); 83 $tpl->assign( "node_area_map", $ic->getImagemapArea() ); 84 $tpl->gotoBlock( "_ROOT" ); 85 86 $tpl->assign( "order", $filterorder ); 85 $tpl_data->assign( "clusterimage", "./image.php?". session_name() . "=" . session_id() ."&c=".rawurlencode($clustername)."&j_view=big-clusterimage".$filter_image_url ); 86 87 $tpl_data->assign( "node_clustermap", "yes" ); 88 $tpl_data->assign( "node_area_map", $ic->getImagemapArea() ); 89 90 $tpl_data->assign( "order", $filterorder ); 87 91 88 92 if( array_key_exists( "id", $filter ) ) … … 101 105 $pie = drawPie(); 102 106 103 $tpl ->assign("pie", $pie );107 $tpl_data->assign("pie", $pie ); 104 108 } 105 109 … … 504 508 function makeOverview() 505 509 { 506 global $ jobs, $nodes, $heartbeat, $clustername, $tpl;510 global $dwoo, $tpl, $tpl_data, $jobs, $nodes, $heartbeat, $clustername, $tpl_data; 507 511 global $sortorder, $sortby, $filter, $sh, $hc, $m, $range; 508 512 global $cluster_url, $get_metric_string, $host_url, $metrics; … … 520 524 $metricname = "load_one"; 521 525 522 $tpl ->assign("sortorder", $sortorder );523 $tpl ->assign("sortby", $sortby );526 $tpl_data->assign("sortorder", $sortorder ); 527 $tpl_data->assign("sortby", $sortby ); 524 528 525 529 $sorted_jobs = sortJobs( $jobs, $sortby, $sortorder ); … … 565 569 if( $COLUMN_REQUESTED_MEMORY ) 566 570 { 567 $tpl ->newBlock( "column_header_req_mem" );571 $tpl_data->assign( "column_header_req_mem", "yes" ); 568 572 } 569 573 … … 572 576 if( $COLUMN_NODES ) 573 577 { 574 $tpl ->newBlock( "column_header_nodes" );578 $tpl_data->assign( "column_header_nodes", "yes" ); 575 579 } 576 580 … … 579 583 if( $COLUMN_QUEUED ) 580 584 { 581 $tpl ->newBlock( "column_header_queued" );585 $tpl_data->assign( "column_header_queued", "yes" ); 582 586 } 583 587 … … 609 613 } 610 614 615 $node_list = array(); 611 616 612 617 foreach( $sorted_jobs as $jobid => $sortdec ) … … 711 716 } 712 717 718 713 719 if( $display_job ) 714 720 { 715 $tpl->newBlock( "node" ); 716 $tpl->assign( "clustername", $clustername ); 717 $tpl->assign( "id", $jobid ); 721 $job_loop = array(); 722 $job_loop["clustername"] = $clustername; 723 724 $job_loop["id"] = $jobid; 718 725 719 726 $last_displayed_job = $jobid; 720 727 721 $ tpl->assign( "state", $jobs[$jobid]['status'] );728 $job_loop["state"] = $jobs[$jobid]['status']; 722 729 723 730 $fullstate = ''; … … 732 739 } 733 740 734 $ tpl->assign( "fullstate", $fullstate );741 $job_loop["fullstate"] = $fullstate; 735 742 736 $ tpl->assign( "owner", $jobs[$jobid]['owner'] );737 $ tpl->assign( "queue", $jobs[$jobid]['queue'] );743 $job_loop["owner"] = $jobs[$jobid]['owner']; 744 $job_loop["queue"] = $jobs[$jobid]['queue']; 738 745 739 746 $fulljobname = $jobs[$jobid]['name']; 740 $shortjobname 741 742 $ tpl->assign( "fulljobname", $fulljobname );747 $shortjobname = ''; 748 749 $job_loop["fulljobname"] = $fulljobname; 743 750 744 751 $fulljobname_fields = explode( ' ', $fulljobname ); … … 753 760 if( $capjobname ) 754 761 { 755 $tpl->newBlock( "jobname_hint_start" );756 $ tpl->gotoBlock( "node" );762 //$tpl_data->assign( "jobname_hint_start", "yes" ); 763 $job_loop[ "jobname_hint_start" ] = "yes"; 757 764 758 765 $shortjobname = substr( $fulljobname, 0, 10 ) . '..'; … … 763 770 } 764 771 765 $ tpl->assign( "name", $shortjobname );772 $job_loop["name"] = $shortjobname; 766 773 767 774 if( $capjobname ) 768 775 { 769 $tpl->newBlock( "jobname_hint_end" );770 $ tpl->gotoBlock( "node" );776 //$tpl_data->assign( "jobname_hint_end", "yes" ); 777 $job_loop[ "jobname_hint_end" ] = "yes"; 771 778 } 772 779 773 780 $domain = $jobs[$jobid]['domain']; 774 781 775 $ tpl->assign( "req_cpu", makeTime( timeToEpoch( $jobs[$jobid]['requested_time'] )) );782 $job_loop["req_cpu"] = makeTime( timeToEpoch( $jobs[$jobid]['requested_time'] ) ); 776 783 777 784 if( $COLUMN_REQUESTED_MEMORY ) 778 785 { 779 $tpl->newBlock( "column_req_mem" );780 $ tpl->assign( "req_memory", $jobs[$jobid]['requested_memory'] );781 $ tpl->gotoBlock( "node" );786 //$tpl_data->assign( "column_req_mem", "yes" ); 787 $job_loop[ "column_req_mem" ] = "yes"; 788 $job_loop["req_memory"] = $jobs[$jobid]['requested_memory']; 782 789 } 783 790 … … 785 792 if( $COLUMN_QUEUED ) 786 793 { 787 $tpl->newBlock( "column_queued" );788 $ tpl->assign( "queued", makeDate( $jobs[$jobid]['queued_timestamp'] ) );789 $ tpl->gotoBlock( "node");794 //$tpl_data->assign( "column_queued", "yes" ); 795 $job_loop[ "column_queued" ] = "yes"; 796 $job_loop["queued"] = makeDate( $jobs[$jobid]['queued_timestamp'] ); 790 797 } 791 798 if( $COLUMN_NODES ) 792 799 { 793 $tpl->newBlock( "column_nodes" ); 794 $tpl->gotoBlock( "node" ); 800 //$tpl_data->assign( "column_nodes", "yes" ); 801 $job_loop[ "column_nodes" ] = "yes"; 802 //echo "colum nodes"; 795 803 } 796 804 … … 798 806 $cpus = $nodes * $ppn; 799 807 800 $ tpl->assign( "nodes", $nodes );801 $ tpl->assign( "cpus", $cpus );808 $job_loop["nodes"] = $nodes; 809 $job_loop["cpus"] = $cpus; 802 810 803 811 $start_time= (int) $jobs[$jobid]['start_timestamp']; … … 827 835 if( $COLUMN_NODES ) 828 836 { 829 $tpl->gotoBlock( "column_nodes" ); 837 //$tpl_data->assign( "column_nodes", "yes" ); 838 $job_loop[ "column_nodes" ] = "yes"; 830 839 831 840 $mynodehosts = array(); … … 843 852 $nodes_hostnames = implode( " ", $mynodehosts ); 844 853 845 $tpl->assign( "nodes_hostnames", $nodes_hostnames ); 846 $tpl->gotoBlock( "node" ); 854 $job_loop["nodes_hostnames"] = $nodes_hostnames; 847 855 } 848 856 } … … 854 862 if( $even ) 855 863 { 856 $ tpl->assign( "nodeclass", "even" );864 $job_loop["nodeclass"] = "even"; 857 865 858 866 $even = 0; … … 860 868 else 861 869 { 862 $ tpl->assign( "nodeclass", "odd" );870 $job_loop["nodeclass"] = "odd"; 863 871 864 872 $even = 1; … … 870 878 $job_runningtime = $heartbeat - $start_time; 871 879 872 $tpl->assign( "started", makeDate( $start_time ) ); 873 $tpl->assign( "runningtime", $runningtime ); 874 } 875 } 880 $job_loop["started"] = makeDate( $start_time ); 881 $job_loop["runningtime"] = $runningtime; 882 } 883 $node_list[] = $job_loop; 884 } 885 $tpl_data->assign("node_list", $node_list ); 876 886 } 877 887 } … … 895 905 $rjqj_str .= "</A>"; 896 906 897 $tpl->gotoBlock( "_ROOT" ); 898 899 $tpl->assign( "rjqj_graph", $rjqj_str ); 907 $tpl_data->assign( "rjqj_graph", $rjqj_str ); 900 908 } 901 909 … … 917 925 $free_cpus = ( $free_cpus >= 0 ) ? $free_cpus : 0; 918 926 919 $tpl ->assignGlobal( "avail_nodes", $avail_nodes );920 $tpl ->assignGlobal( "avail_cpus", $avail_cpus );921 922 $tpl ->assignGlobal( "queued_nodes", $queued_nodes );923 $tpl ->assignGlobal( "queued_jobs", $queued_jobs );924 $tpl ->assignGlobal( "queued_cpus", $queued_cpus );927 $tpl_data->assign( "avail_nodes", $avail_nodes ); 928 $tpl_data->assign( "avail_cpus", $avail_cpus ); 929 930 $tpl_data->assign( "queued_nodes", $queued_nodes ); 931 $tpl_data->assign( "queued_jobs", $queued_jobs ); 932 $tpl_data->assign( "queued_cpus", $queued_cpus ); 925 933 926 934 // Only display "Unavailable" in count overview there are any … … 928 936 if( $na_nodes > 0 ) 929 937 { 930 $tpl->newBlock( "na_nodes" ); 931 932 $tpl->assignGlobal( "na_nodes", $na_nodes ); 933 $tpl->assignGlobal( "na_cpus", $na_cpus ); 934 935 $tpl->gotoBlock( "_ROOT" ); 936 } 937 938 $tpl->assignGlobal( "total_nodes", $total_nodes ); 939 $tpl->assignGlobal( "total_jobs", $total_jobs ); 940 $tpl->assignGlobal( "total_cpus", $total_cpus ); 941 942 $tpl->assignGlobal( "running_nodes", $running_nodes ); 943 $tpl->assignGlobal( "running_jobs", $running_jobs ); 944 $tpl->assignGlobal( "running_cpus", $running_cpus ); 945 946 $tpl->assignGlobal( "used_nodes", $used_nodes ); 947 $tpl->assignGlobal( "used_jobs", $used_jobs ); 948 $tpl->assignGlobal( "used_cpus", $used_cpus ); 949 950 $tpl->assignGlobal( "free_nodes", $free_nodes ); 951 $tpl->assignGlobal( "free_cpus", $free_cpus ); 952 953 $tpl->assignGlobal( "view_nodes", $view_nodes ); 954 $tpl->assignGlobal( "view_jobs", $view_jobs ); 955 $tpl->assignGlobal( "view_cpus", $view_cpus ); 956 957 $tpl->assignGlobal( "report_time", makeDate( $heartbeat) ); 938 $tpl_data->assign( "na_nodes", "yes"); 939 940 $tpl_data->assign( "na_nodes", $na_nodes ); 941 $tpl_data->assign( "na_cpus", $na_cpus ); 942 } 943 944 $tpl_data->assign( "total_nodes", $total_nodes ); 945 $tpl_data->assign( "total_jobs", $total_jobs ); 946 $tpl_data->assign( "total_cpus", $total_cpus ); 947 948 $tpl_data->assign( "running_nodes", $running_nodes ); 949 $tpl_data->assign( "running_jobs", $running_jobs ); 950 $tpl_data->assign( "running_cpus", $running_cpus ); 951 952 $tpl_data->assign( "used_nodes", $used_nodes ); 953 $tpl_data->assign( "used_jobs", $used_jobs ); 954 $tpl_data->assign( "used_cpus", $used_cpus ); 955 956 $tpl_data->assign( "free_nodes", $free_nodes ); 957 $tpl_data->assign( "free_cpus", $free_cpus ); 958 959 $tpl_data->assign( "view_nodes", $view_nodes ); 960 $tpl_data->assign( "view_jobs", $view_jobs ); 961 $tpl_data->assign( "view_cpus", $view_cpus ); 962 963 $tpl_data->assign( "report_time", makeDate( $heartbeat) ); 958 964 959 965 if( intval($view_jobs) == 1 and $start_time ) … … 976 982 if( intval($view_jobs) == 1 and $start_time ) 977 983 { 978 $tpl ->newBlock( "showhosts" );984 $tpl_data->assign( "showhosts", "yes" ); 979 985 980 986 # Present a width list … … 995 1001 $cols_menu .= "</SELECT>\n"; 996 1002 997 $tpl ->assign( "metric","$metricname $units" );998 $tpl ->assign( "id", $filter['id'] );1003 $tpl_data->assign( "metric","$metricname $units" ); 1004 $tpl_data->assign( "id", $filter['id'] ); 999 1005 1000 1006 # Host columns menu defined in header.php 1001 $tpl ->assign( "cols_menu", $cols_menu );1007 $tpl_data->assign( "cols_menu", $cols_menu ); 1002 1008 1003 1009 $showhosts = isset($sh) ? $sh : $default_showhosts; 1004 1010 1005 $tpl->assign( "checked$showhosts", "checked" ); 1011 $tpl_data->assign( "checked$showhosts", "checked" ); 1012 1013 $sorted_list = array(); 1006 1014 1007 1015 if( $showhosts ) … … 1096 1104 $i = 1; 1097 1105 1106 $metric_loop = array(); 1098 1107 foreach ( $sorted_hosts as $host=>$value ) 1099 1108 { 1100 $tpl->newBlock( "sorted_list" );1101 1102 1109 $host_url = rawurlencode( $host ); 1103 1110 $cluster_url = rawurlencode( $clustername ); … … 1150 1157 } 1151 1158 1152 $ tpl->assign( "metric_image", $cell );1159 $metric_loop["metric_image"] = $cell; 1153 1160 1154 1161 if(! ($i++ % $hostcols) ) 1155 1162 { 1156 $tpl->assign( "br", "</tr><tr>" ); 1157 } 1158 } 1159 } 1160 } 1163 $metric_loop["br"] = "</tr><tr>"; 1164 } 1165 $sorted_list[] = $metric_loop; 1166 } 1167 $tpl_data->assign("sorted_list", $sorted_list ); 1168 } 1169 } 1170 $dwoo->output($tpl, $tpl_data); 1161 1171 } 1172 1162 1173 ?> -
branches/0.4/web/addons/job_monarch/templates/footer.tpl
r726 r753 2 2 <CENTER> 3 3 <FONT SIZE="-1" class=footer> 4 <A HREF="https://oss.trac.surfsara.nl/jobmonarch/">Job Monarch</A> version { monarch-version}4 <A HREF="https://oss.trac.surfsara.nl/jobmonarch/">Job Monarch</A> version {$monarchversion} 5 5 <A HREF="https://oss.trac.surfsara.nl/jobmonarch/">Check for Updates.</A><BR> 6 6 7 Ganglia web version { webfrontend-version}<BR>7 Ganglia web version {$webfrontendversion}<BR> 8 8 9 Downloading and parsing ganglia's XML tree took { parsetime}.<BR>9 Downloading and parsing ganglia's XML tree took {$parsetime}.<BR> 10 10 Images created with <A HREF="http://www.rrdtool.org/">RRDTool</A>.<BR> 11 11 </FONT> -
branches/0.4/web/addons/job_monarch/templates/header.tpl
r336 r753 2 2 <HTML> 3 3 <HEAD> 4 <TITLE>Ganglia :: { longpage_title}</TITLE>4 <TITLE>Ganglia :: {$longpage_title}</TITLE> 5 5 <META http-equiv="Content-type" content="text/html; charset=utf-8"> 6 <META http-equiv="refresh" content="{ refresh}{redirect}" >6 <META http-equiv="refresh" content="{$refresh}{$redirect}" > 7 7 <LINK rel="stylesheet" href="./styles.css" type="text/css"> 8 8 <SCRIPT LANGUAGE="javascript" SRC="ts_picker.js"></SCRIPT> … … 11 11 function setPeriodTimestamps() { 12 12 13 document.{ form_name}.period_start.value = document.{form_name}.period_start_pick.value;14 document.{ form_name}.period_stop.value = document.{form_name}.period_stop_pick.value;13 document.{$form_name}.period_start.value = document.{$form_name}.period_start_pick.value; 14 document.{$form_name}.period_stop.value = document.{$form_name}.period_stop_pick.value; 15 15 } 16 16 … … 19 19 <BODY BGCOLOR="#FFFFFF"> 20 20 21 <FORM ACTION="./" METHOD="GET" NAME="{ form_name}">22 <INPUT TYPE="HIDDEN" NAME="c" VALUE="{ cluster}">23 <INPUT TYPE="HIDDEN" NAME="view" VALUE="{ view}">21 <FORM ACTION="./" METHOD="GET" NAME="{$form_name}"> 22 <INPUT TYPE="HIDDEN" NAME="c" VALUE="{$cluster}"> 23 <INPUT TYPE="HIDDEN" NAME="view" VALUE="{$view}"> 24 24 <TABLE WIDTH="100%"> 25 25 <TR> … … 35 35 <TD BGCOLOR="#DDDDDD"> 36 36 <FONT SIZE="+1"> 37 <B>{ page_title} for {date}</B>37 <B>{$page_title} for {$date}</B> 38 38 </FONT> 39 39 </TD> … … 45 45 <TR> 46 46 <TD COLSPAN=1> 47 { metric_menu} 48 { range_menu} 49 { sort_menu} 50 <!-- START BLOCK : timeperiod --> 51 <INPUT TYPE="HIDDEN" NAME="period_start" VALUE="{ period_start}">52 <INPUT TYPE="HIDDEN" NAME="period_stop" VALUE="{ period_stop}">53 <INPUT TYPE="HIDDEN" NAME="h" VALUE="{ hostname}">47 {$metric_menu} 48 {$range_menu} 49 {$sort_menu} 50 {if "$timeperiod" == "yes"} 51 <INPUT TYPE="HIDDEN" NAME="period_start" VALUE="{$period_start}"> 52 <INPUT TYPE="HIDDEN" NAME="period_stop" VALUE="{$period_stop}"> 53 <INPUT TYPE="HIDDEN" NAME="h" VALUE="{$hostname}"> 54 54 <BR><BR><B>Graph/ from 55 <INPUT TYPE="text" NAME="period_start_pick" VALUE="{ period_start}" ALT="Start time" DISABLED="TRUE">56 <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">55 <INPUT TYPE="text" NAME="period_start_pick" VALUE="{$period_start}" ALT="Start time" DISABLED="TRUE"> 56 <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"> 57 57 <img src="cal.gif" width="16" height="16" border="0"></a> 58 <a href="#" onClick="javascript: document.{ form_name}.period_start_pick.value=''" alt="Click here to clear field" title="Click here to clear field">58 <a href="#" onClick="javascript: document.{$form_name}.period_start_pick.value=''" alt="Click here to clear field" title="Click here to clear field"> 59 59 <IMG SRC="redcross.jpg" BORDER=0></A> 60 to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{ period_stop}" ALT="Stop time" DISABLED="TRUE">61 <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">60 to <INPUT TYPE="text" NAME="period_stop_pick" VALUE="{$period_stop}" ALT="Stop time" DISABLED="TRUE"> 61 <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"> 62 62 <img src="cal.gif" width="16" height="16" border="0"></a> 63 <a href="#" onClick="javascript: document.{ form_name}.period_stop_pick.value=''" alt="Click here to clear field" title="Click here to clear field">63 <a href="#" onClick="javascript: document.{$form_name}.period_stop_pick.value=''" alt="Click here to clear field" title="Click here to clear field"> 64 64 </B> 65 65 <IMG SRC="redcross.jpg" BORDER=0></A> 66 66 67 <!-- START BLOCK : hostview --> 68 <INPUT TYPE="HIDDEN" NAME="job_start" VALUE="{ job_start}">69 <INPUT TYPE="HIDDEN" NAME="job_stop" VALUE="{ job_stop}">70 <!-- END BLOCK : hostview --> 67 {if "$hostview" == "yes"} 68 <INPUT TYPE="HIDDEN" NAME="job_start" VALUE="{$job_start}"> 69 <INPUT TYPE="HIDDEN" NAME="job_stop" VALUE="{$job_stop}"> 70 {/if} 71 71 <INPUT TYPE="submit" onClick="setPeriodTimestamps();" VALUE="Refresh graphs"> 72 <!-- END BLOCK : timeperiod --> 72 {/if} 73 73 </TD> 74 74 <TD> 75 <B>{ alt_view}</B>75 <B>{$alt_view}</B> 76 76 </TD> 77 77 … … 79 79 </TABLE> 80 80 81 <!-- START BLOCK : search --> 81 {if "$search" == "yes"} 82 82 <TD align="right"><CENTER> 83 <A HREF="./?c={ cluster_url}&view=search">83 <A HREF="./?c={$cluster_url}&view=search"> 84 84 <B><I>Jobarchive</I></B><BR> 85 <IMG SRC="./document_archive.jpg" HEIGHT=100 ALT="Search the archive for { cluster}" TITLE="Search the archive for {cluster}" BORDER=0></A></CENTER>85 <IMG SRC="./document_archive.jpg" HEIGHT=100 ALT="Search the archive for {$cluster}" TITLE="Search the archive for {$cluster}" BORDER=0></A></CENTER> 86 86 </TD> 87 <!-- END BLOCK : search --> 87 {/if} 88 88 89 89 </TD> … … 92 92 93 93 <FONT SIZE="+1"> 94 { node_menu}94 {$node_menu} 95 95 </FONT> 96 96 -
branches/0.4/web/addons/job_monarch/templates/index.tpl
r117 r753 1 <!-- TOGA SOB: <header> --> 2 <!-- INCLUDE BLOCK : header --> 3 <!-- TOGA EOB: </header> --> 4 <!-- TOGA SOB: <main> --> 5 <!-- INCLUDE BLOCK : main --> 6 <!-- TOGA EOB: </main> --> 7 <!-- TOGA SOB: <footer> --> 8 <!-- INCLUDE BLOCK : footer --> 9 <!-- TOGA EOB: </footer> --> 1 {include(file="$header")} 2 {include(file="$main")} 3 {include(file="$footer")} -
branches/0.4/web/addons/job_monarch/templates/overview.tpl
r741 r753 20 20 </TR> 21 21 22 <!-- START BLOCK : na_nodes --> 22 {if "$na_nodes" == "yes"} 23 23 <TR class="overview"> 24 24 <TD class="gray"> … … 26 26 </TD> 27 27 <TD class="gray"> 28 {na_jobs} 29 </TD> 30 <TD class="gray"> 31 {na_nodes} 32 </TD> 33 <TD class="gray"> 34 {na_cpus} 35 </TD> 36 </TR> 37 <!-- END BLOCK : na_nodes --> 38 28 {$na_jobs} 29 </TD> 30 <TD class="gray"> 31 {$na_nodes} 32 </TD> 33 <TD class="gray"> 34 {$na_cpus} 35 </TD> 36 </TR> 37 {/if} 39 38 40 39 <TR class="overview_line"> … … 45 44 </TD> 46 45 <TD class="blue"> 47 { avail_nodes}48 </TD> 49 <TD class="blue"> 50 { avail_cpus}46 {$avail_nodes} 47 </TD> 48 <TD class="blue"> 49 {$avail_cpus} 51 50 </TD> 52 51 </TR> … … 59 58 </TD> 60 59 <TD class="red"> 61 { running_jobs}62 </TD> 63 <TD class="red"> 64 { running_nodes}65 </TD> 66 <TD class="red"> 67 { running_cpus}60 {$running_jobs} 61 </TD> 62 <TD class="red"> 63 {$running_nodes} 64 </TD> 65 <TD class="red"> 66 {$running_cpus} 68 67 </TD> 69 68 </TR> … … 74 73 </TD> 75 74 <TD class="gray"> 76 { queued_jobs}77 </TD> 78 <TD class="gray"> 79 { queued_nodes}80 </TD> 81 <TD class="gray"> 82 { queued_cpus}75 {$queued_jobs} 76 </TD> 77 <TD class="gray"> 78 {$queued_nodes} 79 </TD> 80 <TD class="gray"> 81 {$queued_cpus} 83 82 </TD> 84 83 </TR> … … 89 88 </TD> 90 89 <TD class="brown"> 91 { total_jobs}92 </TD> 93 <TD class="brown"> 94 { total_nodes}95 </TD> 96 <TD class="brown"> 97 { total_cpus}90 {$total_jobs} 91 </TD> 92 <TD class="brown"> 93 {$total_nodes} 94 </TD> 95 <TD class="brown"> 96 {$total_cpus} 98 97 </TD> 99 98 </TR> … … 107 106 </TD> 108 107 <TD class="green"> 109 { free_nodes}110 </TD> 111 <TD class="green"> 112 { free_cpus}108 {$free_nodes} 109 </TD> 110 <TD class="green"> 111 {$free_cpus} 113 112 </TD> 114 113 </TR> … … 119 118 </TD> 120 119 <TD> 121 { view_jobs}122 </TD> 123 <TD> 124 { view_nodes}125 </TD> 126 <TD> 127 { view_cpus}120 {$view_jobs} 121 </TD> 122 <TD> 123 {$view_nodes} 124 </TD> 125 <TD> 126 {$view_cpus} 128 127 </TD> 129 128 </TR> … … 133 132 <BR> 134 133 <div id="monarchimage"> 135 { rjqj_graph}134 {$rjqj_graph} 136 135 </div> 137 136 … … 139 138 <!-- INCLUDESCRIPT BLOCK : ci_script --> 140 139 <div id="monarchimage"> 141 <IMG SRC="{ clusterimage}" USEMAP="#MONARCH_CLUSTER_BIG" BORDER="0">140 <IMG SRC="{$clusterimage}" USEMAP="#MONARCH_CLUSTER_BIG" BORDER="0"> 142 141 </div> 143 142 <MAP NAME="MONARCH_CLUSTER_BIG"> 144 <!-- START BLOCK : node_clustermap --> 145 { node_area_map}146 <!-- END BLOCK : node_clustermap --> 143 {if "$nodes_clustermap" == "yes"} 144 {$node_area_map} 145 {/if} 147 146 </MAP> 148 147 <BR> 149 <FONT class="footer">Last updated: { report_time}</FONT></CENTER>148 <FONT class="footer">Last updated: {$report_time}</FONT></CENTER> 150 149 </TD> 151 150 152 151 </TD> 153 152 <TD ALIGN="CENTER"> 154 <IMG SRC="{ pie}">153 <IMG SRC="{$pie}"> 155 154 </TD> 156 155 </TR> … … 162 161 <NOSCRIPT><P>[Sorting by column header requires JavaScript]<BR><BR></P></NOSCRIPT> 163 162 164 <INPUT TYPE="HIDDEN" NAME="sortby" VALUE="{ sortby}">165 <INPUT TYPE="HIDDEN" NAME="sortorder" VALUE="{ sortorder}">166 <INPUT TYPE="HIDDEN" NAME="c" VALUE="{ clustername}">167 <INPUT TYPE="HIDDEN" NAME="queue" VALUE="{ queue}">168 <INPUT TYPE="HIDDEN" NAME="state" VALUE="{ state}">169 <INPUT TYPE="HIDDEN" NAME="owner" VALUE="{ owner}">170 <INPUT TYPE="HIDDEN" NAME="id" VALUE="{ id}">171 <INPUT TYPE="HIDDEN" NAME="filterorder" VALUE="{ order}">163 <INPUT TYPE="HIDDEN" NAME="sortby" VALUE="{$sortby}"> 164 <INPUT TYPE="HIDDEN" NAME="sortorder" VALUE="{$sortorder}"> 165 <INPUT TYPE="HIDDEN" NAME="c" VALUE="{$clustername}"> 166 <INPUT TYPE="HIDDEN" NAME="queue" VALUE="{$queue}"> 167 <INPUT TYPE="HIDDEN" NAME="state" VALUE="{$state}"> 168 <INPUT TYPE="HIDDEN" NAME="owner" VALUE="{$owner}"> 169 <INPUT TYPE="HIDDEN" NAME="id" VALUE="{$id}"> 170 <INPUT TYPE="HIDDEN" NAME="filterorder" VALUE="{$order}"> 172 171 173 172 <TABLE WIDTH="100%" CELLPADDING="2" CELLSPACING="2" BORDER=0> … … 179 178 <TH><B><A HREF="#" onClick="setSort( 'name' )" ALT="Jobname" TITLE="Jobname">Name</A></B></TH> 180 179 <TH><B><A HREF="#" onClick="setSort( 'req_cpu' )" ALT="Requested CPU Time (walltime)" TITLE="Requested CPU Time (walltime)">Req. CPU time</A></B></TH> 181 <!-- START BLOCK : column_header_req_mem --> 180 {if "$column_header_req_mem" == "yes"} 182 181 <TH><B><A HREF="#" onClick="setSort( 'req_mem' )" ALT="Requested Memory" TITLE="Requested Memory">Req. Memory</A></B></TH> 183 <!-- END BLOCK : column_header_req_mem --> 182 {/if} 184 183 <TH><B><A HREF="#" onClick="setSort( 'nodes' )" ALT="Nodes" TITLE="Nodes">N</A>/<A HREF="#" onClick="setSort( 'cpus' )" ALT="Processors" TITLE="Processors">P</A></B></TH> 185 <!-- START BLOCK : column_header_queued --> 184 {if "$column_header_queued" == "yes"} 186 185 <TH><B><A HREF="#" onClick="setSort( 'queued' )">Queued</A></B></TH> 187 <!-- END BLOCK : column_header_queued --> 188 <!-- START BLOCK : column_header_nodes --> 186 {/if} 187 {if "$column_header_nodes" == "yes"} 189 188 <TH WIDTH="11%"><B><A HREF="#" onClick="setSort( 'nodes' )" ALT="Nodes" TITLE="Nodes">Nodes</A></B></TH> 190 <!-- END BLOCK : column_header_nodes --> 189 {/if} 191 190 <TH><B><A HREF="#" onClick="setSort( 'start' )">Started</A></B></TH> 192 191 <TH><B><A HREF="#" onClick="setSort( 'runningtime' )">Runningtime</A></B></TH> 193 192 </TR> 194 193 195 <!-- START BLOCK : node --> 196 <TR CLASS="{ nodeclass}">197 <TD><A HREF="#" onClick="setFilter( 'id', '{ id}' )">{id}</A></TD>198 <TD><A HREF="#" onClick="setFilter( 'state', '{ state}' )" ALT="{fullstate}" TITLE="{fullstate}">{state}</A></TD>199 <TD><A HREF="#" onClick="setFilter( 'owner', '{ owner}' )">{owner}</A></TD>200 <TD><A HREF="#" onClick="setFilter( 'queue', '{ queue}' )">{queue}</A></TD>201 <TD ALT="{ fulljobname}" TITLE="{fulljobname}">202 <!-- START BLOCK : jobname_hint_start --> 194 {loop $node_list} 195 <TR CLASS="{$nodeclass}"> 196 <TD><A HREF="#" onClick="setFilter( 'id', '{$id}' )">{$id}</A></TD> 197 <TD><A HREF="#" onClick="setFilter( 'state', '{$state}' )" ALT="{$fullstate}" TITLE="{$fullstate}">{$state}</A></TD> 198 <TD><A HREF="#" onClick="setFilter( 'owner', '{$owner}' )">{$owner}</A></TD> 199 <TD><A HREF="#" onClick="setFilter( 'queue', '{$queue}' )">{$queue}</A></TD> 200 <TD ALT="{$fulljobname}" TITLE="{$fulljobname}"> 201 {if "$jobname_hint_start" == "yes"} 203 202 <FONT CLASS="jobname_hint"> 204 <!-- END BLOCK : jobname_hint_start --> 205 { name}206 <!-- START BLOCK : jobname_hint_end --> 203 {/if} 204 {$name} 205 {if "$jobname_hint_end" == "yes"} 207 206 </FONT> 208 <!-- END BLOCK : jobname_hint_end --> 207 {/if} 209 208 </TD> 210 <TD>{ req_cpu}</TD>211 <!-- START BLOCK : column_req_mem --> 212 <TD>{ req_memory}</TD>213 <!-- END BLOCK : column_req_mem --> 214 <TD>{ nodes}/{cpus}</TD>215 <!-- START BLOCK : column_queued --> 216 <TD>{ queued}</TD>217 <!-- END BLOCK : column_queued --> 218 <!-- START BLOCK : column_nodes --> 219 <TD>{ nodes_hostnames}</TD>220 <!-- END BLOCK : column_nodes --> 221 <TD>{ started}</TD>222 <TD>{ runningtime}</TD>209 <TD>{$req_cpu}</TD> 210 {if "$column_req_mem" == "yes"} 211 <TD>{$req_memory}</TD> 212 {/if} 213 <TD>{$nodes}/{$cpus}</TD> 214 {if "$column_queued" == "yes"} 215 <TD>{$queued}</TD> 216 {/if} 217 {if "$column_nodes" == "yes"} 218 <TD>{$nodes_hostnames}</TD> 219 {/if} 220 <TD>{$started}</TD> 221 <TD>{$runningtime}</TD> 223 222 </TR> 224 <!-- END BLOCK : node --> 223 {/loop} 225 224 </TABLE> 226 225 </CENTER> 227 226 228 <!-- START BLOCK : showhosts --> 227 {if "$showhosts" == "yes"} 229 228 <TABLE BORDER="0" WIDTH="100%"> 230 229 <TR> … … 232 231 <FONT SIZE="-1"> 233 232 Show Hosts: 234 yes<INPUT type=radio name="sh" value="1" OnClick="toga_form.submit();" { checked1}>235 no<INPUT type=radio name="sh" value="0" OnClick="toga_form.submit();" { checked0}>233 yes<INPUT type=radio name="sh" value="1" OnClick="toga_form.submit();" {$checked1}> 234 no<INPUT type=radio name="sh" value="0" OnClick="toga_form.submit();" {$checked0}> 236 235 </FONT> 237 236 | 238 job <strong>{ id}</strong> metric <strong>{metric}</strong>237 job <strong>{$id}</strong> metric <strong>{$metric}</strong> 239 238 | 240 239 <FONT SIZE="-1"> 241 Columns { cols_menu}240 Columns {$cols_menu} 242 241 </FONT> 243 242 </TD> … … 249 248 <TABLE> 250 249 <TR> 251 <!-- START BLOCK : sorted_list --> 252 { metric_image}{br}253 <!-- END BLOCK : sorted_list --> 250 {loop $sorted_list} 251 {$metric_image}{$br} 252 {/loop} 254 253 </TR> 255 254 </TABLE> … … 260 259 </CENTER> 261 260 262 <!-- END BLOCK : showhosts --> 261 {/if}
Note: See TracChangeset
for help on using the changeset viewer.