mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 20:35:02 -02:30
Job detail page
Fixed https://trello.com/c/lRz0fKuM/293-play-missing-from-job-detail-page Now a play with no tasks and no matching hosts appears during live events and after the job finishes and page is reloaded from the API.
This commit is contained in:
@@ -386,6 +386,10 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
|||||||
// this is not the first task
|
// this is not the first task
|
||||||
play.tasks[event.id].hostCount = play.tasks[play.firstTask].hostCount;
|
play.tasks[event.id].hostCount = play.tasks[play.firstTask].hostCount;
|
||||||
}
|
}
|
||||||
|
if (play.tasks[event.id].hostCount === 0) {
|
||||||
|
play.tasks[event.id].status_text = 'No matching hosts';
|
||||||
|
play.tasks[event.id].status_tip = "Event ID: " + event.id + "<br />Status: No matching hosts";
|
||||||
|
}
|
||||||
play.taskCount++;
|
play.taskCount++;
|
||||||
SetTaskStyles({
|
SetTaskStyles({
|
||||||
task: play.tasks[event.id]
|
task: play.tasks[event.id]
|
||||||
@@ -491,11 +495,17 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
|||||||
|
|
||||||
scope.jobData.plays[event.id].hostCount = ok + changed + failed + skipped;
|
scope.jobData.plays[event.id].hostCount = ok + changed + failed + skipped;
|
||||||
|
|
||||||
if (scope.jobData.plays[event.id].hostCount > 0 || event.unreachable_count > 0) {
|
if (scope.jobData.plays[event.id].hostCount > 0 || event.unreachable_count > 0 || scope.job_status.status === 'successful' ||
|
||||||
|
scope.job_status.status === 'failed' || scope.job_status.status === 'error' || scope.job_status.status === 'canceled') {
|
||||||
// force the play to be on the 'active' list
|
// force the play to be on the 'active' list
|
||||||
scope.jobData.plays[event.id].taskCount = 1;
|
scope.jobData.plays[event.id].taskCount = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scope.jobData.plays[event.id].hostCount === 0 && event.unreachable_count === 0) {
|
||||||
|
scope.jobData.plays[event.id].status_text = 'No matching hosts';
|
||||||
|
scope.jobData.plays[event.id].status_tip = "Event ID: " + event.id + "<br />Status: No matching hosts";
|
||||||
|
}
|
||||||
|
|
||||||
scope.host_summary.ok += ok;
|
scope.host_summary.ok += ok;
|
||||||
scope.host_summary.changed += changed;
|
scope.host_summary.changed += changed;
|
||||||
scope.host_summary.unreachable += (event.unreachable_count) ? event.unreachable_count : 0;
|
scope.host_summary.unreachable += (event.unreachable_count) ? event.unreachable_count : 0;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
UpdatePlayStatus({
|
UpdatePlayStatus({
|
||||||
scope: scope,
|
scope: scope,
|
||||||
play_id: event.parent,
|
play_id: event.parent,
|
||||||
failed: true,
|
failed: false,
|
||||||
changed: false,
|
changed: false,
|
||||||
modified: event.modified,
|
modified: event.modified,
|
||||||
no_hosts: true
|
no_hosts: true
|
||||||
@@ -384,22 +384,21 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
play;
|
play;
|
||||||
|
|
||||||
if (scope.jobData.plays[id] !== undefined) {
|
if (scope.jobData.plays[id] !== undefined) {
|
||||||
play = scope.jobData.plays[scope.activePlay];
|
play = scope.jobData.plays[id];
|
||||||
if (failed) {
|
if (failed) {
|
||||||
play.status = 'failed';
|
play.status = 'failed';
|
||||||
play.status_text = 'Failed';
|
play.status_text = 'Failed';
|
||||||
}
|
}
|
||||||
else if (play.status !== 'changed' && play.status !== 'failed') {
|
else if (play.status !== 'changed' && play.status !== 'failed') {
|
||||||
// once the status becomes 'changed' or 'failed' don't modify it
|
// once the status becomes 'changed' or 'failed' don't modify it
|
||||||
|
play.status = (changed) ? 'changed' : (failed) ? 'failed' : 'successful';
|
||||||
if (no_hosts) {
|
if (no_hosts) {
|
||||||
play.status = 'no-matching-hosts';
|
|
||||||
play.status_text = 'No matching hosts';
|
play.status_text = 'No matching hosts';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
play.status = (changed) ? 'changed' : (failed) ? 'failed' : 'successful';
|
|
||||||
play.status_text = (changed) ? 'Changed' : (failed) ? 'Failed' : 'OK';
|
play.status_text = (changed) ? 'Changed' : (failed) ? 'Failed' : 'OK';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
play.taskCount = (play.taskCount > 0) ? play.taskCount : 1; // set to a minimum of 1 to force drawing
|
||||||
play.status_tip = "Event ID: " + play.id + "<br />Status: " + play.status_text;
|
play.status_tip = "Event ID: " + play.id + "<br />Status: " + play.status_text;
|
||||||
play.finished = modified;
|
play.finished = modified;
|
||||||
play.elapsed = GetElapsed({
|
play.elapsed = GetElapsed({
|
||||||
|
|||||||
Reference in New Issue
Block a user