mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DataSourcePlugins: more generics improvements (#16965)
* more types for query editor * generic datasources * update * change ComponentClass to ComponentType * more types * remove input
This commit is contained in:
committed by
Torkel Ödegaard
parent
e1d408a66f
commit
7b92c56055
@@ -3,11 +3,11 @@ import React, { PureComponent } from 'react';
|
||||
|
||||
// Types
|
||||
import { InputDatasource } from './InputDatasource';
|
||||
import { InputQuery } from './types';
|
||||
import { InputQuery, InputOptions } from './types';
|
||||
|
||||
import { FormLabel, Select, QueryEditorProps, SelectOptionItem, SeriesData, TableInputCSV, toCSV } from '@grafana/ui';
|
||||
|
||||
type Props = QueryEditorProps<InputDatasource, InputQuery>;
|
||||
type Props = QueryEditorProps<InputDatasource, InputQuery, InputOptions>;
|
||||
|
||||
const options = [
|
||||
{ value: 'panel', label: 'Panel', description: 'Save data in the panel configuration.' },
|
||||
|
||||
@@ -6,6 +6,6 @@ import { InputQueryEditor } from './InputQueryEditor';
|
||||
import { InputConfigEditor } from './InputConfigEditor';
|
||||
import { InputOptions, InputQuery } from './types';
|
||||
|
||||
export const plugin = new DataSourcePlugin<InputQuery, InputOptions>(InputDatasource)
|
||||
export const plugin = new DataSourcePlugin<InputDatasource, InputQuery, InputOptions>(InputDatasource)
|
||||
.setConfigEditor(InputConfigEditor)
|
||||
.setQueryEditor(InputQueryEditor);
|
||||
|
||||
@@ -66,7 +66,7 @@ export interface CascaderOption {
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface LokiQueryFieldFormProps extends ExploreQueryFieldProps<ExploreDataSourceApi, LokiQuery> {
|
||||
export interface LokiQueryFieldFormProps extends ExploreQueryFieldProps<ExploreDataSourceApi<LokiQuery>, LokiQuery> {
|
||||
history: HistoryItem[];
|
||||
syntax: any;
|
||||
logLabelOptions: any[];
|
||||
|
||||
@@ -102,7 +102,7 @@ interface CascaderOption {
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
interface PromQueryFieldProps extends ExploreQueryFieldProps<ExploreDataSourceApi, PromQuery> {
|
||||
interface PromQueryFieldProps extends ExploreQueryFieldProps<ExploreDataSourceApi<PromQuery>, PromQuery> {
|
||||
history: HistoryItem[];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user