diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index b601fd292..33d6d8717 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -243,7 +243,21 @@ my $lines = 0; print ""; -my $col=""; +my $col = "bgcolor='$color{'color20'}'"; + + print "\n"; + print "\n"; + + if ($cgiparams{'CONNECTION_NAME'}) { + print "\n"; + print "\n"; + print "\n"; + print "\n"; + } else { + print "\n"; while(my @row = $statement_handle->fetchrow_array()) { # Assign some nice to read variable names for the DB fields. @@ -253,23 +267,29 @@ while(my @row = $statement_handle->fetchrow_array()) { my $connection_bytes_recieved = &General::formatBytes($row[3]); my $connection_bytes_sent = &General::formatBytes($row[4]); - # Colorize columns. + # Colorize columns. if ($lines % 2) { - $col="bgcolor='$color{'color22'}'"; - } else { $col="bgcolor='$color{'color20'}'"; + } else { + $col="bgcolor='$color{'color22'}'"; } -print < - - - - - - -END -; + print "\n"; + print "\n"; + + if ($cgiparams{'CONNECTION_NAME'}) { + print "\n"; + print "\n"; + print "\n"; + print "\n"; + } else { + # Convert total connection time into human-readable format. + my $total_time = &General::format_time($row[1]); + + print "\n"; + } + + print "\n"; # Increase lines count. $lines++;
$Lang::tr{'ovpn connection name'}$Lang::tr{'connected'}$Lang::tr{'disconnected'}$Lang::tr{'recieved'}$Lang::tr{'sent'}$Lang::tr{'total connection time'}\n"; + } + + print "
$connection_name$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent
$connection_name$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent$total_time