mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
chore: Remove gh-form and LegacyForms from InfluxFluxConfig (#76495)
* chore: replace SecretFormField with SecretInput * chore: Remove gh-form and LegacyForms from InfluxFluxConfig
This commit is contained in:
parent
5ba32e0f11
commit
7f89251dc9
@ -7,11 +7,11 @@ import {
|
|||||||
onUpdateDatasourceSecureJsonDataOption,
|
onUpdateDatasourceSecureJsonDataOption,
|
||||||
updateDatasourcePluginResetOption,
|
updateDatasourcePluginResetOption,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { InlineFormLabel, LegacyForms } from '@grafana/ui';
|
import { InlineField, InlineFieldRow, Input, SecretInput } from '@grafana/ui';
|
||||||
|
|
||||||
import { InfluxOptions, InfluxSecureJsonData } from '../../../types';
|
import { InfluxOptions, InfluxSecureJsonData } from '../../../types';
|
||||||
|
|
||||||
const { Input, SecretFormField } = LegacyForms;
|
const WIDTH_SHORT = 20;
|
||||||
|
|
||||||
export type Props = DataSourcePluginOptionsEditorProps<InfluxOptions, InfluxSecureJsonData>;
|
export type Props = DataSourcePluginOptionsEditorProps<InfluxOptions, InfluxSecureJsonData>;
|
||||||
|
|
||||||
@ -23,68 +23,55 @@ export const InfluxFluxConfig = (props: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="gf-form-inline">
|
<InlineFieldRow>
|
||||||
<div className="gf-form">
|
<InlineField labelWidth={WIDTH_SHORT} label="Organization" htmlFor={`${htmlPrefix}-org`}>
|
||||||
<InlineFormLabel htmlFor={`${htmlPrefix}-org`} className="width-10">
|
|
||||||
Organization
|
|
||||||
</InlineFormLabel>
|
|
||||||
<div className="width-10">
|
|
||||||
<Input
|
<Input
|
||||||
id={`${htmlPrefix}-org`}
|
id={`${htmlPrefix}-org`}
|
||||||
className="width-20"
|
className="width-20"
|
||||||
value={jsonData.organization || ''}
|
value={jsonData.organization || ''}
|
||||||
onChange={onUpdateDatasourceJsonDataOption(props, 'organization')}
|
onChange={onUpdateDatasourceJsonDataOption(props, 'organization')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</InlineField>
|
||||||
</div>
|
</InlineFieldRow>
|
||||||
</div>
|
<InlineFieldRow>
|
||||||
<div className="gf-form-inline">
|
<InlineField labelWidth={WIDTH_SHORT} label="Token">
|
||||||
<div className="gf-form">
|
<SecretInput
|
||||||
<SecretFormField
|
|
||||||
isConfigured={Boolean(secureJsonFields && secureJsonFields.token)}
|
isConfigured={Boolean(secureJsonFields && secureJsonFields.token)}
|
||||||
value={secureJsonData?.token || ''}
|
value={secureJsonData?.token || ''}
|
||||||
label="Token"
|
label="Token"
|
||||||
aria-label="Token"
|
aria-label="Token"
|
||||||
labelWidth={10}
|
className="width-20"
|
||||||
inputWidth={20}
|
|
||||||
onReset={() => updateDatasourcePluginResetOption(props, 'token')}
|
onReset={() => updateDatasourcePluginResetOption(props, 'token')}
|
||||||
onChange={onUpdateDatasourceSecureJsonDataOption(props, 'token')}
|
onChange={onUpdateDatasourceSecureJsonDataOption(props, 'token')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</InlineField>
|
||||||
</div>
|
</InlineFieldRow>
|
||||||
<div className="gf-form-inline">
|
<InlineFieldRow>
|
||||||
<div className="gf-form">
|
<InlineField labelWidth={WIDTH_SHORT} label="Default Bucket">
|
||||||
<InlineFormLabel className="width-10">Default Bucket</InlineFormLabel>
|
|
||||||
<div className="width-10">
|
|
||||||
<Input
|
<Input
|
||||||
className="width-20"
|
className="width-20"
|
||||||
placeholder="default bucket"
|
placeholder="default bucket"
|
||||||
value={jsonData.defaultBucket || ''}
|
value={jsonData.defaultBucket || ''}
|
||||||
onChange={onUpdateDatasourceJsonDataOption(props, 'defaultBucket')}
|
onChange={onUpdateDatasourceJsonDataOption(props, 'defaultBucket')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</InlineField>
|
||||||
</div>
|
</InlineFieldRow>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="gf-form-inline">
|
<InlineFieldRow>
|
||||||
<div className="gf-form">
|
<InlineField
|
||||||
<InlineFormLabel
|
labelWidth={WIDTH_SHORT}
|
||||||
className="width-10"
|
label="Min time interval"
|
||||||
tooltip="A lower limit for the auto group by time interval. Recommended to be set to write frequency,
|
tooltip="A lower limit for the auto group by time interval. Recommended to be set to write frequency,
|
||||||
for example 1m if your data is written every minute."
|
for example 1m if your data is written every minute."
|
||||||
>
|
>
|
||||||
Min time interval
|
|
||||||
</InlineFormLabel>
|
|
||||||
<div className="width-10">
|
|
||||||
<Input
|
<Input
|
||||||
className="width-20"
|
className="width-20"
|
||||||
placeholder="10s"
|
placeholder="10s"
|
||||||
value={jsonData.timeInterval || ''}
|
value={jsonData.timeInterval || ''}
|
||||||
onChange={onUpdateDatasourceJsonDataOption(props, 'timeInterval')}
|
onChange={onUpdateDatasourceJsonDataOption(props, 'timeInterval')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</InlineField>
|
||||||
</div>
|
</InlineFieldRow>
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user