mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 13:24:52 +00:00
[system admin] all libraries: added 'per page' for paginator (#4387)
This commit is contained in:
@@ -48,6 +48,14 @@ class AllRepos extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
resetPerPage = (perPage) => {
|
||||
this.setState({
|
||||
perPage: perPage
|
||||
}, () => {
|
||||
this.getReposByPage(1);
|
||||
});
|
||||
}
|
||||
|
||||
createRepo = (repoName, Owner) => {
|
||||
seafileAPI.sysAdminCreateRepo(repoName, Owner).then(res => {
|
||||
this.state.repos.unshift(res.data);
|
||||
@@ -107,7 +115,9 @@ class AllRepos extends Component {
|
||||
errorMsg={this.state.errorMsg}
|
||||
items={this.state.repos}
|
||||
pageInfo={this.state.pageInfo}
|
||||
curPerPage={this.state.perPage}
|
||||
getListByPage={this.getReposByPage}
|
||||
resetPerPage={this.resetPerPage}
|
||||
onDeleteRepo={this.onDeleteRepo}
|
||||
onTransferRepo={this.onTransferRepo}
|
||||
/>
|
||||
|
@@ -43,7 +43,7 @@ class Content extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { loading, errorMsg, items, pageInfo } = this.props;
|
||||
const { loading, errorMsg, items, pageInfo, curPerPage } = this.props;
|
||||
if (loading) {
|
||||
return <Loading />;
|
||||
} else if (errorMsg) {
|
||||
@@ -87,7 +87,9 @@ class Content extends Component {
|
||||
gotoNextPage={this.getNextPageList}
|
||||
currentPage={pageInfo.current_page}
|
||||
hasNextPage={pageInfo.has_next_page}
|
||||
canResetPerPage={false}
|
||||
canResetPerPage={true}
|
||||
curPerPage={curPerPage}
|
||||
resetPerPage={this.props.resetPerPage}
|
||||
/>
|
||||
}
|
||||
</Fragment>
|
||||
|
Reference in New Issue
Block a user