From c3311db9904b59945f37fe363fd893ea71a3765e Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 22 Jan 2022 11:24:47 +0100 Subject: build-slaves.php shows a filter for enabled and sanity status of slaves --- buildmaster/build-slaves.php | 36 ++++++++++++++++++++++++++++++++++-- 1 file 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 " \n"; - print " +
+
+ "/> + /> + +
+
+