mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-23 16:31:50 -05:00
Job detail page now working. Form generator now supports 2 column layout and a status fields section.
This commit is contained in:
@@ -136,8 +136,7 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
||||
}
|
||||
|
||||
function postJob(data) {
|
||||
// Once we have a credential and all required passwords, use this
|
||||
// to create and start a job
|
||||
// Create the job record
|
||||
(scope.credentialWatchRemove) ? scope.credentialWatchRemove() : null;
|
||||
var dt = new Date().toISOString();
|
||||
Rest.setUrl(data.related.jobs);
|
||||
@@ -155,17 +154,31 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
||||
extra_vars: data.extra_vars
|
||||
})
|
||||
.success( function(data, status, headers, config) {
|
||||
// Prompt for passwords and start the job
|
||||
PromptPasswords({
|
||||
scope: scope,
|
||||
passwords: data.passwords_needed_to_start,
|
||||
start_url: data.related.start
|
||||
});
|
||||
})
|
||||
if (data.passwords_needed_to_start.length > 0) {
|
||||
// Passwords needed. Prompt for passwords, then start job.
|
||||
PromptPasswords({
|
||||
scope: scope,
|
||||
passwords: data.passwords_needed_to_start,
|
||||
start_url: data.related.start
|
||||
});
|
||||
}
|
||||
else {
|
||||
// No passwords needed, start the job!
|
||||
Rest.setUrl(data.related.start);
|
||||
Rest.post()
|
||||
.success( function(data, status, headers, config) {
|
||||
$location.path(GetBasePath('jobs'));
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Failed to start job. POST returned status: ' + status });
|
||||
});
|
||||
}
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Failed to create job. POST returned status: ' + status });
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
scope.submitJob = function(id) {
|
||||
|
||||
Reference in New Issue
Block a user