From 9ae43dc1f8b14af6957893156eb8e3fc358d6ff3 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 10 Feb 2021 15:06:07 +0100 Subject: [PATCH] net/haproxy: add link to Config Diff page, fix direct tab links --- net/haproxy/pkg-descr | 1 + .../mvc/app/views/OPNsense/HAProxy/export.volt | 10 ++++++++++ .../mvc/app/views/OPNsense/HAProxy/index.volt | 2 +- .../mvc/app/views/OPNsense/HAProxy/statistics.volt | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 902dc499e..511582ebe 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -20,6 +20,7 @@ Added: Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') * prevent service outage by aborting "Apply" when configtest fails +* fix direct links to individual statistics tabs Changed: * change default SSL version to TLSv1.2 (ssl-min-ver) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt index ccfbb5f95..9b4d7d072 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt @@ -90,6 +90,16 @@ POSSIBILITY OF SUCH DAMAGE. }); }); + // update history on tab state and implement navigation + if(window.location.hash != "") { + $('a[href="' + window.location.hash + '"]').click() + } + $('.nav-tabs a').on('shown.bs.tab', function (e) { + history.pushState(null, null, e.target.hash); + }); + $(window).on('hashchange', function(e) { + $('a[href="' + window.location.hash + '"]').click() + }); }); 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 fe86bf89c..e9fa6c2e0 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 @@ -314,7 +314,7 @@ POSSIBILITY OF SUCH DAMAGE. BootstrapDialog.show({ type: BootstrapDialog.TYPE_DANGER, title: "{{ lang._('HAProxy configtest found critical errors') }}", - message: "{{ lang._('The HAProxy service may not be able to start due to critical errors. Run syntax check for further details.') }}", + message: "{{ lang._('The HAProxy service may not be able to start due to critical errors. Run syntax check for further details or review the changes in the %sConfiguration Diff%s.')|format('','') }}", buttons: [{ icon: 'fa fa-trash-o', label: '{{ lang._('Abort') }}', diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt index 52be520da..1f2c4085d 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt @@ -157,6 +157,17 @@ POSSIBILITY OF SUCH DAMAGE. $("#update-status").click(); $("#update-counters").click(); $("#update-tables").click(); + + // update history on tab state and implement navigation + if(window.location.hash != "") { + $('a[href="' + window.location.hash + '"]').click() + } + $('.nav-tabs a').on('shown.bs.tab', function (e) { + history.pushState(null, null, e.target.hash); + }); + $(window).on('hashchange', function(e) { + $('a[href="' + window.location.hash + '"]').click() + }); });