mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user