diff --git a/src/lib/Hydra/Controller/Admin.pm b/src/lib/Hydra/Controller/Admin.pm index 839e2d14..780835c2 100644 --- a/src/lib/Hydra/Controller/Admin.pm +++ b/src/lib/Hydra/Controller/Admin.pm @@ -32,21 +32,21 @@ sub machines : Chained('admin') PathPart('machines') Args(0) { } -sub clear_queue_non_current : Chained('admin') Path('clear-queue-non-current') Args(0) { +sub clear_queue_non_current : Chained('admin') PathPart('clear-queue-non-current') Args(0) { my ($self, $c) = @_; $c->model('DB::Builds')->search({finished => 0, iscurrent => 0, busy => 0})->update({ finished => 1, buildstatus => 4, timestamp => time}); $c->res->redirect($c->request->referer // "/admin"); } -sub clearfailedcache : Chained('admin') Path('clear-failed-cache') Args(0) { +sub clearfailedcache : Chained('admin') PathPart('clear-failed-cache') Args(0) { my ($self, $c) = @_; my $r = `nix-store --clear-failed-paths '*'`; $c->res->redirect($c->request->referer // "/admin"); } -sub clearvcscache : Chained('admin') Path('clear-vcs-cache') Args(0) { +sub clearvcscache : Chained('admin') PathPart('clear-vcs-cache') Args(0) { my ($self, $c) = @_; print "Clearing path cache\n"; @@ -65,7 +65,7 @@ sub clearvcscache : Chained('admin') Path('clear-vcs-cache') Args(0) { } -sub managenews : Chained('admin') Path('news') Args(0) { +sub managenews : Chained('admin') PathPart('news') Args(0) { my ($self, $c) = @_; $c->stash->{newsItems} = [$c->model('DB::NewsItems')->search({}, {order_by => 'createtime DESC'})]; @@ -74,7 +74,7 @@ sub managenews : Chained('admin') Path('news') Args(0) { } -sub news_submit : Chained('admin') Path('news/submit') Args(0) { +sub news_submit : Chained('admin') PathPart('news/submit') Args(0) { my ($self, $c) = @_; requirePost($c); @@ -92,7 +92,7 @@ sub news_submit : Chained('admin') Path('news/submit') Args(0) { } -sub news_delete : Chained('admin') Path('news/delete') Args(1) { +sub news_delete : Chained('admin') PathPart('news/delete') Args(1) { my ($self, $c, $id) = @_; txn_do($c->model('DB')->schema, sub {