1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-23 13:48:20 +00:00
seahub/static/scripts/sysadmin-app/collection/admin-operation-logs.js

40 lines
985 B
JavaScript
Raw Normal View History

2017-03-09 09:42:59 +00:00
define([
'underscore',
'backbone.paginator',
'common',
2017-09-09 07:27:04 +00:00
'sysadmin-app/models/admin-operation-log'
], function(_, BackbonePaginator, Common, AdminOperationLogModel) {
2017-03-09 09:42:59 +00:00
'use strict';
2017-09-09 07:27:04 +00:00
var AdminOperationLogCollection = Backbone.PageableCollection.extend({
2017-03-09 09:42:59 +00:00
2017-09-09 07:27:04 +00:00
model: AdminOperationLogModel,
2017-03-09 09:42:59 +00:00
url: function() {
2017-09-09 07:27:04 +00:00
return Common.getUrl({name: 'admin-operation-logs'});
2017-03-09 09:42:59 +00:00
},
state: {
firstPage: 1,
2017-03-14 07:45:32 +00:00
pageSize: 100
2017-03-09 09:42:59 +00:00
},
2017-03-14 07:45:32 +00:00
// Setting a parameter mapping value to null removes it from the query string
2017-03-09 09:42:59 +00:00
queryParams: {
currentPage: "page",
pageSize: "per_page",
totalPages: null,
2017-03-14 07:45:32 +00:00
totalRecords: null
2017-03-09 09:42:59 +00:00
},
parseState: function (resp) {
return {totalRecords: resp.total_count};
},
parseRecords: function (resp) {
return resp.data;
}
});
2017-09-09 07:27:04 +00:00
return AdminOperationLogCollection;
2017-03-09 09:42:59 +00:00
});