Show query in the inspector, fix #1097
This commit is contained in:
@@ -19,14 +19,6 @@ export interface JSONRPCError {
|
||||
data?: string;
|
||||
}
|
||||
|
||||
export interface GFHTTPRequest {
|
||||
method: HTTPMethod;
|
||||
url: string;
|
||||
data?: any;
|
||||
headers?: {[key: string]: string};
|
||||
withCredentials?: boolean;
|
||||
}
|
||||
|
||||
export type JSONRPCRequestParams = {[key: string]: any};
|
||||
|
||||
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE';
|
||||
|
||||
@@ -4,8 +4,8 @@ import kbn from 'grafana/app/core/utils/kbn';
|
||||
import * as utils from '../../../utils';
|
||||
import { ZBX_ACK_ACTION_NONE, ZBX_ACK_ACTION_ADD_MESSAGE, MIN_SLA_INTERVAL } from '../../../constants';
|
||||
import { ShowProblemTypes, ZBXProblem } from '../../../types';
|
||||
import { GFHTTPRequest, JSONRPCError, ZBXScript, APIExecuteScriptResponse } from './types';
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { JSONRPCError, ZBXScript, APIExecuteScriptResponse } from './types';
|
||||
import { BackendSrvRequest, getBackendSrv } from '@grafana/runtime';
|
||||
|
||||
const DEFAULT_ZABBIX_VERSION = '3.0.0';
|
||||
|
||||
@@ -48,12 +48,13 @@ export class ZabbixAPIConnector {
|
||||
}
|
||||
|
||||
backendAPIRequest(method: string, params: any = {}) {
|
||||
const requestOptions: GFHTTPRequest = {
|
||||
const requestOptions: BackendSrvRequest = {
|
||||
url: this.backendAPIUrl,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
hideFromInspector: false,
|
||||
data: {
|
||||
datasourceId: this.datasourceId,
|
||||
method,
|
||||
|
||||
Reference in New Issue
Block a user