Merge pull request #3923 from influxdata/log-viewer/fix-upper-fetch
Fetch more when scrollingpull/10616/head
commit
17508e109e
|
@ -32,7 +32,7 @@ import {
|
|||
TimeMarker,
|
||||
} from 'src/types/logs'
|
||||
|
||||
export const INITIAL_LIMIT = 100
|
||||
export const INITIAL_LIMIT = 1000
|
||||
|
||||
const defaultTableData: TableData = {
|
||||
columns: [
|
||||
|
|
|
@ -157,8 +157,6 @@ class LogsTable extends Component<Props, State> {
|
|||
isMessageVisible,
|
||||
visibleColumnsCount,
|
||||
}
|
||||
|
||||
this.loadMoreAboveRows = _.throttle(this.loadMoreAboveRows, 50)
|
||||
}
|
||||
|
||||
public componentDidUpdate() {
|
||||
|
@ -314,7 +312,7 @@ class LogsTable extends Component<Props, State> {
|
|||
|
||||
this.setState({scrollTop})
|
||||
|
||||
if (scrollTop < 200 && scrollTop < previousTop) {
|
||||
if (scrollTop < 200 && scrollTop <= previousTop) {
|
||||
this.loadMoreAboveRows()
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,9 @@ class LogsPage extends Component<Props, State> {
|
|||
this.fetchNewDataset()
|
||||
}
|
||||
|
||||
this.startUpdating()
|
||||
if (getDeep<string>(this.props, 'timeRange.timeOption', '') === 'now') {
|
||||
this.startUpdating()
|
||||
}
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
|
@ -236,7 +238,12 @@ class LogsPage extends Component<Props, State> {
|
|||
|
||||
private handleChooseCustomTime = async (time: string) => {
|
||||
this.props.setTableCustomTime(time)
|
||||
this.setState({hasScrolled: false})
|
||||
const liveUpdating = LiveUpdating.Pause
|
||||
|
||||
this.setState({
|
||||
hasScrolled: false,
|
||||
liveUpdating,
|
||||
})
|
||||
|
||||
await this.props.setTimeMarker({
|
||||
timeOption: time,
|
||||
|
@ -255,10 +262,13 @@ class LogsPage extends Component<Props, State> {
|
|||
.toISOString(),
|
||||
}
|
||||
|
||||
let liveUpdating = LiveUpdating.Pause
|
||||
if (time === 0) {
|
||||
timeOption = {timeOption: 'now'}
|
||||
liveUpdating = LiveUpdating.Play
|
||||
}
|
||||
|
||||
this.setState({liveUpdating})
|
||||
await this.props.setTimeMarker(timeOption)
|
||||
this.handleSetTimeBounds()
|
||||
}
|
||||
|
@ -561,7 +571,6 @@ class LogsPage extends Component<Props, State> {
|
|||
}
|
||||
|
||||
private fetchNewDataset() {
|
||||
this.setState({liveUpdating: LiveUpdating.Play})
|
||||
this.props.executeQueriesAsync()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue