mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
removing reload call when a job ends from the socket listener
on the job results page
This commit is contained in:
@@ -459,7 +459,11 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
|
||||
data.status === "error" ||
|
||||
data.status === "canceled") {
|
||||
clearInterval(elapsedInterval);
|
||||
$state.go('.', null, { reload: true });
|
||||
// When the fob is finished retrieve the job data to
|
||||
// correct anything that was out of sync from the job run
|
||||
jobResultsService.getJobData($scope.job.id).then(function(data){
|
||||
$scope.job = data;
|
||||
})
|
||||
}
|
||||
} else if (parseInt(data.project_id, 10) ===
|
||||
parseInt($scope.job.project,10)) {
|
||||
|
||||
@@ -34,26 +34,8 @@ export default {
|
||||
},
|
||||
resolve: {
|
||||
// the GET for the particular job
|
||||
jobData: ['Rest', 'GetBasePath', '$stateParams', '$q', '$state', 'Alert', function(Rest, GetBasePath, $stateParams, $q, $state, Alert) {
|
||||
var val = $q.defer();
|
||||
|
||||
Rest.setUrl(GetBasePath('jobs') + $stateParams.id);
|
||||
Rest.get()
|
||||
.then(function(data) {
|
||||
val.resolve(data.data);
|
||||
}, function(data) {
|
||||
val.reject(data);
|
||||
|
||||
if (data.status === 404) {
|
||||
Alert('Job Not Found', 'Cannot find job.', 'alert-info');
|
||||
} else if (data.status === 403) {
|
||||
Alert('Insufficient Permissions', 'You do not have permission to view this job.', 'alert-info');
|
||||
}
|
||||
|
||||
$state.go('jobs');
|
||||
});
|
||||
|
||||
return val.promise;
|
||||
jobData: ['Rest', 'GetBasePath', '$stateParams', '$q', '$state', 'Alert', 'jobResultsService', function(Rest, GetBasePath, $stateParams, $q, $state, Alert, jobResultsService) {
|
||||
return jobResultsService.getJobData($stateParams.id);
|
||||
}],
|
||||
Dataset: ['QuerySet', '$stateParams', 'jobData',
|
||||
function(qs, $stateParams, jobData) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*************************************************/
|
||||
|
||||
|
||||
export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErrors', 'InitiatePlaybookRun', function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybookRun) {
|
||||
export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErrors', 'InitiatePlaybookRun', 'GetBasePath', function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybookRun, GetBasePath) {
|
||||
var val = {
|
||||
// the playbook_on_stats event returns the count data in a weird format.
|
||||
// format to what we need!
|
||||
@@ -191,6 +191,27 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
|
||||
relaunchJob: function(scope) {
|
||||
InitiatePlaybookRun({ scope: scope, id: scope.job.id,
|
||||
relaunch: true });
|
||||
},
|
||||
getJobData: function(id){
|
||||
var val = $q.defer();
|
||||
|
||||
Rest.setUrl(GetBasePath('jobs') + id );
|
||||
Rest.get()
|
||||
.then(function(data) {
|
||||
val.resolve(data.data);
|
||||
}, function(data) {
|
||||
val.reject(data);
|
||||
|
||||
if (data.status === 404) {
|
||||
Alert('Job Not Found', 'Cannot find job.', 'alert-info');
|
||||
} else if (data.status === 403) {
|
||||
Alert('Insufficient Permissions', 'You do not have permission to view this job.', 'alert-info');
|
||||
}
|
||||
|
||||
$state.go('jobs');
|
||||
});
|
||||
|
||||
return val.promise;
|
||||
}
|
||||
};
|
||||
return val;
|
||||
|
||||
Reference in New Issue
Block a user