IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Browse Source

Added more log entries per page switch to WBLiveLogs.

pull/1/head
parent
commit
b9df02edf2
1 changed files with 15 additions and 4 deletions
  1. +15
    -4
      frontend/src/js/component/wb-live-logs.js

+ 15
- 4
frontend/src/js/component/wb-live-logs.js View File

@@ -6,6 +6,7 @@ class WBLiveLogs extends Component {
constructor(...args) {
super(...args);
this.state.page = 0;
this.state.moreItemsPerPage = false;
this.terminalRef = createRef();
}
@@ -22,8 +23,11 @@ class WBLiveLogs extends Component {
}
fetchData() {
const { uuid, app, itemsPerPage } = this.props;
const { page } = this.state;
const { uuid, app } = this.props;
let { itemsPerPage } = this.props;
const { page, moreItemsPerPage } = this.state;
if (moreItemsPerPage)
itemsPerPage *= 10;
const { arvHost, arvToken } = app.state;
const filters = [
[ 'object_uuid', '=', uuid ]
@@ -44,9 +48,16 @@ class WBLiveLogs extends Component {
});
}
render({}, { content, page, numPages }) {
render({}, { content, page, numPages, moreItemsPerPage }) {
return (
<div>
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="morePerPageSwitch"
checked = { moreItemsPerPage ? 'checked' : null }
onchange={ e => { this.state.moreItemsPerPage = e.target.checked;
this.state.page = 0; this.fetchData(); } } />
<label class="custom-control-label" for="morePerPageSwitch">More log entries per page</label>
</div>
<WBPagination activePage={ page } numPages={ numPages }
onPageChanged={ page => { this.state.page = page; this.fetchData(); } } />
<pre class="word-warp terminal" ref={ this.terminalRef }>
@@ -58,7 +69,7 @@ class WBLiveLogs extends Component {
}
WBLiveLogs.defaultProps = {
itemsPerPage: 1000
itemsPerPage: 100
};
export default WBLiveLogs;

Loading…
Cancel
Save