mirror of
https://github.com/ansible/awx.git
synced 2026-04-07 02:59:21 -02:30
removing some old stale code from host event stdout after decoupling job-results from job-details
This commit is contained in:
@@ -46,7 +46,6 @@ import inventories from './inventories/main';
|
|||||||
import inventoryScripts from './inventory-scripts/main';
|
import inventoryScripts from './inventory-scripts/main';
|
||||||
import organizations from './organizations/main';
|
import organizations from './organizations/main';
|
||||||
import managementJobs from './management-jobs/main';
|
import managementJobs from './management-jobs/main';
|
||||||
import jobDetail from './job-detail/main';
|
|
||||||
import workflowResults from './workflow-results/main';
|
import workflowResults from './workflow-results/main';
|
||||||
import jobResults from './job-results/main';
|
import jobResults from './job-results/main';
|
||||||
import jobSubmission from './job-submission/main';
|
import jobSubmission from './job-submission/main';
|
||||||
@@ -119,7 +118,6 @@ var tower = angular.module('Tower', [
|
|||||||
login.name,
|
login.name,
|
||||||
activityStream.name,
|
activityStream.name,
|
||||||
footer.name,
|
footer.name,
|
||||||
jobDetail.name,
|
|
||||||
workflowResults.name,
|
workflowResults.name,
|
||||||
jobResults.name,
|
jobResults.name,
|
||||||
jobSubmission.name,
|
jobSubmission.name,
|
||||||
|
|||||||
@@ -6,48 +6,32 @@
|
|||||||
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
['$stateParams', '$scope', '$state', 'Wait', 'jobResultsService', 'hostEvent', 'hostResults',
|
['$stateParams', '$scope', '$state', 'Wait', 'jobResultsService', 'hostEvent',
|
||||||
function($stateParams, $scope, $state, Wait, jobResultsService, hostEvent, hostResults){
|
function($stateParams, $scope, $state, Wait, jobResultsService, hostEvent){
|
||||||
|
|
||||||
$scope.processEventStatus = jobResultsService.processEventStatus;
|
$scope.processEventStatus = jobResultsService.processEventStatus;
|
||||||
$scope.hostResults = [];
|
|
||||||
// Avoid rendering objects in the details fieldset
|
|
||||||
// ng-if="processResults(value)" via host-event-details.partial.html
|
|
||||||
$scope.processResults = function(value){
|
$scope.processResults = function(value){
|
||||||
if (typeof value === 'object'){return false;}
|
if (typeof value === 'object'){return false;}
|
||||||
else {return true;}
|
else {return true;}
|
||||||
};
|
};
|
||||||
$scope.isStdOut = function(){
|
|
||||||
if ($state.current.name === 'jobDetail.host-event.stdout' || $state.current.name === 'jobDetail.host-event.stderr'){
|
|
||||||
return 'StandardOut-preContainer StandardOut-preContent';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
/*ignore jslint start*/
|
|
||||||
var initCodeMirror = function(el, data, mode){
|
var initCodeMirror = function(el, data, mode){
|
||||||
var container = document.getElementById(el);
|
var container = document.getElementById(el);
|
||||||
var editor = CodeMirror.fromTextArea(container, { // jshint ignore:line
|
var editor = CodeMirror.fromTextArea(container, {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
mode: mode
|
mode: mode
|
||||||
});
|
});
|
||||||
editor.setSize("100%", 200);
|
editor.setSize("100%", 200);
|
||||||
editor.getDoc().setValue(data);
|
editor.getDoc().setValue(data);
|
||||||
};
|
};
|
||||||
/*ignore jslint end*/
|
|
||||||
$scope.isActiveState = function(name){
|
$scope.isActiveState = function(name){
|
||||||
return $state.current.name === name;
|
return $state.current.name === name;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.getActiveHostIndex = function(){
|
|
||||||
var result = $scope.hostResults.filter(function( obj ) {
|
|
||||||
return obj.id === $scope.event.id;
|
|
||||||
});
|
|
||||||
return $scope.hostResults.indexOf(result[0]);
|
|
||||||
};
|
|
||||||
|
|
||||||
var init = function(){
|
var init = function(){
|
||||||
hostEvent.event_name = hostEvent.event;
|
hostEvent.event_name = hostEvent.event;
|
||||||
$scope.event = _.cloneDeep(hostEvent);
|
$scope.event = _.cloneDeep(hostEvent);
|
||||||
$scope.hostResults = hostResults;
|
|
||||||
|
|
||||||
// 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
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ var hostEventModal = {
|
|||||||
id: $stateParams.eventId
|
id: $stateParams.eventId
|
||||||
}).then(function(res) {
|
}).then(function(res) {
|
||||||
return res.data.results[0]; });
|
return res.data.results[0]; });
|
||||||
}],
|
|
||||||
hostResults: ['jobResultsService', '$stateParams', function(jobResultsService, $stateParams) {
|
|
||||||
return jobResultsService.getJobEventChildren($stateParams.taskId).then(res => res.data.results);
|
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
onExit: function() {
|
onExit: function() {
|
||||||
|
|||||||
@@ -247,19 +247,6 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
|
|||||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getJobEventChildren: function(id){
|
|
||||||
var url = GetBasePath('job_events');
|
|
||||||
url = url + id + '/children/?order_by=host_name';
|
|
||||||
Rest.setUrl(url);
|
|
||||||
return Rest.get()
|
|
||||||
.success(function(data){
|
|
||||||
return data;
|
|
||||||
})
|
|
||||||
.error(function(data, status) {
|
|
||||||
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!',
|
|
||||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
|
||||||
});
|
|
||||||
},
|
|
||||||
stringifyParams: function(params){
|
stringifyParams: function(params){
|
||||||
return _.reduce(params, (result, value, key) => {
|
return _.reduce(params, (result, value, key) => {
|
||||||
return result + key + '=' + value + '&';
|
return result + key + '=' + value + '&';
|
||||||
|
|||||||
Reference in New Issue
Block a user