mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Merge pull request #5516 from jaredevantabor/host-event-stdout
Fixing host event stdout/stderr
This commit is contained in:
commit
fca5e1975a
@ -36,6 +36,11 @@
|
||||
|
||||
<div class="HostEvent-nav">
|
||||
<!-- view navigation buttons -->
|
||||
<button ui-sref="jobDetail.host-event.json" type="button"
|
||||
class="btn btn-sm btn-default HostEvent-tab"
|
||||
ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.json')}">
|
||||
JSON
|
||||
</button>
|
||||
<button ng-if="stdout" ui-sref="jobDetail.host-event.stdout"
|
||||
type="button" class="btn btn-sm btn-default HostEvent-tab"
|
||||
ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.stdout')}">
|
||||
@ -46,11 +51,7 @@
|
||||
ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.stderr')}">
|
||||
Standard Error
|
||||
</button>
|
||||
<button ui-sref="jobDetail.host-event.json" type="button"
|
||||
class="btn btn-sm btn-default HostEvent-tab"
|
||||
ng-class="{'HostEvent-tab--selected' : isActiveState('jobDetail.host-event.json')}">
|
||||
JSON
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="HostEvent-body">
|
||||
<!-- views -->
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
<div class="HostEvent-stdout">
|
||||
<div class="HostEvent-stdoutContainer">
|
||||
<div class="HostEvent-numberColumnPreload"></div>
|
||||
<div class="HostEvent-numberColumn">1</div>
|
||||
<div class="HostEvent-stdoutColumn" ng-bind-html="stderr"></div>
|
||||
<div class="HostEvent-numberColumn HostEvent-numberColumn--second">
|
||||
2
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -6,8 +6,8 @@
|
||||
|
||||
|
||||
export default
|
||||
['$stateParams', '$scope', '$state', 'Wait', 'JobDetailService', 'hostEvent', 'hostResults', 'parseStdoutService',
|
||||
function($stateParams, $scope, $state, Wait, JobDetailService, hostEvent, hostResults, parseStdoutService){
|
||||
['$stateParams', '$scope', '$state', 'Wait', 'JobDetailService', 'hostEvent', 'hostResults',
|
||||
function($stateParams, $scope, $state, Wait, JobDetailService, hostEvent, hostResults){
|
||||
|
||||
$scope.processEventStatus = JobDetailService.processEventStatus;
|
||||
$scope.hostResults = [];
|
||||
@ -18,7 +18,7 @@
|
||||
else {return true;}
|
||||
};
|
||||
$scope.isStdOut = function(){
|
||||
if ($state.current.name === 'jobDetails.host-event.stdout' || $state.current.name === 'jobDetaisl.histe-event.stderr'){
|
||||
if ($state.current.name === 'jobDetail.host-event.stdout' || $state.current.name === 'jobDetail.host-event.stderr'){
|
||||
return 'StandardOut-preContainer StandardOut-preContent';
|
||||
}
|
||||
};
|
||||
@ -50,14 +50,14 @@
|
||||
$scope.hostResults = hostResults;
|
||||
$scope.json = JobDetailService.processJson(hostEvent);
|
||||
|
||||
// grab standard out & standard error if present, and remove from the results displayed in the details panel
|
||||
if (hostEvent.stdout){
|
||||
$scope.stdout = parseStdoutService.prettify(hostEvent.stdout);
|
||||
delete $scope.event.stdout;
|
||||
// grab standard out & standard error if present from the host
|
||||
// event's "res" object, for things like Ansible modules
|
||||
try{
|
||||
$scope.stdout = hostEvent.event_data.res.stdout;
|
||||
$scope.stderr = hostEvent.event_data.res.stderr;
|
||||
}
|
||||
if (hostEvent.stderr){
|
||||
$scope.stderr = hostEvent.stderr;
|
||||
delete $scope.event.stderr;
|
||||
catch(err){
|
||||
// do nothing, no stdout/stderr for this module
|
||||
}
|
||||
// instantiate Codemirror
|
||||
// try/catch pattern prevents the abstract-state controller from complaining about element being null
|
||||
|
||||
@ -51,7 +51,7 @@ var hostEventStderr = {
|
||||
name: 'jobDetail.host-event.stderr',
|
||||
url: '/stderr',
|
||||
controller: 'HostEventController',
|
||||
templateUrl: templateUrl('job-results/host-event/host-event-stdout')
|
||||
templateUrl: templateUrl('job-results/host-event/host-event-stderr')
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ export default ['$log', 'moment', function($log, moment){
|
||||
return `"`;
|
||||
}
|
||||
else{
|
||||
return ` JobResultsStdOut-stdoutColumn--clickable" ui-sref="jobDetail.host-event.stdout({eventId: ${event.id}, taskUuid: '${event.event_data.task_uuid}' })" aw-tool-tip="Event ID: ${event.id} <br>Status: ${event.event_display} <br>Click for details" data-placement="top"`;
|
||||
return ` JobResultsStdOut-stdoutColumn--clickable" ui-sref="jobDetail.host-event.json({eventId: ${event.id}, taskUuid: '${event.event_data.task_uuid}' })" aw-tool-tip="Event ID: ${event.id} <br>Status: ${event.event_display} <br>Click for details" data-placement="top"`;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user