mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* add basic components * adding onchange handler for Prom settings * move options outside component * reorder imports * Add missing setting
22 lines
653 B
TypeScript
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} />
|
|
</>
|
|
);
|
|
};
|