1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-21 20:58:21 +00:00
seahub/static/scripts/sysadmin-app/collection/devices.js

25 lines
669 B
JavaScript
Raw Normal View History

2016-04-23 10:07:09 +00:00
define([
'underscore',
'backbone.paginator',
'common',
'sysadmin-app/models/device'
2016-05-25 02:45:22 +00:00
], function(_, BackbonePaginator, Common, DeviceModel) {
2016-04-23 10:07:09 +00:00
'use strict';
var DeviceCollection = Backbone.PageableCollection.extend({
2016-05-25 02:45:22 +00:00
model: DeviceModel,
state: {pageSize: 50},
2016-04-23 10:07:09 +00:00
parseState: function(data) {
2016-06-16 02:29:25 +00:00
return data.page_info; // {'has_next_page': has_next_page, 'current_page': current_page}
2016-04-23 10:07:09 +00:00
},
url: function () {
return Common.getUrl({name: 'admin-devices'});
},
parseRecords: function(data) {
2016-06-16 02:29:25 +00:00
return data.devices;
2016-04-23 10:07:09 +00:00
}
});
return DeviceCollection;
});