mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 12:27:37 -02:30
Job detail page
Fix for https://trello.com/c/WZ18zIqG/337-completed-job-detail-statistics-differ-between-realtime-and-page-refresh
This commit is contained in:
@@ -583,6 +583,10 @@ angular.module('Tower', [
|
|||||||
$log.debug('Job ' + data.unified_job_id + ' status changed to ' + data.status);
|
$log.debug('Job ' + data.unified_job_id + ' status changed to ' + data.status);
|
||||||
$rootScope.$emit('JobStatusChange', data);
|
$rootScope.$emit('JobStatusChange', data);
|
||||||
});
|
});
|
||||||
|
sock.on("summary_complete", function(data) {
|
||||||
|
$log.debug('Job summary_complete ' + data.unified_job_id);
|
||||||
|
$rootScope.$emit('JobSummaryComplete', data);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
openSocket();
|
openSocket();
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
|||||||
scope.host_summary.total = 0;
|
scope.host_summary.total = 0;
|
||||||
|
|
||||||
scope.jobData = {};
|
scope.jobData = {};
|
||||||
|
scope.jobData.hostSummaries = {};
|
||||||
|
|
||||||
verbosity_options = [
|
verbosity_options = [
|
||||||
{ value: 0, label: 'Default' },
|
{ value: 0, label: 'Default' },
|
||||||
@@ -140,6 +141,15 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($rootScope.removeJobSummaryComplete) {
|
||||||
|
$rootScope.removeJobSummaryComplete();
|
||||||
|
}
|
||||||
|
$rootScope.removeJobSummaryComplete = $rootScope.$on('JobSummaryComplete', function() {
|
||||||
|
// the job host summary should now be available from the API
|
||||||
|
$log.debug('Trigging reload of job_host_summaries');
|
||||||
|
scope.$emit('LoadHostSummaries');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
if (scope.removeInitialLoadComplete) {
|
if (scope.removeInitialLoadComplete) {
|
||||||
scope.removeInitialLoadComplete();
|
scope.removeInitialLoadComplete();
|
||||||
@@ -189,12 +199,14 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
|||||||
var url = scope.job.related.job_host_summaries + '?';
|
var url = scope.job.related.job_host_summaries + '?';
|
||||||
url += '&page_size=' + scope.hostSummariesMaxRows + '&order=host_name';
|
url += '&page_size=' + scope.hostSummariesMaxRows + '&order=host_name';
|
||||||
|
|
||||||
scope.jobData.hostSummaries = {};
|
|
||||||
|
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
scope.next_host_summaries = data.next;
|
scope.next_host_summaries = data.next;
|
||||||
|
if (data.results.length > 0) {
|
||||||
|
// only dump what's in memory when job_host_summaries is available.
|
||||||
|
scope.jobData.hostSummaries = {};
|
||||||
|
}
|
||||||
data.results.forEach(function(event) {
|
data.results.forEach(function(event) {
|
||||||
var name;
|
var name;
|
||||||
if (event.host_name) {
|
if (event.host_name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user