Author: rob
Date: Thu Oct 21 14:37:03 2010
New Revision: 24405
URL: https://svn.nixos.org/websvn/nix/?rev=24405&sc=1

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

Modified:
   hydra/trunk/src/lib/Hydra/Controller/Admin.pm
   hydra/trunk/src/root/admin.tt

Modified: hydra/trunk/src/lib/Hydra/Controller/Admin.pm
==============================================================================
--- hydra/trunk/src/lib/Hydra/Controller/Admin.pm       Thu Oct 21 12:58:19 
2010        (r24404)
+++ hydra/trunk/src/lib/Hydra/Controller/Admin.pm       Thu Oct 21 14:37:03 
2010        (r24405)
@@ -45,7 +45,7 @@
     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']
         })];

Modified: hydra/trunk/src/root/admin.tt
==============================================================================
--- hydra/trunk/src/root/admin.tt       Thu Oct 21 12:58:19 2010        (r24404)
+++ hydra/trunk/src/root/admin.tt       Thu Oct 21 14:37:03 2010        (r24405)
@@ -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 %]
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to