hydra: minor improvements in hydra ui

This commit is contained in:
Rob Vermaas 2010-02-09 13:43:53 +00:00
parent fabc8e4774
commit 090a648020
3 changed files with 35 additions and 4 deletions

View file

@ -20,9 +20,10 @@ sub jobset : Chained('/') PathPart('jobset') CaptureArgs(2) {
or notFound($c, "Jobset $jobsetName doesn't exist."); or notFound($c, "Jobset $jobsetName doesn't exist.");
} }
sub jobsetIndex {
my ($self, $c, $forceStatus) = @_;
sub index : Chained('jobset') PathPart('') Args(0) { print STDERR "index\n";
my ($self, $c) = @_;
$c->stash->{template} = 'jobset.tt'; $c->stash->{template} = 'jobset.tt';
@ -46,7 +47,7 @@ sub index : Chained('jobset') PathPart('') Args(0) {
push(@systems, $system->system); push(@systems, $system->system);
} }
if(scalar(@{$c->stash->{activeJobs}}) <= 20) { if($forceStatus || scalar(@{$c->stash->{activeJobs}}) <= 20) {
my @select = (); my @select = ();
my @as = (); my @as = ();
push(@select, "job"); push(@as, "job"); push(@select, "job"); push(@as, "job");
@ -71,6 +72,16 @@ sub index : Chained('jobset') PathPart('') Args(0) {
->search({finished => 1}, {order_by => "timestamp DESC", rows => 5 })] ; ->search({finished => 1}, {order_by => "timestamp DESC", rows => 5 })] ;
} }
sub index : Chained('jobset') PathPart('') Args(0) {
my ($self, $c) = @_;
jobsetIndex($self, $c, 0);
}
sub indexWithStatus : Chained('jobset') PathPart('') Args(1) {
my ($self, $c, $forceStatus) = @_;
jobsetIndex($self, $c, 1);
}
# Hydra::Base::Controller::ListBuilds needs this. # Hydra::Base::Controller::ListBuilds needs this.
sub get_builds : Chained('jobset') PathPart('') CaptureArgs(0) { sub get_builds : Chained('jobset') PathPart('') CaptureArgs(0) {

View file

@ -79,7 +79,7 @@
<ul> <ul>
[% IF !edit -%] [% IF !edit -%]
<li><a href="#tabs-information">Jobset</a></li> <li><a href="#tabs-information">Jobset</a></li>
[% IF jobset.errormsg -%]<li><a href="#tabs-errors">Errors</a></li>[% END %] [% IF jobset.errormsg -%]<li><a href="#tabs-errors">Evaluation errors</a></li>[% END %]
<li><a href="#tabs-jobs">Jobs ([% activeJobs.size %])</a></li> <li><a href="#tabs-jobs">Jobs ([% activeJobs.size %])</a></li>
[% END %] [% END %]
<li><a href="#tabs-setup">Setup</a></li> <li><a href="#tabs-setup">Setup</a></li>
@ -89,6 +89,16 @@
[% END %] [% END %]
</ul> </ul>
<div id="tabs-information"> <div id="tabs-information">
[% IF jobset.errormsg && !edit -%]
<table class="layoutTable"><tr><td><img src="/static/images/failure.gif" /></td><td><a href="#tabs-errors" id="error-link">There are evaluation errors!</a></td></tr></table>
<script type="text/javascript">
$('#error-link').click(function() {
$("#generic-tabs").tabs('select', 1);
return false;
});
</script>
[% END %]
[% IF lastBuilds %] [% IF lastBuilds %]
<h2>Most recent builds</h2> <h2>Most recent builds</h2>
[% INCLUDE renderBuildList builds=lastBuilds %] [% INCLUDE renderBuildList builds=lastBuilds %]
@ -123,6 +133,12 @@
</tbody> </tbody>
</table> </table>
[% END %] [% END %]
[% IF !edit && !activeJobsStatus -%]
<h2>Status</h2>
<p>
[ <a href="[% c.uri_for('/jobset' project.name jobset.name 'with-status' ) %]">Show status overview</a> ]
</p>
[% END %]
</div> </div>
[% IF !edit -%] [% IF !edit -%]

View file

@ -49,6 +49,10 @@ a.smallLink {
white-space: pre-wrap; white-space: pre-wrap;
} }
a#error-link {
color: red;
}
.error { .error {
color: red; color: red;
font-weight: bold; font-weight: bold;