2013-06-25 02:41:59 +03:00
|
|
|
'use strict';
|
|
|
|
define(['backbone.pageable', 'Logs/Model', ], function (PagableCollection, LogsModel) {
|
|
|
|
return PagableCollection.extend({
|
2013-09-14 10:10:19 +03:00
|
|
|
url : window.NzbDrone.ApiRoot + '/log',
|
2013-06-25 02:41:59 +03:00
|
|
|
model: LogsModel,
|
2013-06-05 03:49:53 +03:00
|
|
|
|
|
|
|
state: {
|
|
|
|
pageSize: 50,
|
2013-06-22 09:24:24 +03:00
|
|
|
sortKey : 'time',
|
2013-06-15 02:18:37 +03:00
|
|
|
order : 1
|
2013-06-05 03:49:53 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
queryParams: {
|
2013-06-15 02:18:37 +03:00
|
|
|
totalPages : null,
|
2013-06-05 03:49:53 +03:00
|
|
|
totalRecords: null,
|
2013-06-15 02:18:37 +03:00
|
|
|
pageSize : 'pageSize',
|
2013-06-22 09:24:24 +03:00
|
|
|
sortKey : 'sortKey',
|
|
|
|
order : 'sortDir',
|
2013-06-15 02:18:37 +03:00
|
|
|
directions : {
|
2013-06-22 09:24:24 +03:00
|
|
|
'-1': 'asc',
|
|
|
|
'1' : 'desc'
|
2013-06-05 03:49:53 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
parseState: function (resp, queryParams, state) {
|
|
|
|
return {totalRecords: resp.totalRecords};
|
|
|
|
},
|
|
|
|
|
|
|
|
parseRecords: function (resp) {
|
|
|
|
if (resp) {
|
|
|
|
return resp.records;
|
|
|
|
}
|
|
|
|
|
|
|
|
return resp;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|