security/acme-client: hide http service entries when not selected

This commit is contained in:
Frank Wall
2017-03-21 14:00:23 +01:00
parent 80243f294f
commit f3db0b507d
2 changed files with 12 additions and 17 deletions
@@ -37,7 +37,7 @@
<field>
<label>HTTP-01/OPNsense</label>
<type>header</type>
<style>method_table method_table_http01</style>
<style>table_http table_http_opnsense</style>
</field>
<field>
<id>validation.http_opn_autodiscovery</id>
@@ -63,7 +63,7 @@
<field>
<label>HTTP-01/HAProxy</label>
<type>header</type>
<style>method_table method_table_http01</style>
<style>table_http table_http_haproxy</style>
</field>
<field>
<id>validation.http_haproxyInject</id>
@@ -79,20 +79,6 @@
<allownew>true</allownew>
<help>Choose the local HAProxy frontends. They will automatically be configured to redirect acme challenges to the internal acme client. The HAProxy service will automatically be restarted if a certificate was renewed.</help>
</field>
<!--
<field>
<id>validation.http_relaydInject</id>
<label>Loadbalancer Config Injection</label>
<type>checkbox</type>
<help>Automatically inject config into the local Loadbalancer (relayd) to let it serve acme challanges without service interruption.</help>
</field>
<field>
<id>validation.http_relaydVserver</id>
<label>Loadbalancer Virtual Server</label>
<type>text</type>
<help>Choose the Virtual Server from the relayd Loadbalancer that should be configured to server acme challenges.</help>
</field>
-->
<field>
<label>DNS-01</label>
<type>header</type>
@@ -51,16 +51,25 @@ POSSIBILITY OF SUCH DAMAGE.
// hook into on-show event for dialog to extend layout.
$('#DialogValidation').on('shown.bs.modal', function (e) {
$("#validation\\.dns_service").change(function(){
var service_id = 'table_' + $(this).val() ;
var service_id = 'table_' + $(this).val();
$(".table_dns").hide();
if ($("#validation\\.method").val() == 'dns01') {
$("."+service_id).show();
}
});
$("#validation\\.http_service").change(function(){
var service_id = 'table_http_' + $(this).val();
$(".table_http").hide();
if ($("#validation\\.method").val() == 'http01') {
$("."+service_id).show();
} else {
}
});
$("#validation\\.method").change(function(){
$(".method_table").hide();
$(".method_table_"+$(this).val()).show();
$("#validation\\.dns_service").change();
$("#validation\\.http_service").change();
});
$("#validation\\.method").change();
})