1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-10-27 20:34:20 +00:00

Pass reason and queuedAt to Home page

This commit is contained in:
vrein 2021-02-20 18:27:08 +02:00 committed by Oliver Giles
parent 8df882b273
commit c42b6d4207

View File

@ -361,15 +361,17 @@ std::string Laminar::getStatus(MonitorScope scope) {
j.EndObject(); j.EndObject();
} else { // Home page } else { // Home page
j.startArray("recent"); j.startArray("recent");
db->stmt("SELECT * FROM builds WHERE completedAt IS NOT NULL ORDER BY completedAt DESC LIMIT 20") db->stmt("SELECT name,number,node,queuedAt,startedAt,completedAt,result,reason FROM builds WHERE completedAt IS NOT NULL ORDER BY completedAt DESC LIMIT 20")
.fetch<str,uint,str,time_t,time_t,time_t,int>([&](str name,uint build,str context,time_t,time_t started,time_t completed,int result){ .fetch<str,uint,str,time_t,time_t,time_t,int,str>([&](str name,uint build,str context,time_t queued,time_t started,time_t completed,int result,str reason){
j.StartObject(); j.StartObject();
j.set("name", name) j.set("name", name)
.set("number", build) .set("number", build)
.set("context", context) .set("context", context)
.set("queued", queued)
.set("started", started) .set("started", started)
.set("completed", completed) .set("completed", completed)
.set("result", to_string(RunState(result))) .set("result", to_string(RunState(result)))
.set("reason", reason)
.EndObject(); .EndObject();
}); });
j.EndArray(); j.EndArray();