Add a "My jobsets" tab to the dashboard

This commit is contained in:
Eelco Dolstra
2013-11-05 16:05:29 +01:00
parent 589271bd72
commit ae85d2df23
7 changed files with 105 additions and 63 deletions

View File

@ -17,7 +17,8 @@ our @EXPORT = qw(
getPrimaryBuildsForView
getPrimaryBuildTotal
getViewResult getLatestSuccessfulViewResult
jobsetOverview removeAsciiEscapes getDrvLogPath findLog logContents
jobsetOverview jobsetOverview_
removeAsciiEscapes getDrvLogPath findLog logContents
getMainOutput
getEvals getMachines
pathIsInsidePrefix
@ -173,9 +174,9 @@ sub findLastJobForBuilds {
}
sub jobsetOverview {
my ($c, $project) = @_;
return $project->jobsets->search( isProjectOwner($c, $project) ? {} : { hidden => 0 },
sub jobsetOverview_ {
my ($c, $jobsets) = @_;
return $jobsets->search({},
{ order_by => "name"
, "+select" =>
[ "(select count(*) from Builds as a where a.finished = 0 and me.project = a.project and me.name = a.jobset and a.isCurrent = 1)"
@ -188,6 +189,13 @@ sub jobsetOverview {
}
sub jobsetOverview {
my ($c, $project) = @_;
my $jobsets = $project->jobsets->search(isProjectOwner($c, $project) ? {} : { hidden => 0 });
return jobsetOverview_($c, $jobsets);
}
sub getViewResult {
my ($primaryBuild, $jobs, $finished) = @_;