diff --git a/src/lib/Hydra/Controller/Admin.pm b/src/lib/Hydra/Controller/Admin.pm index 61835b93..3b935956 100644 --- a/src/lib/Hydra/Controller/Admin.pm +++ b/src/lib/Hydra/Controller/Admin.pm @@ -56,11 +56,7 @@ sub users : Chained('admin') PathPart('users') Args(0) { sub machines : Chained('admin') PathPart('machines') Args(0) { my ($self, $c) = @_; - $c->stash->{machines} = [$c->model('DB::BuildMachines')->search({}, {order_by => "hostname"})]; - $c->stash->{systems} = [$c->model('DB::SystemTypes')->search({}, {select => ["system"], order_by => "system" })]; - $c->stash->{nixMachines} = nixMachines($c); - $c->stash->{nixMachinesWritable} = (-e "/etc/nix.machines" && -w "/etc/nix.machines"); - + $c->stash->{machines} = getMachines; $c->stash->{template} = 'machines.tt'; } diff --git a/src/root/machines.tt b/src/root/machines.tt index d498676d..eea0efe8 100644 --- a/src/root/machines.tt +++ b/src/root/machines.tt @@ -8,32 +8,23 @@ Machine Max concurrent Speed factor - [% FOREACH s IN systems %][% s.system %][% END %] + Systems [% FOREACH m IN machines %] - - [% m.hostname %] - [% m.maxconcurrent %] - [% m.speedfactor %] - [% FOREACH s IN systems %] - - [% checked = false %] - [% FOREACH ms IN m.buildmachinesystemtypes %] - [% checked = ms.system == s.system %] - [% BREAK IF checked %] - [% END %] - - - [% END %] + 0 %]CHECKED[% END %] disabled="true" /> + [% m.key %] + [% m.value.maxJobs %] + [% m.value.speedFactor %] + + [% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END; system; END %] + [% END %] -

Add a new machine

- [% END %]