diff --git a/src/lib/Hydra/Controller/Admin.pm b/src/lib/Hydra/Controller/Admin.pm index a4dca4b2..d1eaef85 100644 --- a/src/lib/Hydra/Controller/Admin.pm +++ b/src/lib/Hydra/Controller/Admin.pm @@ -52,23 +52,6 @@ sub admin : Chained('/') PathPart('admin') CaptureArgs(0) { } -sub index : Chained('admin') PathPart('') Args(0) { - my ($self, $c) = @_; - $c->stash->{machines} = [$c->model('DB::BuildMachines')->search( - {}, - { 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'] - })]; - $c->stash->{steps} = [ $c->model('DB::BuildSteps')->search( - { finished => 0, 'me.busy' => 1, 'build.busy' => 1, }, - { join => [ 'build' ] - , order_by => [ 'machine', 'stepnr' ] - } ) ]; - $c->stash->{template} = 'admin.tt'; -} - - sub updateUser { my ($c, $user) = @_; @@ -119,8 +102,6 @@ sub create_user_submit : Chained('admin') PathPart('create-user/submit') Args(0) } - - sub user : Chained('admin') PathPart('user') CaptureArgs(1) { my ($self, $c, $username) = @_; diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index fd5a8d0d..7769a73e 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -102,6 +102,23 @@ sub status :Local { } +sub machines :Local Args(0) { + my ($self, $c) = @_; + $c->stash->{machines} = [$c->model('DB::BuildMachines')->search( + {}, + { 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'] + })]; + $c->stash->{steps} = [ $c->model('DB::BuildSteps')->search( + { finished => 0, 'me.busy' => 1, 'build.busy' => 1, }, + { join => [ 'build' ] + , order_by => [ 'machine', 'stepnr' ] + } ) ]; + $c->stash->{template} = 'machine-status.tt'; +} + + # Hydra::Base::Controller::ListBuilds needs this. sub get_builds : Chained('/') PathPart('') CaptureArgs(0) { my ($self, $c) = @_; diff --git a/src/root/all.tt b/src/root/all.tt index 5a568028..5ebe39c9 100644 --- a/src/root/all.tt +++ b/src/root/all.tt @@ -1,4 +1,4 @@ -[% WRAPPER layout.tt title="All builds" _ +[% WRAPPER layout.tt title="Recent builds" _ (job ? " for job $project.name:$jobset.name:$job.name" : jobset ? " for jobset $project.name:$jobset.name" : project ? " for project $project.name" : "") %] diff --git a/src/root/admin.tt b/src/root/machine-status.tt similarity index 100% rename from src/root/admin.tt rename to src/root/machine-status.tt diff --git a/src/root/machines.tt b/src/root/machines.tt index 26cee09c..d498676d 100644 --- a/src/root/machines.tt +++ b/src/root/machines.tt @@ -36,12 +36,4 @@

Add a new machine

-

-Resulting /etc/nix.machines [% IF nixMachinesWritable == 0 %](note: file is not writable!)[% END%]: -

- -
-[% nixMachines %]
-
- [% END %] diff --git a/src/root/topbar.tt b/src/root/topbar.tt index e92cdf94..249fab77 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -31,10 +31,10 @@ uri = c.uri_for(c.controller('Root').action_for('queue')) title = "Queue ("_ nrRunningBuilds _"/"_ nrQueuedBuilds _")" %] [% INCLUDE makeLink - uri = c.uri_for(c.controller(Root).action_for('status')) + uri = c.uri_for(c.controller('Root').action_for('status')) title = "Active build steps" %] [% INCLUDE makeLink - uri = c.uri_for(c.controller('Admin').action_for('index')) + uri = c.uri_for(c.controller('Root').action_for('machines')) title = "Machine status" %] [% INCLUDE makeLink uri = c.uri_for(c.controller('Root').action_for('all'))