The job status tabs now has a toggle to show inactive jobs, rendering the "All jobs" tab redundant.
D7X6XTKQVG7SQTAIQ24SOVT6YHBHFKXDXB5GBPII6VK3CB4MYNTQC
M4TBFHHJNJJZEK4IVHOZJI4R4QBEIJKFYSYPB57W4L23I5FJ6SCQC
XU4PKY3UT67BMJYUQNLNGS5CNFP3TDK3PNON2K7MQIJF74J4JAVAC
AKAXJDMWEPMXMUY5R53AOVYAGSV42ZZ53URH7HAPUB5KZZV56TPAC
ODNCGFQ5FPKFI624BVMLW7PJ2EFJOR3TY66OCZM42UNNTWBCF2TQC
3HZY24CX4U2TO74HOY4YX3LBJIYF4DLXHCIY7J2RASAC4COMSMZAC
QTC3SYBMNNTPZHQGXRMV5GU5KDODGXPIM3TIGWBAF7HDKNDKTCXQC
6QRHXIM3XHCDLSIIBEGETDV67V6LTV55QMHC64ZPBMLTAECM5N3QC
J3RYO2CUWIOO7OHRHULCZZRESUJB6W4F3GD2G7PK3V6WHKPIHWWQC
AK2UZDS2IRVBZP3GRNZS2SIKMKEFUBPIVSA45EZBH4UYFKWI2HCAC
D5QIOJGPKQJIYBUCSC3MFJ3TXLPNZ2XMI37GXMFRVRFWWR2VMTFAC
XL43MFDOVUTDVI6VGF47VAJ3HUQUGTPEQVWK342EX6MB5FPQBTNAC
OX6NYJDVCDX2UCJ4QQMTRJVZ535NOMCJGYCHDLCADJPQI7RMCXPQC
225GEK4NN53NJ6EBDAJNECR76FILAHV7KNEG23TDQ2KYMG7NFEUAC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
$c->stash->{activeJobs} = [];
$c->stash->{inactiveJobs} = [];
my $latestEval = $c->stash->{jobset}->jobsetevals->search(
{ hasnewbuilds => 1 }, { rows => 1, order_by => ["id desc"] })->single;
my %activeJobs;
$c->stash->{activeJobs} = {};
if (defined $latestEval) {
foreach my $build ($latestEval->builds->search({}, { order_by => ["job"], select => ["job"] })) {
my $job = $build->get_column("job");
if (!defined $activeJobs{$job}) {
$activeJobs{$job} = 1;
$c->stash->{activeJobs}->{$job} = 1;
}
}
}
foreach my $job ($c->stash->{jobset}->jobs->search({}, { order_by => ["name"] })) {
push @{$c->stash->{jobs}}, $job->name;
}
}
sub job_status_tab : Chained('jobsetChain') PathPart('job-status-tab') Args(0) {
my ($self, $c) = @_;
$c->stash->{template} = 'jobset-job-status-tab.tt';
[% PROCESS common.tt; USE Math %]
<form class="form-search" id="filter-jobs">
<img src="/static/images/ajax-loader.gif" alt="Loading..." style="display: none;" id="filter-loading" />
</form>
<script>
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 %]
[% IF nrJobs > jobs.size %]
<div class="alert">Showing the first [% jobs.size %] jobs only. <a href="javascript:setFilter('filter=%')">Show all [% nrJobs %] jobs...</a></div>
[% END %]
};
$('#filter-jobs').submit(function() {
setFilter($('#filter-jobs').serialize());
function setFilter(filter) {
$('#filter-loading').show().focus();
$('#tabs-job-status').load("[% c.uri_for('/jobset' project.name jobset.name "job-status-tab") %]", filter, function(response, status, xhr) {
<input name="filter" type="text" class="input-large search-query" placeholder="Search jobs by name" [% HTML.attributes(value => filter) %]></input>
[% PROCESS common.tt %]
[% PROCESS common.tt; USE Math %]
<form class="form-search" id="filter-jobs">
<div class="input-append">
<input name="filter" type="text" class="input-large search-query" placeholder="Search jobs by name..." [% HTML.attributes(value => filter) %]></input>
<button type="button" class="btn btn-info [% IF showInactive %]active[% END %]" id="active-toggle">Show inactive jobs</button>
</div>
<img src="/static/images/ajax-loader.gif" alt="Loading..." style="display: none;" id="filter-loading" />
</form>
<script>
function setFilter(filter) {
$('#filter-loading').show();
if ($('#active-toggle').hasClass('active')) filter += '&showInactive=1';
$('#tabs-jobs').load("[% c.uri_for('/jobset' project.name jobset.name "jobs-tab") %]", filter, function(response, status, xhr) {
if (status == "error") {
$('#[% tabName %]').html("<div class='alert alert-error'>Error loading tab: " + xhr.status + " " + xhr.statusText + "</div>");
}
});
};
<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>
[% IF nrJobs > jobs.size %]
<div class="alert">Showing the first [% jobs.size %] jobs. <a href="javascript:setFilter('filter=%')">Show all [% nrJobs %] jobs...</a></div>
[% END %]
[% 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 %]
[% FOREACH j IN jobs-%]
<tr>
<th><span [% IF inactiveJobs.$j %]class="muted override-link"[% END %]>[% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]</span></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 %]