Merge: - client: add initial flag for getLogs
* commit 'dd37c9651a0a5914a5e8c9be4c2f6ad23faf1a13': - client: add initial flag for getLogs
This commit is contained in:
commit
be93dc3482
|
@ -25,7 +25,8 @@ import './Logs.css';
|
|||
import CellWrap from '../ui/CellWrap';
|
||||
|
||||
const TABLE_FIRST_PAGE = 0;
|
||||
const INITIAL_REQUEST_DATA = ['', TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE];
|
||||
const INITIAL_REQUEST = true;
|
||||
const INITIAL_REQUEST_DATA = ['', TABLE_FIRST_PAGE, INITIAL_REQUEST];
|
||||
const FILTERED_REASON = 'Filtered';
|
||||
|
||||
class Logs extends Component {
|
||||
|
@ -36,10 +37,10 @@ class Logs extends Component {
|
|||
this.props.getLogsConfig();
|
||||
}
|
||||
|
||||
getLogs = (older_than, page) => {
|
||||
getLogs = (older_than, page, initial) => {
|
||||
if (this.props.queryLogs.enabled) {
|
||||
this.props.getLogs({
|
||||
older_than, page, pageSize: TABLE_DEFAULT_PAGE_SIZE,
|
||||
older_than, page, pageSize: TABLE_DEFAULT_PAGE_SIZE, initial,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -56,9 +56,9 @@ const queryLogs = handleActions(
|
|||
[actions.getLogsFailure]: state => ({ ...state, processingGetLogs: false }),
|
||||
[actions.getLogsSuccess]: (state, { payload }) => {
|
||||
const {
|
||||
logs, oldest, older_than, page, pageSize,
|
||||
logs, oldest, older_than, page, pageSize, initial,
|
||||
} = payload;
|
||||
let logsWithOffset = state.allLogs.length > 0 ? state.allLogs : logs;
|
||||
let logsWithOffset = state.allLogs.length > 0 && !initial ? state.allLogs : logs;
|
||||
let allLogs = logs;
|
||||
|
||||
if (older_than) {
|
||||
|
|
Loading…
Reference in New Issue