Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/buildmaster/build-slaves.php
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2022-01-22 11:24:47 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2022-01-22 11:24:47 +0100
commitc3311db9904b59945f37fe363fd893ea71a3765e (patch)
tree7d1bd4a5f64b446cb2fc0b0cfafe9acc2df25ff3 /buildmaster/build-slaves.php
parentd9ac436ff3c7482b2c3db2dc97e5114e1a23d206 (diff)
build-slaves.php shows a filter for enabled and sanity status of slaves
Diffstat (limited to 'buildmaster/build-slaves.php')
-rw-r--r--buildmaster/build-slaves.php36
1 files changed, 34 insertions, 2 deletions
diff --git a/buildmaster/build-slaves.php b/buildmaster/build-slaves.php
index 1285fb8..e0c4c02 100644
--- a/buildmaster/build-slaves.php
+++ b/buildmaster/build-slaves.php
@@ -70,6 +70,30 @@ $columns = array(
)
);
+$swowall=0;
+if (array_key_exists("showall", $_GET) && $_GET["showall"] == "on") {
+ $showall=1;
+}
+
+if( $showall ) {
+ $columns = array_merge( $columns, array(
+ "enabled" => array(
+ "label" => "enabled",
+ "mysql_name" => "access_allowed",
+ "mysql_query" => "CASE WHEN `build_slaves`.access_allowed = 1 THEN \"enabled\" ELSE \"disabled\" END",
+ "sort" => "access_allowed",
+ "title" => "enabled"
+ ),
+ "santity" => array(
+ "label" => "sanity",
+ "mysql_name" => "is_sane",
+ "mysql_query" => "CASE WHEN `build_slaves`.is_sane = 1 THEN \"sane\" ELSE \"not sane\" END",
+ "sort" => "is_sane",
+ "title" => "sanity"
+ )
+ ));
+}
+
if (!array_key_exists("sort", $_GET))
$_GET["sort"]="-last_connection";
@@ -131,7 +155,7 @@ $result = mysql_run_query(
" GROUP BY `ssh_log`.`build_slave`" .
") AS `sl_q`" .
" ON `sl_q`.`build_slave`=`build_slaves`.`id`" .
- " WHERE `build_slaves`.`access_allowed`" .
+ ( ( $showall ) ? "" : " WHERE `build_slaves`.`access_allowed`" ) .
") AS `sub_query`" .
" ORDER BY " . $order . "`sub_query`.`name`"
);
@@ -170,7 +194,7 @@ if ($count > 0) {
foreach ($columns as $column) {
print " <th>\n";
- print " <a href=\"?sort=";
+ print " <a href=\"?showall=" . $_GET['showall'] . "&sort=";
if ($column["sort"] == $_GET["sort"])
print "-";
print $column["sort"] . "\" ";
@@ -212,6 +236,14 @@ foreach($rows as $row) {
?>
</tbody>
</table>
+ <div>
+ <form>
+ <input type="hidden" name="sort" value="<?php print $_GET["sort"]?>"/>
+ <label for="showall">Show all:</label><input type="checkbox" name="showall" <?php print ( $showall ? "checked" : ""); ?>/>
+ <input type="submit" value="Filter">
+ </form>
+ </div>
+
</div>
<?php
}