diff --git a/app/js/custom.js b/app/js/custom.js index b834aa30..4ba0436b 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -291,7 +291,7 @@ $('#ovpn-confirm-delete').on('show.bs.modal', function (e) { }); $('#ovpn-confirm-activate').on('click', '.btn-activate', function (e) { - var cfg_id = $(this).data('recordId'); + var cfg_id = $(this).data('record-id'); $.post('ajax/openvpn/activate_ovpncfg.php',{'cfg_id':cfg_id},function(data){ jsonData = JSON.parse(data); $("#ovpn-confirm-activate").modal('hide'); diff --git a/includes/openvpn.php b/includes/openvpn.php index 711c1c45..67084df4 100755 --- a/includes/openvpn.php +++ b/includes/openvpn.php @@ -54,6 +54,8 @@ function DisplayOpenVPNConfig() $authPassword = next($auth); } $clients = preg_grep('/_client.(conf)$/', scandir(pathinfo(RASPI_OPENVPN_CLIENT_CONFIG, PATHINFO_DIRNAME))); + exec("readlink ".RASPI_OPENVPN_CLIENT_CONFIG." | xargs basename", $ret); + $conf_default = empty($ret) ? "none" : $ret[0]; $logEnable = 0; if (!empty($_POST) && !isset($_POST['log-openvpn'])) { @@ -79,7 +81,8 @@ function DisplayOpenVPNConfig() "public_ip", "authUser", "authPassword", - "clients" + "clients", + "conf_default" ) ); } diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php index dc624c63..c3e578ee 100644 --- a/templates/openvpn/configs.php +++ b/templates/openvpn/configs.php @@ -8,14 +8,14 @@

+ } + $label = preg_replace('/_client$/','',pathinfo($client, PATHINFO_FILENAME)); + $client = $label; + ?>