Fix item selection.
This commit is contained in:
@@ -189,13 +189,6 @@ function (angular, _) {
|
|||||||
$scope.datasource.performAppSuggestQuery(hostid).then(function (series) {
|
$scope.datasource.performAppSuggestQuery(hostid).then(function (series) {
|
||||||
$scope.metric.applicationList = $scope.metric.applicationList.concat(series);
|
$scope.metric.applicationList = $scope.metric.applicationList.concat(series);
|
||||||
|
|
||||||
// Add templated variables
|
|
||||||
_.each(templateSrv.variables, function(variable) {
|
|
||||||
$scope.metric.applicationList.push({
|
|
||||||
name: '$' + variable.name
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
if ($scope.target.application) {
|
if ($scope.target.application) {
|
||||||
$scope.target.application = $scope.metric.applicationList.filter(function (item, index, array) {
|
$scope.target.application = $scope.metric.applicationList.filter(function (item, index, array) {
|
||||||
// Find selected application in metric.hostList
|
// Find selected application in metric.hostList
|
||||||
@@ -225,14 +218,14 @@ function (angular, _) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if ($scope.target.item) {
|
if ($scope.target.item) {
|
||||||
$scope.target.item = $scope.metric.itemList.filter(function (item, index, array) {
|
$scope.target.item = $scope.metric.itemList.filter(function (item, index, array) {
|
||||||
// Find selected item in metric.hostList
|
// Find selected item in metric.hostList
|
||||||
return (item.name == $scope.target.item.name);
|
return (item.name == $scope.target.item.name);
|
||||||
}).pop();
|
}).pop();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user