first try for timeline of last 24 hours in hydra

This commit is contained in:
Rob Vermaas
2009-12-01 19:15:09 +00:00
parent 2816b828e9
commit f99b1ee9b1
2 changed files with 81 additions and 0 deletions

View File

@ -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) {