[110] | 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 | * |
---|
| 22 | */ |
---|
| 23 | |
---|
[110] | 24 | include_once "./libtoga.php"; |
---|
| 25 | |
---|
[122] | 26 | if ( !empty( $_GET ) ) { |
---|
| 27 | extract( $_GET ); |
---|
| 28 | } |
---|
| 29 | |
---|
[117] | 30 | $httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET ); |
---|
[110] | 31 | $view = $httpvars->getHttpVar( "view" ); |
---|
[111] | 32 | $clustername = $httpvars->getClusterName(); |
---|
[110] | 33 | |
---|
[163] | 34 | //printf("clustername = %s\n", $clustername ); |
---|
[124] | 35 | if( isset($id) && ($id!='')) $filter[id]=$id; |
---|
| 36 | if( isset($state) && ($state!='')) $filter[state]=$state; |
---|
| 37 | if( isset($user) && ($user!='')) $filter[user]=$user; |
---|
| 38 | if( isset($queue) && ($queue!='')) $filter[queue]=$queue; |
---|
[122] | 39 | |
---|
[110] | 40 | function drawSmallClusterImage() { |
---|
| 41 | |
---|
[164] | 42 | global $clustername; |
---|
| 43 | |
---|
[122] | 44 | $ic = new ClusterImage( $clustername ); |
---|
[110] | 45 | $ic->draw(); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | function drawBigClusterImage() { |
---|
| 49 | |
---|
[163] | 50 | global $filter, $clustername; |
---|
[122] | 51 | |
---|
| 52 | $ic = new ClusterImage( $clustername ); |
---|
[124] | 53 | foreach( $filter as $filtername=>$filtervalue ) { |
---|
| 54 | //printf("filter %s,%s\n", $filtername, $filtervalue); |
---|
| 55 | switch( $filtername ) { |
---|
[122] | 56 | |
---|
[124] | 57 | case "id": |
---|
| 58 | $ic->setFilter( 'jobid', $filtervalue ); |
---|
| 59 | break; |
---|
| 60 | case "user": |
---|
| 61 | $ic->setFilter( 'owner', $filtervalue); |
---|
| 62 | break; |
---|
| 63 | case "queue": |
---|
| 64 | $ic->setFilter( 'queue', $filtervalue); |
---|
| 65 | break; |
---|
| 66 | case "state": |
---|
| 67 | $ic->setFilter( 'status', $filtervalue); |
---|
| 68 | break; |
---|
| 69 | default: |
---|
| 70 | break; |
---|
| 71 | } |
---|
[122] | 72 | } |
---|
[114] | 73 | $ic->draw(); |
---|
[110] | 74 | } |
---|
| 75 | |
---|
| 76 | switch( $view ) { |
---|
| 77 | |
---|
| 78 | case "small-clusterimage": |
---|
| 79 | |
---|
| 80 | drawSmallClusterImage(); |
---|
| 81 | |
---|
| 82 | break; |
---|
| 83 | |
---|
| 84 | case "big-clusterimage": |
---|
| 85 | |
---|
| 86 | drawBigClusterImage(); |
---|
| 87 | |
---|
| 88 | break; |
---|
| 89 | |
---|
| 90 | default: |
---|
| 91 | |
---|
| 92 | break; |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | ?> |
---|