aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-12-02 20:13:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-12-02 20:20:21 +0300
commit9d50600f7ca9f900f8bfdcd30668c7ee47b2c176 (patch)
treec9f83e328406495aa632925feec1e0023e3b6f77 /mod
parent8994205b272e655ad3f3c134dd660019b60042db (diff)
Reflect that build tenant is archived on builds and package version details pages
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-builds.cxx14
-rw-r--r--mod/mod-package-version-details.cxx2
-rw-r--r--mod/page.cxx8
-rw-r--r--mod/page.hxx8
4 files changed, 19 insertions, 13 deletions
diff --git a/mod/mod-builds.cxx b/mod/mod-builds.cxx
index 095dee3..ff27c65 100644
--- a/mod/mod-builds.cxx
+++ b/mod/mod-builds.cxx
@@ -538,7 +538,7 @@ handle (request& rq, response& rs)
// printing the builds.
//
count = 0;
- vector<shared_ptr<build>> builds;
+ vector<package_build> builds;
builds.reserve (page_configs);
// Prepare the package build prepared query.
@@ -644,9 +644,9 @@ handle (request& rq, response& rs)
// we don't increment the counter in this case.
//
if (find_if (builds.begin (), builds.end (),
- [&b] (const shared_ptr<build>& pb)
+ [&b] (const package_build& pb)
{
- return b->id == pb->id;
+ return b->id == pb.build->id;
}) != builds.end ())
continue;
@@ -660,7 +660,7 @@ handle (request& rq, response& rs)
r.log.clear ();
}
- builds.push_back (move (b));
+ builds.push_back (move (pb));
--print;
}
@@ -686,9 +686,9 @@ handle (request& rq, response& rs)
// Enclose the subsequent tables to be able to use nth-child CSS selector.
//
s << DIV;
- for (const shared_ptr<build>& pb: builds)
+ for (const package_build& pb: builds)
{
- const build& b (*pb);
+ const build& b (*pb.build);
string ts (butl::to_string (b.timestamp,
"%Y-%m-%d %H:%M:%S %Z",
@@ -711,7 +711,7 @@ handle (request& rq, response& rs)
if (b.interactive) // Note: can only be present for the building state.
s << TR_VALUE ("login", *b.interactive);
- s << TR_BUILD_RESULT (b, host, root);
+ s << TR_BUILD_RESULT (b, pb.archived, host, root);
// In the global view mode add the tenant builds link. Note that the
// global view (and the link) makes sense only in the multi-tenant mode.
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx
index b158228..3a1ce0a 100644
--- a/mod/mod-package-version-details.cxx
+++ b/mod/mod-package-version-details.cxx
@@ -639,7 +639,7 @@ handle (request& rq, response& rs)
if (b.interactive) // Note: can only be present for the building state.
s << TR_VALUE ("login", *b.interactive);
- s << TR_BUILD_RESULT (b, host, root)
+ s << TR_BUILD_RESULT (b, tn->archived, host, root)
<< ~TBODY
<< ~TABLE;
diff --git a/mod/page.cxx b/mod/page.cxx
index e2a8b84..7352867 100644
--- a/mod/page.cxx
+++ b/mod/page.cxx
@@ -787,9 +787,11 @@ namespace brep
}
}
- if (build_.force == (build_.state == build_state::building
- ? force_state::forcing
- : force_state::forced))
+ if (archived_)
+ s << SPAN(CLASS="archived") << "archived" << ~SPAN;
+ else if (build_.force == (build_.state == build_state::building
+ ? force_state::forcing
+ : force_state::forced))
s << SPAN(CLASS="pending") << "pending" << ~SPAN;
else
s << A
diff --git a/mod/page.hxx b/mod/page.hxx
index acfbe5b..0a5d359 100644
--- a/mod/page.hxx
+++ b/mod/page.hxx
@@ -474,14 +474,18 @@ namespace brep
class TR_BUILD_RESULT
{
public:
- TR_BUILD_RESULT (const build& b, const string& h, const dir_path& r):
- build_ (b), host_ (h), root_ (r) {}
+ TR_BUILD_RESULT (const build& b,
+ bool a,
+ const string& h,
+ const dir_path& r):
+ build_ (b), archived_ (a), host_ (h), root_ (r) {}
void
operator() (xml::serializer&) const;
private:
const build& build_;
+ bool archived_;
const string& host_;
const dir_path& root_;
};