mirror of
https://github.com/ohwgiles/laminar.git
synced 2026-10-18 09:04:42 +00:00
allow setting a job description
adding DESCRIPTION=foo to $JOBNAME.conf will display "foo" in the job overview page on the frontend Resolves #97
This commit is contained in:
@@ -317,7 +317,8 @@ std::string Laminar::getStatus(MonitorScope scope) {
|
||||
j.set("number", build).set("started", started);
|
||||
j.EndObject();
|
||||
});
|
||||
|
||||
auto desc = jobDescriptions.find(scope.job);
|
||||
j.set("description", desc == jobDescriptions.end() ? "" : desc->second);
|
||||
} else if(scope.type == MonitorScope::ALL) {
|
||||
j.startArray("jobs");
|
||||
db->stmt("SELECT name,number,startedAt,completedAt,result FROM builds b JOIN (SELECT name n,MAX(number) l FROM builds GROUP BY n) q ON b.name = q.n AND b.number = q.l")
|
||||
@@ -543,6 +544,10 @@ bool Laminar::loadConfiguration() {
|
||||
ctxPtnList.insert(ctx);
|
||||
jobContexts[jobName].swap(ctxPtnList);
|
||||
}
|
||||
std::string desc = conf.get<std::string>("DESCRIPTION");
|
||||
if(!desc.empty()) {
|
||||
jobDescriptions[jobName] = desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user