fixed errors in JobSubmission

This commit is contained in:
Jared Tabor
2014-10-03 20:25:44 -04:00
parent 2d3a5f5a65
commit 352cec7a37

View File

@@ -174,7 +174,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
callback = params.callback || 'PasswordsAccepted', callback = params.callback || 'PasswordsAccepted',
form = CredentialForm, form = CredentialForm,
acceptedPasswords = {}, acceptedPasswords = {},
fld, field, html; fld, field, html;
scope.passwords = params.passwords; scope.passwords = params.passwords;
// Wait('stop'); // Wait('stop');
@@ -643,16 +643,12 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
prompt_for_vars = false, prompt_for_vars = false,
passwords; passwords;
scope.job_template_id = id; scope.job_template_id = id;
if (base === 'job_templates') { if (base === 'job_templates') {
url = GetBasePath('job_templates') + id + '/launch/'; url = GetBasePath('job_templates') + id + '/launch/';
} }
else { else {
url = GetBasePath('jobs') + id + '/relaunch/'; url = GetBasePath('jobs') + id + '/relaunch/';
} }
//url += id + '/';
//url = GetBasePath('job_templates')+ id + '/launch/';
if (scope.removePostTheJob) { if (scope.removePostTheJob) {
@@ -813,9 +809,10 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
Rest.setUrl(url); Rest.setUrl(url);
Rest.get() Rest.get()
.success(function (data) { .success(function (data) {
// new_job_id = data.id; new_job_id = data.id;
launch_url = url;//data.related.start; launch_url = url;//data.related.start;
prompt_for_vars = data.ask_variables_on_launch; prompt_for_vars = data.ask_variables_on_launch;
extra_vars = data.variables_needed_to_start; extra_vars = data.variables_needed_to_start;
survey_enabled = data.survey_enabled; survey_enabled = data.survey_enabled;
// new_job = data; // new_job = data;
@@ -830,14 +827,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
else { else {
scope.$emit('StartPlaybookRun'); scope.$emit('StartPlaybookRun');
} }
// delete data.id;
// job_template = data;
// if (Empty(data.credential)) {
// scope.$emit('PromptForCredential');
// } else {
// // We have what we need, submit the job
// scope.$emit('PostTheJob');
// }
}) })
.error(function (data, status) { .error(function (data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',