diff --git a/app/js/custom.js b/app/js/custom.js index 7ad6b166..b2214c9c 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -368,6 +368,7 @@ window.addEventListener('load', function() { // Loop over them and prevent submission var validation = Array.prototype.filter.call(forms, function(form) { form.addEventListener('submit', function(event) { + //console.log(event.submitter); if (form.checkValidity() === false) { event.preventDefault(); event.stopPropagation(); diff --git a/config/defaults.json b/config/defaults.json index 69993673..faab15b6 100644 --- a/config/defaults.json +++ b/config/defaults.json @@ -44,7 +44,7 @@ }, "peer": { "Address": [ "10.8.1.2/24" ], - "Endpoint": [ "10.8.2.1" ], + "Endpoint": [ "10.8.2.1:51820" ], "ListenPort": [ "21841" ], "AllowedIPs": ["10.8.2.0/24"], "PersistentKeepalive": [ "15" ] diff --git a/includes/wireguard.php b/includes/wireguard.php index 86665a48..b0d0aacd 100644 --- a/includes/wireguard.php +++ b/includes/wireguard.php @@ -44,6 +44,9 @@ function DisplayWireGuardConfig() $wg_pendpoint = ($conf['Endpoint'] == '') ? getDefaultNetValue('wireguard','peer','Endpoint') : $conf['Endpoint']; $wg_pallowedips = ($conf['AllowedIPs'] == '') ? getDefaultNetValue('wireguard','peer','AllowedIPs') : $conf['AllowedIPs']; $wg_pkeepalive = ($conf['PersistentKeepalive'] == '') ? getDefaultNetValue('wireguard','peer','PersistentKeepalive') : $conf['PersistentKeepalive']; + if (sizeof($conf) >0) { + $wg_penabled = true; + } // fetch service status exec('pidof wg-crypt-wg0 | wc -l', $wgstatus); @@ -56,12 +59,12 @@ function DisplayWireGuardConfig() "wg_state", "serviceStatus", "wg_log", - "endpoint_enable", "peer_id", "wg_srvpubkey", "wg_srvport", "wg_srvipaddress", "wg_srvdns", + "wg_penabled", "wg_pipaddress", "wg_plistenport", "wg_peerpubkey", diff --git a/templates/wg/general.php b/templates/wg/general.php index 51eb5309..b3235e88 100644 --- a/templates/wg/general.php +++ b/templates/wg/general.php @@ -19,7 +19,7 @@