aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-19 14:14:27 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-19 14:14:27 +0300
commitd1d777fbe517b00544402cc8bdaa99c6550ce417 (patch)
tree40eeb440f7f4d0c03449abb327bb3824f9047856
parent4718a059f842a791c89a1922996bb8f1dbea8f65 (diff)
Make builds page form result control to be of drop-down type
-rw-r--r--mod/mod-builds.cxx22
-rw-r--r--mod/options.cli6
2 files changed, 19 insertions, 9 deletions
diff --git a/mod/mod-builds.cxx b/mod/mod-builds.cxx
index 70ef605..adbd9bf 100644
--- a/mod/mod-builds.cxx
+++ b/mod/mod-builds.cxx
@@ -159,7 +159,7 @@ build_query (const C& configs, const brep::params::builds& params)
//
const string& rs (params.result ());
- if (!rs.empty () && rs != "*")
+ if (rs != "*")
{
if (rs == "pending")
q = q && query::forced;
@@ -197,6 +197,16 @@ build_query (const C& configs, const brep::params::builds& params)
return q;
}
+static const vector<pair<string, string>> build_results ({
+ {"*", "*"},
+ {"pending", "pending"},
+ {"building", "building"},
+ {"success", "success"},
+ {"warning", "warning"},
+ {"error", "error"},
+ {"abort", "abort"},
+ {"abnormal", "abnormal"}});
+
bool brep::builds::
handle (request& rq, response& rs)
{
@@ -269,7 +279,7 @@ handle (request& rq, response& rs)
// the * wildcard selection.
//
string tc ("*");
- vector<pair<string,string>> toolchains ({{"*", "*"}});
+ vector<pair<string, string>> toolchains ({{"*", "*"}});
{
using query = query<toolchain>;
@@ -317,9 +327,9 @@ handle (request& rq, response& rs)
<< ~TD
<< ~TR
- << TR_INPUT ("machine", "mn", params.machine (), "*")
- << TR_INPUT ("target", "tg", params.target (), "<default>")
- << TR_INPUT ("result", "rs", params.result (), "*")
+ << TR_INPUT ("machine", "mn", params.machine (), "*")
+ << TR_INPUT ("target", "tg", params.target (), "<default>")
+ << TR_SELECT ("result", "rs", params.result (), build_results)
<< ~TBODY
<< ~TABLE
<< TABLE(CLASS="form-table")
@@ -454,7 +464,7 @@ handle (request& rq, response& rs)
add_filter ("cf", params.configuration ());
add_filter ("mn", params.machine ());
add_filter ("tg", params.target (), "*");
- add_filter ("rs", params.result ());
+ add_filter ("rs", params.result (), "*");
s << DIV_PAGER (page, count, page_configs, options_->build_pages (), u)
<< ~DIV
diff --git a/mod/options.cli b/mod/options.cli
index ced3de2..65f5549 100644
--- a/mod/options.cli
+++ b/mod/options.cli
@@ -456,13 +456,13 @@ namespace brep
//
string target | tg = "*";
- // Package build result. If empty or *, then no build result constraint
- // is applied. Otherwise the value is supposed to be the one of the
+ // Package build result. If *, then no build result constraint is
+ // applied. Otherwise the value is supposed to be the one of the
// following (ordered) statuses: pending, building, success, warning,
// error, abort, abnormal. The first 3 statuses are checked for equality,
// the rest - for being greater or equal.
//
- string result | rs;
+ string result | rs = "*";
};
}
}