Lazy load the metrics tab

This commit is contained in:
Eelco Dolstra
2016-03-25 13:49:06 +01:00
parent 7a72f64e5e
commit dab16fb26b
3 changed files with 34 additions and 25 deletions

View File

@ -77,7 +77,13 @@ sub overview : Chained('job') PathPart('') Args(0) {
, jobset => $c->stash->{jobset}->name
, job => $c->stash->{job}->name
})->count == 1 if $c->user_exists;
}
sub metrics_tab : Chained('job') PathPart('metrics-tab') Args(0) {
my ($self, $c) = @_;
my $job = $c->stash->{job};
$c->stash->{template} = 'job-metrics-tab.tt';
$c->stash->{metrics} = [ $job->buildmetrics->search(
{ }, { select => ["name"], distinct => 1, order_by => "name", }) ];
}