mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
@grafana/runtime: Expose datasourceRequest in backendSrv
This commit is contained in:
parent
53f8088316
commit
08ada20270
@ -12,6 +12,13 @@ export type BackendSrvRequest = {
|
||||
// Show a message with the result
|
||||
showSuccessAlert?: boolean;
|
||||
|
||||
// A requestID is provided by the datasource as a unique identifier for a
|
||||
// particular query. If the requestID exists, the promise it is keyed to
|
||||
// is canceled, canceling the previous datasource request if it is still
|
||||
// in-flight.
|
||||
requestId?: string;
|
||||
|
||||
// Allow any other parameters
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
@ -29,6 +36,9 @@ export interface BackendSrv {
|
||||
// If there is an error, set: err.isHandled = true
|
||||
// otherwise the backend will show a message for you
|
||||
request(options: BackendSrvRequest): Promise<any>;
|
||||
|
||||
// DataSource requests add hooks into the query inspector
|
||||
datasourceRequest(options: BackendSrvRequest): Promise<any>;
|
||||
}
|
||||
|
||||
let singletonInstance: BackendSrv;
|
||||
|
@ -143,7 +143,7 @@ export class BackendSrv implements BackendService {
|
||||
}
|
||||
}
|
||||
|
||||
datasourceRequest(options: any) {
|
||||
datasourceRequest(options: BackendSrvRequest) {
|
||||
let canceler: angular.IDeferred<any> = null;
|
||||
options.retry = options.retry || 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user