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 @@
+
4 Please select a host below to view a summary of all associated tasks.
@@ -43,17 +44,17 @@ {{ host.ok - host.changed }} {{ host.changed }} {{ host.skipped }} - {{ host.dark }} - {{ host.failures }} + {{ host.dark }} + {{ host.failures }} - - Waiting... + + Initiating job run. - - Loading... + + Job is running. Summary will be available on completion. - + No matching hosts @@ -65,7 +66,7 @@
- +
Host Status Summary
diff --git a/awx/ui/client/src/job-detail/host-summary/host-summary.route.js b/awx/ui/client/src/job-detail/host-summary/host-summary.route.js index f451b63ad5..287b565260 100644 --- a/awx/ui/client/src/job-detail/host-summary/host-summary.route.js +++ b/awx/ui/client/src/job-detail/host-summary/host-summary.route.js @@ -8,16 +8,21 @@ import {templateUrl} from '../../shared/template-url/template-url.factory'; export default { name: 'jobDetail.host-summary', + url: '/event-summary', + /* resolve: { jobSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { - var job_socket = Socket({ - scope: $rootScope, - endpoint: "jobs" - }); - job_socket.init(); - return job_socket; + var job_socket = Socket({ + scope: $rootScope, + endpoint: "jobs" + }); + if (!$rootScope.event_socket){ + job_socket.init(); + } + return job_socket; }] }, + */ views:{ 'host-summary': { controller: 'HostSummaryController', diff --git a/awx/ui/client/src/job-detail/job-detail.block.less b/awx/ui/client/src/job-detail/job-detail.block.less index ee02d3d639..11abf06189 100644 --- a/awx/ui/client/src/job-detail/job-detail.block.less +++ b/awx/ui/client/src/job-detail/job-detail.block.less @@ -7,6 +7,13 @@ @breakpoint-md: 1200px; @breakpoint-sm: 420px; +.JobDetail-tasks.section{ + margin-top:40px; +} +.JobDetail-instructions{ + color: @default-interface-txt; + margin: 10px 0 10px 0; +} .JobDetail{ .OnePlusOne-container(100%, @breakpoint-md); } @@ -115,7 +122,7 @@ flex-wrap: wrap; flex-direction: row; height: 50px; - margin-top: 25px; + margin-top: 20px; @media screen and(max-width: @breakpoint-sm){ height: auto; } diff --git a/awx/ui/client/src/job-detail/job-detail.controller.js b/awx/ui/client/src/job-detail/job-detail.controller.js index 007275c44e..de4011dd98 100644 --- a/awx/ui/client/src/job-detail/job-detail.controller.js +++ b/awx/ui/client/src/job-detail/job-detail.controller.js @@ -13,7 +13,7 @@ export default [ '$location', '$rootScope', '$filter', '$scope', '$compile', '$stateParams', '$log', 'ClearScope', 'GetBasePath', 'Wait', - 'ProcessErrors', 'SelectPlay', 'SelectTask', 'Socket', 'GetElapsed', + 'ProcessErrors', 'SelectPlay', 'SelectTask', 'GetElapsed', 'JobIsFinished', 'SetTaskStyles', 'DigestEvent', 'UpdateDOM', 'DeleteJob', 'PlaybookRun', 'LoadPlays', 'LoadTasks', 'HostsEdit', 'ParseVariableString', 'GetChoices', 'fieldChoices', 'fieldLabels', @@ -21,7 +21,7 @@ export default function( $location, $rootScope, $filter, $scope, $compile, $stateParams, $log, ClearScope, GetBasePath, Wait, ProcessErrors, - SelectPlay, SelectTask, Socket, GetElapsed, + SelectPlay, SelectTask, GetElapsed, JobIsFinished, SetTaskStyles, DigestEvent, UpdateDOM, DeleteJob, PlaybookRun, LoadPlays, LoadTasks, @@ -680,7 +680,7 @@ export default // there's a bunch of white space at the bottom, let's use it $('#plays-table-detail').height(80 + (height * 0.10)); $('#tasks-table-detail').height(120 + (height * 0.20)); - $('#hosts-table-detail').height(150 + (height * 0.70)); + $('#hosts-table-detail').height(150 + (height * 0.10)); } scope.$emit('RefreshCompleted'); }; @@ -737,7 +737,7 @@ export default return true; }; - scope.toggleLessEvents = function() { + scope.toggleLessEvents = function(state) { if (!scope.lessEvents) { $('#events-summary').slideUp(200); scope.lessEvents = true; diff --git a/awx/ui/client/src/job-detail/job-detail.partial.html b/awx/ui/client/src/job-detail/job-detail.partial.html index 585b18a071..311d484b0d 100644 --- a/awx/ui/client/src/job-detail/job-detail.partial.html +++ b/awx/ui/client/src/job-detail/job-detail.partial.html @@ -171,6 +171,7 @@
+
1 Please select from a play below to view its associated tasks.
@@ -228,7 +229,8 @@
-
+
+
2 Please select a task below to view its associated hosts
@@ -312,6 +314,7 @@
+
3 Please select a host below to view associated task details.
@@ -368,19 +371,12 @@
- -
- - - -
-
+ + + +
STANDARD OUT
@@ -403,7 +404,7 @@ -
+ diff --git a/awx/ui/client/src/shared/api-loader.js b/awx/ui/client/src/shared/api-loader.js index cd2b887603..abfe73ab6d 100644 --- a/awx/ui/client/src/shared/api-loader.js +++ b/awx/ui/client/src/shared/api-loader.js @@ -35,10 +35,6 @@ angular.module('ApiLoader', ['Utilities']) .success(function (data) { data.base = base; $rootScope.defaultUrls = data; - // tiny hack to side-step api/v1/job_events not being a visible endpoint @ GET api/v1/ - if (!$rootScope.defaultUrls.job_events){ - $rootScope.defaultUrls.job_events = '/api/v1/job_events/'; - } Store('api', data); }) .error(function (data, status) { diff --git a/awx/ui/client/src/standard-out/log/standard-out-log.controller.js b/awx/ui/client/src/standard-out/log/standard-out-log.controller.js index 9a8c600fdb..631294255f 100644 --- a/awx/ui/client/src/standard-out/log/standard-out-log.controller.js +++ b/awx/ui/client/src/standard-out/log/standard-out-log.controller.js @@ -22,14 +22,14 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce // Open up a socket for events depending on the type of job function openSockets() { if ($state.current.name === 'jobDetail') { - $log.debug("socket watching on job_events-" + job_id); - $rootScope.event_socket.on("job_events-" + job_id, function() { - $log.debug("socket fired on job_events-" + job_id); - if (api_complete) { - event_queue++; - } - }); - } + $log.debug("socket watching on job_events-" + job_id); + $rootScope.event_socket.on("job_events-" + job_id, function() { + $log.debug("socket fired on job_events-" + job_id); + if (api_complete) { + event_queue++; + } + }); + } if ($state.current.name === 'adHocJobStdout') { $log.debug("socket watching on ad_hoc_command_events-" + job_id); $rootScope.adhoc_event_socket.on("ad_hoc_command_events-" + job_id, function() { @@ -131,8 +131,6 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce start: (data.range.start < 0) ? 0 : data.range.start, end: data.range.end }); - //console.log('loaded start: ' + data.range.start + ' end: ' + data.range.end); - //console.log(data.content); if ($scope.should_apply_live_events) { // if user has not disabled live event view by scrolling upward, then scroll down to the new content current_range = data.range; diff --git a/awx/ui/client/src/standard-out/standard-out.block.less b/awx/ui/client/src/standard-out/standard-out.block.less index 836813df8a..ccaaedead4 100644 --- a/awx/ui/client/src/standard-out/standard-out.block.less +++ b/awx/ui/client/src/standard-out/standard-out.block.less @@ -3,6 +3,11 @@ /** @define StandardOut */ +.StandardOut-preContent{ + font-size: 12px; + padding: 0 20px 0 20px; + font-family: Menlo,Monaco,Consolas,"Courier New",monospace; +} .StandardOut-container { .OnePlusTwo-container; } @@ -24,8 +29,8 @@ min-height: 200px; background-color: @default-secondary-bg; border-radius: 5px; - height: ~"calc(100% - 74px)"; - overflow: scroll; + max-height: 1600px; + overflow: auto; } .StandardOut-details { @@ -81,7 +86,7 @@ font-size: 16px; height: 30px; min-width: 30px; - color: @default-data-txt; + color: @list-action-icon; background-color: inherit; border: none; border-radius: 50%;