Controller/Build: use showLog in view_runcommandlog

This also adds the `runcommandlog` object to the stash so that we can
access its uuid as well as command run in order to display more useful
and specific information on the webpage.
This commit is contained in:
Cole Helbling 2022-01-26 12:38:06 -08:00
parent 1d0076408b
commit 3594ba942a
2 changed files with 7 additions and 5 deletions

View file

@ -142,10 +142,12 @@ sub view_log : Chained('buildChain') PathPart('log') {
sub view_runcommandlog : Chained('buildChain') PathPart('runcommandlog') {
my ($self, $c, $uuid) = @_;
my ($self, $c, $uuid, $mode) = @_;
$c->stash->{log_uri} = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), $uuid);
my $log_uri = $c->uri_for($c->controller('Root')->action_for("runcommandlog"), $uuid);
showLog($c, $mode, $log_uri);
$c->stash->{template} = 'runcommand-log.tt';
$c->stash->{runcommandlog} = $c->stash->{build}->runcommandlogs->find({ uuid => $uuid });
}

View file

@ -11,10 +11,10 @@
[% ELSE %]
is
[% END %]
the output of a RunCommand execution of derivation <tt>[% IF step; step.drvpath; ELSE; build.drvpath; END %]</tt>.
the output of a RunCommand execution of the command <tt>[% runcommandlog.command %]</tt>
on <a href="[% c.uri_for('/build', build.id) %]">Build [% build.id %]</a>.
[% IF tail %]
The <a href="[% step ? c.uri_for('/build' build.id 'nixlog' step.stepnr)
: c.uri_for('/build' build.id 'log') %]">full log</a> is also available.
The <a href="[% c.uri_for('/build', build.id, 'runcommandlog', runcommandlog.uuid) %]">full log</a> is also available.
[% END %]
</p>