ConfigEditor.tsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from 'react';
  2. import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
  3. import { config } from '@grafana/runtime';
  4. import { DataSourceHttpSettings } from '@grafana/ui';
  5. import { NodeGraphSettings } from 'app/core/components/NodeGraphSettings';
  6. import { TraceToLogsSettings } from 'app/core/components/TraceToLogs/TraceToLogsSettings';
  7. import { TraceToMetricsSettings } from 'app/core/components/TraceToMetrics/TraceToMetricsSettings';
  8. import { LokiSearchSettings } from './LokiSearchSettings';
  9. import { SearchSettings } from './SearchSettings';
  10. import { ServiceGraphSettings } from './ServiceGraphSettings';
  11. export type Props = DataSourcePluginOptionsEditorProps;
  12. export const ConfigEditor: React.FC<Props> = ({ options, onOptionsChange }) => {
  13. return (
  14. <>
  15. <DataSourceHttpSettings
  16. defaultUrl="http://tempo"
  17. dataSourceConfig={options}
  18. showAccessOptions={false}
  19. onChange={onOptionsChange}
  20. />
  21. <div className="gf-form-group">
  22. <TraceToLogsSettings options={options} onOptionsChange={onOptionsChange} />
  23. </div>
  24. {config.featureToggles.traceToMetrics ? (
  25. <div className="gf-form-group">
  26. <TraceToMetricsSettings options={options} onOptionsChange={onOptionsChange} />
  27. </div>
  28. ) : null}
  29. <div className="gf-form-group">
  30. <ServiceGraphSettings options={options} onOptionsChange={onOptionsChange} />
  31. </div>
  32. {config.featureToggles.tempoSearch && (
  33. <div className="gf-form-group">
  34. <SearchSettings options={options} onOptionsChange={onOptionsChange} />
  35. </div>
  36. )}
  37. <div className="gf-form-group">
  38. <NodeGraphSettings options={options} onOptionsChange={onOptionsChange} />
  39. </div>
  40. <div className="gf-form-group">
  41. <LokiSearchSettings options={options} onOptionsChange={onOptionsChange} />
  42. </div>
  43. </>
  44. );
  45. };