From d1d777fbe517b00544402cc8bdaa99c6550ce417 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 19 May 2017 14:14:27 +0300 Subject: Make builds page form result control to be of drop-down type --- mod/mod-builds.cxx | 22 ++++++++++++++++------ mod/options.cli | 6 +++--- 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> 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> toolchains ({{"*", "*"}}); + vector> toolchains ({{"*", "*"}}); { using query = query; @@ -317,9 +327,9 @@ handle (request& rq, response& rs) << ~TD << ~TR - << TR_INPUT ("machine", "mn", params.machine (), "*") - << TR_INPUT ("target", "tg", params.target (), "") - << TR_INPUT ("result", "rs", params.result (), "*") + << TR_INPUT ("machine", "mn", params.machine (), "*") + << TR_INPUT ("target", "tg", params.target (), "") + << 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 = "*"; }; } } -- cgit v1.1