mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
security/acme-client: hide params for restart actions when not selected
This commit is contained in:
+9
-1
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user