sonarr-repo-only/UI/Logs/Collection.js

38 lines
920 B
JavaScript
Raw Normal View History

'use strict';
define(['backbone.pageable', 'Logs/Model', ], function (PagableCollection, LogsModel) {
return PagableCollection.extend({
url : window.ApiRoot + '/log',
model: LogsModel,
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;
}
});
});