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!
소스 검색

Added more log entries per page switch to WBLiveLogs.

master
부모
커밋
b9df02edf2
1개의 변경된 파일15개의 추가작업 그리고 4개의 파일을 삭제
  1. +15
    -4
      frontend/src/js/component/wb-live-logs.js

+ 15
- 4
frontend/src/js/component/wb-live-logs.js 파일 보기

@@ -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;

불러오는 중...
취소
저장