From 69caf45dec1395b64fcfa1ece5a35f7b732ba58a Mon Sep 17 00:00:00 2001 From: jaredevantabor Date: Wed, 25 Jan 2017 16:13:45 -0800 Subject: [PATCH 1/4] Adding additional check for when event_type isn't a runner_on or playbook_on event --- .../src/job-results/job-results.controller.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/job-results/job-results.controller.js b/awx/ui/client/src/job-results/job-results.controller.js index b4b79a7533..38a865322e 100644 --- a/awx/ui/client/src/job-results/job-results.controller.js +++ b/awx/ui/client/src/job-results/job-results.controller.js @@ -275,7 +275,9 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy $scope.events[mungedEvent.counter] .event = mungedEvent; - if (mungedEvent.stdout.indexOf("not_skeleton") > -1) { + if (mungedEvent.stdout.indexOf("not_skeleton") > -1 && + mungedEvent.name.indexOf("plabyook_") > -1 || + mungedEvent.name.indexOf("runner_") > -1 ) { // put non-duplicate lines into the standard // out pane where they should go (within the // right header section, before the next line @@ -294,7 +296,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy putIn = classList .filter(v => v.indexOf("play_") > -1)[0]; } - + var putAfter; var isDup = false; $(".header_" + putIn + ",." + putIn) @@ -324,8 +326,18 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy classList = null; putIn = null; } else { - // this is a header or recap line, so just - // append to the bottom + // if we get here then the event type was either a + // header line, recap line, or one of the additional + // event types, so we append it to the bottom. + // These are the event types for captured + // stdout not directly related to playbook or runner + // events: + // (0, 'debug', _('Debug'), False), + // (0, 'verbose', _('Verbose'), False), + // (0, 'deprecated', _('Deprecated'), False), + // (0, 'warning', _('Warning'), False), + // (0, 'system_warning', _('System Warning'), False), + // (0, 'error', _('Error'), True), angular .element(".JobResultsStdOut-stdoutContainer") .append($compile(mungedEvent From c751c5635524c5540ed8347adb4c1c36e0a10669 Mon Sep 17 00:00:00 2001 From: jaredevantabor Date: Thu, 26 Jan 2017 12:36:15 -0800 Subject: [PATCH 2/4] rearranging logic to match integrity of existing logic --- .../src/job-results/job-results.controller.js | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/awx/ui/client/src/job-results/job-results.controller.js b/awx/ui/client/src/job-results/job-results.controller.js index 38a865322e..51b51c5833 100644 --- a/awx/ui/client/src/job-results/job-results.controller.js +++ b/awx/ui/client/src/job-results/job-results.controller.js @@ -220,6 +220,25 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy // EVENT STUFF BELOW + var appendToBottom = function(mungedEvent){ + // if we get here then the event type was either a + // header line, recap line, or one of the additional + // event types, so we append it to the bottom. + // These are the event types for captured + // stdout not directly related to playbook or runner + // events: + // (0, 'debug', _('Debug'), False), + // (0, 'verbose', _('Verbose'), False), + // (0, 'deprecated', _('Deprecated'), False), + // (0, 'warning', _('Warning'), False), + // (0, 'system_warning', _('System Warning'), False), + // (0, 'error', _('Error'), True), + angular + .element(".JobResultsStdOut-stdoutContainer") + .append($compile(mungedEvent + .stdout)($scope.events[mungedEvent + .counter])); + }; // This is where the async updates to the UI actually happen. // Flow is event queue munging in the service -> $scope setting in here var processEvent = function(event, context) { @@ -275,9 +294,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy $scope.events[mungedEvent.counter] .event = mungedEvent; - if (mungedEvent.stdout.indexOf("not_skeleton") > -1 && - mungedEvent.name.indexOf("plabyook_") > -1 || - mungedEvent.name.indexOf("runner_") > -1 ) { + if (mungedEvent.stdout.indexOf("not_skeleton")) { // put non-duplicate lines into the standard // out pane where they should go (within the // right header section, before the next line @@ -292,11 +309,15 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy .length) { putIn = classList .filter(v => v.indexOf("task_") > -1)[0]; - } else { + } else if(classList + .filter(v => v.indexOf("play_") > -1) + .length) { putIn = classList .filter(v => v.indexOf("play_") > -1)[0]; + } else { + appendToBottom(mungedEvent); } - + var putAfter; var isDup = false; $(".header_" + putIn + ",." + putIn) @@ -323,26 +344,11 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy .counter])); } + classList = null; putIn = null; } else { - // if we get here then the event type was either a - // header line, recap line, or one of the additional - // event types, so we append it to the bottom. - // These are the event types for captured - // stdout not directly related to playbook or runner - // events: - // (0, 'debug', _('Debug'), False), - // (0, 'verbose', _('Verbose'), False), - // (0, 'deprecated', _('Deprecated'), False), - // (0, 'warning', _('Warning'), False), - // (0, 'system_warning', _('System Warning'), False), - // (0, 'error', _('Error'), True), - angular - .element(".JobResultsStdOut-stdoutContainer") - .append($compile(mungedEvent - .stdout)($scope.events[mungedEvent - .counter])); + appendToBottom(mungedEvent); } // move the followAnchor to the bottom of the From 2be7a9ded7413a5e07544f1ea0ca26caaaa8b6d2 Mon Sep 17 00:00:00 2001 From: jaredevantabor Date: Thu, 26 Jan 2017 12:48:05 -0800 Subject: [PATCH 3/4] moving appendToBottom function elsewhere --- .../src/job-results/job-results.controller.js | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/awx/ui/client/src/job-results/job-results.controller.js b/awx/ui/client/src/job-results/job-results.controller.js index 51b51c5833..e61e3286a3 100644 --- a/awx/ui/client/src/job-results/job-results.controller.js +++ b/awx/ui/client/src/job-results/job-results.controller.js @@ -220,25 +220,6 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy // EVENT STUFF BELOW - var appendToBottom = function(mungedEvent){ - // if we get here then the event type was either a - // header line, recap line, or one of the additional - // event types, so we append it to the bottom. - // These are the event types for captured - // stdout not directly related to playbook or runner - // events: - // (0, 'debug', _('Debug'), False), - // (0, 'verbose', _('Verbose'), False), - // (0, 'deprecated', _('Deprecated'), False), - // (0, 'warning', _('Warning'), False), - // (0, 'system_warning', _('System Warning'), False), - // (0, 'error', _('Error'), True), - angular - .element(".JobResultsStdOut-stdoutContainer") - .append($compile(mungedEvent - .stdout)($scope.events[mungedEvent - .counter])); - }; // This is where the async updates to the UI actually happen. // Flow is event queue munging in the service -> $scope setting in here var processEvent = function(event, context) { @@ -285,6 +266,28 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy if(change === 'stdout'){ // put stdout elements in stdout container + + function appendToBottom(mungedEvent){ + // if we get here then the event type was either a + // header line, recap line, or one of the additional + // event types, so we append it to the bottom. + // These are the event types for captured + // stdout not directly related to playbook or runner + // events: + // (0, 'debug', _('Debug'), False), + // (0, 'verbose', _('Verbose'), False), + // (0, 'deprecated', _('Deprecated'), False), + // (0, 'warning', _('Warning'), False), + // (0, 'system_warning', _('System Warning'), False), + // (0, 'error', _('Error'), True), + angular + .element(".JobResultsStdOut-stdoutContainer") + .append($compile(mungedEvent + .stdout)($scope.events[mungedEvent + .counter])); + } + + // this scopes the event to that particular // block of stdout. // If you need to see the event a particular From 6223cb6921eebd117e119ab54045c5bb43aa10bd Mon Sep 17 00:00:00 2001 From: jaredevantabor Date: Thu, 26 Jan 2017 14:52:49 -0800 Subject: [PATCH 4/4] fixing jshint --- awx/ui/client/src/job-results/job-results.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/job-results/job-results.controller.js b/awx/ui/client/src/job-results/job-results.controller.js index e61e3286a3..50e128aa91 100644 --- a/awx/ui/client/src/job-results/job-results.controller.js +++ b/awx/ui/client/src/job-results/job-results.controller.js @@ -267,7 +267,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy // put stdout elements in stdout container - function appendToBottom(mungedEvent){ + var appendToBottom = function(mungedEvent){ // if we get here then the event type was either a // header line, recap line, or one of the additional // event types, so we append it to the bottom. @@ -285,7 +285,7 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy .append($compile(mungedEvent .stdout)($scope.events[mungedEvent .counter])); - } + }; // this scopes the event to that particular