From 5ea3369a44e0daf992ed113fdc3f16a944ff129f Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Fri, 4 Jul 2025 03:48:54 +0000 Subject: [PATCH] index.cgi: Show WireGuard status using the function library commit c29a07b2ee505811a6cd78ca643bf816beb77375 Author: Michael Tremer Date: Mon May 26 11:38:57 2025 +0200 index.cgi: Show WireGuard status using the function library The settings file is also loaded all the time and we don't need to load it again. Signed-off-by: Michael Tremer Signed-off-by: Vincent Li --- html/cgi-bin/index.cgi | 25 +++++++++++++++++++++---- langs/en/cgi-bin/en.pl | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi index 5f80b352f..c75dd733f 100644 --- a/html/cgi-bin/index.cgi +++ b/html/cgi-bin/index.cgi @@ -30,6 +30,7 @@ use Sort::Naturally; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; +require "${General::swroot}/wireguard-functions.pl"; require "/opt/pakfire/lib/functions.pl"; my %cgiparams=(); @@ -342,7 +343,7 @@ if (&Header::orange_used()) { $Lang::tr{'dmz'} $netsettings{'ORANGE_ADDRESS'}/$sub - Online + $Lang::tr{'online'} END } @@ -354,7 +355,7 @@ print<$Lang::tr{'ipsec'} - Online + $Lang::tr{'online'} END } @@ -375,10 +376,26 @@ print <OpenVPN $ovpnip - Online + $Lang::tr{'online'} END - } +} + +# Show WireGuard status +if (&Wireguard::is_enabled()) { + my $network = $Wireguard::settings{'CLIENT_POOL'}; + + print< + + $Lang::tr{'wireguard'} + + $network + $Lang::tr{'online'} + +END +} + print""; &Header::closebox(); diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 660efb679..ba7ebc85f 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1985,6 +1985,7 @@ 'one month' => 'One Month', 'one week' => 'One Week', 'one year' => 'One Year', +'online' => 'Online', 'online help en' => 'Online help (in english)', 'only digits allowed in holdoff field' => 'Only digits allowed in holdoff field', 'only digits allowed in max retries field' => 'Only digits allowed in max retries field.',