diff --git a/awx/ui/client/src/helpers/JobDetail.js b/awx/ui/client/src/helpers/JobDetail.js index 975d16a3ae..90c68cc943 100644 --- a/awx/ui/client/src/helpers/JobDetail.js +++ b/awx/ui/client/src/helpers/JobDetail.js @@ -985,7 +985,7 @@ export default .showLabels(true) .showLegend(false) .growOnHover(false) - //.labelThreshold(0) + .labelThreshold(0.01) .tooltipContent(function(x, y) { return '

'+x+'

'+ '

' + Math.floor(y.replace(',','')) + ' HOSTS ' + '

'; }) 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 7310274682..692d10bd5d 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 @@ -14,7 +14,7 @@ var buildGraph = function(hosts){ // status waterfall: unreachable > failed > changed > ok > skipped - var count + var count; count = { ok : _.filter(hosts, function(o){ return o.failures === 0 && o.changed === 0 && o.ok > 0; @@ -32,7 +32,7 @@ return o.changed > 0; }) }; - return count + return count; }; var socketListener = function(){ // emitted by the API in the same function used to persist host summary data @@ -40,7 +40,7 @@ jobSocket.on('summary_complete', function(data) { // discard socket msgs we don't care about in this context if ($stateParams.id == data['unified_job_id']){ - init() + init(); } }); // UnifiedJob.def socketio_emit_status() from /awx/main.models.unified_jobs.py @@ -83,14 +83,14 @@ } }; $scope.search = function(){ - Wait('start') + 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') + Wait('stop'); }) }; $scope.setFilter = function(filter){ @@ -116,11 +116,12 @@ $scope.next = res.next; }); } - var get = filter == 'all' ? getAll() : getFailed() + var get = filter == 'all' ? getAll() : getFailed(); }; $scope.$watchCollection('hosts', function(curr, prev){ - DrawGraph({count: buildGraph(curr), resize:true}); + $scope.count = buildGraph(curr); + DrawGraph({count: $scope.count, resize:true}); }); var init = function(){ @@ -133,7 +134,7 @@ }); JobDetailService.getJob({id: $stateParams.id}) .success(function(res){ - $scope.status = status; + $scope.status = res.results[0].status; }); }; socketListener(); diff --git a/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html b/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html index e5d5d73feb..f20aff88e4 100644 --- a/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html +++ b/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html @@ -16,7 +16,7 @@ ng-click="setFilter('all')" class="JobDetail-tableToggle btn btn-xs" ng-class="{'btn-default': filter == 'failed', 'btn-primary': filter == 'all'}">All + ng-class="{'btn-default': filter == 'all', 'btn-primary': filter == 'failed'}" ng-disabled='count.failures == 0' class="JobDetail-tableToggle btn btn-xs">Failed