Jobset page: Add a new tab to show job status in a matrix

This commit is contained in:
Eelco Dolstra
2013-08-28 09:59:02 +00:00
parent 82e073d043
commit 410060ec8a
5 changed files with 105 additions and 19 deletions

View File

@ -0,0 +1,49 @@
[% PROCESS common.tt; USE Math %]
<form class="form-search" id="filter-jobs">
<input name="filter" type="text" class="input-large search-query" placeholder="Filter jobs..." [% HTML.attributes(value => filter) %]></input>
</form>
<script>
$('#filter-jobs').submit(function() {
$('#tabs-job-status').load("[% c.uri_for('/jobset' project.name jobset.name "job-status-tab") %]", $('#filter-jobs').serialize(), function(response, status, xhr) {
if (status == "error") {
$('#[% tabName %]').html("<div class='alert alert-error'>Error loading tab: " + xhr.status + " " + xhr.statusText + "</div>");
}
});
return false;
});
</script>
[% IF jobs.size == 0 %]
<div class="alert">There are no matching jobs.</div>
[% ELSE %]
[% evalIds = evals.keys.nsort.reverse %]
<table class="table table-striped table-condensed table-header-rotated">
<thead>
<tr>
<th style="width: 1em;">Job</th>
[% FOREACH eval IN evalIds %]
<th class="rotate-45">
<div><span>
<a href="[% c.uri_for('/eval' eval) %]">[% eval %]</a>
</span></div></th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH j IN jobs-%]
<tr>
<th>[% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]</th>
[% FOREACH eval IN evalIds %]
<td>[% r = evals.$eval.$j; IF r.id %]<a href="[% c.uri_for('/build' r.id) %]">[% INCLUDE renderBuildStatusIcon size=16 build=r %]</a>[% END %]</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
[% END %]

View File

@ -1,15 +1,19 @@
[% PROCESS common.tt %]
<p>This jobset currently contains the following [% activeJobs.size %] jobs:
<blockquote>
[% IF activeJobs.size == 0 %]<em>(none)</em>[% END %]
[% FOREACH j IN activeJobs %][% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]<br/>[% END %]
</blockquote>
</p>
[% IF jobs.size == 0 %]
<div class="alert">This jobset has no jobs yet.</div>
[% ELSE %]
<div class="well well-small">Below is the list of all [% jobs.size
%] jobs that have ever existed in this jobset. Jobs that are no
longer part of the jobset (i.e., that don't appear in the latest
evaluation of the jobset) are <span class="muted">grayed out</span>.</div>
<p>This jobset used to contain the following [% inactiveJobs.size %] jobs:
<blockquote>
[% IF inactiveJobs.size == 0 %]<em>(none)</em>[% END %]
[% FOREACH j IN inactiveJobs %][% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]<br/>[% END %]
</blockquote>
</p>
<table class="table table-striped table-condensed">
<thead>
<tr><th>Job name</th></tr>
</thead>
<tbody>
[% FOREACH j IN jobs %]<tr><td><span class="[% IF !activeJobs.$j %]muted override-link[% END %]">[% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]</span></td></tr>[% END %]
</tbody>
</table>
[% END %]

View File

@ -43,9 +43,10 @@
<ul class="nav nav-tabs">
<li class="active"><a href="#tabs-evaluations" data-toggle="tab">Evaluations</a></li>
[% IF jobset.errormsg %]
<li><a href="#tabs-errors" data-toggle="tab"><img src="/static/images/error_16.png" /> Evaluation errors</a></li>
<li><a href="#tabs-errors" data-toggle="tab"><span class="text-warning">Evaluation errors</span></a></li>
[% END %]
<li><a href="#tabs-jobs" data-toggle="tab">Jobs</a></li>
<li><a href="#tabs-job-status" data-toggle="tab">Job status</a></li>
<li><a href="#tabs-jobs" data-toggle="tab">All jobs</a></li>
<li><a href="#tabs-configuration" data-toggle="tab">Configuration</a></li>
</ul>
@ -140,6 +141,8 @@
[% INCLUDE makeLazyTab tabName="tabs-jobs" uri=c.uri_for('/jobset' project.name jobset.name "jobs-tab") %]
[% INCLUDE makeLazyTab tabName="tabs-job-status" uri=c.uri_for('/jobset' project.name jobset.name "job-status-tab") %]
</div>
[% END %]