diff --git a/awx/ui/client/src/controllers/JobDetail.js b/awx/ui/client/src/controllers/JobDetail.js index 169712ba8d..8d9cd28e6a 100644 --- a/awx/ui/client/src/controllers/JobDetail.js +++ b/awx/ui/client/src/controllers/JobDetail.js @@ -298,7 +298,7 @@ export function JobDetailController ($location, $rootScope, $filter, $scope, $co else { name = ""; } - scope.jobData.hostSummaries[name] = { + scope.jobData.hostSummaries[event.host] = { id: event.host, name: name, ok: event.ok, diff --git a/awx/ui/client/src/helpers/JobDetail.js b/awx/ui/client/src/helpers/JobDetail.js index ba99bc4d10..3e54f37a5d 100644 --- a/awx/ui/client/src/helpers/JobDetail.js +++ b/awx/ui/client/src/helpers/JobDetail.js @@ -3,7 +3,7 @@ * * All Rights Reserved *************************************************/ - + /** * @ngdoc function * @name helpers.function:JobDetail @@ -497,18 +497,18 @@ export default scope.host_summary.failed; */ - if (scope.jobData.hostSummaries[name] !== undefined) { - scope.jobData.hostSummaries[name].ok += (status === 'successful') ? 1 : 0; - scope.jobData.hostSummaries[name].changed += (status === 'changed') ? 1 : 0; - scope.jobData.hostSummaries[name].unreachable += (status === 'unreachable') ? 1 : 0; - scope.jobData.hostSummaries[name].failed += (status === 'failed') ? 1 : 0; + if (scope.jobData.hostSummaries[host_id] !== undefined) { + scope.jobData.hostSummaries[host_id].ok += (status === 'successful') ? 1 : 0; + scope.jobData.hostSummaries[host_id].changed += (status === 'changed') ? 1 : 0; + scope.jobData.hostSummaries[host_id].unreachable += (status === 'unreachable') ? 1 : 0; + scope.jobData.hostSummaries[host_id].failed += (status === 'failed') ? 1 : 0; if (status === 'failed' || status === 'unreachable') { - scope.jobData.hostSummaries[name].status = 'failed'; + scope.jobData.hostSummaries[host_id].status = 'failed'; } } else { - scope.jobData.hostSummaries[name] = { - id: name, + scope.jobData.hostSummaries[host_id] = { + id: host_id, name: name, ok: (status === 'successful') ? 1 : 0, changed: (status === 'changed') ? 1 : 0, @@ -658,7 +658,12 @@ export default var task = params.task, diff; - task.missingCount = task.hostCount - (task.failedCount + task.changedCount + task.skippedCount + task.successfulCount + task.unreachableCount); + task.missingCount = task.hostCount - (task.failedCount + task.changedCount + task.skippedCount + task.successfulCount + + task.unreachableCount); + if(task.missingCount<0){ + task.hostCount = (task.failedCount + task.changedCount + task.skippedCount + task.successfulCount + + task.unreachableCount); + } task.missingPct = (task.hostCount > 0) ? Math.ceil((100 * (task.missingCount / task.hostCount))) : 0; task.failedPct = (task.hostCount > 0) ? Math.ceil((100 * (task.failedCount / task.hostCount))) : 0; task.changedPct = (task.hostCount > 0) ? Math.ceil((100 * (task.changedCount / task.hostCount))) : 0;