Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}