diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat
index 002a393ad..2009990ec 100755
--- a/html/cgi-bin/logs.cgi/ovpnclients.dat
+++ b/html/cgi-bin/logs.cgi/ovpnclients.dat
@@ -128,7 +128,8 @@ my $database_query = qq(
if ($cgiparams{'CONNECTION_NAME'}) {
$database_query = qq(
- SELECT common_name, DATETIME(connected_at, 'localtime'), DATETIME(disconnected_at, 'localtime'), bytes_received, bytes_sent FROM sessions
+ SELECT common_name, DATETIME(connected_at, 'localtime'), DATETIME(disconnected_at, 'localtime'), bytes_received, bytes_sent,
+ STRFTIME('%s', DATETIME(disconnected_at)) - STRFTIME('%s', DATETIME(connected_at)) AS duration FROM sessions
WHERE
common_name = '$cgiparams{"CONNECTION_NAME"}'
AND (
@@ -260,8 +261,9 @@ my $col = "bgcolor='$color{'color20'}'";
print "
$Lang::tr{'ovpn connection name'} | \n";
if ($cgiparams{'CONNECTION_NAME'}) {
- print "$Lang::tr{'connected'} | \n";
- print "$Lang::tr{'disconnected'} | \n";
+ print "$Lang::tr{'connected'} | \n";
+ print "$Lang::tr{'disconnected'} | \n";
+ print "$Lang::tr{'duration'} | \n";
print "$Lang::tr{'received'} | \n";
print "$Lang::tr{'sent'} | \n";
} else {
@@ -279,6 +281,7 @@ unless ($errormessage) {
my $connection_close_time = $row[2];
my $connection_bytes_recieved = &General::formatBytes($row[3]);
my $connection_bytes_sent = &General::formatBytes($row[4]);
+ my $duration = &General::format_time($row[5]);
# Colorize columns.
if ($lines % 2) {
@@ -291,8 +294,9 @@ unless ($errormessage) {
print "$connection_name | \n";
if ($cgiparams{'CONNECTION_NAME'}) {
- print "$connection_open_time | \n";
- print "$connection_close_time | \n";
+ print "$connection_open_time | \n";
+ print "$connection_close_time | \n";
+ print "$duration | \n";
print "$connection_bytes_recieved | \n";
print "$connection_bytes_sent | \n";
} else {
@@ -312,7 +316,7 @@ unless ($errormessage) {
# If nothing has been fetched, the amount of lines is still zero.
# In this case display a hint about no data.
unless ($lines) {
- print "| $Lang::tr{'no entries'} |
\n";
+ print "| $Lang::tr{'no entries'} |
\n";
}
print "
\n";