From a387c1ff86f48a081f8cda2367787c0c2ddecf85 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 1 Nov 2021 23:44:45 +0100 Subject: [PATCH] net/haproxy: show hints after every config change, refs #2590 --- net/haproxy/pkg-descr | 2 + .../mvc/app/views/OPNsense/HAProxy/index.volt | 162 +++++------------- 2 files changed, 49 insertions(+), 115 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index b611a0698..1b3e21cd3 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -11,6 +11,7 @@ Plugin Changelog Added: * add options "preload" and "filename scheme" to Lua scripts (#2265) * add syslog-ng socket for logging (#2620) +* show hint to apply changes after every config change (#2590) Fixed: * unable to use the "require" function in Lua scripts (#2265) @@ -18,6 +19,7 @@ Fixed: Changed: * set "lua-prepend-path" so that Lua scripts can be found (#2265) +* show "apply" and "test syntax" buttons on introduction pages 3.6 diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index 51f40d96a..07a4ffe54 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -300,7 +300,6 @@ POSSIBILITY OF SUCH DAMAGE. $("#healthcheck\\.type").change(function(){ var service_id = 'table_' + $(this).val(); $(".type_table").hide(); - // $(".table_"+$(this).val()).show(); $("."+service_id).show(); }); $("#healthcheck\\.type").change(); @@ -517,15 +516,35 @@ POSSIBILITY OF SUCH DAMAGE. }); }); } - //}); }); }); }); }); + // show hint after every config change + function add_apply_reminder() { + hint_msg = "{{ lang._('After changing settings, please remember to apply them with the button below') }}" + $('[id*="haproxyChangeMessage"]').each(function(){ + $(this).append(hint_msg); + }); + + }; + add_apply_reminder(); + + // show or hide the correct buttons depending on which tab is shown + // NOTE: This does not work on already shown tabs, so this event must + // fire first. + $('.nav-tabs a').on('show.bs.tab', function (e) { + if (/^\#general/.test(e.target.hash)) { + $("#haproxyCommonButtons").hide(); + } else { + $("#haproxyCommonButtons").show(); + } + }); + // update history on tab state and implement navigation - if(window.location.hash != "") { + if (window.location.hash != "") { $('a[href="' + window.location.hash + '"]').click() } $('.nav-tabs a').on('shown.bs.tab', function (e) { @@ -745,7 +764,7 @@ POSSIBILITY OF SUCH DAMAGE.
- +
@@ -768,17 +787,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Enabled') }}
-
-
- - -
-
-
- +
@@ -801,17 +813,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Enabled') }}
-
-
- - -
-
-
- +
@@ -837,17 +842,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Enabled') }}
-
-
- - -
-
-
- +
@@ -869,17 +867,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Health Monitor ID') }}
-
-
- - -
-
-
- +
@@ -901,17 +892,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Rule ID') }}
-
-
- - -
-
-
- +
@@ -933,17 +917,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Condition ID') }}
-
-
- - -
-
-
- +
@@ -966,17 +943,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Enabled') }}
-
-
- - -
-
-
- +
@@ -999,17 +969,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Enabled') }}
-
-
- - -
-
-
- +
@@ -1032,17 +995,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Enabled') }}
-
-
- - -
-
-
- +
@@ -1064,17 +1020,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Error Message ID') }}
-
-
- - -
-
-
- +
@@ -1096,17 +1045,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Map File ID') }}
-
-
- - -
-
-
- +
@@ -1131,17 +1073,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('CPU Rule ID') }}
-
-
- - -
-
-
- +
@@ -1164,17 +1099,10 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Resolver ID') }}
-
-
- - -
-
-
- +
@@ -1198,13 +1126,6 @@ POSSIBILITY OF SUCH DAMAGE.
{{ lang._('Mailer ID') }}
-
-
- - -
-
-
@@ -1284,6 +1205,17 @@ POSSIBILITY OF SUCH DAMAGE. + + + + {# include dialogs #}