mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 10:41:05 -03:30
Merge pull request #5557 from jaredevantabor/host-event-stdout
Host event modal changes, hopefully for the last time
This commit is contained in:
@@ -18,6 +18,10 @@
|
|||||||
<div class="HostEvent-field">
|
<div class="HostEvent-field">
|
||||||
<span class="HostEvent-field--label">CREATED</span>
|
<span class="HostEvent-field--label">CREATED</span>
|
||||||
<span class="HostEvent-field--content">{{(event.created | longDate) || "No result found"}}</span>
|
<span class="HostEvent-field--content">{{(event.created | longDate) || "No result found"}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="HostEvent-field">
|
||||||
|
<span class="HostEvent-field--label">ID</span>
|
||||||
|
<span class="HostEvent-field--content">{{event.id || "No result found"}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="HostEvent-field">
|
<div class="HostEvent-field">
|
||||||
<span class="HostEvent-field--label">PLAY</span>
|
<span class="HostEvent-field--label">PLAY</span>
|
||||||
@@ -29,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="HostEvent-field">
|
<div class="HostEvent-field">
|
||||||
<span class="HostEvent-field--label">MODULE</span>
|
<span class="HostEvent-field--label">MODULE</span>
|
||||||
<span class="HostEvent-field--content">{{event.event_data.res.invocation.module_name || "No result found"}}</span>
|
<span class="HostEvent-field--content">{{module_name}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -48,17 +48,23 @@
|
|||||||
hostEvent.event_name = hostEvent.event;
|
hostEvent.event_name = hostEvent.event;
|
||||||
$scope.event = _.cloneDeep(hostEvent);
|
$scope.event = _.cloneDeep(hostEvent);
|
||||||
$scope.hostResults = hostResults;
|
$scope.hostResults = hostResults;
|
||||||
$scope.json = JobDetailService.processJson(hostEvent);
|
|
||||||
|
|
||||||
// grab standard out & standard error if present from the host
|
// grab standard out & standard error if present from the host
|
||||||
// event's "res" object, for things like Ansible modules
|
// event's "res" object, for things like Ansible modules
|
||||||
try{
|
try{
|
||||||
|
$scope.module_name = hostEvent.event_data.res.invocation.module_name || hostEvent.event_data.res.task_action || "No result found";
|
||||||
$scope.stdout = hostEvent.event_data.res.stdout;
|
$scope.stdout = hostEvent.event_data.res.stdout;
|
||||||
$scope.stderr = hostEvent.event_data.res.stderr;
|
$scope.stderr = hostEvent.event_data.res.stderr;
|
||||||
|
$scope.json = hostEvent.event_data.res;
|
||||||
}
|
}
|
||||||
catch(err){
|
catch(err){
|
||||||
// do nothing, no stdout/stderr for this module
|
// do nothing, no stdout/stderr for this module
|
||||||
}
|
}
|
||||||
|
if($scope.module_name === "yum" &&
|
||||||
|
hostEvent.event_data.res.hasOwnProperty('results') &&
|
||||||
|
_.isArray(hostEvent.event_data.res.results)){
|
||||||
|
$scope.stdout = hostEvent.event_data.res.results[0];
|
||||||
|
}
|
||||||
// instantiate Codemirror
|
// instantiate Codemirror
|
||||||
// try/catch pattern prevents the abstract-state controller from complaining about element being null
|
// try/catch pattern prevents the abstract-state controller from complaining about element being null
|
||||||
if ($state.current.name === 'jobDetail.host-event.json'){
|
if ($state.current.name === 'jobDetail.host-event.json'){
|
||||||
|
|||||||
Reference in New Issue
Block a user