* hydra: 'new' UI for project/jobset/job/build

This commit is contained in:
Rob Vermaas 2010-02-05 14:48:22 +00:00
parent 3677a5fc6e
commit 9dba2127cb
37 changed files with 952 additions and 663 deletions

View file

@ -38,6 +38,37 @@ sub index : Chained('jobset') PathPart('') Args(0) {
{}, {},
{select => ["job"], order_by => ["job"], group_by => ["job"], having => { 'sum(isCurrent)' => 0 }} {select => ["job"], order_by => ["job"], group_by => ["job"], having => { 'sum(isCurrent)' => 0 }}
)]; )];
$c->stash->{systems} = [$c->stash->{jobset}->builds->search({iscurrent => 1}, {select => ["system"], distinct => 1})];
# status per system
my @systems = ();
foreach my $system (@{$c->stash->{systems}}) {
push(@systems, $system->system);
}
if(scalar(@{$c->stash->{activeJobs}}) <= 20) {
my @select = ();
my @as = ();
push(@select, "job"); push(@as, "job");
foreach my $system (@systems) {
push(@select, "(SELECT buildstatus FROM BuildResultInfo bri NATURAL JOIN Builds b WHERE b.id = (SELECT MAX(id) FROM Builds t WHERE t.project = me.project AND t.jobset = me.jobset AND t.job = me.job AND t.system = '$system'))");
push(@as, $system);
push(@select, "(SELECT b.id FROM BuildResultInfo bri NATURAL JOIN Builds b WHERE b.id = (SELECT MAX(id) FROM Builds t WHERE t.project = me.project AND t.jobset = me.jobset AND t.job = me.job AND t.system = '$system'))");
push(@as, $system."-build");
}
$c->stash->{activeJobsStatus} = [$c->model('DB')->resultset('ActiveJobsForJobset')
->search( {}
, { bind => [$c->stash->{project}->name, $c->stash->{jobset}->name]
, select => \@select
, as => \@as
, order_by => ["job"]
})];
}
# last builds for jobset
my $tmp = $c->stash->{jobset}->builds;
$c->stash->{lastBuilds} = [joinWithResultInfo($c, $tmp)
->search({finished => 1}, {order_by => "timestamp DESC", rows => 5 })] ;
} }

View file

