From dc72bc2780c3a07d43ac8a528aab805c01567d27 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sat, 24 Sep 2016 14:02:20 +0300 Subject: [PATCH] Fixed undefined host names after lodash upgrade. --- src/datasource-zabbix/queryProcessor.service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datasource-zabbix/queryProcessor.service.js b/src/datasource-zabbix/queryProcessor.service.js index 6931468..5f8e8e9 100644 --- a/src/datasource-zabbix/queryProcessor.service.js +++ b/src/datasource-zabbix/queryProcessor.service.js @@ -230,13 +230,13 @@ angular.module('grafana.services').factory('QueryProcessor', function($q) { // Group history by itemid var grouped_history = _.groupBy(history, 'itemid'); - var hosts = _.groupBy(_.flatten(_.map(items, 'hosts')), 'hostid'); + var hosts = _.flatten(_.map(items, 'hosts')); return _.map(grouped_history, function(hist, itemid) { var item = _.find(items, {'itemid': itemid}); var alias = item.name; if (_.keys(hosts).length > 1 || addHostName) { - var host = hosts[item.hostid]; + var host = _.find(hosts, {'hostid': item.hostid}); alias = host.name + ": " + alias; } return {