|
@@ -1,14 +1,19 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
import React, { PureComponent } from 'react';
|
|
|
import { Switch } from 'app/core/components/Switch/Switch';
|
|
import { Switch } from 'app/core/components/Switch/Switch';
|
|
|
import { OptionModuleProps } from './module';
|
|
import { OptionModuleProps } from './module';
|
|
|
|
|
+import { Label } from '../../../core/components/Label/Label';
|
|
|
|
|
|
|
|
export default class GaugeOptions extends PureComponent<OptionModuleProps> {
|
|
export default class GaugeOptions extends PureComponent<OptionModuleProps> {
|
|
|
- toggleThresholdLabels = () =>
|
|
|
|
|
|
|
+ onToggleThresholdLabels = () =>
|
|
|
this.props.onChange({ ...this.props.options, showThresholdLabels: !this.props.options.showThresholdLabels });
|
|
this.props.onChange({ ...this.props.options, showThresholdLabels: !this.props.options.showThresholdLabels });
|
|
|
|
|
|
|
|
- toggleThresholdMarkers = () =>
|
|
|
|
|
|
|
+ onToggleThresholdMarkers = () =>
|
|
|
this.props.onChange({ ...this.props.options, showThresholdMarkers: !this.props.options.showThresholdMarkers });
|
|
this.props.onChange({ ...this.props.options, showThresholdMarkers: !this.props.options.showThresholdMarkers });
|
|
|
|
|
|
|
|
|
|
+ onMinValueChange = ({ target }) => this.props.onChange({ ...this.props.options, minValue: target.value });
|
|
|
|
|
+
|
|
|
|
|
+ onMaxValueChange = ({ target }) => this.props.onChange({ ...this.props.options, maxValue: target.value });
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
const { showThresholdLabels, showThresholdMarkers } = this.props.options;
|
|
const { showThresholdLabels, showThresholdMarkers } = this.props.options;
|
|
|
|
|
|
|
@@ -20,7 +25,7 @@ export default class GaugeOptions extends PureComponent<OptionModuleProps> {
|
|
|
label="Threshold labels"
|
|
label="Threshold labels"
|
|
|
labelClass="width-10"
|
|
labelClass="width-10"
|
|
|
checked={showThresholdLabels}
|
|
checked={showThresholdLabels}
|
|
|
- onChange={this.toggleThresholdLabels}
|
|
|
|
|
|
|
+ onChange={this.onToggleThresholdLabels}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="gf-form-inline">
|
|
<div className="gf-form-inline">
|
|
@@ -28,9 +33,17 @@ export default class GaugeOptions extends PureComponent<OptionModuleProps> {
|
|
|
label="Threshold markers"
|
|
label="Threshold markers"
|
|
|
labelClass="width-10"
|
|
labelClass="width-10"
|
|
|
checked={showThresholdMarkers}
|
|
checked={showThresholdMarkers}
|
|
|
- onChange={this.toggleThresholdMarkers}
|
|
|
|
|
|
|
+ onChange={this.onToggleThresholdMarkers}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div className="gf-form-inline">
|
|
|
|
|
+ <Label width={6}>Min value</Label>
|
|
|
|
|
+ <input type="text" className="gf-form-input width-12" onChange={this.onMinValueChange} />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className="gf-form-inline">
|
|
|
|
|
+ <Label width={6}>Max value</Label>
|
|
|
|
|
+ <input type="text" className="gf-form-input width-12" onChange={this.onMaxValueChange} />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|