Machine status: Don't show removed machines anymore

[?]
Apr 23, 2013, 1:20 PM
RFGPN7U7DOFZMPNLJDTS3IXEYSDN57HUDKI5I54NU4LC376JUR2AC

Dependencies

  • [2] BZUB3ZSH Use get_column for 'as' column (max_stoptime).
  • [3] J4R2VCPP Fix showing build steps in the machine status page
  • [4] SMCOU72F hydra: add some admin for adding/enabling/etc build machines
  • [5] R2PON6R7 Allow non-admin users to see the machine status page
  • [6] V6S6OYIA Formatting tweaks
  • [7] HTL6HIBM machine-status: Read /etc/nix.machines instead of using the BuildMachines table
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] ZWCTAZGL added newsitems, added some admin options to clear various caches.

Change contents

  • replacement in src/lib/Hydra/Controller/Root.pm at line 78
    [4.32][4.32:278](),[4.278][2.0:82]()
    my $idles = $c->model('DB::BuildSteps')->search(
    { stoptime => { '!=', undef } },
    { select => [ 'machine', { max => 'stoptime', -as => 'max_stoptime' }], group_by => "machine" });
    while (my $idle = $idles->next) {
    ${$machines}{$idle->machine}{'idle'} = $idle->get_column('max_stoptime');
    [4.32]
    [4.346]
    # Add entry for localhost.
    ${$machines}{''} //= {};
    # Get the last finished build step for each machine.
    foreach my $m (keys %{$machines}) {
    my $idle = $c->model('DB::BuildSteps')->find(
    { machine => "$m", stoptime => { '!=', undef } },
    { order_by => 'stoptime desc', rows => 1 });
    ${$machines}{$m}{'idle'} = $idle ? $idle->stoptime : 0;
  • edit in src/lib/Hydra/Controller/Root.pm at line 89
    [4.352]
    [4.352]
  • replacement in src/root/machine-status.tt at line 10
    [4.259][3.63:129](),[3.129][4.416:437](),[4.1459][4.416:437](),[4.416][4.416:437](),[4.437][3.130:192]()
    [% IF !m.key || m.value.maxJobs %]
    Enabled:
    [% ELSE %]
    Disabled:
    [% END %] <tt>[% name %]</tt>
    [4.259]
    [3.192]
    <tt>[% name %]</tt>
  • replacement in src/root/machine-status.tt at line 34
    [4.1730][4.1730:1844]()
    <tr><td colspan="5">Idle since [% INCLUDE renderDuration duration = curTime - m.value.idle %]</td></tr>
    [4.1730]
    [4.1844]
    <tr><td colspan="5">Idle for [% INCLUDE renderDuration duration = curTime - m.value.idle %]</td></tr>