summaryrefslogtreecommitdiff
path: root/buildmaster
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-18 12:28:21 +0200
committerErich Eckner <git@eckner.net>2018-04-18 12:28:21 +0200
commit892d959fc566cbac28aff63e2f5d8eb65870f361 (patch)
tree37e98e1d1e56fbb56ddc034cf863b9da66613095 /buildmaster
parent6cc8d2aca661d3c9217fc4c8b8b8a40ae5697f91 (diff)
downloadarchweb32-892d959fc566cbac28aff63e2f5d8eb65870f361.tar.xz
buildmaster/build-slaves.php: do not use last_connection
Diffstat (limited to 'buildmaster')
-rw-r--r--buildmaster/build-slaves.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/buildmaster/build-slaves.php b/buildmaster/build-slaves.php
index 73aa96a..2a2f592 100644
--- a/buildmaster/build-slaves.php
+++ b/buildmaster/build-slaves.php
@@ -7,10 +7,15 @@
" `build_slaves`.`name`," .
"`persons`.`name` AS `operator`," .
"`package_sources`.`pkgbase`," .
- "`build_slaves`.`last_connection`," .
+ "MAX(`ssh_log`.`date`" .
+ ") AS `lc`," .
+ "MAX(IF(`ssh_log`.`action`=\"get-assignment\",`ssh_log`.`date`,NULL)" .
+ ") AS `bs`," .
"`build_slaves`.`logged_lines`," .
"`build_slaves`.`last_action`" .
" FROM `build_slaves`" .
+ " LEFT JOIN `ssh_log` ON" .
+ " `ssh_log`.`build_slave`=`build_slaves`.`id`" .
" JOIN `ssh_keys` ON" .
" `build_slaves`.`ssh_key`=`ssh_keys`.`id`" .
" JOIN `persons` ON" .
@@ -19,7 +24,8 @@
" `build_slaves`.`currently_building`=`build_assignments`.`id`" .
" LEFT JOIN `package_sources` ON" .
" `build_assignments`.`package_source`=`package_sources`.`id`" .
- " ORDER BY `build_slaves`.`last_connection`"
+ " GROUP BY `build_slaves`.`id`" .
+ " ORDER BY `lc`"
);
?>
@@ -33,7 +39,7 @@ show_warning_on_offline_slave();
print "<table border=1>\n";
if ($result->num_rows > 0) {
- print "<tr><th>name</th><th>operator</th><th>currently building</th><th>last connection</th><th>logged lines</th><th>last action</th></tr>\n";
+ print "<tr><th>name</th><th>operator</th><th>currently building</th><th>last connection</th><th>building since</th><th>logged lines</th><th>last action</th></tr>\n";
while ($row = $result -> fetch_assoc()) {
foreach ($row as $key => $value) {
if ($value=="") {
@@ -44,7 +50,8 @@ show_warning_on_offline_slave();
print "<td>".$row["name"]."</td>";
print "<td>".$row["operator"]."</td>";
print "<td>".$row["pkgbase"]."</td>";
- print "<td>".$row["last_connection"]."</td>";
+ print "<td>".$row["lc"]."</td>";
+ print "<td>".$row["bs"]."</td>";
print "<td>".$row["logged_lines"]."</td>";
print "<td>".$row["last_action"]."</td>";
print "</tr>\n";