@ -3,6 +3,7 @@ import { InlineFormLabel, LegacyForms } from '@grafana/ui';
const { Select , Input } = LegacyForms ;
import { DataSourceSettings , SelectableValue } from '@grafana/data' ;
import { OpenTsdbOptions } from '../types' ;
import { useUniqueId } from '../../influxdb/components/useUniqueId' ;
const tsdbVersions = [
{ label : '<=2.1' , value : 1 } ,
@ -23,12 +24,17 @@ interface Props {
export const OpenTsdbDetails = ( props : Props ) = > {
const { onChange , value } = props ;
const idSuffix = useUniqueId ( ) ;
return (
< >
< h5 > OpenTSDB settings < / h5 >
< div className = "gf-form" >
< InlineFormLabel width = { 7 } > Version < / InlineFormLabel >
< InlineFormLabel width = { 7 } htmlFor = { ` select-version- ${ idSuffix } ` } >
Version
< / InlineFormLabel >
< Select
inputId = { ` select-version- ${ idSuffix } ` }
menuShouldPortal
options = { tsdbVersions }
value = { tsdbVersions . find ( ( version ) = > version . value === value . jsonData . tsdbVersion ) ? ? tsdbVersions [ 0 ] }
@ -36,8 +42,11 @@ export const OpenTsdbDetails = (props: Props) => {
/ >
< / div >
< div className = "gf-form" >
< InlineFormLabel width = { 7 } > Resolution < / InlineFormLabel >
< InlineFormLabel width = { 7 } htmlFor = { ` select-resolution- ${ idSuffix } ` } >
Resolution
< / InlineFormLabel >
< Select
inputId = { ` select-resolution- ${ idSuffix } ` }
menuShouldPortal
options = { tsdbResolutions }
value = {
@ -48,8 +57,11 @@ export const OpenTsdbDetails = (props: Props) => {
/ >
< / div >
< div className = "gf-form" >
< InlineFormLabel width = { 7 } > Lookup limit < / InlineFormLabel >
< InlineFormLabel width = { 7 } htmlFor = { ` lookup-input- ${ idSuffix } ` } >
Lookup limit
< / InlineFormLabel >
< Input
id = { ` lookup-input- ${ idSuffix } ` }
type = "number"
value = { value . jsonData . lookupLimit ? ? 1000 }
onChange = { onInputChangeHandler ( 'lookupLimit' , value , onChange ) }