Add a "My jobsets" tab to the dashboard
This commit is contained in:
@ -311,4 +311,20 @@ sub my_jobs_tab :Chained('user') :PathPart('my-jobs-tab') :Args(0) {
|
||||
}
|
||||
|
||||
|
||||
sub my_jobsets_tab :Chained('user') :PathPart('my-jobsets-tab') :Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
$c->stash->{template} = 'dashboard-my-jobsets-tab.tt';
|
||||
|
||||
my $jobsets = $c->model('DB::Jobsets')->search(
|
||||
{ "project.enabled" => 1, "me.enabled" => 1,
|
||||
, owner => $c->stash->{user}->username
|
||||
},
|
||||
{ order_by => ["project", "name"]
|
||||
, join => ["project"]
|
||||
});
|
||||
|
||||
$c->stash->{jobsets} = [jobsetOverview_($c, $jobsets)];
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
@ -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) = @_;
|
||||
|
||||
|
Reference in New Issue
Block a user