mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: remove legacy components and CSS classes for OpenTsdbDetails Component (#76165)
* chore: remove legacy components and classes * Update public/app/plugins/datasource/opentsdb/components/OpenTsdbDetails.tsx Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> * chore: format and add width * chore: fix formatting * Update public/app/plugins/datasource/opentsdb/components/OpenTsdbDetails.tsx Co-authored-by: ismail simsek <ismailsimsek09@gmail.com> --------- Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
This commit is contained in:
parent
f3a997acde
commit
cb1dfbeeb4
@ -1,12 +1,10 @@
|
||||
import React, { SyntheticEvent, useId } from 'react';
|
||||
|
||||
import { DataSourceSettings, SelectableValue } from '@grafana/data';
|
||||
import { InlineFormLabel, LegacyForms } from '@grafana/ui';
|
||||
import { Select, Input, Field, FieldSet } from '@grafana/ui';
|
||||
|
||||
import { OpenTsdbOptions } from '../types';
|
||||
|
||||
const { Select, Input } = LegacyForms;
|
||||
|
||||
const tsdbVersions = [
|
||||
{ label: '<=2.1', value: 1 },
|
||||
{ label: '==2.2', value: 2 },
|
||||
@ -30,22 +28,17 @@ export const OpenTsdbDetails = (props: Props) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<h5>OpenTSDB settings</h5>
|
||||
<div className="gf-form">
|
||||
<InlineFormLabel width={7} htmlFor={`select-version-${idSuffix}`}>
|
||||
Version
|
||||
</InlineFormLabel>
|
||||
<FieldSet label="OpenTSDB settings">
|
||||
<Field htmlFor={`select-version-${idSuffix}`} label="Version">
|
||||
<Select
|
||||
inputId={`select-version-${idSuffix}`}
|
||||
options={tsdbVersions}
|
||||
value={tsdbVersions.find((version) => version.value === value.jsonData.tsdbVersion) ?? tsdbVersions[0]}
|
||||
onChange={onSelectChangeHandler('tsdbVersion', value, onChange)}
|
||||
width={20}
|
||||
/>
|
||||
</div>
|
||||
<div className="gf-form">
|
||||
<InlineFormLabel width={7} htmlFor={`select-resolution-${idSuffix}`}>
|
||||
Resolution
|
||||
</InlineFormLabel>
|
||||
</Field>
|
||||
<Field htmlFor={`select-resolution-${idSuffix}`} label="Resolution">
|
||||
<Select
|
||||
inputId={`select-resolution-${idSuffix}`}
|
||||
options={tsdbResolutions}
|
||||
@ -54,19 +47,19 @@ export const OpenTsdbDetails = (props: Props) => {
|
||||
tsdbResolutions[0]
|
||||
}
|
||||
onChange={onSelectChangeHandler('tsdbResolution', value, onChange)}
|
||||
width={20}
|
||||
/>
|
||||
</div>
|
||||
<div className="gf-form">
|
||||
<InlineFormLabel width={7} htmlFor={`lookup-input-${idSuffix}`}>
|
||||
Lookup limit
|
||||
</InlineFormLabel>
|
||||
</Field>
|
||||
<Field htmlFor={`lookup-input-${idSuffix}`} label="Lookup limit">
|
||||
<Input
|
||||
id={`lookup-input-${idSuffix}`}
|
||||
type="number"
|
||||
value={value.jsonData.lookupLimit ?? 1000}
|
||||
onChange={onInputChangeHandler('lookupLimit', value, onChange)}
|
||||
width={20}
|
||||
/>
|
||||
</div>
|
||||
</Field>
|
||||
</FieldSet>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user