|
|
@@ -1,6 +1,6 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
|
import {
|
|
|
- PanelOptionsProps,
|
|
|
+ PanelEditorProps,
|
|
|
ThresholdsEditor,
|
|
|
Threshold,
|
|
|
PanelOptionsGrid,
|
|
|
@@ -8,29 +8,11 @@ import {
|
|
|
ValueMapping,
|
|
|
} from '@grafana/ui';
|
|
|
|
|
|
-import ValueOptions from 'app/plugins/panel/gauge/ValueOptions';
|
|
|
-import GaugeOptionsEditor from './GaugeOptionsEditor';
|
|
|
+import { ValueOptions } from 'app/plugins/panel/gauge/ValueOptions';
|
|
|
+import { GaugeOptionsBox } from './GaugeOptionsBox';
|
|
|
import { GaugeOptions } from './types';
|
|
|
|
|
|
-export const defaultProps = {
|
|
|
- options: {
|
|
|
- minValue: 0,
|
|
|
- maxValue: 100,
|
|
|
- prefix: '',
|
|
|
- showThresholdMarkers: true,
|
|
|
- showThresholdLabels: false,
|
|
|
- suffix: '',
|
|
|
- decimals: 0,
|
|
|
- stat: 'avg',
|
|
|
- unit: 'none',
|
|
|
- valueMappings: [],
|
|
|
- thresholds: [],
|
|
|
- },
|
|
|
-};
|
|
|
-
|
|
|
-export default class GaugePanelOptions extends PureComponent<PanelOptionsProps<GaugeOptions>> {
|
|
|
- static defaultProps = defaultProps;
|
|
|
-
|
|
|
+export class GaugePanelEditor extends PureComponent<PanelEditorProps<GaugeOptions>> {
|
|
|
onThresholdsChanged = (thresholds: Threshold[]) =>
|
|
|
this.props.onChange({
|
|
|
...this.props.options,
|
|
|
@@ -50,7 +32,7 @@ export default class GaugePanelOptions extends PureComponent<PanelOptionsProps<G
|
|
|
<>
|
|
|
<PanelOptionsGrid>
|
|
|
<ValueOptions onChange={onChange} options={options} />
|
|
|
- <GaugeOptionsEditor onChange={onChange} options={options} />
|
|
|
+ <GaugeOptionsBox onChange={onChange} options={options} />
|
|
|
<ThresholdsEditor onChange={this.onThresholdsChanged} thresholds={options.thresholds} />
|
|
|
</PanelOptionsGrid>
|
|
|
|