forked from lix-project/hydra
automatic reload of tail log when build is running
This commit is contained in:
parent
9aeaef80fc
commit
559ab9c97a
|
@ -127,6 +127,16 @@ sub showLog {
|
||||||
$c->forward('Hydra::View::Plain');
|
$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") {
|
elsif ($mode eq "tail") {
|
||||||
$c->stash->{'plain'} = { data => (scalar `$pipestart | tail -n 50`) || " " };
|
$c->stash->{'plain'} = { data => (scalar `$pipestart | tail -n 50`) || " " };
|
||||||
$c->forward('Hydra::View::Plain');
|
$c->forward('Hydra::View::Plain');
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
|
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF step.logfile %]
|
[% IF step.logfile %]
|
||||||
(<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>, <a href="[% "$log/tail" %]">tail</a>)
|
(<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>, <a href="[% "$log/tail-reload" %]">tail</a>)
|
||||||
[% END %]
|
[% END %]
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
<td>
|
<td>
|
||||||
<a href="[% c.uri_for('/build' build.id 'log') %]"><strong>Available</strong></a>
|
<a href="[% c.uri_for('/build' build.id 'log') %]"><strong>Available</strong></a>
|
||||||
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>,
|
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>,
|
||||||
<a href="[% c.uri_for('/build' build.id 'log' 'tail') %]">tail</a>)
|
<a href="[% c.uri_for('/build' build.id 'log' 'tail-reload') %]">tail</a>)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
@ -351,7 +351,7 @@
|
||||||
<td>
|
<td>
|
||||||
<a href="[% c.uri_for('/build' build.id 'log') %]"><strong>Available</strong></a>
|
<a href="[% c.uri_for('/build' build.id 'log') %]"><strong>Available</strong></a>
|
||||||
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>,
|
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>,
|
||||||
<a href="[% c.uri_for('/build' build.id 'log' 'tail') %]">tail</a>)
|
<a href="[% c.uri_for('/build' build.id 'log' 'tail-reload') %]">tail</a>)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
|
@ -141,9 +141,11 @@ pre {
|
||||||
}
|
}
|
||||||
|
|
||||||
pre.buildlog {
|
pre.buildlog {
|
||||||
border: 1px solid black;
|
border: 3px solid darkblue;
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
background: black;
|
||||||
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.buildlog {
|
div.buildlog {
|
||||||
|
|
Loading…
Reference in a new issue