From 9ec32b26e886ae12b528e41800376889094dab45 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 18 Aug 2015 20:39:01 +0300 Subject: [PATCH] iss #71 - Added text metrics editor. --- zabbix/datasource.js | 12 ++++++++-- zabbix/partials/query.editor.html | 34 ++++++++++++++++------------ zabbix/queryCtrl.js | 37 +++++++++++++++++-------------- 3 files changed, 50 insertions(+), 33 deletions(-) diff --git a/zabbix/datasource.js b/zabbix/datasource.js index a6cfcbd..9fdb34d 100644 --- a/zabbix/datasource.js +++ b/zabbix/datasource.js @@ -94,7 +94,7 @@ function (angular, _, kbn) { // Create request for each target var promises = _.map(options.targets, function(target) { - if (!target.ITService) { + if (!target.mode || target.mode === 0) { // Don't show undefined and hidden targets if (target.hide || !target.group || !target.host || !target.application || !target.item) { @@ -199,7 +199,10 @@ function (angular, _, kbn) { }); } }); - } else { + } + + // IT services mode + else if (target.mode === 1) { // Don't show undefined and hidden targets if (target.hide || !target.itservice || !target.slaProperty) { return []; @@ -208,6 +211,11 @@ function (angular, _, kbn) { .then(_.bind(zabbixHelperSrv.handleSLAResponse, zabbixHelperSrv, target.itservice, target.slaProperty)); } } + + // Text metrics mode + else if (target.mode === 2) { + return []; + } }, this); return $q.all(_.flatten(promises)).then(function (results) { diff --git a/zabbix/partials/query.editor.html b/zabbix/partials/query.editor.html index d5a7170..26e2ea5 100644 --- a/zabbix/partials/query.editor.html +++ b/zabbix/partials/query.editor.html @@ -16,14 +16,18 @@ -