Job detail page re-refactor

Fixed task hostCount value when data is reloaded in response to a search. Now the 'skipped' or not processed gap shows on task progress bars. Added animation to less/more link
This commit is contained in:
Chris Houseknecht
2014-07-09 16:56:22 -04:00
parent e3cea8ff25
commit d24f5d2316
3 changed files with 34 additions and 7 deletions

View File

@@ -656,7 +656,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
return function(params) {
var scope = params.scope,
callback = params.callback,
url;
url, play;
scope.tasks = [];
scope.tasksMap = {};
@@ -667,12 +667,25 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
url += (scope.search_task_status === 'failed') ? '&failed=true' : '';
url += '&page_size=' + scope.tasksMaxRows + '&order_by=id';
scope.plays.every(function(p, idx) {
if (p.id === scope.activePlay) {
play = scope.plays[idx];
return false;
}
return true;
});
Rest.setUrl(url);
Rest.get()
.success(function(data) {
data.results.forEach(function(event, idx) {
var end, elapsed, status, status_text;
if (play.firstTask === undefined || play.firstTask === null) {
play.firstTask = event.id;
play.hostCount = (event.host_count) ? event.host_count : 0;
}
if (idx < data.length - 1) {
// end date = starting date of the next event
end = data[idx + 1].created;
@@ -722,6 +735,11 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
taskActiveClass: ''
});
if (play.firstTask !== event.id) {
// this is not the first task
scope.tasks[scope.tasks.length - 1].hostCount = play.hostCount;
}
SetTaskStyles({
task: scope.tasks[scope.tasks.length - 1]
});
@@ -1131,7 +1149,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
filteredListA = hostResults;
}
if (scope.search_host_status === 'failed') {
if (scope.search_host_status === 'failed' || scope.search_host_status === 'unreachable') {
for (key in filteredListA) {
if (filteredListA[key].status === 'failed') {
filteredListB[key] = filteredListA[key];
@@ -1190,7 +1208,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
if (scope.search_host_summary_status === 'failed') {
for (key in filteredListA) {
if (filteredListA[key].status === 'failed') {
if (filteredListA[key].status === 'failed' || filteredListA[key].status === 'unreachable') {
filteredListB[key] = filteredListA[key];
}
}