mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
index.cgi: Show WireGuard status using the function library
commit c29a07b2ee505811a6cd78ca643bf816beb77375
Author: Michael Tremer <michael.tremer@ipfire.org>
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 <michael.tremer@ipfire.org>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
@@ -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()) {
|
||||
<a href='/cgi-bin/firewall.cgi' style='color:white'><b>$Lang::tr{'dmz'}</b></a>
|
||||
</td>
|
||||
<td style='width:30%; text-align:center;'>$netsettings{'ORANGE_ADDRESS'}/$sub</td>
|
||||
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
|
||||
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
|
||||
</tr>
|
||||
END
|
||||
}
|
||||
@@ -354,7 +355,7 @@ print<<END;
|
||||
<a href='/cgi-bin/vpnmain.cgi' style='color:white'><b>$Lang::tr{'ipsec'}</b></a>
|
||||
</td>
|
||||
<td style='width:30%; text-align:center;'></td>
|
||||
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
|
||||
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
|
||||
</tr>
|
||||
END
|
||||
}
|
||||
@@ -375,10 +376,26 @@ print <<END;
|
||||
<a href='/cgi-bin/ovpnmain.cgi' style='color:white'><b>OpenVPN</b></a>
|
||||
</td>
|
||||
<td style='width:30%; text-align:center;'>$ovpnip</td>
|
||||
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
|
||||
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
|
||||
</tr>
|
||||
END
|
||||
}
|
||||
}
|
||||
|
||||
# Show WireGuard status
|
||||
if (&Wireguard::is_enabled()) {
|
||||
my $network = $Wireguard::settings{'CLIENT_POOL'};
|
||||
|
||||
print<<END;
|
||||
<tr>
|
||||
<td style='width:25%; text-align:center; background-color:$Header::colourwg;'>
|
||||
<a href='/cgi-bin/wireguard.cgi' style='color:white'><b>$Lang::tr{'wireguard'}</b></a>
|
||||
</td>
|
||||
<td style='width:30%; text-align:center;'>$network</td>
|
||||
<td style='width:45%; text-align:center; color:$Header::colourgreen;'>$Lang::tr{'online'}</td>
|
||||
</tr>
|
||||
END
|
||||
}
|
||||
|
||||
print"</table>";
|
||||
&Header::closebox();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user