diff --git a/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js b/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js index 89d5572e8a..34763c838e 100644 --- a/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js +++ b/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js @@ -99,16 +99,18 @@ } }; $scope.search = function(){ - $scope.searchActive = true; - Wait('start'); - JobDetailService.getJobHostSummaries($stateParams.id, { - page_size: page_size, - host_name__icontains: $scope.searchTerm, - }).success(function(res){ - $scope.hosts = res.results; - $scope.next = res.next; - Wait('stop'); - }); + if($scope.searchTerm && $scope.searchTerm !== '') { + $scope.searchActive = true; + Wait('start'); + JobDetailService.getJobHostSummaries($stateParams.id, { + page_size: page_size, + host_name__icontains: $scope.searchTerm, + }).success(function(res){ + $scope.hosts = res.results; + $scope.next = res.next; + Wait('stop'); + }); + } }; $scope.clearSearch = function(){ $scope.searchActive = false; diff --git a/awx/ui/client/src/job-detail/job-detail.controller.js b/awx/ui/client/src/job-detail/job-detail.controller.js index adcd3e76ff..88b6265e11 100644 --- a/awx/ui/client/src/job-detail/job-detail.controller.js +++ b/awx/ui/client/src/job-detail/job-detail.controller.js @@ -156,6 +156,10 @@ export default scope.search_task_status = 'all'; scope.search_host_status = 'all'; + scope.search_play_name = ''; + scope.search_task_name = ''; + scope.search_host_name = ''; + scope.haltEventQueue = false; scope.processing = false; scope.lessStatus = false; @@ -869,7 +873,7 @@ export default else { scope.searchHostsEnabled = true; } - if (!scope.liveEventProcessing || scope.pauseLiveEvents) { + if ((!scope.liveEventProcessing || scope.pauseLiveEvents) && scope.selectedTask) { scope.hostResultsLoading = true; params = { parent: scope.selectedTask, @@ -888,6 +892,12 @@ export default } }; + scope.searchHostsKeyPress = function(e) { + if (e.keyCode === 13) { + scope.searchHosts(); + e.stopPropagation(); + } + }; if (scope.removeDeleteFinished) { scope.removeDeleteFinished();