Panel Plugins: pass query request/response to react panel plugins (#16577)

* pass query request/response to panel plugins

* rename finishTime to endTime

* move QueryResponseData to a sub variable

* rename to PanelData

* make data not optional

* make data not optional

* missing optional
This commit is contained in:
Ryan McKinley
2019-04-16 13:23:34 -07:00
committed by GitHub
parent 7b63913dc1
commit 514818f16d
10 changed files with 117 additions and 72 deletions

View File

@@ -234,6 +234,14 @@ export interface DataQueryOptions<TQuery extends DataQuery = DataQuery> {
scopedVars: ScopedVars;
}
/**
* Timestamps when the query starts and stops
*/
export interface DataRequestInfo extends DataQueryOptions {
startTime: number;
endTime?: number;
}
export interface QueryFix {
type: string;
label: string;

View File

@@ -1,14 +1,22 @@
import { ComponentClass } from 'react';
import { LoadingState, SeriesData } from './data';
import { TimeRange } from './time';
import { ScopedVars } from './datasource';
import { ScopedVars, DataRequestInfo, DataQueryError } from './datasource';
export type InterpolateFunction = (value: string, scopedVars?: ScopedVars, format?: string | Function) => string;
export interface PanelData {
state: LoadingState;
series: SeriesData[];
request?: DataRequestInfo;
error?: DataQueryError;
}
export interface PanelProps<T = any> {
data?: SeriesData[];
data: PanelData;
// TODO: annotation?: PanelData;
timeRange: TimeRange;
loading: LoadingState;
options: T;
renderCounter: number;
width: number;