diff --git a/src/laminar.cpp b/src/laminar.cpp index bda3553..8ab9564 100644 --- a/src/laminar.cpp +++ b/src/laminar.cpp @@ -156,6 +156,7 @@ void Laminar::sendStatus(LaminarClient* client) { j.set("queued", run->startedAt - run->queuedAt); j.set("started", run->startedAt); j.set("reason", run->reason()); + j.set("result", to_string(RunState::RUNNING)); db->stmt("SELECT completedAt - startedAt FROM builds WHERE name = ? ORDER BY completedAt DESC LIMIT 1") .bind(run->name) .fetch([&](int etc){ @@ -188,6 +189,7 @@ void Laminar::sendStatus(LaminarClient* client) { j.set("number", run->build); j.set("node", run->node->name); j.set("started", run->startedAt); + j.set("result", to_string(RunState::RUNNING)); j.set("reason", run->reason()); j.EndObject(); } diff --git a/src/resources/js/app.js b/src/resources/js/app.js index f1c8641..eaf22b6 100644 --- a/src/resources/js/app.js +++ b/src/resources/js/app.js @@ -306,7 +306,10 @@ angular.module('laminar',['ngRoute','ngSanitize']) .run(function($rootScope) { angular.extend($rootScope, { runIcon: function(result) { - return result === "success" ? '' : result === "failed" ? '' : ''; + return result === "success" ? '' : result === "failed" || result === "aborted" ? '' : ''; + }, + runComplete: function(run) { + return !!run && (run.result === 'aborted' || run.result === 'failed' || run.result === 'success'); }, formatDate: function(unix) { // TODO reimplement when toLocaleDateString() accepts formatting diff --git a/src/resources/tpl/run.html b/src/resources/tpl/run.html index ef1ee76..1e8f635 100644 --- a/src/resources/tpl/run.html +++ b/src/resources/tpl/run.html @@ -1,7 +1,7 @@
-

{{name}} #{{num}}

+

{{name}} #{{num}}

-
+
diff --git a/src/run.cpp b/src/run.cpp index 759c718..0d6998a 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -30,6 +30,7 @@ namespace fs = boost::filesystem; std::string to_string(const RunState& rs) { switch(rs) { case RunState::PENDING: return "pending"; + case RunState::RUNNING: return "running"; case RunState::ABORTED: return "aborted"; case RunState::FAILED: return "failed"; case RunState::SUCCESS: return "success"; diff --git a/src/run.h b/src/run.h index 87b9c64..b3cd302 100644 --- a/src/run.h +++ b/src/run.h @@ -29,6 +29,7 @@ enum class RunState { UNKNOWN, PENDING, + RUNNING, ABORTED, FAILED, SUCCESS