Add certificate option to openvpn GUI

add JS code to display options and selected ovpn file
This commit is contained in:
Christian Zeitnitz
2021-03-27 10:29:09 +01:00
parent b2b19cd159
commit 720e6c3e77
4 changed files with 77 additions and 30 deletions

View File

@@ -8,11 +8,11 @@
</p>
<div class="openvpn-configs js-openvpn-configs-container">
<?php foreach ($clients as $client) :
if ($client == "login.conf") {
$label = file_get_meta(RASPI_OPENVPN_CLIENT_LOGIN,'#\sfilename\s(.*)');
if ($client == "client.conf") {
$label = file_get_meta(RASPI_OPENVPN_CLIENT_CONFIG,'#\sfilename\s(.*)');
$btn_class = "active";
} else {
$label = trim(pathinfo($client, PATHINFO_FILENAME), "_login");
$label = preg_replace('/_client$/','',pathinfo($client, PATHINFO_FILENAME));
$client = $label;
$btn_class = "disabled";
}?>