diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index d2cd6551..f9f6679a 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -63,6 +63,21 @@ sub queue :Local { $c->stash->{flashMsg} = $c->flash->{buildMsg}; } +sub timeline :Local { + my ($self, $c) = @_; + my $pit = time()-(24*60*60)-1; + $pit = 1258469400 - (24*60*60)-1; + + $c->stash->{template} = 'timeline.tt'; + $c->stash->{pit} = $pit; + $c->stash->{builds} = [$c->model('DB::Builds')->search( + {finished => 1, stoptime => { '>' => $pit } } + , { join => 'resultInfo' + , order_by => ["starttime"] + , '+select' => [ 'resultInfo.starttime', 'resultInfo.stoptime', 'resultInfo.buildstatus' ] + , '+as' => [ 'starttime', 'stoptime', 'buildstatus' ] + })]; +} # Hydra::Base::Controller::ListBuilds needs this. sub get_builds : Chained('/') PathPart('') CaptureArgs(0) { diff --git a/src/root/timeline.tt b/src/root/timeline.tt new file mode 100644 index 00000000..ca21aeb6 --- /dev/null +++ b/src/root/timeline.tt @@ -0,0 +1,66 @@ +[% USE date %] + +[% WRAPPER layout.tt title="Timeline" %] + +[% PROCESS common.tt %] + +

Hydra timeline of last 24 hours

+ + + + + + + +
+ + +[% END %]