From e2be1adc22431647ac94379eaa6f0dbbd69afee6 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Thu, 18 Mar 2010 15:59:24 +0000 Subject: [PATCH] hydra: add status icon per jobset on project page --- src/lib/Hydra/Controller/Project.pm | 11 ++++++++++- src/root/project.tt | 15 +++++++++++++-- src/root/static/images/failure-some.gif | Bin 0 -> 215 bytes 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 src/root/static/images/failure-some.gif diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index 65d4e0ee..e46e1e73 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -14,7 +14,7 @@ sub project : Chained('/') PathPart('project') CaptureArgs(1) { or notFound($c, "Project $projectName doesn't exist."); $c->stash->{project} = $project; - $c->stash->{jobsets} = [$project->jobsets->search({},{ order_by => "name" })]; + } @@ -26,6 +26,15 @@ sub view : Chained('project') PathPart('') Args(0) { #getBuildStats($c, scalar $c->stash->{project}->builds); $c->stash->{views} = [$c->stash->{project}->views->all]; + $c->stash->{jobsets} = [$c->stash->{project}->jobsets->search({}, + { order_by => "name" + , "+select" => [ + "(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 )" + ] + , "+as" => ["nrscheduled", "nrfailed", "nrsucceeded"] + })]; } diff --git a/src/root/project.tt b/src/root/project.tt index 03f4f96c..867e09bd 100644 --- a/src/root/project.tt +++ b/src/root/project.tt @@ -1,6 +1,5 @@ [% WRAPPER layout.tt title=(edit ? (create ? "New Project" : "Editing Project ‘$project.name’") : "Project ‘$project.name’") %] [% PROCESS common.tt %] - [% IF create %]

New Project

[% ELSE %] @@ -31,6 +30,7 @@ + @@ -40,9 +40,20 @@ [% FOREACH j IN jobsets %] + - + [% END %] diff --git a/src/root/static/images/failure-some.gif b/src/root/static/images/failure-some.gif new file mode 100644 index 0000000000000000000000000000000000000000..a3136bbadf3020411ee867447fa731734a2beb71 GIT binary patch literal 215 zcmZ?wbhEHb6krfwc+AJ}%ZFioE9;9=mVYIDzx$ML?6CT|-u3&g=p$$HE?sv$cRT&= zg9&$DEc@_!*?%xl{3qyKl$uzQnxasiS(2gP?&%xAp!k!8k%57qL5BedKn63g
Id Description Last evaluated
+ [% IF j.get_column('nrscheduled') > 0 %] + Scheduled + [% ELSIF j.get_column('nrfailed') == 0 %] + Succeeded + [% ELSIF j.get_column('nrfailed') > 0 && j.get_column('nrsucceeded') > 0 %] + Some Failed + [% ELSE %] + All Failed + [% END %] + [% INCLUDE renderJobsetName project = project.name jobset = j.name %] [% HTML.escape(j.description) %][% INCLUDE renderDateTime timestamp = j.lastcheckedtime %][% INCLUDE renderDateTime timestamp = j.lastcheckedtime %]