generic repeater

This commit is contained in:
ryan 2019-03-13 11:30:52 -07:00
parent 36d67f22e9
commit 6472c2bcd9
2 changed files with 6 additions and 6 deletions

View File

@ -10,12 +10,12 @@ import { BarGauge, VizRepeater } from '@grafana/ui';
// Types // Types
import { BarGaugeOptions } from './types'; import { BarGaugeOptions } from './types';
import { PanelProps } from '@grafana/ui/src/types'; import { PanelProps, SingleStatValueInfo } from '@grafana/ui/src/types';
interface Props extends PanelProps<BarGaugeOptions> {} interface Props extends PanelProps<BarGaugeOptions> {}
export class BarGaugePanel extends PureComponent<Props> { export class BarGaugePanel extends PureComponent<Props> {
renderBarGauge(value, width, height) { renderBarGauge(value: SingleStatValueInfo, width, height) {
const { replaceVariables, options } = this.props; const { replaceVariables, options } = this.props;
const { valueOptions } = options; const { valueOptions } = options;
@ -24,7 +24,7 @@ export class BarGaugePanel extends PureComponent<Props> {
return ( return (
<BarGauge <BarGauge
value={value} value={value.value as number | null}
width={width} width={width}
height={height} height={height}
prefix={prefix} prefix={prefix}

View File

@ -10,12 +10,12 @@ import { Gauge, VizRepeater } from '@grafana/ui';
// Types // Types
import { GaugeOptions } from './types'; import { GaugeOptions } from './types';
import { PanelProps, VizOrientation } from '@grafana/ui/src/types'; import { PanelProps, VizOrientation, SingleStatValueInfo } from '@grafana/ui/src/types';
interface Props extends PanelProps<GaugeOptions> {} interface Props extends PanelProps<GaugeOptions> {}
export class GaugePanel extends PureComponent<Props> { export class GaugePanel extends PureComponent<Props> {
renderGauge(value, width, height) { renderGauge(value: SingleStatValueInfo, width, height) {
const { replaceVariables, options } = this.props; const { replaceVariables, options } = this.props;
const { valueOptions } = options; const { valueOptions } = options;
@ -24,7 +24,7 @@ export class GaugePanel extends PureComponent<Props> {
return ( return (
<Gauge <Gauge
value={value} value={value.value as number | null}
width={width} width={width}
height={height} height={height}
prefix={prefix} prefix={prefix}