// Libraries import React, { memo } from 'react'; import { css, cx } from 'emotion'; // Types import { InlineFormLabel, RadioButtonGroup } from '@grafana/ui'; import { PromQuery } from '../types'; import { PromExemplarField } from './PromExemplarField'; import { PrometheusDatasource } from '../datasource'; export interface PromExploreExtraFieldProps { queryType: string; stepValue: string; query: PromQuery; onStepChange: (e: React.SyntheticEvent) => void; onKeyDownFunc: (e: React.KeyboardEvent) => void; onQueryTypeChange: (value: string) => void; onChange: (value: PromQuery) => void; datasource: PrometheusDatasource; } export const PromExploreExtraField: React.FC = memo( ({ queryType, stepValue, query, onChange, onStepChange, onQueryTypeChange, onKeyDownFunc, datasource }) => { const rangeOptions = [ { value: 'range', label: 'Range', description: 'Run query over a range of time.' }, { value: 'instant', label: 'Instant', description: 'Run query against a single point in time. For this query, the "To" time is used.', }, { value: 'both', label: 'Both', description: 'Run an Instant query and a Range query.' }, ]; return (
{/*Query type field*/}
Query type
{/*Step field*/}
Step
onChange({ ...query, exemplar: isEnabled })} datasource={datasource} />
); } );