diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 1b3e21cd3..6ba357c23 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -12,6 +12,7 @@ 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) +* show warning for pending configuration changes (#2590) Fixed: * unable to use the "require" function in Lua scripts (#2265) 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 07a4ffe54..6aaf9cef2 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 @@ -356,6 +356,11 @@ POSSIBILITY OF SUCH DAMAGE. message: data['status'], draggable: true }); + } else { + // reload page to hide pending changes reminder + setTimeout(function () { + window.location.reload(true) + }, 300); } // when done, disable progress animation $('[id*="reconfigureAct_progress"]').each(function(){ @@ -509,6 +514,11 @@ POSSIBILITY OF SUCH DAMAGE. message: data['status'], draggable: true }); + } else { + // reload page to hide pending changes reminder + setTimeout(function () { + window.location.reload(true) + }, 300); } // when done, disable progress animation $('[id*="saveAndReconfigureAct_progress"]').each(function(){ @@ -522,9 +532,25 @@ POSSIBILITY OF SUCH DAMAGE. }); }); + /*********************************************************************** + * UI tricks + **********************************************************************/ + + // show reminder when config has pending changes + function pending_changes_reminder() { + ajaxCall(url="/api/haproxy/export/diff/", sendData={}, callback=function(data,status) { + if (data['response'] && data['response'].trim()) { + $("#haproxyPendingReminder").show(); + } else { + $("#haproxyPendingReminder").hide(); + } + }); + } + pending_changes_reminder(); + // 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') }}" + hint_msg = "{{ lang._('After changing settings, please remember to test and apply them with the buttons below.') }}" $('[id*="haproxyChangeMessage"]').each(function(){ $(this).append(hint_msg); }); @@ -1208,6 +1234,9 @@ POSSIBILITY OF SUCH DAMAGE.