source: trunk/web2/addons/job_monarch/js/monarch.js @ 593

Last change on this file since 593 was 593, checked in by ramonb, 15 years ago

job_monarch/templates/header.tpl,
job_monarch/js/monarch.js:

  • code cleanup
File size: 19.5 KB
Line 
1var JobsDataStore;
2var JobsColumnModel;
3var JobListingEditorGrid;
4var JobListingWindow;
5var JobProxy;
6var SearchField;
7var filterButton;
8
9// associative filter array
10//
11var myfilters = { };
12
13// any other datastore params
14//
15var myparams = { };
16
17// (default) paging size
18//
19var mylimit = 15;
20
21var ClusterImageArgs = { };
22
23var filterfields = [ "jid", "queue", "name", "owner" ];
24
25var filterMenu = new Ext.menu.Menu(
26{
27        id:     'filterMenu',
28        items:  [ new Ext.menu.Item({ text: 'Clear all', handler: clearFilters }) ]
29});
30
31var filterButton = new Ext.MenuButton(
32{
33        id:             'filtermenuknop',
34        text:           'Filters',
35        disabled:       true,
36        menu:           filterMenu,
37        listeners:
38        {
39                'click':
40                {
41                        scope:  this,
42                        fn:     function( myButton, event )
43                                {
44                                        myButton.menu.show( myButton.getEl() );
45                                }
46                }
47        }
48});
49
50Ext.namespace('Ext.ux');
51
52Ext.ux.PageSizePlugin = function()
53{
54        Ext.ux.PageSizePlugin.superclass.constructor.call(this,
55        {
56                store:  new Ext.data.SimpleStore(
57                {
58                        fields: ['text', 'value'],
59                        data:   [['10', 10], ['15', 15], ['20', 20], ['30', 30], ['50', 50], ['100', 100], ['max', 'max' ]]
60                }),
61                mode:           'local',
62                displayField:   'text',
63                valueField:     'value',
64                editable:       false,
65                allowBlank:     false,
66                triggerAction:  'all',
67                width:          40
68        });
69};
70
71Ext.extend(Ext.ux.PageSizePlugin, Ext.form.ComboBox,
72{
73        init:                   function(paging)
74                                {
75                                        paging.on('render', this.onInitView, this);
76                                },
77   
78        onInitView:             function(paging)
79                                {
80                                        paging.add('-',
81                                        this,
82                                        'jobs per page'
83                                        );
84                                        this.setValue(paging.pageSize);
85                                        this.on('select', this.onPageSizeChanged, paging);
86                                },
87
88        onPageSizeChanged:      function(combo)
89                                {
90                                        if ( combo.getValue() == 'max' )
91                                        {
92                                                mylimit = JobsDataStore.getTotalCount();
93                                        }
94                                        else
95                                        {
96                                                mylimit = parseInt(combo.getValue());
97                                        }
98                                        this.pageSize = mylimit;
99                                        this.doLoad(0);
100                                }
101});
102
103Ext.namespace( 'Ext' );
104
105function clearFilters()
106{
107        if( inMyArrayKeys( myfilters, 'query' ) )
108        {
109                SearchField.getEl().dom.value = '';
110                delete SearchField.store.baseParams['query'];
111                delete myfilters['query'];
112                delete myparams['query'];
113        }
114        if( inMyArrayKeys( myfilters, 'host' ) )
115        {
116                delete myfilters['host'];
117                delete myparams['host'];
118        }
119        if( inMyArrayKeys( myfilters, 'jid' ) )
120        {
121                delete myfilters['jid'];
122                delete myparams['jid'];
123        }
124        if( inMyArrayKeys( myfilters, 'queue' ) )
125        {
126                delete myfilters['queue'];
127                delete myparams['queue'];
128        }
129        if( inMyArrayKeys( myfilters, 'owner' ) )
130        {
131                delete myfilters['owner'];
132                delete myparams['owner'];
133        }
134        if( inMyArrayKeys( myfilters, 'status' ) )
135        {
136                delete myfilters['status'];
137                delete myparams['status'];
138        }
139        reloadJobStore();
140}
141
142function makeArrayURL( somearr )
143{
144        filter_url = '';
145        filter_sep = '';
146
147        for( filtername in somearr )
148        {
149                filter_url = filter_url + filter_sep + filtername + '=' + somearr[filtername];
150                filter_sep = '&';
151        }
152
153        return filter_url;
154}
155
156
157function isset( somevar )
158{
159        try
160        {
161                if( eval( somevar ) ) { }
162        }
163        catch( err )
164        {
165                return false;
166        }
167        return true;
168}
169
170function inMyArray( arr, someval )
171{
172        for( arval in arr )
173        {
174                if( arval == someval )
175                {
176                        return true;
177                }
178        }
179        return false;
180}
181
182function ArraySize( arr )
183{
184        count = 0;
185
186        for( arkey in arr )
187        {
188                count = count + 1;
189        }
190
191        return count;
192}
193
194function inMyArrayValues( arr, someval )
195{
196        for( arkey in arr )
197        {
198                if( arr[arkey] == someval )
199                {
200                        return true;
201                }
202        }
203        return false;
204}
205
206function inMyArrayKeys( arr, someval )
207{
208        for( arkey in arr )
209        {
210                if( arkey == someval )
211                {
212                        return true;
213                }
214        }
215        return false;
216}
217
218function joinMyArray( arr1, arr2 )
219{
220        for( arkey in arr2 )
221        {
222                arr1[arkey] = arr2[arkey];
223        }
224
225        return arr1;
226}
227
228function ClusterImageSelectHost( somehost )
229{
230        if( !inMyArrayKeys( myfilters, 'host' ) )
231        {
232                myfilters['host'] = somehost;
233        }
234        else
235        {
236                if( myfilters['host'] == somehost )
237                {
238                        delete myfilters['host'];
239                        delete myparams['host'];
240                }
241                else
242                {
243                        myfilters['host'] = somehost;
244                }
245        }
246
247        reloadClusterImage();
248        reloadJobStore();
249
250        // returning false causes a image reload
251        //
252        return false;
253}
254
255function reloadJobStore()
256{
257        // Respect any other parameters that may have been set outside filters
258        //
259        myparams = joinMyArray( myparams, myfilters );
260
261        // Can't be sure if there are enough pages for new filter: reset to page 1
262        //
263        myparams = joinMyArray( myparams, { start: 0, limit: mylimit } );
264
265        JobsDataStore.reload( { params: myparams } );
266}
267
268function addListener(element, type, expression, bubbling)
269{
270        bubbling = bubbling || false;
271
272        if(window.addEventListener)
273        { // Standard
274                element.addEventListener(type, expression, bubbling);
275                return true;
276        } 
277        else if(window.attachEvent) 
278        { // IE
279                element.attachEvent('on' + type, expression);
280                return true;
281        }
282        else 
283        {
284                return false;
285        }
286}
287
288function makeFilterString()
289{
290        var filter_str = '';
291
292        for( arkey in myfilters )
293        {
294                filter_str = filter_str + ' > ' + myfilters[arkey];
295        }
296
297        return filter_str;
298}
299
300var ImageLoader = function( id, url )
301{
302        this.url = url;
303        this.image = document.getElementById( id );
304        this.loadEvent = null;
305};
306
307ImageLoader.prototype = 
308{
309        load:           function()
310                        {
311                                var url = this.url;
312                                var image = this.image;
313                                var loadEvent = this.loadEvent;
314                                addListener( this.image, 'load',
315                                        function(e)
316                                        {
317                                                if( loadEvent != null )
318                                                {
319                                                        loadEvent( url, image );
320                                                }
321                                        }, false);
322                                this.image.src = this.url;
323                        },
324        getImage:       function()
325                        {
326                                return this.image;
327                        }
328};
329
330function achorJobListing()
331{
332        JobListingWindow.anchorTo( "ClusterImageWindow", "tr-br", [ 0, 10 ] );
333}
334
335function setClusterImagePosition()
336{
337        ci_x = (window.innerWidth - ClusterImageWindow.getSize()['width'] - 20); 
338        ClusterImageWindow.setPosition( ci_x, 10 );
339}
340
341function deselectFilterMenu( menuItem, event )
342{
343        filterValue = menuItem.text;
344
345        if( filterValue == SearchField.getEl().dom.value && inMyArrayKeys( myfilters, 'query' ) )
346        {
347                SearchField.getEl().dom.value = '';
348                delete SearchField.store.baseParams['query'];
349        }
350
351        for( arkey in myfilters )
352        {
353                if( myfilters[arkey] == filterValue )
354                {
355                        delete myfilters[arkey];
356                        delete myparams[arkey];
357                }
358        }
359        reloadJobStore();
360}
361
362function makeFilterMenu()
363{
364        var filterMenu = new Ext.menu.Menu(
365        {
366                id:     'filterMenu',
367                items:  [ new Ext.menu.Item({ text: 'Clear all', handler: clearFilters }) ]
368        });
369
370        if( ArraySize( myfilters ) > 0 )
371        {
372                filterMenu.addSeparator();
373        }
374
375        for( arkey in myfilters )
376        {
377                filterMenu.add( new Ext.menu.CheckItem({ text: myfilters[arkey], handler: deselectFilterMenu, checked: true }) );
378        }
379
380        if( filterButton )
381        {
382                filterButton.menu = filterMenu;
383
384                if( ArraySize( myfilters ) > 0 )
385                {
386                        filterButton.enable();
387                }
388                else
389                {
390                        filterButton.disable();
391                }
392        }
393}
394
395function reloadClusterImage()
396{
397        ClusterImageArgs['view'] = 'big-clusterimage';
398
399        filt_url = makeArrayURL( myfilters );
400        imag_url = makeArrayURL( ClusterImageArgs );
401        img_url = './image.php?' + filt_url + '&' + imag_url;
402
403        var newClusterImage = new ImageLoader( 'clusterimage', img_url );
404        newClusterImage.loadEvent = function( url, image ) 
405        {
406                ClusterImageWindow.getBottomToolbar().clearStatus( { useDefaults:true } );
407                setTimeout( "resizeClusterImage()", 250 );
408                setTimeout( "setClusterImagePosition()", 500 );
409                //setTimeout( "achorJobListing()", 1000 );
410        }
411
412        ClusterImageWindow.getBottomToolbar().showBusy();
413
414        filter_str = 'Nodes' + makeFilterString();
415        ClusterImageWindow.setTitle( filter_str );
416
417        newClusterImage.load();
418}
419
420function resizeClusterImage()
421{
422        var ci_height = document.getElementById( "clusterimage" ).height + ClusterImageWindow.getFrameHeight();
423        var ci_width = document.getElementById( "clusterimage" ).width + ClusterImageWindow.getFrameWidth();
424
425        ClusterImageWindow.setSize( ci_width, ci_height );
426}
427
428Ext.apply(Ext.form.VTypes,
429{
430        num:            function(val, field)
431                        {
432                                if (val) 
433                                {
434                                        var strValidChars = "0123456789";
435                                        var blnResult = true;
436
437                                        if (val.length == 0) return false;
438
439                                        //  test strString consists of valid characters listed above
440                                        for (i = 0; i < val.length && blnResult == true; i++)
441                                        {
442                                                strChar = val.charAt(i);
443                                                if (strValidChars.indexOf(strChar) == -1)
444                                                {
445                                                        blnResult = false;
446                                                }
447                                        }
448                                        return blnResult;
449
450                                }
451                        },
452        numText:        'Must be numeric'
453});
454
455function jobRowSelect( selModel ) 
456{
457        if( selModel.hasSelection() )
458        {
459                showGraphsButton.enable();
460        }
461        else
462        {
463                showGraphsButton.disable();
464        }
465}
466
467function jobCellClick(grid, rowIndex, columnIndex, e)
468{
469        var record              = grid.getStore().getAt(rowIndex);  // Get the Record
470        var fieldName           = grid.getColumnModel().getDataIndex(columnIndex);
471        var data                = record.get(fieldName);
472        var view                = grid.getView();
473        var cell                = view.getCell( rowIndex, columnIndex );
474        var filter_title        = false;
475        var fil_dis             = 'filter';
476        var fil_ena             = 'filterenabled';
477        var filterName          = fieldName;
478
479        if( fieldName == 'owner' || fieldName == 'jid' || fieldName == 'status' || fieldName == 'queue' || fieldName == 'nodes')
480        {
481                if( fieldName == 'nodes' )
482                {
483                        filterName = 'host';
484                        fil_dis = 'nodesfilter';
485                        fil_ena = 'nodesfilterenabled';
486                }
487                if( inMyArrayKeys( myfilters, filterName ) )
488                {
489                        Ext.fly(cell).removeClass( fil_ena );
490                        Ext.fly(cell).addClass( fil_dis );
491
492                        // Remove this filter
493                        //
494                        delete myfilters[filterName];
495                        delete myparams[filterName];
496
497                        reloadJobStore();
498                        //reloadClusterImage();
499                }
500                else
501                {
502                        Ext.fly(cell).removeClass( fil_dis );
503                        Ext.fly(cell).addClass( fil_ena );
504
505                        if( fieldName == 'nodes' )
506                        { // Get the first node (master mom) as node filter
507                                new_data = data.split( ',' )[0];
508                                data = new_data;
509                        }
510
511                        // Set filter for selected column to selected cell value
512                        //
513                        myfilters[filterName] = data;
514
515                        reloadJobStore();
516                        //reloadClusterImage();
517                }
518                JobListingWindow.setTitle( filter_str );
519                filter_title = true;
520                filter_str = myparams.c + ' Jobs Overview' + makeFilterString();
521        }
522}
523
524function jobCellRender( value, metadata, record, rowindex, colindex, store )
525{
526        var fieldName = JobsColumnModel.getColumnById( colindex ).dataIndex;
527        var fil_dis = 'filter';
528        var fil_ena = 'filterenabled';
529        var filterName = fieldName;
530
531        if( fieldName == 'owner' || fieldName == 'jid' || fieldName == 'status' || fieldName == 'queue' || fieldName == 'nodes' )
532        {
533                if( fieldName == 'nodes' )
534                {
535                        fil_dis = 'nodesfilter';
536                        fil_ena = 'nodesfilterenabled';
537                        filterName = 'host';
538                }
539                if( myfilters[filterName] != null )
540                {
541                        metadata.css = fil_ena;
542                }
543                else
544                {
545                        metadata.css = fil_dis;
546                }
547        }
548        return value;
549}
550
551JobProxy = new Ext.data.HttpProxy(
552{
553        url:    'jobstore.php',
554        method: 'POST'
555});
556
557JobsDataStore = new Ext.data.Store(
558{
559        id:             'JobsDataStore',
560        proxy:          JobProxy,
561        baseParams:     { task: "GETJOBS" },
562        reader:
563                new Ext.data.JsonReader(
564                {
565                        root: 'results',
566                        totalProperty: 'total',
567                        id: 'id'
568                },
569                [
570                        {name: 'jid', type: 'int', mapping: 'jid'},
571                        {name: 'status', type: 'string', mapping: 'status'},
572                        {name: 'owner', type: 'string', mapping: 'owner'},
573                        {name: 'queue', type: 'string', mapping: 'queue'},
574                        {name: 'name', type: 'string', mapping: 'name'},
575                        {name: 'requested_time', type: 'string', mapping: 'requested_time'},
576                        {name: 'requested_memory', type: 'string', mapping: 'requested_memory'},
577                        {name: 'ppn', type: 'int', mapping: 'ppn'},
578                        {name: 'nodect', type: 'int', mapping: 'nodect'},
579                        {name: 'nodes', type: 'string', mapping: 'nodes'},
580                        {name: 'queued_timestamp', type: 'string', mapping: 'queued_timestamp'},
581                        {name: 'start_timestamp', type: 'string', mapping: 'start_timestamp'},
582                        {name: 'runningtime', type: 'string', mapping: 'runningtime'}
583                ]),
584        sortInfo: 
585        { 
586                field: 'jid', 
587                direction: "DESC" 
588        },
589        remoteSort: true,
590        listeners:
591        { 
592                'beforeload':
593                {
594                        scope: this,
595                        fn:
596
597                        function()
598                        {
599                                if( SearchField )
600                                {
601                                        search_value = SearchField.getEl().dom.value;
602                                        if( search_value == '' )
603                                        {
604                                                delete SearchField.store.baseParams['query'];
605                                                delete myfilters['query'];
606                                                delete myparams['query'];
607                                        }
608                                        else
609                                        {
610                                                myfilters['query']      = search_value;
611                                        }
612
613                                        makeFilterMenu();
614                                        reloadClusterImage();
615
616                                        filter_str = myparams.c + ' Jobs Overview' + makeFilterString();
617                                        JobListingWindow.setTitle( filter_str );
618                                }
619                        }
620                }
621        }
622});
623   
624var CheckJobs =
625
626        new Ext.grid.CheckboxSelectionModel(
627        {
628                listeners:
629                {
630                        'selectionchange':
631                        {
632                                scope:  this,
633                                fn:     jobRowSelect
634                        }
635                },
636        });
637
638JobsColumnModel = new Ext.grid.ColumnModel(
639[
640        CheckJobs,
641        {
642                header:         '#',
643                tooltip:        'Job id',
644                readOnly:       true,
645                dataIndex:      'jid',
646                width:          50,
647                hidden:         false,
648                renderer:       jobCellRender
649        },{
650                header:         'S',
651                tooltip:        'Job status',
652                readOnly:       true,
653                dataIndex:      'status',
654                width:          20,
655                hidden:         false,
656                renderer:       jobCellRender
657        },{
658                header:         'User',
659                tooltip:        'Owner of job',
660                readOnly:       true,
661                dataIndex:      'owner',
662                width:          60,
663                hidden:         false,
664                renderer:       jobCellRender
665        },{
666                header:         'Queue',
667                tooltip:        'In which queue does this job reside',
668                readOnly:       true,
669                dataIndex:      'queue',
670                width:          60,
671                hidden:         false,
672                renderer:       jobCellRender
673        },{
674                header:         'Name',
675                tooltip:        'Name of job',
676                readOnly:       true,
677                dataIndex:      'name',
678                width:          100,
679                hidden:         false
680        },{
681                header:         'Requested Time',
682                tooltip:        'Amount of requested time (wallclock)',
683                readOnly:       true,
684                dataIndex:      'requested_time',
685                width:          100,
686                hidden:         false
687        },{
688                header:         'Requested Memory',
689                tooltip:        'Amount of requested memory',
690                readOnly:       true,
691                dataIndex:      'requested_memory',
692                width:          100,
693                hidden:         true
694        },{
695                header:         'P',
696                tooltip:        'Number of processors per node (PPN)',
697                readOnly:       true,
698                dataIndex:      'ppn',
699                width:          25,
700                hidden:         false
701        },{
702                header:         'N',
703                tooltip:        'Number of nodes (hosts)',
704                readOnly:       true,
705                dataIndex:      'nodect',
706                width:          25,
707                hidden:         false
708        },{
709                header:         'Nodes',
710                readOnly:       true,
711                dataIndex:      'nodes',
712                width:          100,
713                hidden:         false,
714                renderer:       jobCellRender
715        },{
716                header:         'Queued',
717                tooltip:        'At what time did this job enter the queue',
718                readOnly:       true,
719                dataIndex:      'queued_timestamp',
720                width:          120,
721                hidden:         false
722        },{
723                header:         'Started',
724                tooltip:        'At what time did this job enter the running status',
725                readOnly:       true,
726                dataIndex:      'start_timestamp',
727                width:          120,
728                hidden:         false
729        },{
730                header:         'Runningtime',
731                tooltip:        'How long has this job been in the running status',
732                readOnly:       true,
733                dataIndex:      'runningtime',
734                width:          140,
735                hidden:         false
736        }]
737);
738
739JobsColumnModel.defaultSortable = true;
740
741var win;
742
743MetricsDataStore = new Ext.data.Store(
744{
745        id:             'MetricsDataStore',
746        proxy:          JobProxy,
747        autoLoad:       false,
748        baseParams:     { task: "GETMETRICS" },
749        reader:
750                new Ext.data.JsonReader(
751                {
752                        root: 'names',
753                        totalProperty: 'total',
754                        id: 'id'
755                },
756                [{
757                        name: 'ID'
758                },{
759                        name: 'name'
760                }]
761                )
762});
763
764SearchField     = new Ext.app.SearchField(
765                {
766                        store:  JobsDataStore,
767                        params: {start: 0, limit: mylimit},
768                        width:  200
769                });
770
771NodesDataStore = new Ext.data.Store(
772{
773        id: 'NodesDataStore',
774        proxy: JobProxy,
775        autoLoad: false,
776        baseParams: { task: "GETNODES" },
777        reader: new Ext.data.JsonReader(
778        {
779                root: 'results',
780                totalProperty: 'total',
781                id: 'id'
782        },[
783                {name: 'c', type: 'string', mapping: 'c'},
784                {name: 'h', type: 'string', mapping: 'h'},
785                {name: 'x', type: 'string', mapping: 'x'},
786                {name: 'v', type: 'string', mapping: 'v'},
787                {name: 'l', type: 'string', mapping: 'l'},
788                {name: 'jr', type: 'string', mapping: 'jr'},
789                {name: 'js', type: 'string', mapping: 'js'}
790        ]),
791        listeners: 
792        {
793                'beforeload': 
794                {
795                        scope: this,
796                        fn: 
797                       
798                        function() 
799                        {
800                                var jids;
801
802                                var row_records = CheckJobs.getSelections();
803
804                                for(var i=0; i<row_records.length; i++ )
805                                {
806                                        rsel = row_records[i];
807                                        if( !jids )
808                                        {
809                                                jids = rsel.get('jid');
810                                        }
811                                        else
812                                        {
813                                                jids = jids + ',' + rsel.get('jid');
814                                        }
815                                }
816                                NodesDataStore.baseParams.jids  = jids;
817                                NodesDataStore.baseParams.c     = myparams.c;
818                        }
819                }
820        }
821});
822
823function ShowGraphs( Button, Event ) 
824{
825        var GraphView =
826       
827                new Ext.DataView(
828                {
829                        itemSelector:   'thumb',
830                        style:          'overflow:auto',
831                        multiSelect:    true,
832                        store:          NodesDataStore,
833                        tpl:
834                       
835                                new Ext.XTemplate(
836                                        '<tpl for=".">',
837                                        '<div class="rrd-float"><img src="../../graph.php?z=small&c={c}&h={h}&l={l}&v={v}&x={x}&r=job&jr={jr}&js={js}" border="0"></div>',
838                                        '</tpl>'
839                                )
840                });
841
842        var images = 
843
844                new Ext.Panel(
845                {
846                        id:             'images',
847                        //title:        'My Images',
848                        region:         'center',
849                        bodyStyle:      'background: transparent',
850                        //margins:      '2 2 2 0',
851                        layout:         'fit',
852                        items:          GraphView
853                });
854
855        if(!win)
856        {
857                win = new Ext.Window(
858                {
859                        animateTarget:  Button,
860                        width:          500,
861                        height:         300,
862                        closeAction:    'hide',
863                        collapsible:    true,
864                        animCollapse:   true,
865                        maximizable:    true,
866                        title:          'Node graph details',
867                        layout:         'fit',
868                        tbar:   
869                       
870                        new Ext.form.ComboBox(
871                        {
872                                fieldLabel:     'Metric',
873                                //hiddenName:   'ID',
874                                store:          MetricsDataStore,
875                                valueField:     'name',
876                                displayField:   'name',
877                                typeAhead:      true,
878                                mode:           'remote',
879                                triggerAction:  'all',
880                                emptyText:      'Select metric',
881                                selectOnFocus:  true,
882                                xtype:          'combo',
883                                width:          190,
884                                listeners:
885                                {
886                                        select: 
887                                                       
888                                        function(combo, record, index)
889                                        {
890                                                var metric = record.data.name;
891                                                // doe iets
892                                        }
893                                }
894
895                        }),
896
897                        items:  [ images ]
898                });
899        }
900        NodesDataStore.load();
901        win.show( Button );
902}
903
904var showGraphsButton = 
905
906        new Ext.Button(
907        {
908                text:           'Show graphs',
909                tooltip:        'Show node graphs for selected jobs',
910                iconCls:        'option',
911                disabled:       true,
912                listeners: 
913                {
914                        'click': 
915                        {
916                                scope:  this,
917                                fn:     ShowGraphs
918                        }
919                }
920        });
921
922var JobListingEditorGrid =
923
924        new Ext.grid.EditorGridPanel(
925        {
926                id:             'JobListingEditorGrid',
927                store:          JobsDataStore,
928                cm:             JobsColumnModel,
929                enableColLock:  false,
930                clicksToEdit:   1,
931                loadMask:       true,
932                selModel:       new Ext.grid.RowSelectionModel({singleSelect:false}),
933                stripeRows:     true,
934                sm:             CheckJobs,
935                listeners:
936                {
937                        'cellclick':
938                        {
939                                scope:  this,
940                                fn:     jobCellClick
941                        }
942                },
943                bbar:
944       
945                new Ext.PagingToolbar(
946                {
947                        pageSize: 15,
948                        store: JobsDataStore,
949                        displayInfo: true,
950                        displayMsg: 'Displaying jobs {0} - {1} out of {2} jobs total found.',
951                        emptyMsg: 'No jobs found to display',
952                        plugins: [new Ext.ux.PageSizePlugin()]
953                }),
954
955                tbar: 
956                [ 
957                        SearchField,
958                        showGraphsButton,
959                        filterButton 
960                ]
961        });
962
963var ClusterImageWindow =
964
965        new Ext.Window(
966        {
967                id:             'ClusterImageWindow',
968                title:          'Nodes',
969                closable:       true,
970                collapsible:    true,
971                animCollapse:   true,
972                width:          1,
973                height:         1,
974                y:              15,
975                plain:          true,
976                shadow:         true,
977                resizable:      false,
978                shadowOffset:   10,
979                layout:         'fit',
980                bbar: 
981               
982                        new Ext.StatusBar(
983                        {
984                                defaultText: 'Ready.',
985                                id: 'basic-statusbar',
986                                defaultIconCls: ''
987                        })
988        });
989
990var GraphSummaryWindow =
991
992        new Ext.Window(
993        {
994                id:             'GraphSummaryWindow',
995                title:          'Graph Summary',
996                closable:       true,
997                collapsible:    true,
998                animCollapse:   true,
999                width:          500,
1000                height:         400,
1001                x:              10,
1002                y:              10,
1003                plain:          true,
1004                shadow:         true,
1005                resizable:      true,
1006                shadowOffset:   10,
1007                layout:         'table',
1008                layoutConfig: 
1009                {
1010                        columns: 2
1011                },
1012                defaults:       { border: false },
1013                items: 
1014                [
1015                        {
1016                                id:             'monarchlogo',
1017                                cls:            'monarch',
1018                                bodyStyle:      'background: transparent',
1019                                html:           '<A HREF="https://subtrac.sara.nl/oss/jobmonarch/" TARGET="_blank"><IMG SRC="./jobmonarch.gif" ALT="Job Monarch" BORDER="0"></A>'
1020                                //colspan: 2
1021                        },{
1022                                id:             'summarycount'
1023                        },{
1024                                id:             'rjqjgraph'
1025                        },{
1026                                id:             'pie',
1027                                colspan:        2
1028                        }
1029                ],
1030                bbar:
1031               
1032                        new Ext.StatusBar(
1033                        {
1034                                defaultText:    'Ready.',
1035                                id:             'basic-statusbar',
1036                                defaultIconCls: ''
1037                        })
1038        });
1039
1040var JobListingWindow =
1041
1042        new Ext.Window(
1043        {
1044                id:             'JobListingWindow',
1045                title:          'Cluster Jobs Overview',
1046                closable:       true,
1047                collapsible:    true,
1048                animCollapse:   true,
1049                maximizable:    true,
1050                y:              375,
1051                width:          860,
1052                height:         445,
1053                plain:          true,
1054                shadow:         true,
1055                shadowOffset:   10,
1056                layout:         'fit',
1057                items:          JobListingEditorGrid
1058        });
Note: See TracBrowser for help on using the repository browser.