Ignore:
Timestamp:
01/29/09 14:29:10 (15 years ago)
Author:
ramonb
Message:

job_monarch/libtoga.php:

  • selected node in clusterimage has different border color
  • even nodes without jobs are now displayed in clusterimage
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web2/addons/job_monarch/libtoga.php

    r574 r575  
    10491049                $this->small            = false;
    10501050                $this->big              = false;
     1051                $this->selected         = false;
    10511052        }
    10521053
     
    11771178        {
    11781179                $this->showinfo = $showinfo;
     1180        }
     1181
     1182        function setSelected()
     1183        {
     1184                $this->selected = true;
    11791185        }
    11801186
     
    12681274                }
    12691275
    1270                 imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+($size-$sep), $this->y+($size-$sep), $black_color );
     1276                $select_color   = imageColorAllocate( $this->image, 91, 255, 41 );
     1277
     1278                if( $this->selected )
     1279                {
     1280                        imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+($size), $this->y+($size), $select_color );
     1281                }
     1282                else
     1283                {
     1284                        imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+($size-$sep), $this->y+($size-$sep), $black_color );
     1285                }
    12711286
    12721287                if( $this->showinfo)
     
    13471362                $this->height           = 0;
    13481363                $this->output           = 1;
     1364                $this->selected         = '';
    13491365        }
    13501366
     
    13961412                                $mynjobs = $node->getJobs();
    13971413
    1398                                 if( count( $mynjobs ) > 0 )
     1414                                if( $filtername == 'host' && $hostname == $filtervalue )
     1415                                {
     1416                                        $addhost        = 1;
     1417                                        $this->selected = $hostname;
     1418                                }
     1419                                else if( count( $mynjobs ) > 0 )
    13991420                                {
    14001421                                        foreach( $mynjobs as $myjob )
     
    14191440                                                                else
    14201441                                                                {
    1421                                                                         if( $filtername == 'host' && $hostname == $filtervalue )
     1442                                                                        if( $jobs[$myjob][$filtername] == $filtervalue )
    14221443                                                                        {
    14231444                                                                                $addhost = 1;
     1445                                                                                continue;
    14241446                                                                        }
    1425                                                                         else
     1447                                                                        else if( $jobs[$myjob][$filtername] != $filtervalue )
    14261448                                                                        {
    1427                                                                                 if( $jobs[$myjob][$filtername] == $filtervalue )
    1428                                                                                 {
    1429                                                                                         $addhost = 1;
    1430                                                                                         continue;
    1431                                                                                 }
    1432                                                                                 else if( $jobs[$myjob][$filtername] != $filtervalue )
    1433                                                                                 {
    1434                                                                                         $addhost = 0;
    1435                                                                                 }
     1449                                                                                $addhost = 0;
    14361450                                                                        }
    14371451                                                                        if( $filtername == 'query' )
     
    15571571                $jobs = $mydatag->getJobs();
    15581572                $filtered_nodes = $this->filterNodes( $jobs, $nodes );
     1573                $selected_host  = $this->selected;
    15591574
    15601575                if( $SORTBY_HOSTNAME != "" )
     
    19511966                                                        $nodes[$cur_node]->setShowinfo( 0 );
    19521967                                                }
     1968                                                else
     1969                                                {
     1970                                                        if( $selected_host != '' && $host == $selected_host )
     1971                                                        {
     1972                                                                $nodes[$cur_node]->setSelected();
     1973                                                        }
     1974                                                }
    19531975
    19541976                                                $nodes[$cur_node]->setCoords( $x, $y );
Note: See TracChangeset for help on using the changeset viewer.