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,
|
TimeMarker,
|
||||||
} from 'src/types/logs'
|
} from 'src/types/logs'
|
||||||
|
|
||||||
export const INITIAL_LIMIT = 100
|
export const INITIAL_LIMIT = 1000
|
||||||
|
|
||||||
const defaultTableData: TableData = {
|
const defaultTableData: TableData = {
|
||||||
columns: [
|
columns: [
|
||||||
|
|
|
@ -157,8 +157,6 @@ class LogsTable extends Component<Props, State> {
|
||||||
isMessageVisible,
|
isMessageVisible,
|
||||||
visibleColumnsCount,
|
visibleColumnsCount,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadMoreAboveRows = _.throttle(this.loadMoreAboveRows, 50)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentDidUpdate() {
|
public componentDidUpdate() {
|
||||||
|
@ -314,7 +312,7 @@ class LogsTable extends Component<Props, State> {
|
||||||
|
|
||||||
this.setState({scrollTop})
|
this.setState({scrollTop})
|
||||||
|
|
||||||
if (scrollTop < 200 && scrollTop < previousTop) {
|
if (scrollTop < 200 && scrollTop <= previousTop) {
|
||||||
this.loadMoreAboveRows()
|
this.loadMoreAboveRows()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,8 +156,10 @@ class LogsPage extends Component<Props, State> {
|
||||||
this.fetchNewDataset()
|
this.fetchNewDataset()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getDeep<string>(this.props, 'timeRange.timeOption', '') === 'now') {
|
||||||
this.startUpdating()
|
this.startUpdating()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
clearInterval(this.interval)
|
clearInterval(this.interval)
|
||||||
|
@ -236,7 +238,12 @@ class LogsPage extends Component<Props, State> {
|
||||||
|
|
||||||
private handleChooseCustomTime = async (time: string) => {
|
private handleChooseCustomTime = async (time: string) => {
|
||||||
this.props.setTableCustomTime(time)
|
this.props.setTableCustomTime(time)
|
||||||
this.setState({hasScrolled: false})
|
const liveUpdating = LiveUpdating.Pause
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
hasScrolled: false,
|
||||||
|
liveUpdating,
|
||||||
|
})
|
||||||
|
|
||||||
await this.props.setTimeMarker({
|
await this.props.setTimeMarker({
|
||||||
timeOption: time,
|
timeOption: time,
|
||||||
|
@ -255,10 +262,13 @@ class LogsPage extends Component<Props, State> {
|
||||||
.toISOString(),
|
.toISOString(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let liveUpdating = LiveUpdating.Pause
|
||||||
if (time === 0) {
|
if (time === 0) {
|
||||||
timeOption = {timeOption: 'now'}
|
timeOption = {timeOption: 'now'}
|
||||||
|
liveUpdating = LiveUpdating.Play
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setState({liveUpdating})
|
||||||
await this.props.setTimeMarker(timeOption)
|
await this.props.setTimeMarker(timeOption)
|
||||||
this.handleSetTimeBounds()
|
this.handleSetTimeBounds()
|
||||||
}
|
}
|
||||||
|
@ -561,7 +571,6 @@ class LogsPage extends Component<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fetchNewDataset() {
|
private fetchNewDataset() {
|
||||||
this.setState({liveUpdating: LiveUpdating.Play})
|
|
||||||
this.props.executeQueriesAsync()
|
this.props.executeQueriesAsync()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue