|
|
@ -1,5 +1,7 @@ |
|
|
|
import { FieldNamePicker } from '../../grafana/MatchersUI/FieldNamePicker'; |
|
|
|
import { FieldNamePicker } from '../../grafana/MatchersUI/FieldNamePicker'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { isNumber } from '../../utils'; |
|
|
|
|
|
|
|
|
|
|
|
import { StandardEditorProps } from '@grafana/data'; |
|
|
|
import { StandardEditorProps } from '@grafana/data'; |
|
|
|
import { HorizontalGroup, InlineField, InlineSwitch, Input } from '@grafana/ui'; |
|
|
|
import { HorizontalGroup, InlineField, InlineSwitch, Input } from '@grafana/ui'; |
|
|
|
|
|
|
|
|
|
|
@ -32,7 +34,7 @@ export function UseMetricEditor({ onChange, value, context }: StandardEditorProp |
|
|
|
<InlineField label="Use metric"> |
|
|
|
<InlineField label="Use metric"> |
|
|
|
<InlineSwitch |
|
|
|
<InlineSwitch |
|
|
|
value={config?.useMetric} |
|
|
|
value={config?.useMetric} |
|
|
|
onChange={(evt) => onFieldChange('useMetric', (evt.target as any).checked)} |
|
|
|
onChange={(evt) => onFieldChange('useMetric', evt.currentTarget.checked)} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</InlineField> |
|
|
|
</InlineField> |
|
|
|
<InlineField> |
|
|
|
<InlineField> |
|
|
@ -48,7 +50,7 @@ export function UseMetricEditor({ onChange, value, context }: StandardEditorProp |
|
|
|
placeholder="value" |
|
|
|
placeholder="value" |
|
|
|
value={config?.value} |
|
|
|
value={config?.value} |
|
|
|
width={24} |
|
|
|
width={24} |
|
|
|
onChange={(evt) => onFieldChange('value', (evt.target as any).value)} |
|
|
|
onChange={(evt) => onFieldChange('value', isNumber(evt.currentTarget.value) ? +evt.currentTarget.value : undefined)} |
|
|
|
/> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</InlineField> |
|
|
|
</InlineField> |
|
|
|