mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* WIP * Functional without custom wrapper component, needs highlight * Remove latency from explore * Sync eventbus * Some cleanup & removal of unused code * Avoid clearing queries when running all empty queries * Run remaining queries when removing one * Update snapshots * fix failing tests * type cleanup * Refactor QueryRows * update snapshot * Remove highlighter expressions * minor fixes in queryrows * remove unwanted change * fix failing e2e test * Persist refId in explore url state * make traces test slightly more robust * add test for query duplication
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
// Libraries
|
|
import React, { memo } from 'react';
|
|
|
|
// Types
|
|
import { QueryEditorProps } from '@grafana/data';
|
|
import { LokiDatasource } from '../datasource';
|
|
import { LokiQuery, LokiOptions } from '../types';
|
|
import { LokiQueryField } from './LokiQueryField';
|
|
import { LokiOptionFields } from './LokiOptionFields';
|
|
|
|
type Props = QueryEditorProps<LokiDatasource, LokiQuery, LokiOptions>;
|
|
|
|
export function LokiExploreQueryEditor(props: Props) {
|
|
const { query, data, datasource, history, onChange, onRunQuery, range } = props;
|
|
|
|
return (
|
|
<LokiQueryField
|
|
datasource={datasource}
|
|
query={query}
|
|
onChange={onChange}
|
|
onBlur={() => {}}
|
|
onRunQuery={onRunQuery}
|
|
history={history}
|
|
data={data}
|
|
range={range}
|
|
ExtraFieldElement={
|
|
<LokiOptionFields
|
|
queryType={query.instant ? 'instant' : 'range'}
|
|
lineLimitValue={query?.maxLines?.toString() || ''}
|
|
resolution={query.resolution || 1}
|
|
query={query}
|
|
onRunQuery={onRunQuery}
|
|
onChange={onChange}
|
|
/>
|
|
}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default memo(LokiExploreQueryEditor);
|