mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* move metrics editor related files to a separate folder * cleanup * add tests * remove snapshot test * nit * remove unsued import * remove snapshot
29 lines
849 B
TypeScript
29 lines
849 B
TypeScript
import React, { PureComponent } from 'react';
|
|
|
|
import { QueryEditorProps } from '@grafana/data';
|
|
|
|
import { CloudWatchDatasource } from '../datasource';
|
|
import { 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} />
|
|
) : (
|
|
<LogsQueryEditor {...this.props} allowCustomValue />
|
|
)}
|
|
</>
|
|
);
|
|
}
|
|
}
|