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) = @_; my ($self, $c) = @_;
$c->stash->{machines} = [$c->model('DB::BuildMachines')->search( $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)"] , '+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'] , '+as' => ['idle']
})]; })];

View file

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