From 62a4bbf6eeb6d783d1ec51ac0003bd0f46623511 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 23 Jun 2015 00:02:55 +0300 Subject: [PATCH] iss #30 - Fix problem with All parameters in query editor (All not return any objects). --- zabbix/datasource.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/zabbix/datasource.js b/zabbix/datasource.js index cfb75f0..f2db61b 100644 --- a/zabbix/datasource.js +++ b/zabbix/datasource.js @@ -463,11 +463,12 @@ function (angular, _, kbn) { ZabbixAPIDatasource.prototype.findZabbixGroup = function (group) { var params = { output: ['name'], - filter: { + searchByAny: true + }; + if (group != '*') { + params.filter = { name: group - }, - searchByAny: true, - searchWildcardsEnabled: true + }; } return this.performZabbixAPIRequest('hostgroup.get', params); }; @@ -482,12 +483,12 @@ function (angular, _, kbn) { ZabbixAPIDatasource.prototype.findZabbixHost = function (hostnames) { var params = { output: ['host', 'name'], - filter: { - host: hostnames, + searchByAny: true + }; + if (hostnames != '*') { + params.filter = { name: hostnames - }, - searchByAny: true, - searchWildcardsEnabled: true + }; } return this.performZabbixAPIRequest('host.get', params); }; @@ -502,12 +503,13 @@ function (angular, _, kbn) { ZabbixAPIDatasource.prototype.findZabbixApp = function (application) { var params = { output: ['name'], - filter: { - name: application - }, - searchByAny: true, - searchWildcardsEnabled: true, + searchByAny: true } + if (application != '*') { + params.filter = { + name: application + }; + }; return this.performZabbixAPIRequest('application.get', params); };