2013-06-24 23:41:59 +00:00
|
|
|
|
'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',
|
2013-06-14 23:18:37 +00:00
|
|
|
|
order : 1
|
2013-06-05 00:49:53 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
queryParams: {
|
2013-06-14 23:18:37 +00:00
|
|
|
|
totalPages : null,
|
2013-06-05 00:49:53 +00:00
|
|
|
|
totalRecords: null,
|
2013-06-14 23:18:37 +00:00
|
|
|
|
pageSize : 'pageSize',
|
2013-06-22 06:24:24 +00:00
|
|
|
|
sortKey : 'sortKey',
|
|
|
|
|
order : 'sortDir',
|
2013-06-14 23:18:37 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|