Changeset 563 for trunk


Ignore:
Timestamp:
01/22/09 16:33:31 (15 years ago)
Author:
ramonb
Message:

web2/addons/job_monarch/image.php:

  • added query search option for node filtering

web2/addons/job_monarch/jobstore.php:

  • also search nodes and jobid with query

web2/addons/job_monarch/js/jobgrid.js:

  • added load event to datastore to trigger clusterimage reload and include any searchfield query

web2/addons/job_monarch/libtoga.php:

  • added query filter for clusterimage node filtering
Location:
trunk/web2/addons/job_monarch
Files:
4 edited

Legend:

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

    r555 r563  
    5757$view = $httpvars->getHttpVar( "view" );
    5858$host = $httpvars->getHttpVar( "host" );
     59$query = $httpvars->getHttpVar( "query" );
    5960$clustername = $httpvars->getClusterName();
    6061
     
    6465if( isset($queue) && ($queue!='')) $filter[queue]=$queue;
    6566if( isset($host) && ($host!='')) $filter[host]=$host;
     67if( isset($query) && ($query!='')) $filter[query]=$query;
    6668//printf("host = %s\n", $filter[host] );
    6769
     
    135137                                        $ic->setFilter( 'host', $filtervalue);
    136138                                        break;
     139                                case "query":
     140                                        $ic->setFilter( 'query', $filtervalue);
     141                                        break;
    137142                                default:
    138143                                        break;
  • trunk/web2/addons/job_monarch/jobstore.php

    r562 r563  
    110110                        {
    111111                                $searchresults[$jobid]  = $jobattrs;
     112                        }
     113                        if( is_array( $jobattrs['nodes'] ) )
     114                        {
     115                                foreach( $jobattrs['nodes'] as $jattr )
     116                                {
     117                                        if( strpos( $jattr, $query ) !== false )
     118                                        {
     119                                                $searchresults[$jobid]  = $jobattrs;
     120                                        }
     121                                }
     122                        }
     123                        if( strpos( $jobid, $query ) !== false )
     124                        {
     125                                $searchresults[$jobid]  = $jobattrs;
    112126                        }
    113127                }
  • trunk/web2/addons/job_monarch/js/jobgrid.js

    r562 r563  
    336336                method: 'POST'
    337337            });
     338
     339  var SearchField;
    338340
    339341  JobsDataStore = new Ext.data.Store({
     
    361363      ]),
    362364      sortInfo: { field: 'jid', direction: "DESC" },
    363       remoteSort: true
     365      remoteSort: true,
     366      listeners: { 'load': {
     367                        scope: this,
     368                        fn: function() {
     369                                        if( SearchField ) {
     370                                                search_value = SearchField.getEl().dom.value;
     371
     372                                                if( search_value != '' )
     373                                                {
     374                                                        myfilters['query']      = search_value;
     375                                                }
     376
     377                                                reloadClusterImage();
     378
     379                                                if( search_value != '' )
     380                                                {
     381                                                        delete myfilters['query'];
     382                                                }
     383                                        }
     384                                }
     385                        }
     386                }
    364387    });
    365388   
     
    467490
    468491  var win;
     492
     493  SearchField   = new Ext.app.SearchField({
     494                                store: JobsDataStore,
     495                                params: {start: 0, limit: mylimit},
     496                                width: 200
     497                    });
    469498
    470499  JobListingEditorGrid =  new Ext.grid.EditorGridPanel({
     
    486515                plugins: [new Ext.ux.PageSizePlugin()]
    487516            }),
    488       tbar: [ new Ext.app.SearchField({
    489                                 store: JobsDataStore,
    490                                 params: {start: 0, limit: mylimit},
    491                                 width: 200
    492                     }),
     517      tbar: [ SearchField,
    493518                new Ext.Button({
    494519                                text: 'Show nodes',
     
    511536                                        }
    512537                                }
    513                         })
    514       ]
     538                        }) ]
    515539    });
    516540
  • trunk/web2/addons/job_monarch/libtoga.php

    r562 r563  
    13631363                                                                        }
    13641364                                                                }
     1365                                                                if( $filtername == 'query' )
     1366                                                                {
     1367                                                                        foreach( $jobs[$myjob] as $myj_attr => $myj_val )
     1368                                                                        {
     1369                                                                                if(!is_array( $myj_val ) )
     1370                                                                                {
     1371                                                                                        if( strpos( $myj_val, $filtervalue ) !== false )
     1372                                                                                        {
     1373                                                                                                $addhost = 1;
     1374                                                                                                continue;
     1375                                                                                        }
     1376                                                                                }
     1377                                                                                else
     1378                                                                                {
     1379                                                                                        foreach( $myj_val as $myj_v )
     1380                                                                                        {
     1381                                                                                                if( strpos( $myj_v, $filtervalue ) !== false )
     1382                                                                                                {
     1383                                                                                                        $addhost = 1;
     1384                                                                                                        continue;
     1385                                                                                                }
     1386                                                                                        }
     1387                                                                                }
     1388                                                                                if( strpos( $myjob, $filtervalue ) !== false )
     1389                                                                                {
     1390                                                                                        $addhost        = 1;
     1391                                                                                        continue;
     1392                                                                                }
     1393                                                                        }
     1394                                                                }
    13651395                                                        }
    13661396                                                }
Note: See TracChangeset for help on using the changeset viewer.