Merge branch 'develop'
This commit is contained in:
@@ -120,13 +120,14 @@ function (angular, _, kbn) {
|
|||||||
return [];
|
return [];
|
||||||
} else {
|
} else {
|
||||||
items = _.flatten(items);
|
items = _.flatten(items);
|
||||||
|
var alias = itemnames === 'All' ? undefined : target.alias;
|
||||||
|
|
||||||
if ((from < useTrendsFrom) && self.trends) {
|
if ((from < useTrendsFrom) && self.trends) {
|
||||||
return self.getTrends(items, from, to)
|
return self.getTrends(items, from, to)
|
||||||
.then(_.partial(self.handleTrendResponse, items, target.alias, target.scale));
|
.then(_.partial(self.handleTrendResponse, items, alias, target.scale));
|
||||||
} else {
|
} else {
|
||||||
return self.performTimeSeriesQuery(items, from, to)
|
return self.performTimeSeriesQuery(items, from, to)
|
||||||
.then(_.partial(self.handleHistoryResponse, items, target.alias, target.scale));
|
.then(_.partial(self.handleHistoryResponse, items, alias, target.scale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -212,7 +213,7 @@ function (angular, _, kbn) {
|
|||||||
return $q.when(_.map(grouped_history, function (trends, itemid) {
|
return $q.when(_.map(grouped_history, function (trends, itemid) {
|
||||||
var item = indexed_items[itemid];
|
var item = indexed_items[itemid];
|
||||||
var series = {
|
var series = {
|
||||||
target: (item.hosts ? item.hosts[0].name+': ' : '') + expandItemName(item),
|
target: (item.hosts ? item.hosts[0].name+': ' : '') + (alias ? alias : expandItemName(item)),
|
||||||
datapoints: _.map(trends, function (p) {
|
datapoints: _.map(trends, function (p) {
|
||||||
|
|
||||||
// Value must be a number for properly work
|
// Value must be a number for properly work
|
||||||
@@ -227,13 +228,7 @@ function (angular, _, kbn) {
|
|||||||
};
|
};
|
||||||
return series;
|
return series;
|
||||||
})).then(function (result) {
|
})).then(function (result) {
|
||||||
// Add alias or sort targets
|
return _.sortBy(result, 'target');
|
||||||
if (result.length == 1) {
|
|
||||||
result[0].target = alias;
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return _.sortBy(result, 'target');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -272,7 +267,7 @@ function (angular, _, kbn) {
|
|||||||
return $q.when(_.map(grouped_history, function (history, itemid) {
|
return $q.when(_.map(grouped_history, function (history, itemid) {
|
||||||
var item = indexed_items[itemid];
|
var item = indexed_items[itemid];
|
||||||
var series = {
|
var series = {
|
||||||
target: (item.hosts ? item.hosts[0].name+': ' : '') + expandItemName(item),
|
target: (item.hosts ? item.hosts[0].name+': ' : '') + (alias ? alias : expandItemName(item)),
|
||||||
datapoints: _.map(history, function (p) {
|
datapoints: _.map(history, function (p) {
|
||||||
|
|
||||||
// Value must be a number for properly work
|
// Value must be a number for properly work
|
||||||
@@ -287,13 +282,7 @@ function (angular, _, kbn) {
|
|||||||
};
|
};
|
||||||
return series;
|
return series;
|
||||||
})).then(function (result) {
|
})).then(function (result) {
|
||||||
// Add alias or sort targets
|
return _.sortBy(result, 'target');
|
||||||
if (result.length == 1) {
|
|
||||||
result[0].target = alias;
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return _.sortBy(result, 'target');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user