1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

[system admin] improved pagination for all (#4404)

* [system admin] improved pagination for all

* [paginator] show 'current page'

* redesigned paginator

* [pagination] cleanup
This commit is contained in:
llj
2020-01-13 12:07:24 +08:00
committed by Daniel Pan
parent fc176627e6
commit a5ad32d3c4
26 changed files with 284 additions and 99 deletions

View File

@@ -20,13 +20,20 @@ class AllRepos extends Component {
errorMsg: '',
repos: [],
pageInfo: {},
perPage: 100,
perPage: 25,
isCreateRepoDialogOpen: false
};
}
componentDidMount () {
this.getReposByPage(1);
let urlParams = (new URL(window.location)).searchParams;
const { currentPage = 1, perPage } = this.state;
this.setState({
perPage: parseInt(urlParams.get('per_page') || perPage),
currentPage: parseInt(urlParams.get('page') || currentPage)
}, () => {
this.getReposByPage(this.state.currentPage);
});
}
toggleCreateRepoDialog = () => {