From f65be494844fd30e76ad76272c050761ab9f3cd1 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 21 Mar 2017 15:05:24 +0100 Subject: [PATCH] security/acme-client: hide params for restart actions when not selected --- .../OPNsense/AcmeClient/forms/dialogAction.xml | 10 +++++++++- .../app/views/OPNsense/AcmeClient/actions.volt | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml index 51254439c..4dcfa42b4 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml @@ -24,19 +24,27 @@ Pre-defined commands for this restart action. - + header + action.configd dropdown Select a pre-defined system command which should be run for this action. + + + + + header + action.custom textbox Specify a custom commands which should be run for this action. + diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt index fbb8f54c5..034406368 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt @@ -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(); + }) });