Changeset 600


Ignore:
Timestamp:
02/11/09 12:28:50 (15 years ago)
Author:
ramonb
Message:

job_monarch/js/monarch.js:

  • only jobs with status 'R' are selectable
  • graphPanel is now window toolbar in stead of item
  • apply layouts after resizing graphWindow
  • graph Metric combobox is now moved to graphView's toolbar
  • added Lightbox2 image href's for graph image popup/slider, group by jid

job_monarch/jobstore.php:

  • also return jid now, for Lightbox2 grouping

job_monarch/templates/header.tpl:

  • added Lightbox css and js
Location:
trunk/web2/addons/job_monarch
Files:
3 edited

Legend:

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

    r598 r600  
    480480                $nr['jr']       = -$job_window;
    481481                $nr['js']       = (int) $jobs[$jid]['start_timestamp'];
     482                $nr['jid']      = $jid;
    482483
    483484                $node_results[] = $nr;
  • trunk/web2/addons/job_monarch/js/monarch.js

    r599 r600  
    510510});
    511511
    512 function jobRowSelect( selModel )
    513 {
    514         if( selModel.hasSelection() )
     512function jobBeforeRowSelect( mySelectionModel, rowIndex, keepExisting, myRecord )
     513{
     514        if( myRecord.get('status') == 'Q' )
     515        {       // return false: dont select row if queued
     516                return false;
     517        }
     518
     519        return true;
     520}
     521
     522function jobRowSelect( mySelectionModel, rowIndex, myRecord )
     523{
     524        if( mySelectionModel.hasSelection() )
    515525        {
    516526                showGraphsButton.enable();
    517         }
    518         else
    519         {
    520                 showGraphsButton.disable();
    521         }
     527
     528                return 0;
     529        }
     530
     531        showGraphsButton.disable();
    522532}
    523533
     
    690700                listeners:
    691701                {
    692                         'selectionchange':
     702                        'beforerowselect':
     703                        {
     704                                scope:  this,
     705                                fn:     jobBeforeRowSelect
     706                        },
     707                        'rowselect':
     708                        {
     709                                scope:  this,
     710                                fn:     jobRowSelect
     711                        },
     712                        'rowdeselect':
    693713                        {
    694714                                scope:  this,
     
    862882                                {name: 'l', type: 'string', mapping: 'l'},
    863883                                {name: 'jr', type: 'string', mapping: 'jr'},
    864                                 {name: 'js', type: 'string', mapping: 'js'}
     884                                {name: 'js', type: 'string', mapping: 'js'},
     885                                {name: 'jid', type: 'string', mapping: 'jid'}
    865886                        ]),
    866887                        listeners:
     
    876897                                                //
    877898                                                myStore.proxy.url       = 'jobstore.php?timestamp=' + new Date().getTime();
    878                                                 //alert( myStore.proxy.url );
    879899                                        }
    880900                                }
     
    903923                        store:          store,
    904924                        layout:         'fit',
     925                        closable:       true,
    905926                        tpl:
    906927                       
    907928                                new Ext.XTemplate(
    908929                                        '<tpl for=".">',
    909                                         '<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>',
     930                                        '<div class="rrd-float"><a href="../../graph.php?z=large&c={c}&h={h}&l={l}&v={v}\&x={x}&r=job&jr={jr}&js={js}" border="0" rel="lightbox[{jid}]"><img src="../../graph.php?z=small&c={c}&h={h}&l={l}&v={v}&x={x}&r=job&jr={jr}&js={js}" border="0"></a></div>',
    910931                                        '</tpl>'
    911932                                )
     
    927948                        autoHeight:     true,
    928949                        autoWidth:      true,
    929                         //margins:      '2 2 2 0',
    930                         //layout:       'fit',
     950                        autoScroll:     true,
    931951                        resizeTabs:     true,
    932952                        minTabWidth:    60,
     
    935955                        enableTabScroll:true,
    936956                        resizeTabs:     true,
    937                         //defaults:     {autoScroll:true},
    938                         listeners:
    939                         {
    940                                 'tabchange':
     957                        // RB TODO: range combobox; hour, day, week, etc
     958
     959                        tbar:
     960                        [
     961                                new Ext.form.ComboBox(
    941962                                {
    942                                         scope:  this,
    943                                         fn:     function( myTabPanel, tab )
     963                                        fieldLabel:     'Metric',
     964                                        store:          MetricsDataStore,
     965                                        valueField:     'name',
     966                                        displayField:   'name',
     967                                        typeAhead:      true,
     968                                        mode:           'remote',
     969                                        triggerAction:  'all',
     970                                        emptyText:      'load_one',
     971                                        selectOnFocus:  true,
     972                                        xtype:          'combo',
     973                                        width:          190,
     974                                        listeners:
     975                                        {
     976                                                select:
     977                                                               
     978                                                function(combo, record, index)
    944979                                                {
    945                                                         //myTabPanel.items[0].refresh();
    946                                                         //this.view.refresh();
     980                                                        var metric = record.data.name;
     981                                                        // doe iets
     982
     983                                                        // RB: misschien zo metric opgeven aan datastore?
     984                                                        //items[0].items[0].getStore().baseParams.metric = metric;
    947985                                                }
    948                                 }
    949                         }
     986                                        }
     987                                })
     988                        ]
    950989                });
    951990
     
    9661005                        animCollapse:   true,
    9671006                        maximizable:    true,
    968                         autoScroll:     true,
    969                         defaults:       {autoScroll:true},
     1007                        //autoScroll:   true,
     1008                        //defaults:     {autoScroll:true},
    9701009                        title:          'Node graph details',
    971                         //layout:               'fit',
    972                         tbar:   
     1010                        tbar:           panel,
    9731011               
    974                         // RB TODO: range combobox; hour, day, week, etc
    975        
    976                         new Ext.form.ComboBox(
    977                         {
    978                                 fieldLabel:     'Metric',
    979                                 store:          MetricsDataStore,
    980                                 valueField:     'name',
    981                                 displayField:   'name',
    982                                 typeAhead:      true,
    983                                 mode:           'remote',
    984                                 triggerAction:  'all',
    985                                 emptyText:      'load_one',
    986                                 selectOnFocus:  true,
    987                                 xtype:          'combo',
    988                                 width:          190,
    989                                 listeners:
    990                                 {
    991                                         select:
    992                                                        
    993                                         function(combo, record, index)
    994                                         {
    995                                                 var metric = record.data.name;
    996                                                 // doe iets
    997 
    998                                                 // RB: misschien zo metric opgeven aan datastore?
    999                                                 //items[0].items[0].getStore().baseParams.metric = metric;
    1000                                         }
    1001                                 }
    1002                         }),
    1003 
    1004                         items:  [ panel ],
    10051012                        listeners:
    10061013                        {
     
    10091016                                function(  myWindow, width, height )
    10101017                                {
    1011                                         //var myPanel   = myWindow.getComponent( 'tabPanel' ).getEl();
    10121018                                        var myPanel     = myWindow.items.get( 'tabPanel' );
    1013 
    10141019                                        var myView      = myPanel.getActiveTab();
    10151020
    1016                                         //myView.doLayout();
    10171021                                        myPanel.doLayout();
    10181022                                        myWindow.doLayout();
     
    10581062        for( var w=0; w<=windowCount; w++ )
    10591063        {
    1060                 if( graphWindowBehaviour == 'tabbed-prev-window' )
     1064                if( ( graphWindowBehaviour == 'tabbed-prev-window' ) && ( previousGraphWindow != null ) && ( previousGraphPanel != null ) )
    10611065                {
    10621066                        myWindow        = previousGraphWindow;
     
    11031107                clicksToEdit:   1,
    11041108                loadMask:       true,
    1105                 selModel:       new Ext.grid.RowSelectionModel({singleSelect:false}),
     1109                selModel:       new Ext.grid.RowSelectionModel( { singleSelect: false } ),
    11061110                stripeRows:     true,
    11071111                sm:             CheckJobs,
  • trunk/web2/addons/job_monarch/templates/header.tpl

    r596 r600  
    55<META http-equiv="Content-type" content="text/html; charset=utf-8">
    66
     7<link rel="stylesheet" href="./lib/lightbox/css/lightbox.css" type="text/css" media="screen" />
     8
     9<script type="text/javascript" src="./lib/lightbox/js/prototype.js"></script>
     10<script type="text/javascript" src="./lib/lightbox/js/scriptaculous.js?load=effects,builder"></script>
     11<script type="text/javascript" src="./lib/lightbox/js/lightbox.js"></script>
     12
    713<link rel="stylesheet" type="text/css" href="./lib/extjs/resources/css/ext-all.css" />
    814<link rel="stylesheet" type="text/css" href="./css/styles.css" />
     15
    916<script type="text/javascript" src="./lib/extjs/adapter/ext/ext-base.js"></script>
    1017<!-- <script type="text/javascript" src="./lib/extjs/adapter/ext/ext-base-debug.js"></script> -->
     
    4754</script>
    4855
     56
    4957</HEAD>
    5058<BODY CLASS="background">
Note: See TracChangeset for help on using the changeset viewer.