You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/UI/Logs/Layout.js

73 lines
2.0 KiB

'use strict';
12 years ago
define([
'marionette',
'backgrid',
'Shared/Grid/Pager',
'Logs/Collection'
12 years ago
],
function (Marionette,Backgrid, GridPager, LogCollection) {
return Marionette.Layout.extend({
12 years ago
template: 'Logs/LayoutTemplate',
regions: {
grid : '#x-grid',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
columns: [
{
name : 'level',
label : 'Level',
sortable: true,
cell : Backgrid.StringCell
},
{
name : 'logger',
label : 'Component',
sortable: true,
cell : Backgrid.StringCell
},
{
name : 'message',
label : 'Message',
sortable: false,
cell : Backgrid.StringCell
},
{
name : 'time',
label: 'Time',
cell : Backgrid.DatetimeCell
}
],
showTable: function () {
this.grid.show(new Backgrid.Grid(
{
row : Backgrid.Row,
columns : this.columns,
collection: this.collection,
className : 'table table-hover'
}));
this.pager.show(new GridPager({
12 years ago
columns : this.columns,
collection: this.collection
}));
},
initialize: function () {
this.collection = new LogCollection();
12 years ago
this.collection.fetch();
},
onShow: function () {
this.showTable();
}
})
;
})
;