From e2264d6c34de011753913dd9b447b3d38649619c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 16 May 2017 17:41:28 +0300 Subject: Adjust builds page style --- mod/mod-builds.cxx | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) (limited to 'mod/mod-builds.cxx') diff --git a/mod/mod-builds.cxx b/mod/mod-builds.cxx index 6ffb517..6b6ab08 100644 --- a/mod/mod-builds.cxx +++ b/mod/mod-builds.cxx @@ -9,6 +9,8 @@ #include #include +#include // to_string() + #include #include @@ -22,7 +24,6 @@ #include // *_url() using namespace std; -using namespace butl; using namespace bbot; using namespace odb::core; using namespace brep::cli; @@ -137,16 +138,21 @@ handle (request& rq, response& rs) assert (i != build_conf_map_->end ()); const build_config& c (*i->second); + string ts (butl::to_string (b.timestamp, + "%Y-%m-%d %H:%M:%S%[.N] %Z", + true, true)); + s << TABLE(CLASS="proplist build") << TBODY << TR_NAME (b.package_name, string (), root) << TR_VERSION (b.package_name, b.package_version, root) - << TR_VALUE ("config", b.configuration) << TR_VALUE ("toolchain", b.toolchain_name + '-' + b.toolchain_version.string ()) + << TR_VALUE ("config", b.configuration) << TR_VALUE ("machine", *b.machine) - << TR_VALUE ("target", c.target ? c.target->string () : "default") + << TR_VALUE ("target", c.target ? c.target->string () : "") + << TR_VALUE ("timestamp", ts) << TR(CLASS="result") << TH << "result" << ~TH << TD @@ -160,42 +166,48 @@ handle (request& rq, response& rs) build_db_->load (b, b.results_section); - // If no results available, then print the overall build status. - // Otherwise print unsuccessful operations statuses with the links to the + // If no unsuccessful operations results available, then print the + // overall build status. If there are any operations results available, + // then also print unsuccessful operations statuses with the links to the // respective logs, followed with a link to the operations combined log. - // Print the forced package rebuild link afterwards. + // Print the forced package rebuild link afterwards, unless the package + // build is already pending. // - if (b.results.empty ()) + if (b.results.empty () || *b.status == result_status::success) { assert (b.status); - s << SPAN_BUILD_RESULT_STATUS (*b.status); + s << SPAN_BUILD_RESULT_STATUS (*b.status) << " | "; } - else + + if (!b.results.empty ()) { for (const auto& r: b.results) { if (r.status != result_status::success) - s << SPAN_BUILD_RESULT_STATUS (r.status) << '(' + s << SPAN_BUILD_RESULT_STATUS (r.status) << " (" << A << HREF << build_log_url (host, root, b, &r.operation) << ~HREF << r.operation << ~A - << ')' << ' '; + << ") | "; } s << A << HREF << build_log_url (host, root, b) << ~HREF - << "all" - << ~A; + << "log" + << ~A + << " | "; } - s << ' ' - << A - << HREF << force_rebuild_url (host, root, b) << ~HREF - << "rebuild" - << ~A; + if (b.forced) + s << "pending"; + else + s << A + << HREF << force_rebuild_url (host, root, b) << ~HREF + << "rebuild" + << ~A; } s << ~SPAN -- cgit v1.1