From be03af656dd2a0094bc3e0baf9ee088889e48248 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Wed, 21 May 2025 16:39:23 -0700 Subject: [PATCH] fix: enhance layout consistency in WG0.page, WGX.page, and WG0.css - Updated layout structure in WG0.page and WGX.page by wrapping elements in spans for improved visual consistency. - Adjusted CSS in WG0.css to streamline styles and enhance layout consistency across the plugin. - This change continues the effort to enhance visual structure across the plugin. --- emhttp/plugins/dynamix/WG0.page | 268 +++++++++++------- emhttp/plugins/dynamix/WGX.page | 247 ++++++++++------ emhttp/plugins/dynamix/sheets/WG0.css | 84 +----- .../plugins/dynamix/styles/default-base.css | 112 +++++++- 4 files changed, 446 insertions(+), 265 deletions(-) diff --git a/emhttp/plugins/dynamix/WG0.page b/emhttp/plugins/dynamix/WG0.page index 798bb9ac4..23d2e3b58 100644 --- a/emhttp/plugins/dynamix/WG0.page +++ b/emhttp/plugins/dynamix/WG0.page @@ -503,6 +503,7 @@ function clearTunnel(vtun) { } function addTunnel() { + console.log('addTunnel'); $.post('/webGui/include/update.wireguard.php',{'#cmd':'addtunnel','#name':''},function(){refresh();}); } @@ -1048,20 +1049,20 @@ function getPublicIP(ip,wg,protocol) { var ext_ipv6 = ips[3]; if ((protocol==''||protocol=='46') && ext_ipv4 && ip) { if (!wgx_ipv4) { - if (!wgx_ipv6) $('#endpoint4-'+wg).html("
 
_(Remark)_: _(The Local endpoint does not resolve to an IPv4 address)_. _(In most cases, this should be your public WAN IPv4)_: "+ext_ipv4+"
\n").show(); + if (!wgx_ipv6) $('#endpoint4-'+wg).html("
 
_(Remark)_: _(The Local endpoint does not resolve to an IPv4 address)_. _(In most cases, this should be your public WAN IPv4)_: "+ext_ipv4+"
\n").show(); } else if (wgx_ipv4 != ext_ipv4) { - $('#endpoint4-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv4+". _(In most cases, this should be your public WAN IPv4 instead)_: "+ext_ipv4+"
\n").show(); + $('#endpoint4-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv4+". _(In most cases, this should be your public WAN IPv4 instead)_: "+ext_ipv4+"
\n").show(); } else if (endpoints.includes(wgx_ipv4) && isPublic(wgx_ipv4)) { - $('#endpoint4-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv4+". _(Your Unraid Server is reachable from the internet)_
\n").show(); + $('#endpoint4-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv4+". _(Your Unraid Server is reachable from the internet)_
\n").show(); } } if ((protocol=='6'||protocol=='46') && ext_ipv6 && ip) { if (!wgx_ipv6) { - if (!wgx_ipv4) $('#endpoint6-'+wg).html("
 
_(Remark)_: _(The Local endpoint does not resolve to an IPv6 address)_. _(In most cases, this should be your public WAN IPv6)_: "+ext_ipv6+"
\n").show(); + if (!wgx_ipv4) $('#endpoint6-'+wg).html("
 
_(Remark)_: _(The Local endpoint does not resolve to an IPv6 address)_. _(In most cases, this should be your public WAN IPv6)_: "+ext_ipv6+"
\n").show(); } else if (wgx_ipv6 != ext_ipv6) { - $('#endpoint6-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv6+". _(In most cases, this should be your public WAN IPv6 instead)_: "+ext_ipv6+"
\n").show(); + $('#endpoint6-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv6+". _(In most cases, this should be your public WAN IPv6 instead)_: "+ext_ipv6+"
\n").show(); } else if (endpoints.includes(wgx_ipv6)) { - $('#endpoint6-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv6+". _(Your Unraid Server is reachable from the internet)_
\n").show(); + $('#endpoint6-'+wg).html("
 
_(Remark)_: _(The Local endpoint resolves to)_ "+wgx_ipv6+". _(Your Unraid Server is reachable from the internet)_
\n").show(); } } @@ -1111,14 +1112,16 @@ statistics.on('message', function(data) { $(function(){ var form = $(document.wg0); - var ctrl = ""; - ctrl += "_(Autostart)_>"; - ctrl += ""; - ctrl += ""; + var ctrl = ""; + ctrl += "_(Autostart)_>"; + ctrl += ""; + ctrl += ""; + ctrl += ""; + ctrl += ""; statistics.start(); getPublicIP($('#endpoint-wg0').val(),'wg0',$('#protocol-wg0').val()); - $('div.content').prepend('
>
'); - $('div.title').eq(0).find('span.left').append(ctrl); + $('div.content').prepend('
"WireGuard" and the "WireGuard" logo are registered trademarks of Jason A. Donenfeld
>
'); + $('div.title').eq(0).find('.right').append(ctrl); $.post('/webGui/include/update.wireguard.php',{'#cmd':'upnp','#gw':"",'#link':""},function(url){ if (url) { $('div.upnp').show(); @@ -1265,30 +1268,40 @@ $(function(){ + _(Local name)_: -: " pattern="" title="_(Use only letters A-Z, digits or space,dash,underscore)_" placeholder="(_(optional)_)"> - - - +: + " pattern="" title="_(Use only letters A-Z, digits or space,dash,underscore)_" placeholder="(_(optional)_)"> + + + + + + :wg_local_name_help: -