Ext.define('TP.PanletGridLogs', {
    extend: 'TP.PanletGrid',

    title:  'Logfiles',
    height: 200,
    width:  800,
    //maximizable: true, // does not work stateful
    initComponent: function() {
        this.callParent();
        this.xdata.url      = 'panorama.cgi?task=show_logs';
        this.xdata.pattern  = '';
        this.xdata.exclude  = '';
        this.xdata.time     = '15m';
        TP.hideFormElements(this.down('form').getForm(), ['url']);
        this.reloadOnSiteChanges = true;

        this.formUpdatedCallback = function() {
            this.loader.baseParams = {
                time:    this.xdata.time,
                exclude: this.xdata.exclude,
                pattern: this.xdata.pattern
            };
        };
        this.down('form').add({
            fieldLabel: 'Time',
            xtype:      'textfield',
            name:       'time'
        });
        this.down('form').add({
            fieldLabel: 'Include Pattern',
            xtype:      'textfield',
            name:       'pattern',
            emptyText:  'regular search expression'
        });
        this.down('form').add({
            fieldLabel: 'Exclude Pattern',
            xtype:      'textfield',
            name:       'exclude',
            emptyText:  'regular search exclude expression'
        });
    }
});
