import React, { PureComponent } from 'react'; import { DataSourceHttpSettings, InlineFormLabel, LegacyForms } from '@grafana/ui'; const { Select, Switch } = LegacyForms; import { DataSourcePluginOptionsEditorProps, onUpdateDatasourceJsonDataOptionSelect, onUpdateDatasourceJsonDataOptionChecked, } from '@grafana/data'; import { GraphiteOptions, GraphiteType } from '../types'; const graphiteVersions = [ { label: '0.9.x', value: '0.9' }, { label: '1.0.x', value: '1.0' }, { label: '1.1.x', value: '1.1' }, ]; const graphiteTypes = Object.entries(GraphiteType).map(([label, value]) => ({ label, value, })); export type Props = DataSourcePluginOptionsEditorProps; export class ConfigEditor extends PureComponent { constructor(props: Props) { super(props); } renderTypeHelp = () => { return (

There are different types of Graphite compatible backends. Here you can specify the type you are using. If you are using{' '} Metrictank {' '} then select that here. This will enable Metrictank specific features like query processing meta data. Metrictank is a multi-tenant timeseries engine for Graphite and friends.

); }; render() { const { options, onOptionsChange } = this.props; const currentVersion = graphiteVersions.find((item) => item.value === options.jsonData.graphiteVersion) ?? graphiteVersions[2]; return ( <>

Graphite details

Version type.value === options.jsonData.graphiteType)} width={8} onChange={onUpdateDatasourceJsonDataOptionSelect(this.props, 'graphiteType')} />
{options.jsonData.graphiteType === GraphiteType.Metrictank && (
)}
); } }