summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-10-30 00:10:28 (GMT)
committer Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-10-30 00:10:28 (GMT)
commit4840eec19648172b6fc9e83fe2c2f1dea550c1cf (patch)
tree1f1227a39df8c353386691e11a4b6a8a1c561686
parent51317ea5ce4ea0244744ff284ecfb98a2743520d (diff)
downloadbuildroot-test-4840eec19648172b6fc9e83fe2c2f1dea550c1cf.tar.gz
buildroot-test-4840eec19648172b6fc9e83fe2c2f1dea550c1cf.tar.bz2
Allow filtering by architecture
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--web/funcs.inc.php10
-rw-r--r--web/index.php7
2 files changed, 14 insertions, 3 deletions
diff --git a/web/funcs.inc.php b/web/funcs.inc.php
index 25be0a5..c7c35e2 100644
--- a/web/funcs.inc.php
+++ b/web/funcs.inc.php
@@ -52,11 +52,17 @@ function bab_total_results_count()
* and limited to $count items. The items starting with $start=0 are
* the most recent build results.
*/
-function bab_get_results($start=0, $count=100, $filter_status=-1)
+function bab_get_results($start=0, $count=100, $filter_status=-1, $filter_arch="")
{
$db = new db();
+ $where_parts = array();
if ($filter_status != -1)
- $condition = "where status=" . $db->quote_smart($filter_status) . " ";
+ $where_parts[] = " status=" . $db->quote_smart($filter_status) . " ";
+ if ($filter_arch != "")
+ $where_parts[] = " arch=" . $db->quote_smart($filter_arch) . " ";
+ if (count($where_parts)) {
+ $condition = "where " . implode("and", $where_parts);
+ }
$sql = "select * from results $condition order by builddate desc limit $start, $count;";
$ret = $db->query($sql);
if ($ret == FALSE) {
diff --git a/web/index.php b/web/index.php
index 2df3a9e..d830aa2 100644
--- a/web/index.php
+++ b/web/index.php
@@ -25,6 +25,11 @@ else if ($_GET['status'] == 'TIMEOUT')
else
$filter_status = -1;
+if (isset($_GET['arch']) && ereg("^[a-z0-9]*$", $_GET['arch']))
+ $filter_arch = $_GET['arch'];
+else
+ $filter_arch = "";
+
bab_header("Buildroot tests");
echo "<table>\n";
@@ -33,7 +38,7 @@ echo "<tr class=\"header\">";
echo "<td>Date</td><td>Status</td><td>Commit ID</td><td>Submitter</td><td>Arch</td><td>Failure reason</td><td>Data</td>";
echo "</tr>";
-$results = bab_get_results($start, $step, $filter_status);
+$results = bab_get_results($start, $step, $filter_status, $filter_arch);
while ($current = mysql_fetch_object($results)) {