hydra: order machines by enabled/disabled, add green and red color for enabled/disabled

This commit is contained in:
Rob Vermaas 2010-10-21 14:37:03 +00:00
parent 7cd219bcbc
commit 0f1c580731
2 changed files with 2 additions and 2 deletions

View file

@ -45,7 +45,7 @@ sub index : Chained('admin') PathPart('') Args(0) {
my ($self, $c) = @_;
$c->stash->{machines} = [$c->model('DB::BuildMachines')->search(
{},
{ order_by => "hostname"
{ order_by => ["enabled DESC", "hostname"]
, '+select' => ["(select bs.stoptime from buildsteps as bs where bs.machine = (me.username || '\@' || me.hostname) and not bs.stoptime is null order by bs.stoptime desc limit 1)"]
, '+as' => ['idle']
})];

View file

@ -20,7 +20,7 @@
<table style="width: 40em;">
<thead>
<tr>
<th colspan="5">
<th colspan="5" style="background-color: [% IF m.enabled == 1 %]lime[% ELSE %]red[% END %];">
[% IF m.enabled == 1 %]
[% INCLUDE maybeLink uri = c.uri_for('/admin/machine' m.hostname 'disable' ) content='-' %]
[% ELSE %]