mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com> Co-authored-by: Yaelle Chaudy <42030685+yaelleC@users.noreply.github.com>
26 lines
817 B
TypeScript
26 lines
817 B
TypeScript
import React, { PureComponent } from 'react';
|
|
import { QueryEditorProps, ExploreMode } from '@grafana/data';
|
|
import { CloudWatchJsonData, CloudWatchQuery } from '../types';
|
|
import { CloudWatchDatasource } from '../datasource';
|
|
import { MetricsQueryEditor } from './MetricsQueryEditor';
|
|
import LogsQueryEditor from './LogsQueryEditor';
|
|
|
|
export type Props = QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>;
|
|
|
|
export class PanelQueryEditor extends PureComponent<Props> {
|
|
render() {
|
|
const { query } = this.props;
|
|
const apiMode = query.queryMode ?? 'Metrics';
|
|
|
|
return (
|
|
<>
|
|
{apiMode === ExploreMode.Logs ? (
|
|
<LogsQueryEditor {...this.props} allowCustomValue />
|
|
) : (
|
|
<MetricsQueryEditor {...this.props} />
|
|
)}
|
|
</>
|
|
);
|
|
}
|
|
}
|