diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index cd107a5590..0042de8cd9 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -670,15 +670,15 @@ var tower = angular.module('Tower', [ // accessing. if ($state.is('jobs')) { $rootScope.$emit('JobStatusChange-jobs', data); - } else if ($state.is('jobDetail') || + } else if ($state.includes('jobDetail') || $state.is('adHocJobStdout') || $state.is('inventorySyncStdout') || $state.is('managementJobStdout') || - $state.is('scmUpdateStdout')) { + $state.is('scmUpdateStdout')){ $log.debug("sending status to standard out"); $rootScope.$emit('JobStatusChange-jobStdout', data); - } if ($state.is('jobDetail')) { + } if ($state.includes('jobDetail')) { $rootScope.$emit('JobStatusChange-jobDetails', data); } else if ($state.is('dashboard')) { $rootScope.$emit('JobStatusChange-home', data); @@ -739,10 +739,19 @@ var tower = angular.module('Tower', [ } // remove any lingering intervals - if ($rootScope.jobDetailInterval) { + // except on jobDetails.* states + var jobDetailStates = [ + 'jobDetail', + 'jobDetail.host-summary', + 'jobDetail.host-event.details', + 'jobDetail.host-event.json', + 'jobDetail.host-events', + 'jobDetail.host-event.stdout' + ]; + if ($rootScope.jobDetailInterval && !_.includes(jobDetailStates, next.name) ) { window.clearInterval($rootScope.jobDetailInterval); } - if ($rootScope.jobStdOutInterval) { + if ($rootScope.jobStdOutInterval && !_.includes(jobDetailStates, next.name) ) { window.clearInterval($rootScope.jobStdOutInterval); } diff --git a/awx/ui/client/src/job-detail/host-event/host-event.controller.js b/awx/ui/client/src/job-detail/host-event/host-event.controller.js index 4a1f0c926d..8b97a11765 100644 --- a/awx/ui/client/src/job-detail/host-event/host-event.controller.js +++ b/awx/ui/client/src/job-detail/host-event/host-event.controller.js @@ -6,8 +6,8 @@ export default - ['$stateParams', '$scope', '$state', 'Wait', 'JobDetailService', 'event', 'CodeMirror', - function($stateParams, $scope, $state, Wait, JobDetailService, event, CodeMirror){ + ['$stateParams', '$scope', '$state', 'Wait', 'JobDetailService', 'hostEvent', + function($stateParams, $scope, $state, Wait, JobDetailService, hostEvent){ $scope.processEventStatus = JobDetailService.processEventStatus; $scope.hostResults = []; @@ -56,7 +56,7 @@ }; var init = function(){ - $scope.event = event; + $scope.event = hostEvent; JobDetailService.getJobEventChildren($stateParams.taskId).success(function(res){ $scope.hostResults = res.results; }); diff --git a/awx/ui/client/src/job-detail/host-event/host-event.route.js b/awx/ui/client/src/job-detail/host-event/host-event.route.js index 534618187e..c1e14bd91a 100644 --- a/awx/ui/client/src/job-detail/host-event/host-event.route.js +++ b/awx/ui/client/src/job-detail/host-event/host-event.route.js @@ -12,10 +12,10 @@ var hostEventModal = { controller: 'HostEventController', templateUrl: templateUrl('job-detail/host-event/host-event-modal'), resolve: { - event: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) { + hostEvent: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) { return JobDetailService.getRelatedJobEvents($stateParams.id, { id: $stateParams.eventId - }).success(function(res){ return res.results[0];}); + }).then(function(res){ return res.data.results[0];}); }] }, onExit: function(){ diff --git a/awx/ui/client/src/job-detail/host-events/host-events.controller.js b/awx/ui/client/src/job-detail/host-events/host-events.controller.js index d794473cf3..2edea0a622 100644 --- a/awx/ui/client/src/job-detail/host-events/host-events.controller.js +++ b/awx/ui/client/src/job-detail/host-events/host-events.controller.js @@ -72,8 +72,7 @@ if (filter === 'ok'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { host_name: $stateParams.hostName, - or__field__event: 'runner_on_ok', - changed: false + event__startswith: 'runner_on_ok' }) .success(function(res){ $scope.results = res.results; @@ -93,7 +92,9 @@ if (filter === 'failed'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { host_name: $stateParams.hostName, - failed: true}) + failed: true, + event__startswith: 'runner_on_failed' + }) .success(function(res){ $scope.results = res.results; Wait('stop'); diff --git a/awx/ui/client/src/job-detail/host-summary/host-summary.block.less b/awx/ui/client/src/job-detail/host-summary/host-summary.block.less index d8fa6983cb..8322bc0978 100644 --- a/awx/ui/client/src/job-detail/host-summary/host-summary.block.less +++ b/awx/ui/client/src/job-detail/host-summary/host-summary.block.less @@ -5,7 +5,7 @@ text-anchor: end !important; } .HostSummary-graph--changed{ - text-anchor: end !important; + text-anchor: start !important; } .HostSUmmary-graph--unreachable{} .HostSummary-loading{ diff --git a/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js b/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js index f89903a621..9825d3a740 100644 --- a/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js +++ b/awx/ui/client/src/job-detail/host-summary/host-summary.controller.js @@ -53,13 +53,13 @@ // JobEvent.update_host_summary_from_stats() from /awx/main.models.jobs.py jobSocket.on('summary_complete', function(data) { // discard socket msgs we don't care about in this context - if ($stateParams.id === data.unified_job_id){ + if (parseInt($stateParams.id) === data.unified_job_id){ init(); } }); // UnifiedJob.def socketio_emit_status() from /awx/main.models.unified_jobs.py jobSocket.on('status_changed', function(data) { - if ($stateParams.id === data.unified_job_id){ + if (parseInt($stateParams.id) === data.unified_job_id){ $scope.status = data.status; } }); @@ -78,11 +78,6 @@ return n !== 0 ? n + dict[n] + status : dict[n] + status; } }; - /* - _.forIn(count, function(value, key){ - text[key] = grammar(value.length, key); - }); - */ return grammar(n, status); }; $scope.getNextPage = function(){ diff --git a/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html b/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html index 84d3b3aba5..546772ffc0 100644 --- a/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html +++ b/awx/ui/client/src/job-detail/host-summary/host-summary.partial.html @@ -1,5 +1,6 @@