diff --git a/awx/ui/client/src/helpers/JobDetail.js b/awx/ui/client/src/helpers/JobDetail.js index 562b73d0eb..975d16a3ae 100644 --- a/awx/ui/client/src/helpers/JobDetail.js +++ b/awx/ui/client/src/helpers/JobDetail.js @@ -42,7 +42,7 @@ export default .factory('DigestEvent', ['$rootScope', '$log', 'UpdatePlayStatus', 'UpdateHostStatus', 'AddHostResult', 'GetElapsed', 'UpdateTaskStatus', 'JobIsFinished', 'AddNewTask', 'AddNewPlay', function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, GetElapsed, - UpdateTaskStatus, JobIsFinished, AddNewTask, AddNewPlay, longDateFilter) { + UpdateTaskStatus, JobIsFinished, AddNewTask, AddNewPlay) { return function(params) { var scope = params.scope, @@ -485,8 +485,7 @@ export default created = params.created, msg = params.message, item = params.item, - counter = params.counter, - h, host; + counter = params.counter; if (scope.jobData.hostSummaries[host_id] !== undefined) { scope.jobData.hostSummaries[host_id].ok += (status === 'successful') ? 1 : 0; @@ -920,7 +919,7 @@ export default order: 'host_name,counter', }; JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){ - scope.hostResults = JobDetailService.processHostEvents(res.results) + scope.hostResults = JobDetailService.processHostEvents(res.results); scope.hostResultsLoading = false; }); }; @@ -986,7 +985,7 @@ export default .showLabels(true) .showLegend(false) .growOnHover(false) - .labelThreshold(0.01) + //.labelThreshold(0) .tooltipContent(function(x, y) { return '
'+x+'
'+ '' + Math.floor(y.replace(',','')) + ' HOSTS ' + '
'; }) diff --git a/awx/ui/client/src/job-detail/host-events/host-events.controller.js b/awx/ui/client/src/job-detail/host-events/host-events.controller.js index 15ab24d4ca..8869248a04 100644 --- a/awx/ui/client/src/job-detail/host-events/host-events.controller.js +++ b/awx/ui/client/src/job-detail/host-events/host-events.controller.js @@ -110,7 +110,6 @@ var init = function(){ $scope.hostName = $stateParams.hostName; // create filter dropdown - console.log($stateParams) CreateSelect2({ element: '.HostEvents-select', multiple: false 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 e06ee53611..7310274682 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 @@ -8,14 +8,13 @@ ['$scope', '$rootScope', '$stateParams', 'Wait', 'JobDetailService', 'jobSocket', 'DrawGraph', function($scope, $rootScope, $stateParams, Wait, JobDetailService, jobSocket, DrawGraph){ var page_size = 200; - $scope.loading = $scope.hosts.length > 0 ? false : true; $scope.filter = 'all'; $scope.search = null; - var buildTooltips = function(hosts){ + var buildGraph = function(hosts){ // status waterfall: unreachable > failed > changed > ok > skipped - var count, grammar, text = {}; + var count count = { ok : _.filter(hosts, function(o){ return o.failures === 0 && o.changed === 0 && o.ok > 0; @@ -33,23 +32,7 @@ return o.changed > 0; }) }; - var grammar = function(n, status){ - var dict = { - 0: 'No host events were ', - 1: ' host event was ', - 2: ' host events were ' - }; - if (n >= 2){ - return n + dict[2] + status; - } - else{ - return n !== 0 ? n + dict[n] + status : dict[n] + status; - } - }; - _.forIn(count, function(value, key){ - text[key] = grammar(value.length, key); - }); - return {count, text} + return count }; var socketListener = function(){ // emitted by the API in the same function used to persist host summary data @@ -67,7 +50,27 @@ } }); }; - + $scope.buildTooltip = function(n, status){ + var grammar = function(n, status){ + var dict = { + 0: 'No host events were ', + 1: ' host event was ', + 2: ' host events were ' + }; + if (n >= 2){ + return n + dict[2] + status; + } + else{ + return n !== 0 ? n + dict[n] + status : dict[n] + status; + } + }; + /* + _.forIn(count, function(value, key){ + text[key] = grammar(value.length, key); + }); + */ + return grammar(n, status) + }; $scope.getNextPage = function(){ if ($scope.next){ JobDetailService.getNextPage($scope.next).success(function(res){ @@ -117,8 +120,7 @@ }; $scope.$watchCollection('hosts', function(curr, prev){ - $scope.tooltips = buildTooltips(curr); - DrawGraph({count: $scope.tooltips.count, resize:true}); + DrawGraph({count: buildGraph(curr), resize:true}); }); var init = function(){ @@ -129,7 +131,7 @@ $scope.next = res.next; Wait('stop'); }); - JobDetailService.getJob($stateParams.id) + JobDetailService.getJob({id: $stateParams.id}) .success(function(res){ $scope.status = status; }); 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 0011d4a97d..e5d5d73feb 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 @@ -40,11 +40,11 @@ {{ host.host_name }}