Fix showing build steps in the machine status page

This was broken because of the comparison

  step.machine.match('@(.*)').0 == m.key

where m.key contains the SSH user.

Also some style tweaks.
This commit is contained in:
Eelco Dolstra 2013-04-23 14:24:48 +02:00
parent bd5454d5d9
commit b3612b8a81
2 changed files with 13 additions and 10 deletions

View file

@ -3,28 +3,33 @@
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
[% FOREACH m IN machines %] [% FOREACH m IN machines %]
[% name = m.key ? m.key.match('@(.*)').0 : "localhost" %]
<thead> <thead>
<tr> <tr>
<th colspan="5"> <th colspan="5">
[% IF m.value.maxJobs > 0 %] [% IF !m.key || m.value.maxJobs %]
Running Enabled:
[% ELSE %] [% ELSE %]
Stopped Disabled:
[% END %] <tt>[% m.key %]</tt> (<tt>[% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END; system; END %])</tt> [% END %] <tt>[% name %]</tt>
[% IF m.value.systemTypes %]
([% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% system %]</tt>[% END %])
[% END %]
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
[% idle = 1 %] [% idle = 1 %]
[% FOREACH step IN steps %] [% FOREACH step IN steps %]
[% IF step.machine.match('@(.*)').0 == m.key %] [% name2 = step.machine ? step.machine.match('@(.*)').0 : "localhost" %]
[% IF name == name2 %]
[% idle = 0 %] [% idle = 0 %]
<tr> <tr>
<td><tt>[% INCLUDE renderFullJobName project = step.build.project.name jobset = step.build.jobset.name job = step.build.job.name %]</tt></td> <td><tt>[% INCLUDE renderFullJobName project = step.build.project.name jobset = step.build.jobset.name job = step.build.job.name %]</tt></td>
<td><tt>[% step.system %]</tt></td> <td><tt>[% step.system %]</tt></td>
<td><a href="[% c.uri_for('/build' step.build.id) %]">[% step.build.id %]</a></td> <td><a href="[% c.uri_for('/build' step.build.id) %]">[% step.build.id %]</a></td>
<td><tt>[% step.drvpath.match('-(.*)').0 %]</tt></td> <td><tt>[% step.drvpath.match('-(.*)').0 %]</tt></td>
<td class='right'>[% INCLUDE renderDuration duration = curTime - step.starttime %] </td> <td style="width: 10em">[% INCLUDE renderDuration duration = curTime - step.starttime %] </td>
</tr> </tr>
[% END %] [% END %]
[% END %] [% END %]
@ -32,13 +37,11 @@
[% IF m.value.idle %] [% IF m.value.idle %]
<tr><td colspan="5">Idle since [% INCLUDE renderDuration duration = curTime - m.value.idle %]</td></tr> <tr><td colspan="5">Idle since [% INCLUDE renderDuration duration = curTime - m.value.idle %]</td></tr>
[% ELSE %] [% ELSE %]
<tr><td colspan="5">Never built</td></tr> <tr><td colspan="5">Never used</td></tr>
[% END %] [% END %]
[% END %] [% END %]
</tbody> </tbody>
[% END %] [% END %]
</table> </table>
[% END %] [% END %]

View file

@ -14,7 +14,7 @@
<td><a href="[% c.uri_for('/build' step.build.id) %]">[% step.build.id %]</a></td> <td><a href="[% c.uri_for('/build' step.build.id) %]">[% step.build.id %]</a></td>
<td><a class="row-link" href="[% c.uri_for('/build' step.build.id 'nixlog' step.stepnr 'tail-reload') %]">[% step.stepnr %]</a></td> <td><a class="row-link" href="[% c.uri_for('/build' step.build.id 'nixlog' step.stepnr 'tail-reload') %]">[% step.stepnr %]</a></td>
<td><tt>[% step.drvpath.match('-(.*)').0 %]</tt></td> <td><tt>[% step.drvpath.match('-(.*)').0 %]</tt></td>
<td class='right'>[% INCLUDE renderDuration duration = curTime - step.starttime %] </td> <td style="width: 10em">[% INCLUDE renderDuration duration = curTime - step.starttime %] </td>
</tr> </tr>
[% END %] [% END %]
</tbody> </tbody>