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/repos.js

25 lines
663 B
JavaScript
Raw Normal View History

2016-05-25 02:45:22 +00:00
define([
'underscore',
'backbone.paginator',
'common',
2016-05-27 08:42:40 +00:00
'sysadmin-app/models/repo'
], function(_, BackbonePaginator, Common, RepoModel) {
2016-05-25 02:45:22 +00:00
'use strict';
2016-05-27 08:42:40 +00:00
var RepoCollection = Backbone.PageableCollection.extend({
model: RepoModel,
2016-05-25 02:45:22 +00:00
state: {pageSize: 100},
parseState: function(data) {
return data.page_info; // {'has_next_page': has_next_page, 'current_page': current_page}
2016-05-25 02:45:22 +00:00
},
parseRecords: function(data) {
return data.repos;
2016-05-25 02:45:22 +00:00
},
url: function () {
return Common.getUrl({name: 'admin-libraries'});
}
});
2016-05-27 08:42:40 +00:00
return RepoCollection;
2016-05-25 02:45:22 +00:00
});