diff --git a/awx/ui/client/features/output/host-event/_index.less b/awx/ui/client/features/output/host-event/_index.less index bec8548cd2..f93f80a56d 100644 --- a/awx/ui/client/features/output/host-event/_index.less +++ b/awx/ui/client/features/output/host-event/_index.less @@ -170,10 +170,13 @@ } .HostEvent-stdoutColumn{ - white-space: pre; - overflow-y: scroll; + overflow-y: hidden; + overflow-x: auto; margin-left: 46px; padding-top: 4px; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; } .HostEvent-noJson{ diff --git a/awx/ui/client/features/output/host-event/host-event.controller.js b/awx/ui/client/features/output/host-event/host-event.controller.js index 9f199fcd34..87f698db9d 100644 --- a/awx/ui/client/features/output/host-event/host-event.controller.js +++ b/awx/ui/client/features/output/host-event/host-event.controller.js @@ -1,6 +1,7 @@ function HostEventsController ( $scope, $state, + $filter, HostEventService, hostEvent, OutputStrings @@ -11,6 +12,9 @@ function HostEventsController ( $scope.getActiveHostIndex = getActiveHostIndex; $scope.closeHostEvent = closeHostEvent; $scope.strings = OutputStrings; + + const sanitize = $filter('sanitize'); + function init () { hostEvent.event_name = hostEvent.event; $scope.event = _.cloneDeep(hostEvent); @@ -31,7 +35,7 @@ function HostEventsController ( if (hostEvent.event_data.res.stdout === '') { $scope.stdout = ' '; } else { - $scope.stdout = hostEvent.event_data.res.stdout; + $scope.stdout = sanitize(hostEvent.event_data.res.stdout); } } @@ -39,7 +43,7 @@ function HostEventsController ( if (hostEvent.event_data.res.stderr === '') { $scope.stderr = ' '; } else { - $scope.stderr = hostEvent.event_data.res.stderr; + $scope.stderr = sanitize(hostEvent.event_data.res.stderr); } } @@ -49,13 +53,13 @@ function HostEventsController ( if ($scope.module_name === 'debug' && _.has(hostEvent.event_data, 'res.result.stdout')) { - $scope.stdout = hostEvent.event_data.res.result.stdout; + $scope.stdout = sanitize(hostEvent.event_data.res.result.stdout); } if ($scope.module_name === 'yum' && _.has(hostEvent.event_data, 'res.results') && _.isArray(hostEvent.event_data.res.results)) { const event = hostEvent.event_data.res.results; - $scope.stdout = event[0];// eslint-disable-line prefer-destructuring + $scope.stdout = sanitize(event[0]);// eslint-disable-line prefer-destructuring } // instantiate Codemirror if ($state.current.name === 'output.host-event.json') { @@ -164,6 +168,7 @@ function HostEventsController ( HostEventsController.$inject = [ '$scope', '$state', + '$filter', 'HostEventService', 'hostEvent', 'OutputStrings'