diff --git a/src/http.cpp b/src/http.cpp index f87526e..d2be879 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -78,14 +78,14 @@ kj::Maybe fromUrl(std::string resource, char* query) { return kj::mv(scope); } - if(resource.substr(0, 5) != "/jobs") - return nullptr; - - if(resource.length() == 5) { + if(resource == "/jobs" || resource == "/wallboard") { scope.type = MonitorScope::ALL; return kj::mv(scope); } + if(resource.substr(0, 5) != "/jobs") + return nullptr; + resource = resource.substr(5); size_t split = resource.find('/',1); std::string job = resource.substr(1,split-1); diff --git a/src/laminar.cpp b/src/laminar.cpp index 63bc641..70c7d40 100644 --- a/src/laminar.cpp +++ b/src/laminar.cpp @@ -325,16 +325,17 @@ std::string Laminar::getStatus(MonitorScope scope) { 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 " + db->stmt("SELECT name,number,startedAt,completedAt,result,reason FROM builds b " "JOIN (SELECT name n,MAX(number) latest FROM builds WHERE result IS NOT NULL GROUP BY n) q " "ON b.name = q.n AND b.number = latest") - .fetch([&](str name,uint number, time_t started, time_t completed, int result){ + .fetch([&](str name,uint number, time_t started, time_t completed, int result, str reason){ j.StartObject(); j.set("name", name); j.set("number", number); j.set("result", to_string(RunState(result))); j.set("started", started); j.set("completed", completed); + j.set("reason", reason); j.EndObject(); }); j.EndArray(); diff --git a/src/resources.cpp b/src/resources.cpp index 021905b..0cc3a64 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -122,7 +122,7 @@ inline bool beginsWith(std::string haystack, const char* needle) { bool Resources::handleRequest(std::string path, const char** start, const char** end, const char** content_type) { // need to keep the list of "application links" synchronised with the angular // application. We cannot return a 404 for any of these - auto it = beginsWith(path,"/jobs") + auto it = beginsWith(path,"/jobs") || path == "/wallboard" ? resources.find("/") : resources.find(path); diff --git a/src/resources/index.html b/src/resources/index.html index 6194064..e2a6774 100644 --- a/src/resources/index.html +++ b/src/resources/index.html @@ -81,7 +81,19 @@ Ungrouped Jobs {{g}} - +
+ + + + + + + + + + + +
@@ -93,6 +105,14 @@
+ +