1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-24 22:22:38 +00:00
seahub/static/scripts/sysadmin-app/collection/devices.js
2016-06-14 14:46:13 +08:00

25 lines
656 B
JavaScript

define([
'underscore',
'backbone.paginator',
'common',
'sysadmin-app/models/device'
], function(_, BackbonePaginator, Common, DeviceModel) {
'use strict';
var DeviceCollection = Backbone.PageableCollection.extend({
model: DeviceModel,
state: {pageSize: 50},
parseState: function(data) {
return {hasNextPage: data[0].has_next_page, current_page: data[0].current_page};
},
url: function () {
return Common.getUrl({name: 'admin-devices'});
},
parseRecords: function(data) {
return data[1];
}
});
return DeviceCollection;
});