Add per-service-option startup & executable

Also fixes display issue on front-end where users could see and edit
hidden settings
Fixes a bug in relation to #57
This commit is contained in:
Dane Everitt 2016-02-13 17:29:52 -05:00
parent 5678d643cd
commit a903ae313a
5 changed files with 150 additions and 84 deletions

View file

@ -362,9 +362,7 @@ $(document).ready(function () {
service: $('#getService').val()
}
}).done(function (data) {
$('#startupExec').html(data.exec);
$('input[name="startup"]').val(data.startup);
$.each(data.options, function (i, option) {
$.each(data, function (i, option) {
$('#getOption').append('<option value="' + option.id + '" data-image="' + option.docker_image + '">' + option.name + '</option>');
});
$('#getOption').parent().parent().removeClass('hidden');
@ -395,7 +393,9 @@ $(document).ready(function () {
option: $('#getOption').val()
}
}).done(function (data) {
$.each(data, function (i, item) {
$('#startupExec').html(data.exec);
$('input[name="startup"]').val(data.startup);
$.each(data.variables, function (i, item) {
var isRequired = (item.required === 1) ? '<span class="label label-primary">Required</span> ' : '';
var dataAppend = ' \
<div class="form-group col-md-12">\