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