import React from 'react'; import { DataSourcePluginOptionsEditorProps } from '@grafana/data'; import { config } from '@grafana/runtime'; import { DataSourceHttpSettings, EventsWithValidation, LegacyForms, regexValidation } from '@grafana/ui'; import { PyroscopeDataSourceOptions } from './types'; interface Props extends DataSourcePluginOptionsEditorProps {} export const ConfigEditor = (props: Props) => { const { options, onOptionsChange } = props; return ( <>

Querying

{ onOptionsChange({ ...options, jsonData: { ...options.jsonData, minStep: event.currentTarget.value, }, }); }} validationEvents={{ [EventsWithValidation.onBlur]: [ regexValidation( /^$|^\d+(ms|[Mwdhmsy])$/, 'Value is not valid, you can use number with time unit specifier: y, M, w, d, h, m, s' ), ], }} /> } tooltip="Minimal step used for metric query. Should be the same or higher as the scrape interval setting in the Pyroscope database." />
); };