security/acme-client: hide params for restart actions when not selected

This commit is contained in:
Frank Wall
2017-03-21 15:05:24 +01:00
parent 664ec700dc
commit f65be49484
2 changed files with 25 additions and 1 deletions
@@ -24,19 +24,27 @@
<help>Pre-defined commands for this restart action.</help>
</field>
<field>
<label>Optional Parameters</label>
<label>Required Parameters</label>
<type>header</type>
<style>method_table method_table_configd</style>
</field>
<field>
<id>action.configd</id>
<label>System Command</label>
<type>dropdown</type>
<help>Select a pre-defined system command which should be run for this action.</help>
<style>table_optional table_optional_configd</style>
</field>
<field>
<label>Required Parameters</label>
<type>header</type>
<style>method_table method_table_custom</style>
</field>
<field>
<id>action.custom</id>
<label>Custom Command</label>
<type>textbox</type>
<help>Specify a custom commands which should be run for this action.</help>
<style>table_optional table_optional_custom</style>
</field>
</form>
@@ -48,6 +48,22 @@ POSSIBILITY OF SUCH DAMAGE.
}
);
// hook into on-show event for dialog to extend layout.
$('#DialogAction').on('shown.bs.modal', function (e) {
$("#action\\.type").change(function(){
var service_id = 'table_optional_' + $(this).val();
$(".table_optional").hide();
if (($("#action\\.type").val() == 'configd') || ($("#action\\.type").val() == 'custom')) {
$("."+service_id).show();
} else {
}
});
$("#action\\.type").change(function(){
$(".method_table").hide();
$(".method_table_"+$(this).val()).show();
});
$("#action\\.type").change();
})
});
</script>