mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
26 lines
866 B
TypeScript
26 lines
866 B
TypeScript
import React, { PureComponent } from 'react';
|
|
|
|
import { QueryEditorProps } from '@grafana/data';
|
|
|
|
import { CloudWatchDatasource } from '../datasource';
|
|
import { isCloudWatchLogsQuery, isCloudWatchMetricsQuery } from '../guards';
|
|
import { CloudWatchJsonData, CloudWatchQuery } from '../types';
|
|
|
|
import { MetricsQueryEditor } from '././MetricsQueryEditor/MetricsQueryEditor';
|
|
import LogsQueryEditor from './LogsQueryEditor';
|
|
|
|
export type Props = QueryEditorProps<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>;
|
|
|
|
export class PanelQueryEditor extends PureComponent<Props> {
|
|
render() {
|
|
const { query } = this.props;
|
|
|
|
return (
|
|
<>
|
|
{isCloudWatchMetricsQuery(query) && <MetricsQueryEditor {...this.props} query={query} />}
|
|
{isCloudWatchLogsQuery(query) && <LogsQueryEditor {...this.props} query={query} />}
|
|
</>
|
|
);
|
|
}
|
|
}
|