From 7607fb8bee300c9196df79188e8dea4dd1a315c1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 18 Apr 2018 09:50:19 +0200 Subject: buildmaster/ssh-log.php: fix shown time interval --- buildmaster/ssh-log.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/buildmaster/ssh-log.php b/buildmaster/ssh-log.php index d293ebb..505cf22 100644 --- a/buildmaster/ssh-log.php +++ b/buildmaster/ssh-log.php @@ -2,6 +2,11 @@ include "lib/mysql.php"; + if (isset($_GET["from"])) + $min_time = $_GET["from"]; + else + $min_time = "00:42:00"; + $result = mysql_run_query( "SELECT `ssh_log`.`date`," . "`build_slaves`.`name`," . @@ -9,7 +14,10 @@ "`ssh_log`.`parameters`" . " FROM `ssh_log`" . " JOIN `build_slaves` ON `ssh_log`.`build_slave`=`build_slaves`.`id`" . - " WHERE TIMEDIFF(NOW(),`ssh_log`.`date`) < \"10:00\"" . + " WHERE TIMEDIFF((" . + // NOW() is wrong here - due to differing time zones O.o + "SELECT MAX(`l`.`date`) FROM `ssh_log` AS `l`" . + "),`ssh_log`.`date`) < from_base64(\"" . base64_encode( $min_time ) . "\")" . " ORDER BY `ssh_log`.`date` DESC" ); -- cgit v1.2.3-70-g09d2