1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-30 19:56:54 +00:00
Sonarr/UI/Logs/Collection.js

38 lines
971 B
JavaScript
Raw Normal View History

2013-06-22 06:24:24 +00:00
'use strict';
define(['app', 'Logs/Model', 'backbone.pageable'], function (app, SeriesModel, PagableCollection) {
NzbDrone.Logs.Collection = PagableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/log',
model: NzbDrone.Logs.Model,
2013-06-05 00:49:53 +00:00
state: {
pageSize: 50,
2013-06-22 06:24:24 +00:00
sortKey : 'time',
order : 1
2013-06-05 00:49:53 +00:00
},
queryParams: {
totalPages : null,
2013-06-05 00:49:53 +00:00
totalRecords: null,
pageSize : 'pageSize',
2013-06-22 06:24:24 +00:00
sortKey : 'sortKey',
order : 'sortDir',
directions : {
2013-06-22 06:24:24 +00:00
'-1': 'asc',
'1' : 'desc'
2013-06-05 00:49:53 +00:00
}
},
parseState: function (resp, queryParams, state) {
return {totalRecords: resp.totalRecords};
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
});