hydra: order machines by enabled/disabled, add green and red color for enabled/disabled
This commit is contained in:
parent
7cd219bcbc
commit
0f1c580731
|
@ -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']
|
||||
})];
|
||||
|
|
|
@ -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 %]
|
||||
|
|
Loading…
Reference in a new issue