Job detail page

Added 'Loading...' message to each table. Loading message is turned on at initial page load. It is turned off at the last possible second after completion of page rendering. It is turned on before each API call and back off after the API call completes.
This commit is contained in:
Chris Houseknecht
2014-07-29 16:40:05 -04:00
parent feb13b1f11
commit 5b6d8e5c98
3 changed files with 54 additions and 6 deletions

View File

@@ -665,7 +665,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
url = scope.job.url + 'job_plays/?page_size=' + scope.playsMaxRows + '&order_by=id';
url += (scope.search_play_name) ? '&play__icontains=' + scope.search_play_name : '';
url += (scope.search_play_status === 'failed') ? '&failed=true' : '';
scope.playsLoading = true;
Rest.setUrl(url);
Rest.get()
.success(function(data) {
@@ -717,6 +717,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
id: (scope.plays.length > 0) ? scope.plays[0].id : null,
callback: callback
});
scope.playsLoading = false;
})
.error(function(data) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
@@ -774,6 +775,8 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
return true;
});
scope.tasksLoading = true;
Rest.setUrl(url);
Rest.get()
.success(function(data) {
@@ -852,6 +855,8 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
callback: callback
});
scope.tasksLoading = false;
})
.error(function(data) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
@@ -909,7 +914,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
url += (scope.search_host_name) ? 'host__name__icontains=' + scope.search_host_name + '&' : '';
url += (scope.search_host_status === 'failed') ? 'failed=true&' : '';
url += 'event__startswith=runner&page_size=' + scope.hostResultsMaxRows + '&order_by=host__name';
scope.hostResultsLoading = true;
Rest.setUrl(url);
Rest.get()
.success(function(data) {
@@ -963,6 +968,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
item: item
});
}
scope.hostResultsLoading = false;
});
if (callback) {
scope.$emit(callback);
@@ -995,6 +1001,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
url += '&page_size=' + scope.hostSummariesMaxRows + '&order_by=host_name';
scope.hosts = [];
scope.hostSummariesLoading = true;
Rest.setUrl(url);
Rest.get()
@@ -1017,6 +1024,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
failed: event.failures,
status: (event.failed) ? 'failed' : 'successful'
});
scope.hostSummariesLoading = false;
});
if (callback) {
scope.$emit(callback);
@@ -1399,6 +1407,13 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
DrawHostSummaries({ scope: scope });
setTimeout(function() {
scope.playsLoading = false;
scope.tasksLoading = false;
scope.hostResultsLoading = false;
scope.LoadHostSummaries = false;
},100);
if (scope.host_summary.total > 0) {
DrawGraph({ scope: scope, resize: true });
}