Skip to content

Commit

Permalink
Show query in the inspector, fix #1097
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Dec 23, 2020
1 parent 9a67019 commit 3f10be6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 0 additions & 8 deletions src/datasource-zabbix/zabbix/connectors/zabbix_api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3f10be6

Please sign in to comment.