Job detail page now working. Form generator now supports 2 column layout and a status fields section.

This commit is contained in:
chouseknecht
2013-05-19 18:55:13 -04:00
parent f409db7778
commit 6b881a58bf
12 changed files with 537 additions and 69 deletions

View File

@@ -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) {