index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2022-01-22 11:24:47 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2022-01-22 11:24:47 +0100 |
commit | c3311db9904b59945f37fe363fd893ea71a3765e (patch) | |
tree | 7d1bd4a5f64b446cb2fc0b0cfafe9acc2df25ff3 /buildmaster/build-slaves.php | |
parent | d9ac436ff3c7482b2c3db2dc97e5114e1a23d206 (diff) |
-rw-r--r-- | buildmaster/build-slaves.php | 36 |
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 } |