forked from lix-project/hydra
* Unify rendering of finished and scheduled builds.
This commit is contained in:
parent
b7e03351cb
commit
fa042e04ae
|
@ -49,8 +49,6 @@ sub getBuild {
|
|||
sub index :Path :Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
$c->stash->{template} = 'index.tt';
|
||||
$c->stash->{scheduled} = [$c->model('DB::Builds')->search(
|
||||
{finished => 0}, {join => 'schedulingInfo'})]; # !!!
|
||||
$c->stash->{allBuilds} = [$c->model('DB::Builds')->search(
|
||||
{finished => 1}, {order_by => "timestamp DESC"})];
|
||||
# Get the latest finished build for each unique job.
|
||||
|
@ -63,6 +61,14 @@ sub index :Path :Args(0) {
|
|||
}
|
||||
|
||||
|
||||
sub queue :Local {
|
||||
my ($self, $c) = @_;
|
||||
$c->stash->{template} = 'queue.tt';
|
||||
$c->stash->{queue} = [$c->model('DB::Builds')->search(
|
||||
{finished => 0}, {join => 'schedulingInfo', order_by => ["priority DESC", "timestamp"]})];
|
||||
}
|
||||
|
||||
|
||||
sub updateProject {
|
||||
my ($c, $project) = @_;
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
[% USE date %]
|
||||
|
||||
|
||||
[% inputTypes =
|
||||
{ "svn" = "Subversion checkout"
|
||||
, "cvs" = "CVS checkout"
|
||||
|
@ -9,8 +12,53 @@
|
|||
}
|
||||
%]
|
||||
|
||||
[% USE date %]
|
||||
|
||||
[% BLOCK renderDateTime %]
|
||||
[% date.format(timestamp, '%Y-%m-%d %H:%M:%S') -%]
|
||||
[% END %]
|
||||
|
||||
|
||||
[% BLOCK renderBuildList %]
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
[% IF !hideResultInfo %]
|
||||
<th></th>
|
||||
[% END %]
|
||||
<th>#</th>
|
||||
[% IF showSchedulingInfo %]
|
||||
<th>Priority</th>
|
||||
[% END %]
|
||||
<th>Project</th>
|
||||
<th>Job</th>
|
||||
<th>System</th>
|
||||
<th>Timestamp</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH build IN builds -%]
|
||||
<tr [% IF build.schedulingInfo.busy %]class="runningJob"[% END %] >
|
||||
[% IF !hideResultInfo %]
|
||||
<td>
|
||||
[% IF build.resultInfo.buildstatus == 0 %]
|
||||
<img src="/static/images/success.gif" />
|
||||
[% ELSE %]
|
||||
<img src="/static/images/failure.gif" />
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
<td><a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</a></td>
|
||||
[% IF showSchedulingInfo %]
|
||||
<td>[% build.schedulingInfo.priority %]</td>
|
||||
[% END %]
|
||||
<td><a href="[% c.uri_for('/project' build.project.name) %]"><tt>[% build.project.name %]</tt></a></td>
|
||||
<td><a href="[% c.uri_for('/job' build.project.name build.attrname) %]"><tt>[% build.attrname %]</tt></a></td>
|
||||
<td><tt>[% build.system %]</tt></td>
|
||||
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
|
||||
<td>[% build.description %]</td>
|
||||
</tr>
|
||||
[% END -%]
|
||||
</tbody>
|
||||
</table>
|
||||
[% END %]
|
|
@ -1,70 +1,22 @@
|
|||
[% WRAPPER layout.tt title="Hydra Overview" %]
|
||||
[% USE date %]
|
||||
[% PROCESS common.tt %]
|
||||
|
||||
|
||||
<h1>Hydra Overview</h1>
|
||||
|
||||
|
||||
<h2>Queue</h2>
|
||||
|
||||
[% IF scheduled.size == 0 %]
|
||||
|
||||
<p>The queue is empty.</p>
|
||||
|
||||
[% ELSE %]
|
||||
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr><th>#</th><th>Priority</th><th>Project</th><th>Job</th><th>System</th><th>Timestamp</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH build IN scheduled -%]
|
||||
<tr [% IF build.schedulingInfo.busy %]class="runningJob"[% END %] >
|
||||
<td><a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</a></td>
|
||||
<td>[% build.schedulingInfo.priority %]</td>
|
||||
<td><tt>[% build.project.name %]</tt></td>
|
||||
<td><tt>[% build.attrname %]</tt></td>
|
||||
<td><tt>[% build.system %]</tt></td>
|
||||
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
|
||||
<td>[% build.description %]</td>
|
||||
</tr>
|
||||
[% END -%]
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
[% END %]
|
||||
|
||||
|
||||
<h2>Job status</h2>
|
||||
|
||||
<p>Below are the latest builds for each job.</p>
|
||||
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr><th></th><th>#</th><th>Project</th><th>Job</th><th>System</th><th>Timestamp</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH build IN latestBuilds -%]
|
||||
[% INCLUDE "short-build-info.tt" %]
|
||||
[% END -%]
|
||||
</tbody>
|
||||
</table>
|
||||
[% PROCESS renderBuildList builds=latestBuilds %]
|
||||
|
||||
|
||||
<h2>All builds</h2>
|
||||
|
||||
<p>Number of builds: [% allBuilds.size %]</p>
|
||||
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr><th></th><th>#</th><th>Project</th><th>Job</th><th>System</th><th>Timestamp</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH build IN allBuilds -%]
|
||||
[% INCLUDE "short-build-info.tt" %]
|
||||
[% END -%]
|
||||
</tbody>
|
||||
</table>
|
||||
[% PROCESS renderBuildList builds=allBuilds %]
|
||||
|
||||
|
||||
[% END %]
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
[% WRAPPER layout.tt title="Hydra Overview" %]
|
||||
[% PROCESS common.tt %]
|
||||
|
||||
<h1>All builds for job <tt>[% curProject.name %]:[% jobName %]</tt></h1>
|
||||
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr><th></th><th>Id</th><th>Project</th><th>Job</th><th>System</th><th>Timestamp</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
[% FOREACH build IN builds -%]
|
||||
[% INCLUDE "short-build-info.tt" %]
|
||||
[% END -%]
|
||||
</tbody>
|
||||
</table>
|
||||
[% PROCESS renderBuildList builds=builds %]
|
||||
|
||||
[% END %]
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
[% USE date %]
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
[% IF build.resultInfo.buildstatus == 0 %]
|
||||
<img src="/static/images/success.gif" />
|
||||
[% ELSE %]
|
||||
<img src="/static/images/failure.gif" />
|
||||
[% END %]
|
||||
</td>
|
||||
<td><a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</a></td>
|
||||
<td><a href="[% c.uri_for('/project' build.project.name) %]"><tt>[% build.project.name %]</tt></a></td>
|
||||
<td><a href="[% c.uri_for('/job' build.project.name build.attrname) %]"><tt>[% build.attrname %]</tt></a></td>
|
||||
<td><tt>[% build.system %]</tt></td>
|
||||
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
|
||||
<td>[% build.description %]</td>
|
||||
</tr>
|
|
@ -185,7 +185,7 @@ ul.productList li {
|
|||
margin-top: 1em;
|
||||
}
|
||||
|
||||
tr.runningJob {
|
||||
.runningJob {
|
||||
background-color: #ff3030;
|
||||
color: white;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue