mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 12:41:19 -03:30
Organize host summary results by host id instead of name
on the job detail page as host results were stored in the hostSummaries array, they were organized by hostname, but hostname can be changed as a result of the playbook potentially
This commit is contained in:
parent
9249cc8298
commit
74c5236da2
@ -298,7 +298,7 @@ export function JobDetailController ($location, $rootScope, $filter, $scope, $co
|
||||
else {
|
||||
name = "<deleted host>";
|
||||
}
|
||||
scope.jobData.hostSummaries[name] = {
|
||||
scope.jobData.hostSummaries[event.host] = {
|
||||
id: event.host,
|
||||
name: name,
|
||||
ok: event.ok,
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user