Add custom options in General Settings/Default Parameters

This commit is contained in:
Manus Freedom
2016-06-07 22:50:25 +02:00
parent 6b9cadab8e
commit 6ed7455d9b
3 changed files with 16 additions and 0 deletions
@@ -118,6 +118,13 @@
<type>dropdown</type>
<help><![CDATA[Enable or disable session redistribution in case of connection failure.]]></help>
</field>
<field>
<id>haproxy.general.defaults.customOptions</id>
<label>Custom options</label>
<type>textbox</type>
<help><![CDATA[These lines will be added to the defaults settings of to the HAProxy configuration file.<br/><div class="text-info"><b>NOTE:</b> The syntax will not be checked, use at your own risk!</div>]]></help>
<advanced>true</advanced>
</field>
</subtab>
<subtab id="haproxy-general-logging" description="Logging Configuration">
<field>
@@ -114,6 +114,9 @@
<x-3>redispatch on the 3rd retry prior to the last retry</x-3>
</OptionValues>
</redispatch>
<customOptions type="TextField">
<Required>N</Required>
</customOptions>
</defaults>
<logging>
<host type="TextField">
@@ -523,6 +523,12 @@ defaults
{% if OPNsense.HAProxy.general.defaults.retries|default("") != "" %}
retries {{OPNsense.HAProxy.general.defaults.retries}}
{% endif %}
{% if OPNsense.HAProxy.general.defaults.customOptions|default("") != "" %}
# WARNING: pass through options below this line
{% for customOpt in OPNsense.HAProxy.general.defaults.customOptions.split("\n") %}
{{customOpt}}
{% endfor %}
{% endif %}
{% endif %}
{# ############################### #}