Fixed undefined host names after lodash upgrade.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user