Fixed #34 - Aliases don't work properly in templated dashboard.

This commit is contained in:
Alexander Zobnin
2015-06-25 22:26:26 +03:00
parent 0057d6a091
commit 3f00e4c8eb

View File

@@ -120,7 +120,7 @@ function (angular, _, kbn) {
return []; return [];
} else { } else {
items = _.flatten(items); items = _.flatten(items);
var alias = itemnames === 'All' ? undefined : templateSrv.replace(target.alias); var alias = target.item.name === 'All' ? undefined : templateSrv.replace(target.alias);
if ((from < useTrendsFrom) && self.trends) { if ((from < useTrendsFrom) && self.trends) {
return self.getTrends(items, from, to) return self.getTrends(items, from, to)
@@ -467,9 +467,16 @@ function (angular, _, kbn) {
searchByAny: true searchByAny: true
}; };
if (group != '*') { if (group != '*') {
params.filter = { if (_.isArray(group)) {
name: group params.filter = {
}; name: group
};
} else {
params.search = {
name: group
};
params.searchWildcardsEnabled = true;
}
} }
return this.performZabbixAPIRequest('hostgroup.get', params); return this.performZabbixAPIRequest('hostgroup.get', params);
}; };
@@ -575,7 +582,7 @@ function (angular, _, kbn) {
} }
// Get groups // Get groups
else if (parts.length === 1) { else if (parts.length === 1) {
return this.performHostGroupSuggestQuery().then(function (result) { return this.findZabbixGroup(template.group).then(function (result) {
return _.map(result, function (hostgroup) { return _.map(result, function (hostgroup) {
return { return {
text: hostgroup.name, text: hostgroup.name,