diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm
index e46e1e73..741194b4 100644
--- a/src/lib/Hydra/Controller/Project.pm
+++ b/src/lib/Hydra/Controller/Project.pm
@@ -32,8 +32,9 @@ sub view : Chained('project') PathPart('') Args(0) {
"(SELECT COUNT(*) FROM Builds AS a NATURAL JOIN BuildSchedulingInfo WHERE me.project = a.project AND me.name = a.jobset AND a.isCurrent = 1 )"
, "(SELECT COUNT(*) FROM Builds AS a NATURAL JOIN BuildResultInfo WHERE me.project = a.project AND me.name = a.jobset AND buildstatus <> 0 AND a.isCurrent = 1 )"
, "(SELECT COUNT(*) FROM Builds AS a NATURAL JOIN BuildResultInfo WHERE me.project = a.project AND me.name = a.jobset AND buildstatus = 0 AND a.isCurrent = 1 )"
+ , "(SELECT COUNT(*) FROM Builds AS a WHERE me.project = a.project AND me.name = a.jobset AND a.isCurrent = 1 )"
]
- , "+as" => ["nrscheduled", "nrfailed", "nrsucceeded"]
+ , "+as" => ["nrscheduled", "nrfailed", "nrsucceeded", "nrtotal"]
})];
}
diff --git a/src/root/project.tt b/src/root/project.tt
index 867e09bd..8acdddb4 100644
--- a/src/root/project.tt
+++ b/src/root/project.tt
@@ -34,6 +34,7 @@
Id |
Description |
Last evaluated |
+ Success |
@@ -54,6 +55,27 @@
[% INCLUDE renderJobsetName project = project.name jobset = j.name %] |
[% HTML.escape(j.description) %] |
[% INCLUDE renderDateTime timestamp = j.lastcheckedtime %] |
+ [% IF j.get_column('nrtotal') > 0 %]
+ [% successrate = ( j.get_column('nrsucceeded') / j.get_column('nrtotal') )*100 %]
+ [% IF j.get_column('nrscheduled') > 0 %]
+ [% class = '' %]
+ [% ELSIF successrate < 25 %]
+ [% class = 'red' %]
+ [% ELSIF successrate < 75 %]
+ [% class = 'orange' %]
+ [% ELSIF successrate <= 100 %]green
+ [% class = 'green' %]
+ [% END %]
+ [% END %]
+
+ [% successrate FILTER format('%d') %]%
+ [% IF j.get_column('nrscheduled') > 0 %]
+ [% j.get_column('nrscheduled') %] builds still running
+ [% END %]
+ |
+
+ [% j.get_column('nrsucceeded') %]/[% j.get_column('nrtotal') %]
+ |
[% END %]
diff --git a/src/root/static/css/hydra.css b/src/root/static/css/hydra.css
index ed825d61..b4e1253c 100644
--- a/src/root/static/css/hydra.css
+++ b/src/root/static/css/hydra.css
@@ -199,3 +199,12 @@ form.inline {
display: inline;
}
+.red {
+ color: red;
+}
+.orange {
+ color: orange;
+}
+.green {
+ color: green;
+}