From 9002b69c2d77341ddfd0b028e0066e293b2bc24b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 28 Aug 2013 11:10:40 +0000 Subject: [PATCH] By default, show the first 250 jobs only This is particularly useful for the Nixpkgs jobsets, which now have ~24K jobs. --- src/lib/Hydra/Controller/Jobset.pm | 5 ++++- src/root/jobset-job-status-tab.tt | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index 9264366b..46041d6d 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -199,7 +199,10 @@ sub job_status_tab : Chained('jobsetChain') PathPart('job-status-tab') Args(0) { } $c->stash->{evals} = $evals; - $c->stash->{jobs} = [sort (keys %jobs)]; + my @jobs = sort (keys %jobs); + $c->stash->{nrJobs} = scalar @jobs; + splice @jobs, 250 if $c->stash->{filter} eq ""; + $c->stash->{jobs} = [@jobs]; } diff --git a/src/root/jobset-job-status-tab.tt b/src/root/jobset-job-status-tab.tt index 44d2a8dd..f1f5a160 100644 --- a/src/root/jobset-job-status-tab.tt +++ b/src/root/jobset-job-status-tab.tt @@ -1,18 +1,22 @@ [% PROCESS common.tt; USE Math %] @@ -23,6 +27,10 @@ [% ELSE %] + [% IF nrJobs > jobs.size %] +
Showing the first [% jobs.size %] jobs only. Show all [% nrJobs %] jobs...
+ [% END %] + [% evalIds = evals.keys.nsort.reverse %]