Merge pull request #3923 from influxdata/log-viewer/fix-upper-fetch

Fetch more when scrolling
pull/10616/head
Brandon Farmer 2018-07-13 17:21:03 -07:00 committed by GitHub
commit 17508e109e
3 changed files with 14 additions and 7 deletions

View File

@ -32,7 +32,7 @@ import {
TimeMarker,
} from 'src/types/logs'
export const INITIAL_LIMIT = 100
export const INITIAL_LIMIT = 1000
const defaultTableData: TableData = {
columns: [

View File

@ -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()
}

View File

@ -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()
}