ConfigEditor.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. export type Props = DataSourcePluginOptionsEditorProps;
  9. export const ConfigEditor: React.FC<Props> = ({ options, onOptionsChange }) => {
  10. return (
  11. <>
  12. <DataSourceHttpSettings
  13. defaultUrl="http://localhost:9411"
  14. dataSourceConfig={options}
  15. showAccessOptions={false}
  16. onChange={onOptionsChange}
  17. />
  18. <div className="gf-form-group">
  19. <TraceToLogsSettings options={options} onOptionsChange={onOptionsChange} />
  20. </div>
  21. {config.featureToggles.traceToMetrics ? (
  22. <div className="gf-form-group">
  23. <TraceToMetricsSettings options={options} onOptionsChange={onOptionsChange} />
  24. </div>
  25. ) : null}
  26. <div className="gf-form-group">
  27. <NodeGraphSettings options={options} onOptionsChange={onOptionsChange} />
  28. </div>
  29. </>
  30. );
  31. };