diff --git a/ui/src/logs/actions/index.ts b/ui/src/logs/actions/index.ts index 67d8509fa9..b44f797e79 100644 --- a/ui/src/logs/actions/index.ts +++ b/ui/src/logs/actions/index.ts @@ -32,7 +32,7 @@ import { TimeMarker, } from 'src/types/logs' -export const INITIAL_LIMIT = 100 +export const INITIAL_LIMIT = 1000 const defaultTableData: TableData = { columns: [ diff --git a/ui/src/logs/components/LogsTable.tsx b/ui/src/logs/components/LogsTable.tsx index 23f3b9fbac..6c50e1fd3d 100644 --- a/ui/src/logs/components/LogsTable.tsx +++ b/ui/src/logs/components/LogsTable.tsx @@ -157,8 +157,6 @@ class LogsTable extends Component { isMessageVisible, visibleColumnsCount, } - - this.loadMoreAboveRows = _.throttle(this.loadMoreAboveRows, 50) } public componentDidUpdate() { @@ -314,7 +312,7 @@ class LogsTable extends Component { this.setState({scrollTop}) - if (scrollTop < 200 && scrollTop < previousTop) { + if (scrollTop < 200 && scrollTop <= previousTop) { this.loadMoreAboveRows() } diff --git a/ui/src/logs/containers/LogsPage.tsx b/ui/src/logs/containers/LogsPage.tsx index c6160f079c..0df99da8a1 100644 --- a/ui/src/logs/containers/LogsPage.tsx +++ b/ui/src/logs/containers/LogsPage.tsx @@ -156,7 +156,9 @@ class LogsPage extends Component { this.fetchNewDataset() } - this.startUpdating() + if (getDeep(this.props, 'timeRange.timeOption', '') === 'now') { + this.startUpdating() + } } public componentWillUnmount() { @@ -236,7 +238,12 @@ class LogsPage extends Component { 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 { .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 { } private fetchNewDataset() { - this.setState({liveUpdating: LiveUpdating.Play}) this.props.executeQueriesAsync() }