summaryrefslogtreecommitdiff
path: root/buildmaster/build-slaves.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
committerErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
commit5c5ed42237757efcf698a36c37cf9bd0630232c3 (patch)
tree184a92122c95c33ccb09aa5db2955af2d32e2771 /buildmaster/build-slaves.php
parent8af016645fee5c0b22e69d46de9b3401c1bc82d3 (diff)
downloadarchweb32-5c5ed42237757efcf698a36c37cf9bd0630232c3.tar.xz
buildmaster/*.php: use lib/mysql.php
Diffstat (limited to 'buildmaster/build-slaves.php')
-rw-r--r--buildmaster/build-slaves.php46
1 files changed, 24 insertions, 22 deletions
diff --git a/buildmaster/build-slaves.php b/buildmaster/build-slaves.php
index b6afc2d..9a45afd 100644
--- a/buildmaster/build-slaves.php
+++ b/buildmaster/build-slaves.php
@@ -1,28 +1,30 @@
-<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);
- }
+ include "lib/mysql.php";
+
+ $result = mysql_run_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`"
+ );
- 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);
+?>
+<html>
+ <head>
+ <title>list of build slaves</title>
+ </head>
+ <body>
+<?php
print "<table border=1>\n";
if ($result->num_rows > 0) {