mirror of
https://github.com/haiwen/seahub.git
synced 2025-06-21 12:48:24 +00:00
25 lines
669 B
JavaScript
25 lines
669 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 data.page_info; // {'has_next_page': has_next_page, 'current_page': current_page}
|
|
},
|
|
url: function () {
|
|
return Common.getUrl({name: 'admin-devices'});
|
|
},
|
|
parseRecords: function(data) {
|
|
return data.devices;
|
|
}
|
|
});
|
|
|
|
return DeviceCollection;
|
|
});
|