mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Let drag-selecting a timerange disable autorefresh * Send action to stop livestreaming at better time.
This commit is contained in:
parent
db38e66de2
commit
c1b9111d06
4 changed files with 17 additions and 2 deletions
|
@ -23,6 +23,8 @@ interface Props {
|
|||
nodeId: string;
|
||||
label: string;
|
||||
onChangeRangeTime?: (time: metricTimeActions.MetricRangeTimeState) => void;
|
||||
isLiveStreaming?: boolean;
|
||||
stopLiveStreaming?: () => void;
|
||||
intl: InjectedIntl;
|
||||
}
|
||||
|
||||
|
@ -103,9 +105,11 @@ export const Metrics = injectI18n(
|
|||
private renderSection = (layout: InfraMetricLayout) => (section: InfraMetricLayoutSection) => {
|
||||
let sectionProps = {};
|
||||
if (section.type === 'chart') {
|
||||
const { onChangeRangeTime } = this.props;
|
||||
const { onChangeRangeTime, isLiveStreaming, stopLiveStreaming } = this.props;
|
||||
sectionProps = {
|
||||
onChangeRangeTime,
|
||||
isLiveStreaming,
|
||||
stopLiveStreaming,
|
||||
crosshairValue: this.state.crosshairValue,
|
||||
onCrosshairUpdate: this.onCrosshairUpdate,
|
||||
};
|
||||
|
|
|
@ -16,6 +16,8 @@ interface Props {
|
|||
onChangeRangeTime?: (time: metricTimeActions.MetricRangeTimeState) => void;
|
||||
crosshairValue?: number;
|
||||
onCrosshairUpdate?: (crosshairValue: number) => void;
|
||||
isLiveStreaming?: boolean;
|
||||
stopLiveStreaming?: () => void;
|
||||
}
|
||||
|
||||
export class Section extends React.PureComponent<Props> {
|
||||
|
@ -30,6 +32,8 @@ export class Section extends React.PureComponent<Props> {
|
|||
onChangeRangeTime: this.props.onChangeRangeTime,
|
||||
crosshairValue: this.props.crosshairValue,
|
||||
onCrosshairUpdate: this.props.onCrosshairUpdate,
|
||||
isLiveStreaming: this.props.isLiveStreaming,
|
||||
stopLiveStreaming: this.props.stopLiveStreaming,
|
||||
};
|
||||
}
|
||||
const Component = sections[this.props.section.type];
|
||||
|
|
|
@ -43,6 +43,8 @@ interface Props {
|
|||
onChangeRangeTime?: (time: metricTimeActions.MetricRangeTimeState) => void;
|
||||
crosshairValue?: number;
|
||||
onCrosshairUpdate?: (crosshairValue: number) => void;
|
||||
isLiveStreaming?: boolean;
|
||||
stopLiveStreaming?: () => void;
|
||||
intl: InjectedIntl;
|
||||
}
|
||||
|
||||
|
@ -214,9 +216,12 @@ export const ChartSection = injectI18n(
|
|||
}
|
||||
|
||||
private handleSelectionBrushEnd = (area: Area) => {
|
||||
const { onChangeRangeTime } = this.props;
|
||||
const { onChangeRangeTime, isLiveStreaming, stopLiveStreaming } = this.props;
|
||||
const { startX, endX } = area.domainArea;
|
||||
if (onChangeRangeTime) {
|
||||
if (isLiveStreaming && stopLiveStreaming) {
|
||||
stopLiveStreaming();
|
||||
}
|
||||
onChangeRangeTime({
|
||||
to: endX.valueOf(),
|
||||
from: startX.valueOf(),
|
||||
|
|
|
@ -166,6 +166,8 @@ export const MetricDetail = withTheme(
|
|||
}
|
||||
refetch={refetch}
|
||||
onChangeRangeTime={setRangeTime}
|
||||
isLiveStreaming={isAutoReloading}
|
||||
stopLiveStreaming={stopMetricsAutoReload}
|
||||
/>
|
||||
</EuiPageContentWithRelative>
|
||||
</EuiPageBody>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue