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.
Sonarr/UI/Logs/Layout.js

81 lines
2.4 KiB

'use strict';
11 years ago
define(
[
'marionette',
'backgrid',
'Logs/LogTimeCell',
'Logs/LogLevelCell',
'Shared/Grid/Pager',
'Logs/Collection'
], function (Marionette, Backgrid, LogTimeCell, LogLevelCell, GridPager, LogCollection) {
return Marionette.Layout.extend({
12 years ago
template: 'Logs/LayoutTemplate',
regions: {
grid : '#x-grid',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
11 years ago
attributes: {
id: 'logs-screen'
},
columns:
[
{
name : 'level',
label : '',
sortable: true,
cell : LogLevelCell
},
{
name : 'logger',
label : 'Component',
sortable: true,
cell : Backgrid.StringCell.extend({
className: 'log-logger-cell'
})
},
{
name : 'message',
label : 'Message',
sortable: false,
cell : Backgrid.StringCell.extend({
className: 'log-message-cell'
})
},
{
name : 'time',
label: 'Time',
cell : LogTimeCell
}
],
12 years ago
showTable: function () {
11 years ago
this.grid.show(new Backgrid.Grid({
row : Backgrid.Row,
columns : this.columns,
collection: this.collection,
className : 'table table-hover'
}));
12 years ago
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();
}
11 years ago
});
});