The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/datasources/components/picker/DataSourcePicker.tsx

25 lines
851 B

import React from 'react';
import {
DataSourcePicker as DeprecatedDataSourcePicker,
DataSourcePickerProps as DeprecatedDataSourcePickerProps,
} from '@grafana/runtime';
import { config } from 'app/core/config';
import { DataSourceDropdown } from './DataSourceDropdown';
import { DataSourceDropdownProps } from './types';
type DataSourcePickerProps = DeprecatedDataSourcePickerProps | DataSourceDropdownProps;
/**
* DataSourcePicker is a wrapper around the old DataSourcePicker and the new one.
* Depending on the feature toggle, it will render the old or the new one.
* Feature toggle: advancedDataSourcePicker
*/
export function DataSourcePicker(props: DataSourcePickerProps) {
return !config.featureToggles.advancedDataSourcePicker ? (
<DeprecatedDataSourcePicker {...props} />
) : (
<DataSourceDropdown {...props} />
);
}