index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-01-23 09:29:11 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-01-23 09:29:11 +0100 |
commit | a92f2fcc7bd2b67c4ee5910b4f66edcadd5c9589 (patch) | |
tree | 9b9c8baa06f6d75b146d2f72fc650532681fea82 | |
parent | 6a6d23c6a2246007ae7a7c2b2f0b79c5d9056fb9 (diff) |
-rw-r--r-- | web-scripts/build-slaves.php | 44 |
diff --git a/web-scripts/build-slaves.php b/web-scripts/build-slaves.php new file mode 100644 index 0000000..0b8ae6a --- /dev/null +++ b/web-scripts/build-slaves.php @@ -0,0 +1,44 @@ +<html><head><title>list of build slaves</title></head><body> +<?php + + $conn = new mysqli("localhost","http","http","buildmaster"); + if ($conn->connect_error) { + die("Connection to mysql database failed: " . $conn->connect_error); + } + + $result = + $conn->query( + "SELECT" . + " `build_slaves`.`name`," . + "`build_slaves`.`operator`," . + "`package_sources`.`pkgbase`," . + "`build_slaves`.`last_connection`" . + " 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`" + ); + + 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></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 "</tr>\n"; + } + } + print "</table>\n"; + +?> +</body></html> |