source: trunk/web/addons/job_monarch/image.php @ 263

Last change on this file since 263 was 231, checked in by bastiaans, 18 years ago

*.php:

  • added svn keywords propset
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
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: image.php 231 2006-03-10 16:36:38Z bastiaans $
23 */
24
25include_once "./libtoga.php";
26
27if ( !empty( $_GET ) ) {
28        extract( $_GET );
29}
30
31$httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET );
32$view = $httpvars->getHttpVar( "view" );
33$clustername = $httpvars->getClusterName();
34
35//printf("clustername = %s\n", $clustername );
36if( isset($id) && ($id!='')) $filter[id]=$id;
37if( isset($state) && ($state!='')) $filter[state]=$state;
38if( isset($user) && ($user!='')) $filter[user]=$user;
39if( isset($queue) && ($queue!='')) $filter[queue]=$queue;
40
41function drawSmallClusterImage() {
42
43        global $clustername;
44
45        $ic = new ClusterImage( $clustername );
46        $ic->draw();
47}
48
49function drawBigClusterImage() {
50
51        global $filter, $clustername;
52
53        $ic = new ClusterImage( $clustername );
54        foreach( $filter as $filtername=>$filtervalue ) {
55                //printf("filter %s,%s\n", $filtername, $filtervalue);
56                switch( $filtername ) {
57
58                        case "id":
59                                $ic->setFilter( 'jobid', $filtervalue );
60                                break;
61                        case "user":
62                                $ic->setFilter( 'owner', $filtervalue);
63                                break;
64                        case "queue":
65                                $ic->setFilter( 'queue', $filtervalue);
66                                break;
67                        case "state":
68                                $ic->setFilter( 'status', $filtervalue);
69                                break;
70                        default:
71                                break;
72                }
73        }
74        $ic->draw();
75}
76
77switch( $view ) {
78
79        case "small-clusterimage":
80
81                drawSmallClusterImage();
82               
83                break;
84
85        case "big-clusterimage":
86
87                drawBigClusterImage();
88       
89                break;
90
91        default:
92
93                break;
94}
95
96?>
Note: See TracBrowser for help on using the repository browser.