Fixed bug where empty searches were hiding the results and attempting to filter without a selected task threw an error

This commit is contained in:
Michael Abashian 2016-07-05 15:25:04 -04:00
parent 9e0f01a29f
commit ea170f4fe6
2 changed files with 23 additions and 11 deletions

View File

@ -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;

View File

@ -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();