1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 00:00:00 +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

@@ -69,7 +69,6 @@ class Content extends Component {
gotoNextPage={this.getNextPage}
currentPage={currentPage}
hasNextPage={hasNextPage}
canResetPerPage={true}
curPerPage={perPage}
resetPerPage={this.props.resetPerPage}
/>
@@ -124,7 +123,7 @@ class FileAccessLogs extends Component {
loading: true,
errorMsg: '',
logList: [],
perPage: 100,
perPage: 25,
currentPage: 1,
hasNextPage: false,
isExportExcelDialogOpen: false,
@@ -137,7 +136,14 @@ class FileAccessLogs extends Component {
}
componentDidMount () {
this.getLogsByPage(this.initPage);
let urlParams = (new URL(window.location)).searchParams;
const { currentPage, perPage } = this.state;
this.setState({
perPage: parseInt(urlParams.get('per_page') || perPage),
currentPage: parseInt(urlParams.get('page') || currentPage)
}, () => {
this.getLogsByPage(this.state.currentPage);
});
}
getLogsByPage = (page) => {