mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-16 15:19:06 +00:00
[sysadmin] devices: fix & improvement
This commit is contained in:
@@ -10,13 +10,13 @@ define([
|
||||
model: DeviceModel,
|
||||
state: {pageSize: 50},
|
||||
parseState: function(data) {
|
||||
return {hasNextPage: data[0].has_next_page, current_page: data[0].current_page};
|
||||
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[1];
|
||||
return data.devices;
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -49,10 +49,10 @@ define([
|
||||
getNextPage: function() {
|
||||
this.initPage();
|
||||
var current_page = this.deviceCollection.state.current_page;
|
||||
if (this.deviceCollection.state.hasNextPage) {
|
||||
if (this.deviceCollection.state.has_next_page) {
|
||||
this.deviceCollection.getPage(current_page + 1, {
|
||||
reset: true,
|
||||
data: {'platform': 'desktop'},
|
||||
data: {'platform': 'desktop'}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
@@ -64,7 +64,7 @@ define([
|
||||
if (current_page > 1) {
|
||||
this.deviceCollection.getPage(current_page - 1, {
|
||||
reset: true,
|
||||
data: {'platform': 'desktop'},
|
||||
data: {'platform': 'desktop'}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
@@ -132,7 +132,7 @@ define([
|
||||
},
|
||||
|
||||
renderPaginator: function() {
|
||||
if (this.deviceCollection.state.hasNextPage) {
|
||||
if (this.deviceCollection.state.has_next_page) {
|
||||
this.$jsNext.show();
|
||||
} else {
|
||||
this.$jsNext.hide();
|
||||
|
@@ -49,10 +49,10 @@ define([
|
||||
getNextPage: function() {
|
||||
this.initPage();
|
||||
var current_page = this.deviceCollection.state.current_page;
|
||||
if (this.deviceCollection.state.hasNextPage) {
|
||||
if (this.deviceCollection.state.has_next_page) {
|
||||
this.deviceCollection.getPage(current_page + 1, {
|
||||
reset: true,
|
||||
data: {'platform': 'mobile'},
|
||||
data: {'platform': 'mobile'}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ define([
|
||||
if (current_page > 1) {
|
||||
this.deviceCollection.getPage(current_page - 1, {
|
||||
reset: true,
|
||||
data: {'platform': 'mobile'},
|
||||
data: {'platform': 'mobile'}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
@@ -133,7 +133,7 @@ define([
|
||||
},
|
||||
|
||||
renderPaginator: function() {
|
||||
if (this.deviceCollection.state.hasNextPage) {
|
||||
if (this.deviceCollection.state.has_next_page) {
|
||||
this.$jsNext.show();
|
||||
} else {
|
||||
this.$jsNext.hide();
|
||||
|
Reference in New Issue
Block a user