import React, { PureComponent } from 'react'; import Gauge from 'app/viz/Gauge'; import { getTimeSeriesVMs } from 'app/viz/state/timeSeries'; import ValueOptions from './ValueOptions'; import GaugeOptions from './GaugeOptions'; import Thresholds from './Thresholds'; import ValueMappings from './ValueMappings'; import { PanelOptionsProps, PanelProps, NullValueMode } from '@grafana/ui'; import { BasicGaugeColor, RangeMap, Threshold, ValueMap } from 'app/types'; export interface OptionsProps { baseColor: string; decimals: number; mappings: Array; maxValue: number; minValue: number; prefix: string; showThresholdLabels: boolean; showThresholdMarkers: boolean; stat: string; suffix: string; thresholds: Threshold[]; unit: string; } export interface OptionModuleProps { onChange: (item: any) => void; options: OptionsProps; } export const defaultProps = { options: { baseColor: BasicGaugeColor.Green, minValue: 0, maxValue: 100, prefix: '', showThresholdMarkers: true, showThresholdLabels: false, suffix: '', decimals: 0, stat: '', unit: '', mappings: [], thresholds: [], }, }; interface Props extends PanelProps {} class GaugePanel extends PureComponent { render() { const { timeSeries, width, height } = this.props; const vmSeries = getTimeSeriesVMs({ timeSeries: timeSeries, nullValueMode: NullValueMode.Ignore, }); return ; } } class Options extends PureComponent> { static defaultProps = defaultProps; render() { const { onChange, options } = this.props; return (
); } } export { GaugePanel as Panel, Options as PanelOptions, defaultProps as PanelDefaults };