mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 11:25:08 -02:30
fixed host prepopulation with no groups/no hosts from errorsing to console
This commit is contained in:
@@ -910,8 +910,16 @@ export function InventoriesManage ($log, $scope, $rootScope, $location,
|
|||||||
$scope.populateAdhocForm = function() {
|
$scope.populateAdhocForm = function() {
|
||||||
var host_patterns = "all";
|
var host_patterns = "all";
|
||||||
if ($scope.hostsSelected || $scope.groupsSelected) {
|
if ($scope.hostsSelected || $scope.groupsSelected) {
|
||||||
var allSelectedItems = $scope.groupsSelectedItems.concat($scope.hostsSelectedItems);
|
var allSelectedItems = [];
|
||||||
host_patterns = _.pluck(allSelectedItems, "name").join(":");
|
if ($scope.groupsSelectedItems) {
|
||||||
|
allSelectedItems = allSelectedItems.concat($scope.groupsSelectedItems);
|
||||||
|
}
|
||||||
|
if ($scope.hostsSelectedItems) {
|
||||||
|
allSelectedItems = allSelectedItems.concat($scope.hostsSelectedItems);
|
||||||
|
}
|
||||||
|
if (allSelectedItems) {
|
||||||
|
host_patterns = _.pluck(allSelectedItems, "name").join(":");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$rootScope.hostPatterns = host_patterns;
|
$rootScope.hostPatterns = host_patterns;
|
||||||
$location.path('/inventories/' + $scope.inventory.id + '/adhoc');
|
$location.path('/inventories/' + $scope.inventory.id + '/adhoc');
|
||||||
|
|||||||
Reference in New Issue
Block a user