mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 17:07:36 -02: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 === "error" ||
|
||||||
data.status === "canceled") {
|
data.status === "canceled") {
|
||||||
clearInterval(elapsedInterval);
|
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) ===
|
} else if (parseInt(data.project_id, 10) ===
|
||||||
parseInt($scope.job.project,10)) {
|
parseInt($scope.job.project,10)) {
|
||||||
|
|||||||
@@ -34,26 +34,8 @@ export default {
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
// the GET for the particular job
|
// the GET for the particular job
|
||||||
jobData: ['Rest', 'GetBasePath', '$stateParams', '$q', '$state', 'Alert', function(Rest, GetBasePath, $stateParams, $q, $state, Alert) {
|
jobData: ['Rest', 'GetBasePath', '$stateParams', '$q', '$state', 'Alert', 'jobResultsService', function(Rest, GetBasePath, $stateParams, $q, $state, Alert, jobResultsService) {
|
||||||
var val = $q.defer();
|
return jobResultsService.getJobData($stateParams.id);
|
||||||
|
|
||||||
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;
|
|
||||||
}],
|
}],
|
||||||
Dataset: ['QuerySet', '$stateParams', 'jobData',
|
Dataset: ['QuerySet', '$stateParams', 'jobData',
|
||||||
function(qs, $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 = {
|
var val = {
|
||||||
// the playbook_on_stats event returns the count data in a weird format.
|
// the playbook_on_stats event returns the count data in a weird format.
|
||||||
// format to what we need!
|
// format to what we need!
|
||||||
@@ -191,6 +191,27 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
|
|||||||
relaunchJob: function(scope) {
|
relaunchJob: function(scope) {
|
||||||
InitiatePlaybookRun({ scope: scope, id: scope.job.id,
|
InitiatePlaybookRun({ scope: scope, id: scope.job.id,
|
||||||
relaunch: true });
|
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;
|
return val;
|
||||||
|
|||||||
Reference in New Issue
Block a user