@ -191,6 +191,14 @@ __PACKAGE__->has_many(
use Hydra::Helper::Nix; use Hydra::Helper::Nix;
# order buildsteps
__PACKAGE__->has_many(
"buildsteps",
"Hydra::Schema::BuildSteps",
{ "foreign.build" => "self.id" },
{ order_by => "stepnr" },
);
__PACKAGE__->has_many( __PACKAGE__->has_many(
"dependents", "dependents",
"Hydra::Schema::BuildInputs", "Hydra::Schema::BuildInputs",
@ -274,6 +282,8 @@ QUERY
QUERY QUERY
); );
makeSource("ActiveJobs$name", "(select distinct project, jobset, job from Builds where isCurrent = 1 $constraint)");
makeSource( makeSource(
"LatestSucceeded$name", "LatestSucceeded$name",
<<QUERY <<QUERY

View file

@ -97,6 +97,12 @@ __PACKAGE__->has_many(
# Created by DBIx::Class::Schema::Loader v0.04999_09 @ 2009-11-17 16:05:10 # Created by DBIx::Class::Schema::Loader v0.04999_09 @ 2009-11-17 16:05:10
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+HDJ8tIPcvj5+IwgHqTnaw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+HDJ8tIPcvj5+IwgHqTnaw
__PACKAGE__->has_many(
"jobsets",
"Hydra::Schema::Jobsets",
{ "foreign.project" => "self.name" },
{ order_by => "name" },
);
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration
1; 1;

View file

@ -2,11 +2,69 @@
[% PROCESS common.tt %] [% PROCESS common.tt %]
[% PROCESS "product-list.tt" %] [% PROCESS "product-list.tt" %]
[% USE HTML %] [% USE HTML %]
[% USE Date %]
[% project = build.project %] [% project = build.project %]
[% jobset = build.jobset %] [% jobset = build.jobset %]
[% job = build.job %] [% job = build.job %]
[% BLOCK renderBuildSteps %]
<h2 id="buildsteps">Build steps</h2>
<table class="tablesorter">
<thead>
<tr><th>Nr</th><th>What</th><th>Duration</th><th>Status</th></tr>
</thead>
<tbody>
[% FOREACH step IN build.buildsteps -%]
[% IF (onlyFailed != 1) || (step.status != 0) -%]
[% log = c.uri_for('/build' build.id 'nixlog' step.stepnr) %]
<tr class="[% IF step.logfile %]clickable[% END %]"
[% IF step.logfile %] onclick="window.location = '[% log %]'" [% END %]>
<td>[% step.stepnr %]</td>
<td>
[% IF step.type == 0 %]
Build of <tt>[% step.outpath %]</tt>
[% ELSE %]
Substitution of <tt>[% step.outpath %]</tt>
[% END %]
</td>
<td>
[% IF step.busy == 0 %]
[% INCLUDE renderDuration duration = step.stoptime - step.starttime %]
[% ELSE %]
[% IF build.finished %]
[% INCLUDE renderDuration duration = build.resultInfo.stoptime - step.starttime %]
[% ELSE %]
[% INCLUDE renderDuration duration = curTime - step.starttime %]
[% END %]
[% END %]
</td>
<td>
[% IF step.busy == 1 %]
[% IF build.finished %]
<span class="error">Aborted</span>
[% ELSE %]
<strong>Building</strong>
[% END %]
[% ELSIF step.status == 0 %]
Succeeded
[% ELSE %]
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
[% END %]
[% IF step.logfile %]
(<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>, <a href="[% "$log/tail" %]">tail</a>)
[% END %]
</td>
</tr>
[% END %]
[% END %]
</tbody>
</table>
[% END %]
<h1> <h1>
Job <tt>[% project.name %]:[% jobset.name %]:[% job.name %]</tt> build [% id %] Job <tt>[% project.name %]:[% jobset.name %]:[% job.name %]</tt> build [% id %]
[% IF !build.finished %] [% IF !build.finished %]
@ -24,6 +82,123 @@
[% END %] [% END %]
<div id="generic-tabs">
<ul>
<li><a href="#tabs-summary">Summary</a></li>
<li><a href="#tabs-information">Information</a></li>
<li><a href="#tabs-buildinputs">Build Inputs</a></li>
[% IF build.buildsteps %]<li><a href="#tabs-buildsteps">Build Steps</a></li>[% END %]
[% IF build.dependents %]<li><a href="#tabs-usedby">Used by</a></li>[% END%]
</ul>
<div id="tabs-summary">
<table class="statusTable">
<tr>
<td>
[% INCLUDE renderBuildStatusIcon size=128, build=build %]
</td>
<td>
<table class="layoutTable">
<tr>
<th>Build ID:</th>
<td>[% build.id %]</td>
</tr>
[% IF build.resultInfo.releasename %]
<tr>
<th>Release name:</th>
<td><tt>[% HTML.escape(build.resultInfo.releasename) %]</tt></td>
</tr>
[% ELSE %]
<tr>
<th>Nix name:</th>
<td><tt>[% build.nixname %]</tt></td>
</tr>
[% END %]
<tr>
<th>Status:</th>
<td>
[% INCLUDE renderStatus build=build %]
</td>
</tr>
<tr>
<th>System:</th>
<td><tt>[% build.system %]</tt></td>
</tr>
[% IF !build.schedulingInfo %]
<tr>
<th>Duration:</th>
<td>
[% IF build.resultInfo.iscachedbuild %]
(cached from [% INCLUDE renderFullBuildLink build=cachedBuild %])
[% ELSE %]
[% INCLUDE renderDuration duration = build.resultInfo.stoptime - build.resultInfo.starttime %]
[% END %]
</td>
</tr>
[% END %]
[% IF build.resultInfo.logfile %]
<tr>
<th>Logfile:</th>
<td>
<a href="[% c.uri_for('/build' build.id 'log') %]"><strong>Available</strong></a>
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>,
<a href="[% c.uri_for('/build' build.id 'log' 'tail') %]">tail</a>)
</td>
</tr>
[% END %]
</table>
</td>
</tr>
</table>
[% IF c.user_exists && available %]
<form action="[% c.uri_for('/build' build.id 'add-to-release') %]" method="post">
<p>Add to release: <input type="text" class="string" name="name" />
<button type="submit"><img src="/static/images/success.gif" />Apply</button></p>
</form>
[% END %]
[% IF c.user_exists %]
<p>[<a href="[% c.uri_for('/build' build.id 'clone') %]">Clone this build</a>]</p>
[% END %]
[% IF build.buildproducts %]
<h2>Build products</h2>
[% IF !available %]
<p class="error">Note: this build is no longer available.</p>
[% END %]
[% INCLUDE renderProductList latestRoot=['/job' build.project.name build.jobset.name build.job.name 'latest'] %]
[% END %]
[% IF build.finished %]
[% IF build.buildsteps && (build.resultInfo.buildstatus == 2 || build.resultInfo.buildstatus == 5)%]
[% INCLUDE renderBuildSteps onlyFailed=1 %]
[% END %]
[% IF build.resultInfo.errormsg && build.resultInfo.buildstatus != 5 %]
<h2 id="nix-error">Nix error output</h2>
<pre class="buildlog">
[% HTML.escape(build.resultInfo.errormsg) -%]
</pre>
[% END %]
[% ELSIF build.schedulingInfo.busy %]
<h2>Log</h2>
<pre class="buildlog">
[% HTML.escape(logtext) -%]
</pre>
[% END %]
</div>
<div id="tabs-information">
<h2>Information</h2> <h2>Information</h2>
<table class="layoutTable"> <table class="layoutTable">
@ -34,45 +209,7 @@
<tr> <tr>
<th>Status:</th> <th>Status:</th>
<td> <td>
[% IF build.finished %] [% INCLUDE renderStatus build=build %]
[% IF build.resultInfo.buildstatus == 0 %]
<img src="/static/images/success.gif" alt="Succeeded" />
<strong>Success</strong>
[% ELSIF build.resultInfo.buildstatus == 1 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build returned a non-zero exit code</span>
[% ELSIF build.resultInfo.buildstatus == 2 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">A dependency of the build failed</span>
[% ELSIF build.resultInfo.buildstatus == 4 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Cancelled by user</span>
[% ELSIF build.resultInfo.buildstatus == 5 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build inhibited because a dependency previously failed to build</span>
[% failedDep = build.resultInfo.failedDep %]
(namely, <a href="[% c.uri_for('/build' failedDep.build.id 'nixlog' failedDep.stepnr) %]"><tt>[% failedDep.outpath %]</tt></a>)
[% ELSE %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build failed</span>
(see <a href="#nix-error">below</a>)
[% END %]
[% IF c.user_exists && (build.resultInfo.buildstatus == 3 || build.resultInfo.buildstatus == 4) %]
<form action="[% c.uri_for('/build' build.id 'restart') %]" method="post" class="inline">
<button id="restart" type="submit">Restart</button>
</form>
[% END %]
[% ELSIF build.schedulingInfo.busy %]
<strong>Build in progress</strong>
since [% INCLUDE renderDateTime timestamp = build.schedulingInfo.starttime %]
[% ELSE %]
<strong>Scheduled to be built</strong>
[% IF c.user_exists %]
<form action="[% c.uri_for('/build' build.id 'cancel') %]" method="post" class="inline">
<button id="cancel" type="submit">Cancel</button>
</form>
[% END %]
[% END %]
</td> </td>
</tr> </tr>
<tr> <tr>
@ -153,7 +290,7 @@
[% IF build.resultInfo.iscachedbuild && cachedBuild %] [% IF build.resultInfo.iscachedbuild && cachedBuild %]
<tr> <tr>
<th>Cached build:</th> <th>Cached build:</th>
<td><a href="[% c.uri_for('/build' cachedBuild.id ) %]">[% cachedBuild.id %]</a></td> <td>[% INCLUDE renderFullBuildLink build=cachedBuild %]</td>
</tr> </tr>
[% END %] [% END %]
@ -217,31 +354,8 @@
</tr> </tr>
[% END %] [% END %]
</table> </table>
</div>
[% IF c.user_exists && available %] <div id="tabs-buildinputs">
<form action="[% c.uri_for('/build' build.id 'add-to-release') %]" method="post">
<p>Add to release: <input type="text" class="string" name="name" />
<button type="submit"><img src="/static/images/success.gif" />Apply</button></p>
</form>
[% END %]
[% IF c.user_exists %]
<p>[<a href="[% c.uri_for('/build' build.id 'clone') %]">Clone this build</a>]</p>
[% END %]
[% IF build.buildproducts %]
<h2>Build products</h2>
[% IF !available %]
<p class="error">Note: this build is no longer available.</p>
[% END %]
[% INCLUDE renderProductList latestRoot=['/job' build.project.name build.jobset.name build.job.name 'latest'] %]
[% END %]
<h2>Build inputs</h2> <h2>Build inputs</h2>
@ -256,7 +370,7 @@
<td><tt>[% type = input.type; inputTypes.$type %]</tt></td> <td><tt>[% type = input.type; inputTypes.$type %]</tt></td>
<td> <td>
[% IF input.type == "build" || input.type == "sysbuild" %] [% IF input.type == "build" || input.type == "sysbuild" %]
Job [% INCLUDE renderFullJobNameOfBuild build=input.dependency %] <a href="[% c.uri_for('/build' input.dependency.id) %]">build [% input.dependency.id %]</a> [% INCLUDE renderFullBuildLink build=input.dependency %]</a>
[% ELSIF input.type == "string" || input.type == "boolean" %] [% ELSIF input.type == "string" || input.type == "boolean" %]
<tt>"[% input.value %]"</tt> <tt>"[% input.value %]"</tt>
[% ELSE %] [% ELSE %]
@ -269,79 +383,18 @@
[% END -%] [% END -%]
</tbody> </tbody>
</table> </table>
</div>
[% IF build.buildsteps %] [% IF build.buildsteps %]
<div id="tabs-buildsteps">
<h2 id="buildsteps">Build steps</h2> [% INCLUDE renderBuildSteps onlyFailed=0 %]
</div>
<table class="tablesorter">
<thead>
<tr><th>Nr</th><th>What</th><th>Duration</th><th>Status</th></tr>
</thead>
<tbody>
[% FOREACH step IN build.buildsteps -%]
[% log = c.uri_for('/build' build.id 'nixlog' step.stepnr) %]
<tr class="[% IF step.logfile %]clickable[% END %]"
[% IF step.logfile %] onclick="window.location = '[% log %]'" [% END %]>
<td>[% step.stepnr %]</td>
<td>
[% IF step.type == 0 %]
Build of <tt>[% step.outpath %]</tt>
[% ELSE %]
Substitution of <tt>[% step.outpath %]</tt>
[% END %]
</td>
<td>
[% IF step.busy == 0 %]
[% INCLUDE renderDuration duration = step.stoptime - step.starttime %]
[% ELSE %]
[% IF build.finished %]
[% INCLUDE renderDuration duration = build.resultInfo.stoptime - step.starttime %]
[% ELSE %]
[% INCLUDE renderDuration duration = curTime - step.starttime %]
[% END %]
[% END %]
</td>
<td>
[% IF step.busy == 1 %]
[% IF build.finished %]
<span class="error">Aborted</span>
[% ELSE %]
<strong>Building</strong>
[% END %]
[% ELSIF step.status == 0 %]
Succeeded
[% ELSE %]
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
[% END %]
[% IF step.logfile %]
(<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>, <a href="[% "$log/tail" %]">tail</a>)
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF build.finished %]
[% IF build.resultInfo.errormsg && build.resultInfo.buildstatus != 5 %]
<h2 id="nix-error">Nix error output</h2>
<pre class="buildlog">
[% HTML.escape(build.resultInfo.errormsg) -%]
</pre>
[% END %] [% END %]
[% IF build.dependents %] [% IF build.dependents %]
<div id="tabs-usedby">
<h2>Used by</h2> <h2>Used by</h2>
@ -354,7 +407,7 @@
<tbody> <tbody>
[% FOREACH input IN build.dependents -%] [% FOREACH input IN build.dependents -%]
<tr> <tr>
<td>Job [% INCLUDE renderFullJobNameOfBuild build=input.build %] <a href="[% c.uri_for('/build' input.build.id) %]">build [% input.build.id %]</a></td> <td>[% INCLUDE renderFullBuildLink build=input.build %]</td>
<td><tt>[% input.name %]</tt></td> <td><tt>[% input.name %]</tt></td>
<td><tt>[% input.build.system %]</tt></td> <td><tt>[% input.build.system %]</tt></td>
<td>[% INCLUDE renderDateTime timestamp = input.build.timestamp %]</td> <td>[% INCLUDE renderDateTime timestamp = input.build.timestamp %]</td>
@ -362,22 +415,16 @@
[% END -%] [% END -%]
</tbody> </tbody>
</table> </table>
</div>
[% END %] [% END %]
</div>
[% ELSIF build.schedulingInfo.busy %] <script type="text/javascript">
$("#generic-tabs").tabs();
</script>
<h2>Log</h2>
<pre class="buildlog">
[% HTML.escape(logtext) -%]
</pre>
[% END %]
[% END %] [% END %]

View file

@ -196,3 +196,72 @@
HTML.escape(value); HTML.escape(value);
END -%] END -%]
[% END -%] [% END -%]
[% BLOCK renderFullBuildLink; %]
Job [% INCLUDE renderFullJobNameOfBuild build=build %] <a href="[% c.uri_for('/build' build.id) %]">build [% build.id %]
[% END %]
[% BLOCK renderBuildStatusIcon; %]
[% IF build.finished %]
[% IF build.resultInfo.buildstatus == 0 %]
<img src="/static/images/checkmark_[% size %].png" alt="Succeeded" />
[% ELSIF build.resultInfo.buildstatus == 1 %]
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% ELSIF build.resultInfo.buildstatus == 2 %]
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% ELSIF build.resultInfo.buildstatus == 4 %]
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% ELSIF build.resultInfo.buildstatus == 5 %]
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% ELSE %]
<img src="/static/images/error_[% size %].png" alt="Failed" />
[% END %]
[% ELSIF build.schedulingInfo.busy %]
<img src="/static/images/help_[% size %].png" alt="Budy" />
[% ELSE %]
<img src="/static/images/help_[% size %].png" alt="Scheduled" />
[% END %]
[% END %]
[% BLOCK renderStatus; %]
[% IF build.finished %]
[% IF build.resultInfo.buildstatus == 0 %]
<img src="/static/images/success.gif" alt="Succeeded" />
<strong>Success</strong>
[% ELSIF build.resultInfo.buildstatus == 1 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build returned a non-zero exit code</span>
[% ELSIF build.resultInfo.buildstatus == 2 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">A dependency of the build failed</span>
[% ELSIF build.resultInfo.buildstatus == 4 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Cancelled by user</span>
[% ELSIF build.resultInfo.buildstatus == 5 %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build inhibited because a dependency previously failed to build</span>
[% failedDep = build.resultInfo.failedDep %]
(namely, <a href="[% c.uri_for('/build' failedDep.build.id 'nixlog' failedDep.stepnr) %]"><tt>[% failedDep.outpath %]</tt></a>)
[% ELSE %]
<img src="/static/images/failure.gif" alt="Failed" />
<span class="error">Build failed</span>
(see <a href="#nix-error">below</a>)
[% END %]
[% IF c.user_exists && (build.resultInfo.buildstatus == 3 || build.resultInfo.buildstatus == 4) %]
<form action="[% c.uri_for('/build' build.id 'restart') %]" method="post" class="inline">
<button id="restart" type="submit">Restart</button>
</form>
[% END %]
[% ELSIF build.schedulingInfo.busy %]
<strong>Build in progress</strong>
since [% INCLUDE renderDateTime timestamp = build.schedulingInfo.starttime %]
[% ELSE %]
<strong>Scheduled to be built</strong>
[% IF c.user_exists %]
<form action="[% c.uri_for('/build' build.id 'cancel') %]" method="post" class="inline">
<button id="cancel" type="submit">Cancel</button>
</form>
[% END %]
[% END %]
[% END -%]

View file

@ -9,12 +9,22 @@
title = jobset.name %]:[% job.name %]</tt></h1> title = jobset.name %]:[% job.name %]</tt></h1>
<h2>Status</h2> <div id="generic-tabs">
<ul>
<li><a href="#tabs-status">Status</a></li>
<li><a href="#tabs-channels">Channels</a></li>
<li><a href="#tabs-latestbuilds">Latest builds</a></li>
<li><a href="#tabs-statistics">Statistics</a></li>
</ul>
<div id="tabs-status">
<h2>Finished builds</h2>
[% INCLUDE renderBuildList builds=currentBuilds showStatusChange=0 %] [% INCLUDE renderBuildList builds=currentBuilds showStatusChange=0 %]
[% IF runningBuilds %]
<h2>Channels</h2> <h2>Running builds</h2>
[% INCLUDE renderBuildList builds=runningBuilds showStatusChange=0 %]
[% END %]
</div>
<div id="tabs-channels">
<p>This job provides the following Nix channels:</p> <p>This job provides the following Nix channels:</p>
<ul> <ul>
@ -29,10 +39,8 @@
build of this job. build of this job.
</li> </li>
</ul> </ul>
</div>
<div id="tabs-latestbuilds">
<h2>Latest builds</h2>
<ul> <ul>
<li><a href="[% c.uri_for('/job' project.name jobset.name job.name <li><a href="[% c.uri_for('/job' project.name jobset.name job.name
'latest') %]">Latest successful build.</a></li> 'latest') %]">Latest successful build.</a></li>
@ -42,11 +50,14 @@
system.system %]</tt>.</a></li> system.system %]</tt>.</a></li>
[% END %] [% END %]
</ul> </ul>
</div>
<div id="tabs-statistics">
<h2>Statistics</h2>
[% INCLUDE showBuildStats %] [% INCLUDE showBuildStats %]
</div>
</div>
<script type="text/javascript">
$("#generic-tabs").tabs();
</script>
[% END %] [% END %]

View file

@ -53,6 +53,88 @@
[% END %] [% END %]
[% BLOCK renderInputs %]
<h3>Inputs</h3>
<table class="tablesorter">
<thead>
<tr><th>Input name</th><th>Type</th><th>Values</th></tr>
</thead>
<tbody class="inputs">
[% FOREACH input IN jobset.jobsetinputs -%]
[% INCLUDE renderInput input=input baseName="input-$input.name" %]
[% END %]
[% IF edit %]
<tr>
<td colspan="3"><button type="button" class="add-input">Add a new input</button></td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
<div id="generic-tabs">
<ul>
[% IF !edit -%]
<li><a href="#tabs-information">Jobset</a></li>
[% IF jobset.errormsg -%]<li><a href="#tabs-errors">Errors</a></li>[% END %]
<li><a href="#tabs-jobs">Jobs ([% activeJobs.size %])</a></li>
[% END %]
<li><a href="#tabs-setup">Setup</a></li>
[% IF !edit -%]
<li><a href="#tabs-channels">Channels</a></li>
<li><a href="#tabs-statistics">Statistics</a></li>
[% END %]
</ul>
<div id="tabs-information">
[% IF lastBuilds %]
<h2>Most recent builds</h2>
[% INCLUDE renderBuildList builds=lastBuilds %]
[% END %]
[% IF !edit && activeJobsStatus -%]
<h2>Status</h2>
<table class="activeJobsStatus">
<thead><tr><th>Job</th>[% FOREACH s IN systems %]<th>[% s.system %]</th>[% END %]</tr></thead>
<tbody>
[% odd = 0 %]
[% FOREACH j IN activeJobsStatus %]
<tr class="[% IF odd %] odd [% END; odd = !odd -%]">
<td>[% INCLUDE renderJobName project=project.name jobset = jobset.name job = j.get_column('job') %]</td>
[% FOREACH s IN systems %]
[% system = s.system %]
[% systemStatus = j.get_column(system) %]
<td>
[% IF systemStatus != undef %]
<a href="[% c.uri_for('/build' j.get_column(system _ '-build') ) %]">
[% IF systemStatus == 0 %]
<img src="/static/images/success.gif" alt="Succeeded" />
[% ELSE %]
<img src="/static/images/failure.gif" alt="Failed" />
[% END %]
</a>
[% END %]
</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
[% END %]
</div>
[% IF !edit -%]
[% IF jobset.errormsg -%]
<div id="tabs-errors">
<h3>Evaluation error</h3>
<pre class="multiLineMsg error">[% HTML.escape(jobset.errormsg) %]</pre>
</div>
[% END %]
[% END %]
<div id="tabs-setup">
<h2>Information[% IF !edit %] <a class="smallLink" href="[% c.uri_for('/jobset' project.name jobset.name 'edit') %]">[Edit]</a>[% END %]</h2> <h2>Information[% IF !edit %] <a class="smallLink" href="[% c.uri_for('/jobset' project.name jobset.name 'edit') %]">[Edit]</a>[% END %]</h2>
<table class="layoutTable"> <table class="layoutTable">
@ -96,8 +178,7 @@
<th>Last checked:</th> <th>Last checked:</th>
<td> <td>
[% IF jobset.lastcheckedtime %] [% IF jobset.lastcheckedtime %]
[% INCLUDE renderDateTime timestamp = jobset.lastcheckedtime -%][% IF jobset.errormsg -%]<em>, evaluation error</em>: [% INCLUDE renderDateTime timestamp = jobset.lastcheckedtime -%][% IF jobset.errormsg -%]<em>, with errors!</em>
<pre class="multiLineMsg error">[% HTML.escape(jobset.errormsg) %]</pre>
[% ELSE %], <em>no errors</em> [% ELSE %], <em>no errors</em>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
@ -109,24 +190,10 @@
</table> </table>
<h3>Inputs</h3> [% INCLUDE renderInputs %]
</div>
<table class="tablesorter"> [% IF !edit -%]
<thead> <div id="tabs-channels">
<tr><th>Input name</th><th>Type</th><th>Values</th></tr>
</thead>
<tbody class="inputs">
[% FOREACH input IN jobset.jobsetinputs -%]
[% INCLUDE renderInput input=input baseName="input-$input.name" %]
[% END %]
[% IF edit %]
<tr>
<td colspan="3"><button type="button" class="add-input">Add a new input</button></td>
</tr>
[% END %]
</tbody>
</table>
<h2>Channels</h2> <h2>Channels</h2>
@ -145,9 +212,9 @@
</li> </li>
</ul> </ul>
</div>
[% IF !edit %] <div id="tabs-jobs">
<h2>Jobs</h2> <h2>Jobs</h2>
@ -168,14 +235,20 @@
</p> </p>
</div>
<div id="tabs-statistics">
<h2>Statistics</h2> <h2>Statistics</h2>
[% INCLUDE showBuildStats %] [% INCLUDE showBuildStats %]
</div>
[% END %] [% END %]
</div>
<script type="text/javascript">
$("#generic-tabs").tabs();
</script>
[% IF edit %] [% IF edit %]

View file

@ -10,11 +10,11 @@
<head> <head>
<title>Hydra - [% title %]</title> <title>Hydra - [% title %]</title>
<link type="text/css" href="/static/js/jquery/css/smoothness/jquery-ui-1.7.2.custom.css" rel="Stylesheet" />
<link rel="stylesheet" href="/static/css/hydra.css" type="text/css" /> <link rel="stylesheet" href="/static/css/hydra.css" type="text/css" />
<link rel="stylesheet" href="/static/css/nix-common.css" type="text/css" /> <link rel="stylesheet" href="/static/css/nix-common.css" type="text/css" />
<link rel="stylesheet" href="/static/css/nixos-site.css" type="text/css" /> <link rel="stylesheet" href="/static/css/nixos-site.css" type="text/css" />
<link rel="stylesheet" href="/static/css/logfile.css" type="text/css" /> <link rel="stylesheet" href="/static/css/logfile.css" type="text/css" />
<link type="text/css" href="/static/js/jquery/css/smoothness/jquery-ui-1.7.2.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="/static/js/jquery/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/static/js/jquery/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/static/js/jquery/js/jquery-ui-1.7.2.custom.min.js"></script> <script type="text/javascript" src="/static/js/jquery/js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="/static/js/tablesorter/jquery.tablesorter.js"></script> <script type="text/javascript" src="/static/js/tablesorter/jquery.tablesorter.js"></script>

View file

@ -1,15 +1,6 @@
[% WRAPPER layout.tt title="Overview" %] [% WRAPPER layout.tt title="Overview" %]
[% PROCESS common.tt %] [% PROCESS common.tt %]
<h1>Hydra Overview</h1>
<p>Welcome to Hydra, the <a href="http://nixos.org/">Nix-based</a>
continuous build system. Hydra continuously builds, tests and
releases software packages from source repositories. <a
href="http://nixos.org/hydra"><em>[Read more...]</em></a></p>
<h2>Projects</h2> <h2>Projects</h2>
<p>The following projects are hosted on this server:</p> <p>The following projects are hosted on this server:</p>

View file

@ -1,18 +1,68 @@
[% WRAPPER layout.tt title=(edit ? (create ? "New Project" : "Editing Project $project.name") : "Project $project.name") %] [% WRAPPER layout.tt title=(edit ? (create ? "New Project" : "Editing Project $project.name") : "Project $project.name") %]
[% PROCESS common.tt %] [% PROCESS common.tt %]
[% IF edit %]
<form action="[% IF create %][% c.uri_for('/create-project/submit') %][% ELSE %][% c.uri_for('/project' project.name 'submit') %][% END %]" method="post">
[% END %]
[% IF create %] [% IF create %]
<h1>New Project</h1> <h1>New Project</h1>
[% ELSE %] [% ELSE %]
<h1>Project <tt>[% project.name %]</tt></h1> <h1>Project <tt>[% project.name %]</tt></h1>
[% END %] [% END %]
<div id="generic-tabs">
<ul>
[% IF !edit %]
<li><a href="#tabs-project">Project</a></li>
[% END %]
<li><a href="#tabs-settings">Settings</a></li>
[% IF !edit %]
<li><a href="#tabs-views">Views</a></li>
<li><a href="#tabs-channels">Channels</a></li>
<li><a href="#tabs-statistics">Statistics</a></li>
[% END %]
</ul>
[% IF !edit %]
<div id="tabs-project">
<h2>Jobsets</h2>
[% IF project.jobsets.size > 0 %]
<p>This project has the following jobsets:</p>
<table class="tablesorter">
<thead>
<tr>
<th>Id</th>
<th>Description</th>
<th>Last evaluated</th>
</tr>
</thead>
<tbody>
[% FOREACH j IN project.jobsets %]
<tr class="clickable [% IF odd %] odd [% END; odd = !odd %]"
onclick="window.location = '[% c.uri_for('/jobset' project.name j.name) %]'">
<td>[% INCLUDE renderJobsetName project = project.name jobset = j.name %]</td>
<td>[% HTML.escape(j.description) %]</td>
<td>[% INCLUDE renderDateTime timestamp = j.lastcheckedtime %]</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<p>No jobsets have been defined yet.</p>
[% END %]
<p><a href="[% c.uri_for(c.controller('Project').action_for('create_jobset'), [project.name]) %]">[Create a new jobset]</a></p>
</div>
[% END %]
<div id="tabs-settings">
[% IF edit %]
<form action="[% IF create %][% c.uri_for('/create-project/submit') %][% ELSE %][% c.uri_for('/project' project.name 'submit') %][% END %]" method="post">
[% END %]
<h2>Information[% IF !edit %] <a class="smallLink" href="[% c.uri_for('/project' project.name 'edit') %]">[Edit]</a>[% END %]</h2> <h2>Information[% IF !edit %] <a class="smallLink" href="[% c.uri_for('/project' project.name 'edit') %]">[Edit]</a>[% END %]</h2>
@ -57,46 +107,32 @@
</tr> </tr>
</table> </table>
[% IF edit %]
<p><button type="submit"><img src="/static/images/success.gif" />[%IF create %]Create[% ELSE %]Apply changes[% END %]</button></p>
</form>
[% IF !create %]
<form action="[% c.uri_for('/project' project.name 'delete') %]" method="post">
<p><button id="delete-project" type="submit"><img src="/static/images/failure.gif" />Delete this project</button></p>
</form>
<script type="text/javascript">
$("#delete-project").click(function() {
return confirm("Are you sure you want to delete this project?");
});
</script>
[% END %]
[% END %]
</div>
[% IF !edit %] [% IF !edit %]
<div id="tabs-views">
<h2>Jobsets</h2>
[% IF project.jobsets.size > 0 %]
<p>This project has the following jobsets:</p>
<table class="tablesorter">
<thead>
<tr>
<th>Id</th>
<th>Description</th>
<th>Last evaluated</th>
</tr>
</thead>
<tbody>
[% FOREACH j IN project.jobsets %]
<tr class="clickable [% IF odd %] odd [% END; odd = !odd %]"
onclick="window.location = '[% c.uri_for('/jobset' project.name j.name) %]'">
<td>[% INCLUDE renderJobsetName project = project.name jobset = j.name %]</td>
<td>[% HTML.escape(j.description) %]</td>
<td>[% INCLUDE renderDateTime timestamp = j.lastcheckedtime %]</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<p>No jobsets have been defined yet.</p>
[% END %]
<p><a href="[% c.uri_for(c.controller('Project').action_for('create_jobset'), [project.name]) %]">[Create a new jobset]</a></p>
<h2>Views</h2> <h2>Views</h2>
@ -121,6 +157,8 @@
<p><a href="[% c.uri_for('/project' project.name 'create-view') %]">[Create a new view]</a></p> <p><a href="[% c.uri_for('/project' project.name 'create-view') %]">[Create a new view]</a></p>
</div>
<div id="tabs-channels">
<h2>Channels</h2> <h2>Channels</h2>
@ -138,36 +176,19 @@
</li> </li>
</ul> </ul>
</div>
<div id="tabs-statistics">
<h2>Statistics</h2> <h2>Statistics</h2>
[% INCLUDE showBuildStats %] [% INCLUDE showBuildStats %]
</div>
[% END %] [% END %]
</div>
[% IF edit %]
<p><button type="submit"><img src="/static/images/success.gif" />[%IF create %]Create[% ELSE %]Apply changes[% END %]</button></p>
</form>
[% IF !create %]
<form action="[% c.uri_for('/project' project.name 'delete') %]" method="post">
<p><button id="delete-project" type="submit"><img src="/static/images/failure.gif" />Delete this project</button></p>
</form>
<script type="text/javascript"> <script type="text/javascript">
$("#delete-project").click(function() { $("#generic-tabs").tabs();
return confirm("Are you sure you want to delete this project?");
});
</script> </script>
[% END %]
[% END %]
[% END %] [% END %]

View file

@ -1,7 +1,22 @@
#generic-tabs li {
height : 30px;
font-size : 90%;
}
#generic-tabs {
min-height: 30em;
}
#generic-tabs div {
font-size : 90%;
}
#logo img { #logo img {
width: 8em; width: 8em;
} }
.statusTable td, .statusTable th {
border-style: none;
}
tr.clickable:hover { tr.clickable:hover {
background-color: #a0a0f0; background-color: #a0a0f0;
cursor: pointer; cursor: pointer;
@ -9,12 +24,21 @@ tr.clickable:hover {
.layoutTable td, .layoutTable th { .layoutTable td, .layoutTable th {
border-style: none; border-style: none;
text-align: left;
} }
.layoutTable th { .layoutTable th {
vertical-align: top; vertical-align: top;
} }
.activeJobsStatus td, .activeJobsStatus th {
border-style: 1px dotted #CCCCCC;
}
.activeJobsStatus tbody tr td {
align: center;
}
a.smallLink { a.smallLink {
font-size: 60%; font-size: 60%;
vertical-align: top; vertical-align: top;
@ -125,7 +149,6 @@ th.releaseSetJobName {
padding: 0 0 0 0; padding: 0 0 0 0;
} }
/* Editing */ /* Editing */
input.string { input.string {

View file

@ -93,14 +93,18 @@ ul.short-menu li a:hover {
/* The left menu. */ /* The left menu. */
div#main { div#main {
position: relative; position: relative;
min-height: 10em; min-height: 20em;
}
div#content {
min-height: 20em;
} }
div#left-bar { div#left-bar {
position: absolute; position: absolute;
left: 0em; left: 0em;
width: 8em; width: 8em;
min-height: 10em; min-height: 20em;
} }
div#left-title { div#left-title {

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -33,6 +33,9 @@
[% INCLUDE makeLink [% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('errors')) uri = c.uri_for(c.controller('Root').action_for('errors'))
title = "Errors" %] title = "Errors" %]
[% INCLUDE makeLink
uri = "http://nixos.org/hydra"
title = "About" %]
[% IF c.user_exists %] [% IF c.user_exists %]
[% INCLUDE makeLink [% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('logout')) uri = c.uri_for(c.controller('Root').action_for('logout'))