mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Add tracing config sub sections * Export common sections and update divider in additional settings section * Max width and margin bottom * Add feature name to config link * Update SpanBarSettings * remove import
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import React from 'react';
|
|
|
|
import { DataSourcePluginOptionsEditorProps, updateDatasourcePluginJsonDataOption } from '@grafana/data';
|
|
import { DataSourcePicker } from '@grafana/runtime';
|
|
import { Button, InlineField, InlineFieldRow, useStyles2 } from '@grafana/ui';
|
|
|
|
import { TempoJsonData } from '../types';
|
|
|
|
import { getStyles } from './QuerySettings';
|
|
|
|
interface Props extends DataSourcePluginOptionsEditorProps<TempoJsonData> {}
|
|
|
|
export function ServiceGraphSettings({ options, onOptionsChange }: Props) {
|
|
const styles = useStyles2(getStyles);
|
|
|
|
return (
|
|
<div className={styles.container}>
|
|
<InlineFieldRow className={styles.row}>
|
|
<InlineField
|
|
tooltip="The Prometheus data source with the service graph data"
|
|
label="Data source"
|
|
labelWidth={26}
|
|
>
|
|
<DataSourcePicker
|
|
inputId="service-graph-data-source-picker"
|
|
pluginId="prometheus"
|
|
current={options.jsonData.serviceMap?.datasourceUid}
|
|
noDefault={true}
|
|
width={40}
|
|
onChange={(ds) =>
|
|
updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'serviceMap', {
|
|
datasourceUid: ds.uid,
|
|
})
|
|
}
|
|
/>
|
|
</InlineField>
|
|
{options.jsonData.serviceMap?.datasourceUid ? (
|
|
<Button
|
|
type={'button'}
|
|
variant={'secondary'}
|
|
size={'sm'}
|
|
fill={'text'}
|
|
onClick={() => {
|
|
updateDatasourcePluginJsonDataOption({ onOptionsChange, options }, 'serviceMap', {
|
|
datasourceUid: undefined,
|
|
});
|
|
}}
|
|
>
|
|
Clear
|
|
</Button>
|
|
) : null}
|
|
</InlineFieldRow>
|
|
</div>
|
|
);
|
|
}
|