![]()
A minor change to the wireguard.cgi code could improve the readability of the connection table?
1.Adding a “Type” column:
Insert code
<th width='10%'>
$Lang::tr{'type'}
</th>
to
<table class='tbl'>
<tr>
<th width='15%'>
$Lang::tr{'name'}
</th>
<th width='10%'>
$Lang::tr{'type'}
</th>
<th>
$Lang::tr{'remark'}
</th>
<th width='20%' colspan='2'>
$Lang::tr{'status'}
</th>
<th width='10%' colspan='3'>
$Lang::tr{'action'}
</th>
</tr>
Insert code
<td align='center'>
$type
</td>
to
<th scope="row" title="${pubkey}">
$name
</th>
<td align='center'>
$type
</td>
<td>
$remarks
</td>
2.Change the sort order by Type and Name:
foreach my $key (sort { $Wireguard::peers{$a}[2] cmp $Wireguard::peers{$b}[2] } keys %Wireguard::peers) {
to
foreach my $key (sort { $Wireguard::peers{$a}[1] cmp $Wireguard::peers{$b}[1] || $Wireguard::peers{$a}[2] cmp $Wireguard::peers{$b}[2] } keys %Wireguard::peers) {
The effect below
Best regards
