2019-01-09 10:00:10 -06:00
|
|
|
import React, { PureComponent } from 'react';
|
2019-01-11 01:30:30 -06:00
|
|
|
import { GaugeOptions, PanelProps, NullValueMode } from '@grafana/ui';
|
|
|
|
|
2019-01-09 10:00:10 -06:00
|
|
|
import { getTimeSeriesVMs } from 'app/viz/state/timeSeries';
|
|
|
|
import Gauge from 'app/viz/Gauge';
|
|
|
|
|
2019-01-11 01:30:30 -06:00
|
|
|
interface Props extends PanelProps<GaugeOptions> {}
|
2019-01-09 10:00:10 -06:00
|
|
|
|
|
|
|
export class GaugePanel extends PureComponent<Props> {
|
|
|
|
render() {
|
|
|
|
const { timeSeries, width, height } = this.props;
|
|
|
|
|
|
|
|
const vmSeries = getTimeSeriesVMs({
|
|
|
|
timeSeries: timeSeries,
|
|
|
|
nullValueMode: NullValueMode.Ignore,
|
|
|
|
});
|
|
|
|
|
2019-01-14 02:45:55 -06:00
|
|
|
return (
|
|
|
|
<Gauge
|
|
|
|
timeSeries={vmSeries}
|
|
|
|
{...this.props.options}
|
2019-01-14 07:47:41 -06:00
|
|
|
width={width}
|
|
|
|
height={height}
|
2019-01-14 02:45:55 -06:00
|
|
|
/>
|
|
|
|
);
|
2019-01-09 10:00:10 -06:00
|
|
|
}
|
|
|
|
}
|