mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 22:54:11 +00:00
[system admin] trash repos: list by page
This commit is contained in:
24
static/scripts/sysadmin-app/collection/search-trash-repos.js
Normal file
24
static/scripts/sysadmin-app/collection/search-trash-repos.js
Normal file
@@ -0,0 +1,24 @@
|
||||
define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common',
|
||||
'sysadmin-app/models/trash-repo'
|
||||
], function(_, Backbone, Common, TrashRepoModel) {
|
||||
'use strict';
|
||||
|
||||
var TrashRepoCollection = Backbone.Collection.extend({
|
||||
model: TrashRepoModel,
|
||||
|
||||
url: function () {
|
||||
return Common.getUrl({name: 'admin-trash-libraries'});
|
||||
},
|
||||
|
||||
parse: function(data) {
|
||||
this.search_owner = data.search_owner;
|
||||
return data.repos;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return TrashRepoCollection;
|
||||
});
|
@@ -1,20 +1,25 @@
|
||||
define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'backbone.paginator',
|
||||
'common',
|
||||
'sysadmin-app/models/trash-repo'
|
||||
], function(_, Backbone, Common, TrashRepoModel) {
|
||||
], function(_, BackbonePaginator, Common, TrashRepoModel) {
|
||||
'use strict';
|
||||
|
||||
var TrashRepoCollection = Backbone.Collection.extend({
|
||||
var TrashRepoCollection = Backbone.PageableCollection.extend({
|
||||
model: TrashRepoModel,
|
||||
|
||||
url: function () {
|
||||
return Common.getUrl({name: 'admin-trash-libraries'});
|
||||
},
|
||||
|
||||
parse: function(data) {
|
||||
this.search_owner = data.search_owner;
|
||||
state: {pageSize: 100},
|
||||
|
||||
parseState: function(data) {
|
||||
return data.page_info; // {'has_next_page': has_next_page, 'current_page': current_pag
|
||||
},
|
||||
|
||||
parseRecords: function(data) {
|
||||
return data.repos;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user