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.
 
 
 
 
 
 

46 lines
1.6 KiB

import React from 'react';
import { AlertingSettings, DataSourceHttpSettings, Alert } from '@grafana/ui';
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
import { config } from 'app/core/config';
import { PromOptions } from '../types';
import { AzureAuthSettings } from './AzureAuthSettings';
import { PromSettings } from './PromSettings';
import { getAllAlertmanagerDataSources } from 'app/features/alerting/unified/utils/alertmanager';
export type Props = DataSourcePluginOptionsEditorProps<PromOptions>;
export const ConfigEditor = (props: Props) => {
const { options, onOptionsChange } = props;
const alertmanagers = getAllAlertmanagerDataSources();
const azureAuthSettings = {
azureAuthEnabled: config.featureToggles['prometheus_azure_auth'] ?? false,
azureSettingsUI: AzureAuthSettings,
};
return (
<>
{options.access === 'direct' && (
<Alert title="Deprecation Notice" severity="warning">
Browser access mode in the Prometheus datasource is deprecated and will be removed in a future release.
</Alert>
)}
<DataSourceHttpSettings
defaultUrl="http://localhost:9090"
dataSourceConfig={options}
showAccessOptions={true}
onChange={onOptionsChange}
sigV4AuthToggleEnabled={config.sigV4AuthEnabled}
azureAuthSettings={azureAuthSettings}
/>
<AlertingSettings<PromOptions>
alertmanagerDataSources={alertmanagers}
options={options}
onOptionsChange={onOptionsChange}
/>
<PromSettings options={options} onOptionsChange={onOptionsChange} />
</>
);
};