Files
grafana/public/app/plugins/datasource/prometheus/configuration/ConfigEditor.tsx
Peter Holmberg dcfc74ef00 ReactMigration: Migrate Prometheus config page to React (#20248)
* add basic components

* adding onchange handler for Prom settings

* move options outside component

* reorder imports

* Add missing setting
2019-11-08 10:02:51 +01:00

22 lines
653 B
TypeScript

import React from 'react';
import { DataSourceHttpSettings } from '@grafana/ui';
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
import { PromSettings } from './PromSettings';
import { PromOptions } from '../types';
export type Props = DataSourcePluginOptionsEditorProps<PromOptions>;
export const ConfigEditor = (props: Props) => {
const { options, onOptionsChange } = props;
return (
<>
<DataSourceHttpSettings
defaultUrl="http://localhost:9090"
dataSourceConfig={options}
onChange={onOptionsChange}
/>
<PromSettings value={options} onChange={onOptionsChange} />
</>
);
};