mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
Job detail page refactoration
Latest changes to job detail page. Making it work with parallel play and task arrivals.
This commit is contained in:
@@ -88,6 +88,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
|||||||
if (parseInt(data.unified_job_id, 10) === parseInt(job_id,10)) {
|
if (parseInt(data.unified_job_id, 10) === parseInt(job_id,10)) {
|
||||||
if (data.status === 'failed' || data.status === 'canceled' ||
|
if (data.status === 'failed' || data.status === 'canceled' ||
|
||||||
data.status === 'error' || data.status === 'successful') {
|
data.status === 'error' || data.status === 'successful') {
|
||||||
|
$scope.liveEventProcessing = false;
|
||||||
if ($rootScope.jobDetailInterval) {
|
if ($rootScope.jobDetailInterval) {
|
||||||
window.clearInterval($rootScope.jobDetailInterval);
|
window.clearInterval($rootScope.jobDetailInterval);
|
||||||
}
|
}
|
||||||
@@ -319,6 +320,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
play.taskCount++;
|
||||||
SetTaskStyles({
|
SetTaskStyles({
|
||||||
task: play.tasks[event.id]
|
task: play.tasks[event.id]
|
||||||
});
|
});
|
||||||
@@ -402,6 +404,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
|||||||
elapsed: elapsed,
|
elapsed: elapsed,
|
||||||
hostCount: 0,
|
hostCount: 0,
|
||||||
fistTask: null,
|
fistTask: null,
|
||||||
|
taskCount: 0,
|
||||||
playActiveClass: '',
|
playActiveClass: '',
|
||||||
unreachableCount: (event.unreachable_count) ? event.unreachable_count : 0,
|
unreachableCount: (event.unreachable_count) ? event.unreachable_count : 0,
|
||||||
tasks: {}
|
tasks: {}
|
||||||
@@ -414,6 +417,11 @@ 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) {
|
||||||
|
// force the play to be on the 'active' list
|
||||||
|
scope.jobData.plays[event.id].taskCount = 1;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
if (newActivePlay && scope.activePlay && newActivePlay !== scope.activePlay) {
|
if (newActivePlay && scope.activePlay && newActivePlay !== scope.activePlay) {
|
||||||
scope.jobData.plays[scope.activePlay].tasks = {};
|
scope.jobData.plays[scope.activePlay].tasks = {};
|
||||||
scope.jobData.plays[scope.activePlay].playActiveClass = '';
|
scope.jobData.plays[scope.activePlay].playActiveClass = '';
|
||||||
|
scope.activeTask = null;
|
||||||
}
|
}
|
||||||
if (newActivePlay) {
|
if (newActivePlay) {
|
||||||
scope.activePlay = newActivePlay;
|
scope.activePlay = newActivePlay;
|
||||||
@@ -284,7 +285,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
scope.jobData.plays[event.parent].tasks[event.id] = {
|
scope.jobData.plays[event.parent].tasks[event.id] = {
|
||||||
id: event.id,
|
id: event.id,
|
||||||
play_id: event.parent,
|
play_id: event.parent,
|
||||||
name: event.task,
|
name: (event.task) ? event.task : event.event_display,
|
||||||
status: status,
|
status: status,
|
||||||
status_text: status_text,
|
status_text: status_text,
|
||||||
status_tip: "Event ID: " + event.id + "<br />Status: " + status_text,
|
status_tip: "Event ID: " + event.id + "<br />Status: " + status_text,
|
||||||
@@ -378,7 +379,6 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
play.status_text = (changed) ? 'Changed' : (failed) ? 'Failed' : 'OK';
|
play.status_text = (changed) ? 'Changed' : (failed) ? 'Failed' : 'OK';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
play.taskCount++;
|
|
||||||
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({
|
||||||
@@ -404,10 +404,16 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
id = params.task_id,
|
id = params.task_id,
|
||||||
modified = params.modified,
|
modified = params.modified,
|
||||||
no_hosts = params.no_hosts,
|
no_hosts = params.no_hosts,
|
||||||
task;
|
play, task;
|
||||||
|
|
||||||
if (scope.jobData.plays[scope.activePlay].tasks[id] !== undefined) {
|
// find the task in our hierarchy
|
||||||
task = scope.jobData.plays[scope.activePlay].tasks[scope.activeTask];
|
for (play in scope.jobData.plays) {
|
||||||
|
if (scope.jobData.plays[play].tasks[id]) {
|
||||||
|
task = scope.jobData.plays[play].tasks[id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (task) {
|
||||||
if (no_hosts){
|
if (no_hosts){
|
||||||
task.status = 'no-matching-hosts';
|
task.status = 'no-matching-hosts';
|
||||||
task.status_text = 'No matching hosts';
|
task.status_text = 'No matching hosts';
|
||||||
@@ -545,8 +551,6 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
msg: msg
|
msg: msg
|
||||||
};
|
};
|
||||||
|
|
||||||
SetActiveTask({ scope: scope });
|
|
||||||
|
|
||||||
// increment the unreachable count on the play
|
// increment the unreachable count on the play
|
||||||
if (status === 'unreachable' && scope.jobData.plays[scope.activePlay]) {
|
if (status === 'unreachable' && scope.jobData.plays[scope.activePlay]) {
|
||||||
scope.jobData.plays[scope.activePlay].unreachableCount++;
|
scope.jobData.plays[scope.activePlay].unreachableCount++;
|
||||||
@@ -571,6 +575,8 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
SetTaskStyles({
|
SetTaskStyles({
|
||||||
task: task
|
task: task
|
||||||
});
|
});
|
||||||
|
|
||||||
|
SetActiveTask({ scope: scope });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
|||||||
Reference in New Issue
Block a user