|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
import { FieldNamePicker } from '../../grafana/MatchersUI/FieldNamePicker'; |
|
|
|
|
|
|
|
|
|
import { isNumber } from '../../utils'; |
|
|
|
|
|
|
|
|
|
import { GrafanaTheme, StandardEditorProps } from '@grafana/data'; |
|
|
|
|
import { |
|
|
|
|
Button, |
|
|
|
@ -97,7 +99,7 @@ export function ThresholdsEditor({ onChange, value, context }: StandardEditorPro
|
|
|
|
|
<InlineField label="Use metric"> |
|
|
|
|
<InlineSwitch |
|
|
|
|
value={threshold.useMetric} |
|
|
|
|
onChange={(evt) => onThresholdFieldChange(thresholdIdx, 'useMetric', (evt.target as any).checked)} |
|
|
|
|
onChange={(evt) => onThresholdFieldChange(thresholdIdx, 'useMetric', evt.currentTarget.checked)} |
|
|
|
|
/> |
|
|
|
|
</InlineField> |
|
|
|
|
<InlineField> |
|
|
|
@ -113,7 +115,7 @@ export function ThresholdsEditor({ onChange, value, context }: StandardEditorPro
|
|
|
|
|
placeholder="value" |
|
|
|
|
width={24} |
|
|
|
|
value={threshold.value} |
|
|
|
|
onChange={(evt) => onThresholdFieldChange(thresholdIdx, 'value', (evt.target as any).value)} |
|
|
|
|
onChange={(evt) => onThresholdFieldChange(thresholdIdx, 'value', isNumber(evt.currentTarget.value) ? +evt.currentTarget.value : undefined)} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
</InlineField> |
|
|
|
|