From 559ab9c97ac129c47bbe72d14a4ca3c9b0a35844 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 2 Feb 2011 09:00:52 +0000 Subject: [PATCH] automatic reload of tail log when build is running --- src/lib/Hydra/Controller/Build.pm | 10 ++++++++++ src/root/build.tt | 6 +++--- src/root/static/css/hydra.css | 4 +++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index c4eb7998..5ac1da15 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -127,6 +127,16 @@ sub showLog { $c->forward('Hydra::View::Plain'); } + elsif ($mode eq "tail-reload") { + my $url = $c->request->uri->as_string; + $url =~ s/tail-reload/tail/g; + $c->stash->{url} = $url; + $c->stash->{reload} = defined $c->stash->{build}->schedulingInfo && $c->stash->{build}->schedulingInfo->busy; + $c->stash->{title} = ""; + $c->stash->{contents} = (scalar `$pipestart | tail -n 50`) || " "; + $c->stash->{template} = 'plain-reload.tt'; + } + elsif ($mode eq "tail") { $c->stash->{'plain'} = { data => (scalar `$pipestart | tail -n 50`) || " " }; $c->forward('Hydra::View::Plain'); diff --git a/src/root/build.tt b/src/root/build.tt index 8d778ad9..6b5ed9a5 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -54,7 +54,7 @@ Failed: [% HTML.escape(step.errormsg) %] [% END %] [% IF step.logfile %] - (log, raw, tail) + (log, raw, tail) [% END %] @@ -143,7 +143,7 @@ Available (raw, - tail) + tail) [% END %] @@ -351,7 +351,7 @@ Available (raw, - tail) + tail) [% END %] diff --git a/src/root/static/css/hydra.css b/src/root/static/css/hydra.css index d3f3ed92..a740bc58 100644 --- a/src/root/static/css/hydra.css +++ b/src/root/static/css/hydra.css @@ -141,9 +141,11 @@ pre { } pre.buildlog { - border: 1px solid black; + border: 3px solid darkblue; padding: 0.3em; white-space: pre-wrap; + background: black; + color: #ffffff; } div.buildlog {