Set time marker when user clicks bar in histogram
Co-authored-by: Alex Paxton <thealexpaxton@gmail.com> Co-authored-by: Daniel Campbell <metalwhirlwind@gmail.com>pull/3897/head
parent
1215cb53cd
commit
0b08684d30
|
@ -250,6 +250,7 @@ class LogsPage extends PureComponent<Props, State> {
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
colorScale={colorForSeverity}
|
colorScale={colorForSeverity}
|
||||||
|
onBarClick={this.handleBarClick}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</AutoSizer>
|
</AutoSizer>
|
||||||
|
@ -316,6 +317,19 @@ class LogsPage extends PureComponent<Props, State> {
|
||||||
this.props.executeQueriesAsync()
|
this.props.executeQueriesAsync()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private handleBarClick = (group: BarGroup): void => {
|
||||||
|
const {data} = group
|
||||||
|
|
||||||
|
if (!data.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const unixTimestamp = data[0].time
|
||||||
|
const timeOption = moment(unixTimestamp).toISOString()
|
||||||
|
|
||||||
|
this.handleSetTimeMarker({timeOption})
|
||||||
|
}
|
||||||
|
|
||||||
private handleSetTimeBounds = async () => {
|
private handleSetTimeBounds = async () => {
|
||||||
const {seconds, windowOption, timeOption} = this.props.timeRange
|
const {seconds, windowOption, timeOption} = this.props.timeRange
|
||||||
let lower = `now() - ${windowOption}`
|
let lower = `now() - ${windowOption}`
|
||||||
|
|
Loading…
Reference in New Issue