[113] | 1 | <?php |
---|
[225] | 2 | /* |
---|
| 3 | * |
---|
| 4 | * This file is part of Jobmonarch |
---|
| 5 | * |
---|
| 6 | * Copyright (C) 2006 Ramon Bastiaans |
---|
| 7 | * |
---|
| 8 | * Jobmonarch is free software; you can redistribute it and/or modify |
---|
| 9 | * it under the terms of the GNU General Public License as published by |
---|
| 10 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 11 | * (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * Jobmonarch is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 21 | * |
---|
[231] | 22 | * SVN $Id: index.php 711 2013-03-21 19:56:28Z ramonb $ |
---|
[225] | 23 | */ |
---|
[113] | 24 | |
---|
[686] | 25 | ini_set("memory_limit","500M"); |
---|
[398] | 26 | set_time_limit(0); |
---|
| 27 | |
---|
[409] | 28 | |
---|
| 29 | $my_dir = getcwd(); |
---|
| 30 | |
---|
| 31 | global $r, $range; |
---|
| 32 | |
---|
| 33 | include_once "./libtoga.php"; |
---|
| 34 | |
---|
[117] | 35 | if ( !empty( $_GET ) ) { |
---|
| 36 | extract( $_GET ); |
---|
| 37 | } |
---|
| 38 | |
---|
[409] | 39 | //printf( "r2%s\n", $range ); |
---|
[113] | 40 | |
---|
[117] | 41 | global $GANGLIA_PATH; |
---|
[686] | 42 | //chdir( $GANGLIA_PATH ); |
---|
[113] | 43 | |
---|
| 44 | include_once "./class.TemplatePower.inc.php"; |
---|
[686] | 45 | //chdir( $my_dir ); |
---|
[113] | 46 | |
---|
[117] | 47 | $httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET ); |
---|
| 48 | $clustername = $httpvars->getClusterName(); |
---|
[708] | 49 | $view = $httpvars->getHttpVar( "j_view" ); |
---|
[113] | 50 | |
---|
[119] | 51 | $filter = array(); |
---|
| 52 | |
---|
[117] | 53 | if( !isset($view) ) $view = "overview"; |
---|
| 54 | if( !isset($sortorder) ) $sortorder = "asc"; |
---|
| 55 | if( !isset($sortby) ) $sortby = "id"; |
---|
| 56 | |
---|
[178] | 57 | if( isset( $filterorder ) && ($filterorder!='') ) { |
---|
| 58 | $myfilter_fields = explode( ",", $filterorder ); |
---|
| 59 | } else { |
---|
[710] | 60 | if( isset($queue) && ($queue!='')) $filter['queue']=$queue; |
---|
| 61 | if( isset($state) && ($state!='')) $filter['state']=$state; |
---|
[711] | 62 | if( isset($owner) && ($owner!='')) $filter['owner']=$owner; |
---|
[710] | 63 | if( isset($id) && ($id!='')) $filter['id']=$id; |
---|
[178] | 64 | } |
---|
[158] | 65 | |
---|
| 66 | // Fill filter array in order they were picked by user |
---|
[300] | 67 | if( isset($myfilter_fields) ) { |
---|
[158] | 68 | |
---|
[300] | 69 | foreach( $myfilter_fields as $myfilter ) { |
---|
[158] | 70 | |
---|
[300] | 71 | switch( $myfilter ) { |
---|
| 72 | |
---|
[710] | 73 | case "queue": |
---|
[711] | 74 | $filter['queue']=$queue; |
---|
[300] | 75 | break; |
---|
| 76 | case "state": |
---|
[711] | 77 | $filter['state']=$state; |
---|
[300] | 78 | break; |
---|
[711] | 79 | case "owner": |
---|
| 80 | $filter['owner']=$owner; |
---|
[300] | 81 | break; |
---|
| 82 | case "id": |
---|
[711] | 83 | $filter['id']=$id; |
---|
[300] | 84 | break; |
---|
| 85 | } |
---|
[158] | 86 | } |
---|
| 87 | } |
---|
| 88 | |
---|
| 89 | //if( isset($queue) && ($queue!='')) $filter[queue]=$queue; |
---|
| 90 | //if( isset($state) && ($state!='')) $filter[state]=$state; |
---|
| 91 | //if( isset($user) && ($user!='')) $filter[user]=$user; |
---|
| 92 | //if( isset($id) && ($id!='')) $filter[id]=$id; |
---|
| 93 | |
---|
[189] | 94 | function epochToDatetime( $epoch ) { |
---|
| 95 | |
---|
| 96 | return strftime( "%d-%m-%Y %H:%M:%S", $epoch ); |
---|
| 97 | } |
---|
| 98 | |
---|
[406] | 99 | function makeHeader( $page_call, $title, $longtitle ) { |
---|
[117] | 100 | |
---|
| 101 | global $tpl, $grid, $context, $initgrid; |
---|
[406] | 102 | global $jobrange, $jobstart; |
---|
[117] | 103 | global $page, $gridwalk, $clustername; |
---|
| 104 | global $parentgrid, $physical, $hostname; |
---|
[122] | 105 | global $self, $filter, $cluster_url, $get_metric_string; |
---|
[126] | 106 | global $metrics, $reports, $m, $default_metric; |
---|
[138] | 107 | global $default_refresh, $filterorder, $view; |
---|
[206] | 108 | global $JOB_ARCHIVE, $period_start, $period_stop, $h, $id; |
---|
[411] | 109 | global $job_start, $job_stop, $range, $r, $metricname; |
---|
[145] | 110 | |
---|
[126] | 111 | if( isset($default_metric) and !isset($m) ) |
---|
| 112 | $metricname = $default_metric; |
---|
| 113 | else |
---|
| 114 | if( isset( $m ) ) |
---|
| 115 | $metricname = $m; |
---|
| 116 | else |
---|
| 117 | $metricname = "load_one"; |
---|
| 118 | |
---|
[129] | 119 | $header = "header"; |
---|
[117] | 120 | |
---|
| 121 | # Maintain our path through the grid tree. |
---|
| 122 | $me = $self . "@" . $grid[$self][AUTHORITY]; |
---|
| 123 | |
---|
[129] | 124 | $gridstack = array(); |
---|
| 125 | $gridstack[] = $me; |
---|
| 126 | |
---|
| 127 | if ($gridwalk=="fwd") { |
---|
[117] | 128 | # push our info on gridstack, format is "name@url>name2@url". |
---|
| 129 | if (end($gridstack) != $me) { |
---|
| 130 | $gridstack[] = $me; |
---|
| 131 | } |
---|
| 132 | } else if ($gridwalk=="back") { |
---|
| 133 | # pop a single grid off stack. |
---|
| 134 | if (end($gridstack) != $me) { |
---|
| 135 | array_pop($gridstack); |
---|
| 136 | } |
---|
| 137 | } |
---|
| 138 | |
---|
| 139 | $gridstack_str = join(">", $gridstack); |
---|
| 140 | $gridstack_url = rawurlencode($gridstack_str); |
---|
| 141 | |
---|
| 142 | if ($initgrid or $gridwalk) { |
---|
| 143 | # Use cookie so we dont have to pass gridstack around within this site. |
---|
| 144 | # Cookie values are automatically urlencoded. Expires in a day. |
---|
| 145 | setcookie("gs", $gridstack_str, time() + 86400); |
---|
| 146 | } |
---|
| 147 | |
---|
| 148 | # Invariant: back pointer is second-to-last element of gridstack. Grid stack never |
---|
| 149 | # has duplicate entries. |
---|
| 150 | list($parentgrid, $parentlink) = explode("@", $gridstack[count($gridstack)-2]); |
---|
| 151 | |
---|
| 152 | # Setup a redirect to a remote server if you choose a grid from pulldown menu. Tell |
---|
| 153 | # destination server that we're walking foward in the grid tree. |
---|
| 154 | if (strstr($clustername, "http://")) { |
---|
| 155 | $tpl->assign("refresh", "0"); |
---|
| 156 | $tpl->assign("redirect", ";URL=$clustername?gw=fwd&gs=$gridstack_url"); |
---|
| 157 | echo "<h2>Redirecting, please wait...</h2>"; |
---|
| 158 | $tpl->printToScreen(); |
---|
| 159 | exit; |
---|
| 160 | } |
---|
[406] | 161 | $tpl->gotoBlock( "_ROOT" ); |
---|
[117] | 162 | |
---|
[161] | 163 | if( $view != "search" ) |
---|
[160] | 164 | $tpl->assign( "refresh", $default_refresh ); |
---|
| 165 | |
---|
[117] | 166 | $tpl->assign( "date", date("r") ); |
---|
[406] | 167 | //printf("lg %s\n", $longtitle ); |
---|
| 168 | //printf("title %s\n", $title ); |
---|
[334] | 169 | $tpl->assign( "longpage_title", $longtitle ); |
---|
[117] | 170 | $tpl->assign( "page_title", $title ); |
---|
| 171 | |
---|
| 172 | # The page to go to when "Get Fresh Data" is pressed. |
---|
[129] | 173 | $tpl->assign("page","./"); |
---|
[117] | 174 | |
---|
| 175 | # Templated Logo image |
---|
| 176 | $tpl->assign("images","./templates/$template_name/images"); |
---|
| 177 | |
---|
| 178 | # |
---|
| 179 | # Used when making graphs via graph.php. Included in most URLs |
---|
| 180 | # |
---|
| 181 | $sort_url=rawurlencode($sort); |
---|
| 182 | $get_metric_string = "m=$metric&r=$range&s=$sort_url&hc=$hostcols"; |
---|
| 183 | |
---|
| 184 | if ($jobrange and $jobstart) |
---|
| 185 | $get_metric_string .= "&jr=$jobrange&js=$jobstart"; |
---|
| 186 | |
---|
| 187 | # Set the Alternate view link. |
---|
| 188 | $cluster_url=rawurlencode($clustername); |
---|
| 189 | $node_url=rawurlencode($hostname); |
---|
| 190 | |
---|
| 191 | # Make some information available to templates. |
---|
| 192 | $tpl->assign("cluster_url", $cluster_url); |
---|
| 193 | # Build the node_menu |
---|
| 194 | $node_menu = ""; |
---|
| 195 | |
---|
| 196 | if ($parentgrid) { |
---|
| 197 | $node_menu .= "<B>$parentgrid $meta_designator</B> "; |
---|
| 198 | $node_menu .= "<B>></B>\n"; |
---|
| 199 | } |
---|
| 200 | |
---|
| 201 | # Show grid. |
---|
| 202 | $mygrid = ($self == "unspecified") ? "" : $self; |
---|
[171] | 203 | $node_menu .= "<B><A HREF=\"../..\">$mygrid $meta_designator</A></B> "; |
---|
[117] | 204 | $node_menu .= "<B>></B>\n"; |
---|
| 205 | |
---|
| 206 | if ($physical) |
---|
| 207 | $node_menu .= hiddenvar("p", $physical); |
---|
| 208 | |
---|
| 209 | if ( $clustername ) { |
---|
| 210 | $url = rawurlencode($clustername); |
---|
[122] | 211 | $node_menu .= "<B><A HREF=\"../../?c=".rawurlencode($clustername)."\">$clustername</A></B> "; |
---|
| 212 | $node_menu .= "<B>></B>\n"; |
---|
[117] | 213 | $node_menu .= hiddenvar("c", $clustername); |
---|
| 214 | } |
---|
| 215 | |
---|
[126] | 216 | if (!count($metrics)) { |
---|
[406] | 217 | echo "<h4>Cannot find any metrics for selected cluster \"$clustername\", exiting.</h4>\n"; |
---|
| 218 | echo "Check ganglia XML tree (telnet $ganglia_ip $ganglia_port)\n"; |
---|
[126] | 219 | exit; |
---|
| 220 | } |
---|
[406] | 221 | reset($metrics); |
---|
[126] | 222 | $firsthost = key($metrics); |
---|
[145] | 223 | |
---|
[406] | 224 | $mmfh = array(); |
---|
[126] | 225 | |
---|
[406] | 226 | $mmfh = $metrics[$firsthost]; |
---|
| 227 | |
---|
| 228 | $context_metrics = array(); |
---|
| 229 | |
---|
| 230 | //foreach ($mmfh as $mm => $mfoo) |
---|
| 231 | foreach( $mmfh as $mm => $bla ) |
---|
| 232 | { |
---|
| 233 | $context_metrics[] = $mm; |
---|
| 234 | } |
---|
| 235 | |
---|
| 236 | foreach ($reports as $mr => $mfoo) |
---|
| 237 | $context_metrics[] = $mr; |
---|
| 238 | |
---|
[122] | 239 | $node_menu .= "<B><A HREF=\"./?c=".rawurlencode($clustername)."\">Joblist</A></B> "; |
---|
| 240 | |
---|
[413] | 241 | if( isset( $hostname ) && ( $view != 'host' ) ) { |
---|
[267] | 242 | |
---|
| 243 | $node_menu .= "<B>></B>\n"; |
---|
| 244 | $href = "<A HREF=\"./?c=".rawurlencode($clustername)."&h=".$hostname."\">"; |
---|
| 245 | $node_menu .= "<B>$href"; |
---|
| 246 | $node_menu .= "host: $hostname</A></B> "; |
---|
| 247 | } |
---|
| 248 | |
---|
[138] | 249 | if( count( $filter ) > 0 && $view != "search" ) { |
---|
[119] | 250 | |
---|
[153] | 251 | $my_ct = 1; |
---|
| 252 | $filter_nr = count( $filter ); |
---|
[119] | 253 | |
---|
[153] | 254 | foreach( $filter as $filtername=>$filterval ) { |
---|
[138] | 255 | |
---|
[153] | 256 | $node_menu .= "<B>></B>\n"; |
---|
| 257 | |
---|
| 258 | $href = "<A HREF=\"./?c=".rawurlencode($clustername); |
---|
| 259 | $temp_ct = 0; |
---|
| 260 | $n_filter = $filter; |
---|
[158] | 261 | $my_filterorder = ""; |
---|
| 262 | $my_filters = array_keys( $filter ); |
---|
[153] | 263 | |
---|
| 264 | foreach( $n_filter as $n_filtername=>$n_filterval ) { |
---|
| 265 | |
---|
[158] | 266 | if( $temp_ct < $my_ct ) { |
---|
[153] | 267 | $href .= "&". $n_filtername . "=" . $n_filterval; |
---|
| 268 | |
---|
[158] | 269 | if( $my_filterorder == "" ) |
---|
| 270 | $my_filterorder = $my_filters[$temp_ct]; |
---|
| 271 | else |
---|
| 272 | $my_filterorder .= "," . $my_filters[$temp_ct]; |
---|
| 273 | } |
---|
| 274 | |
---|
[153] | 275 | $temp_ct++; |
---|
[138] | 276 | } |
---|
[158] | 277 | $href .= "&filterorder=$my_filterorder\">"; |
---|
[138] | 278 | |
---|
[153] | 279 | if( $my_ct < $filter_nr ) |
---|
| 280 | $node_menu .= "<B>$href$filtername: $filterval</A></B> "; |
---|
| 281 | else |
---|
[138] | 282 | $node_menu .= "<B>$filtername: $filterval</B> "; |
---|
[153] | 283 | |
---|
| 284 | $my_ct++; |
---|
[119] | 285 | } |
---|
| 286 | } |
---|
| 287 | |
---|
[411] | 288 | //$m = $metricname; |
---|
[149] | 289 | |
---|
| 290 | |
---|
[189] | 291 | $tpl->gotoBlock( "_ROOT" ); |
---|
| 292 | $tpl->assignGlobal("view", $view); |
---|
[143] | 293 | |
---|
[409] | 294 | |
---|
[189] | 295 | if( array_key_exists( "id", $filter ) or isset($hostname) ) { |
---|
[117] | 296 | |
---|
[409] | 297 | $range = "job"; |
---|
| 298 | |
---|
[178] | 299 | //print_r( $context_metrics ); |
---|
| 300 | |
---|
[413] | 301 | if( $page_call != "host_view" ) |
---|
| 302 | { |
---|
[126] | 303 | |
---|
[413] | 304 | if (is_array($context_metrics) ) { |
---|
| 305 | $metric_menu = "<B>Metric</B> " |
---|
| 306 | ."<SELECT NAME=\"m\" OnChange=\"toga_form.submit();\">\n"; |
---|
| 307 | |
---|
| 308 | sort($context_metrics); |
---|
| 309 | foreach( $context_metrics as $k ) { |
---|
| 310 | $url = rawurlencode($k); |
---|
| 311 | $metric_menu .= "<OPTION VALUE=\"$url\" "; |
---|
| 312 | if ($k == $metricname ) |
---|
| 313 | $metric_menu .= "SELECTED"; |
---|
| 314 | $metric_menu .= ">$k\n"; |
---|
| 315 | } |
---|
| 316 | $metric_menu .= "</SELECT>\n"; |
---|
[358] | 317 | } |
---|
[189] | 318 | |
---|
[126] | 319 | } |
---|
[149] | 320 | |
---|
| 321 | $tpl->assign("metric_menu", $metric_menu ); |
---|
[189] | 322 | |
---|
| 323 | if( $view == "search" or $view == "host" ) { |
---|
| 324 | $tpl->newBlock("timeperiod"); |
---|
| 325 | if( is_numeric( $period_start ) ) { |
---|
| 326 | $period_start = epochToDatetime( $period_start ); |
---|
| 327 | } |
---|
| 328 | if( is_numeric( $period_stop ) ) { |
---|
| 329 | $period_stop = epochToDatetime( $period_stop ); |
---|
| 330 | } |
---|
| 331 | $tpl->assign("period_start", $period_start ); |
---|
| 332 | $tpl->assign("period_stop", $period_stop ); |
---|
| 333 | $tpl->assign("hostname", $hostname ); |
---|
| 334 | |
---|
| 335 | if( $view == "host" ) { |
---|
| 336 | $tpl->newBlock("hostview"); |
---|
| 337 | $tpl->assign("job_start", $job_start ); |
---|
| 338 | $tpl->assign("job_stop", $job_stop ); |
---|
| 339 | } |
---|
| 340 | } |
---|
| 341 | |
---|
[126] | 342 | } |
---|
| 343 | |
---|
[263] | 344 | //$ex_fn = $tpl->getVarValue( "_ROOT", "form_name" ); |
---|
| 345 | |
---|
[410] | 346 | if( $view != "search" ) |
---|
| 347 | { |
---|
| 348 | $context_ranges[]="hour"; |
---|
| 349 | $context_ranges[]="day"; |
---|
| 350 | $context_ranges[]="week"; |
---|
| 351 | $context_ranges[]="month"; |
---|
| 352 | $context_ranges[]="year"; |
---|
| 353 | $context_ranges[]="job"; |
---|
[409] | 354 | |
---|
[410] | 355 | $range_menu = "<B>Last</B> " ."<SELECT NAME=\"r\" OnChange=\"toga_form.submit();\">\n"; |
---|
| 356 | foreach ($context_ranges as $v) { |
---|
| 357 | $url=rawurlencode($v); |
---|
| 358 | $range_menu .= "<OPTION VALUE=\"$url\" "; |
---|
| 359 | if ($v == $range) |
---|
| 360 | $range_menu .= "SELECTED"; |
---|
| 361 | $range_menu .= ">$v\n"; |
---|
| 362 | } |
---|
| 363 | $range_menu .= "</SELECT>\n"; |
---|
| 364 | |
---|
| 365 | $tpl->assign("range_menu", $range_menu); |
---|
| 366 | |
---|
[409] | 367 | } |
---|
| 368 | |
---|
[189] | 369 | if( $view == "search" or $view == "host" ) { |
---|
| 370 | |
---|
| 371 | $node_menu .= "<B>></B>\n"; |
---|
| 372 | $node_menu .= "<B>Jobarchive</B> "; |
---|
| 373 | $form_name = "archive_search_form"; |
---|
| 374 | $tpl->assignGlobal("form_name", $form_name ); |
---|
| 375 | |
---|
| 376 | } else { |
---|
| 377 | $form_name = "toga_form"; |
---|
| 378 | $tpl->assignGlobal("form_name", $form_name ); |
---|
| 379 | } |
---|
| 380 | |
---|
[406] | 381 | if( $JOB_ARCHIVE && $page_call == 'overview' ) { |
---|
[140] | 382 | $tpl->newBlock( "search" ); |
---|
| 383 | $tpl->assignGlobal( "cluster_url", rawurlencode($clustername) ); |
---|
| 384 | $tpl->assignGlobal( "cluster", $clustername ); |
---|
| 385 | } |
---|
[189] | 386 | $tpl->gotoBlock( "_ROOT" ); |
---|
| 387 | $tpl->assignGlobal( "cluster", $clustername ); |
---|
| 388 | $tpl->assign("node_menu", $node_menu); |
---|
[140] | 389 | |
---|
[117] | 390 | # Make sure that no data is cached.. |
---|
| 391 | header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Date in the past |
---|
| 392 | header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); # always modified |
---|
| 393 | header ("Cache-Control: no-cache, must-revalidate"); # HTTP/1.1 |
---|
| 394 | header ("Pragma: no-cache"); # HTTP/1.0 |
---|
| 395 | } |
---|
| 396 | |
---|
| 397 | function makeFooter() { |
---|
[195] | 398 | global $tpl, $version, $parsetime, $monarchversion; |
---|
[117] | 399 | |
---|
[195] | 400 | $tpl->gotoBlock( "_ROOT" ); |
---|
[117] | 401 | $tpl->assign("webfrontend-version",$version["webfrontend"]); |
---|
[195] | 402 | $tpl->assign("monarch-version", $monarchversion); |
---|
[117] | 403 | |
---|
| 404 | if ($version["gmetad"]) { |
---|
| 405 | $tpl->assign("webbackend-component", "gmetad"); |
---|
| 406 | $tpl->assign("webbackend-version",$version["gmetad"]); |
---|
| 407 | } else if ($version["gmond"]) { |
---|
| 408 | $tpl->assign("webbackend-component", "gmond"); |
---|
| 409 | $tpl->assign("webbackend-version", $version["gmond"]); |
---|
| 410 | } |
---|
| 411 | |
---|
| 412 | $tpl->assign("parsetime", sprintf("%.4f", $parsetime) . "s"); |
---|
| 413 | } |
---|
| 414 | |
---|
[129] | 415 | function includeSearchpage() { |
---|
[117] | 416 | global $tpl; |
---|
| 417 | |
---|
[129] | 418 | $tpl->assignInclude( "main", "templates/search.tpl" ); |
---|
| 419 | |
---|
[117] | 420 | } |
---|
| 421 | |
---|
[129] | 422 | function includeOverview() { |
---|
| 423 | global $tpl; |
---|
[117] | 424 | |
---|
[129] | 425 | $tpl->assignInclude( "main", "templates/overview.tpl" ); |
---|
[117] | 426 | } |
---|
| 427 | |
---|
[149] | 428 | function includeHostPage() { |
---|
| 429 | |
---|
| 430 | global $tpl; |
---|
| 431 | |
---|
| 432 | $tpl->assignInclude( "main", "templates/host_view.tpl" ); |
---|
| 433 | } |
---|
| 434 | |
---|
[117] | 435 | $tpl = new TemplatePower( "templates/index.tpl" ); |
---|
| 436 | |
---|
| 437 | $tpl->assignInclude( "header", "templates/header.tpl" ); |
---|
| 438 | |
---|
[149] | 439 | if( isset( $h ) and $h != '' ) { |
---|
| 440 | $hostname = $h; |
---|
[263] | 441 | //$view = "host"; |
---|
[149] | 442 | } |
---|
| 443 | |
---|
[117] | 444 | switch( $view ) { |
---|
| 445 | |
---|
| 446 | case "overview": |
---|
| 447 | |
---|
| 448 | includeOverview(); |
---|
| 449 | break; |
---|
| 450 | |
---|
[129] | 451 | case "search": |
---|
[117] | 452 | |
---|
[129] | 453 | includeSearchPage(); |
---|
| 454 | break; |
---|
[117] | 455 | |
---|
[399] | 456 | case "host": |
---|
[149] | 457 | |
---|
[399] | 458 | includeHostPage(); |
---|
| 459 | break; |
---|
[149] | 460 | |
---|
[117] | 461 | default: |
---|
| 462 | |
---|
| 463 | includeOverview(); |
---|
| 464 | break; |
---|
| 465 | } |
---|
| 466 | |
---|
| 467 | $tpl->assignInclude( "footer", "templates/footer.tpl" ); |
---|
| 468 | $tpl->prepare(); |
---|
| 469 | |
---|
[334] | 470 | $longtitle = "Batch Report :: Powered by Job Monarch!"; |
---|
[323] | 471 | $title = "Batch Report"; |
---|
[406] | 472 | //makeHeader( 'index' ); |
---|
[129] | 473 | $tpl->assign("cluster_url", rawurlencode($clustername) ); |
---|
| 474 | $tpl->assign("cluster", $clustername ); |
---|
[117] | 475 | |
---|
| 476 | switch( $view ) { |
---|
| 477 | |
---|
| 478 | case "overview": |
---|
| 479 | |
---|
| 480 | include "./overview.php"; |
---|
| 481 | makeOverview(); |
---|
| 482 | break; |
---|
| 483 | |
---|
[129] | 484 | case "search": |
---|
[117] | 485 | |
---|
[129] | 486 | include "./search.php"; |
---|
| 487 | makeSearchPage(); |
---|
| 488 | break; |
---|
[117] | 489 | |
---|
[399] | 490 | case "host": |
---|
[149] | 491 | |
---|
[399] | 492 | include "./host_view.php"; |
---|
| 493 | makeHostView(); |
---|
| 494 | break; |
---|
[149] | 495 | |
---|
[117] | 496 | default: |
---|
| 497 | |
---|
| 498 | makeOverview(); |
---|
| 499 | break; |
---|
| 500 | } |
---|
| 501 | |
---|
| 502 | makeFooter(); |
---|
| 503 | $tpl->printToScreen(); |
---|
[113] | 504 | ?> |
---|