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