diff options
author | Erich Eckner <git@eckner.net> | 2018-04-12 10:28:31 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-04-12 10:28:31 +0200 |
commit | 5036d7a7172055a24ae9fa493e37998b725966eb (patch) | |
tree | 82956ba699664612f283109c104ae4533c5fc080 /buildmaster/build-slaves.php | |
parent | 4b2dcc3b53fafcab1f1912990fd5468795108a18 (diff) | |
download | archweb32-5036d7a7172055a24ae9fa493e37998b725966eb.tar.xz |
move buildmaster stuff to separate directory
Diffstat (limited to 'buildmaster/build-slaves.php')
-rw-r--r-- | buildmaster/build-slaves.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/buildmaster/build-slaves.php b/buildmaster/build-slaves.php new file mode 100644 index 0000000..b6afc2d --- /dev/null +++ b/buildmaster/build-slaves.php @@ -0,0 +1,49 @@ +<html><head><title>list of build slaves</title></head><body> +<?php + + $conn = new mysqli("localhost","webserver","empty","buildmaster"); + if ($conn->connect_error) { + die("Connection to mysql database failed: " . $conn->connect_error); + } + + if (!$result = + $conn->query( + "SELECT" . + " `build_slaves`.`name`," . + "`build_slaves`.`operator`," . + "`package_sources`.`pkgbase`," . + "`build_slaves`.`last_connection`," . + "`build_slaves`.`logged_lines`," . + "`build_slaves`.`last_action`" . + " FROM `build_slaves`" . + " LEFT JOIN `build_assignments` ON" . + " `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`" + )) + die($conn->error); + + 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"; + while ($row = $result -> fetch_assoc()) { + foreach ($row as $key => $value) { + if ($value=="") { + $row[$key]=" "; + } + } + print "<tr>"; + print "<td>".$row["name"]."</td>"; + print "<td>".$row["operator"]."</td>"; + print "<td>".$row["pkgbase"]."</td>"; + print "<td>".$row["last_connection"]."</td>"; + print "<td>".$row["logged_lines"]."</td>"; + print "<td>".$row["last_action"]."</td>"; + print "</tr>\n"; + } + } + print "</table>\n"; + +?> +</body></html> |