forked from lix-project/hydra
add links in admin page to clear queue (all non-running builds, and all non-running old (non-current) builds)
This commit is contained in:
parent
bb6ef9c2ed
commit
355135b6e8
|
@ -294,6 +294,18 @@ sub machine_disable : Chained('machine') PathPart('disable') Args(0) {
|
||||||
$c->res->redirect("/admin/machines");
|
$c->res->redirect("/admin/machines");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub clear_queue_non_current : Chained('admin') Path('clear-queue-non-current') Args(0) {
|
||||||
|
my ($self, $c) = @_;
|
||||||
|
$c->model('DB::Builds')->search({iscurrent => 0, busy => 0}, { join => 'schedulingInfo' })->delete_all;
|
||||||
|
$c->res->redirect("/admin");
|
||||||
|
}
|
||||||
|
|
||||||
|
sub clear_queue : Chained('admin') Path('clear-queue') Args(0) {
|
||||||
|
my ($self, $c) = @_;
|
||||||
|
$c->model('DB::Builds')->search({busy => 0}, { join => 'schedulingInfo' })->delete_all;
|
||||||
|
$c->res->redirect("/admin");
|
||||||
|
}
|
||||||
|
|
||||||
sub clearfailedcache : Chained('admin') Path('clear-failed-cache') Args(0) {
|
sub clearfailedcache : Chained('admin') Path('clear-failed-cache') Args(0) {
|
||||||
my ($self, $c) = @_;
|
my ($self, $c) = @_;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,12 @@
|
||||||
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Project').action_for('create')) content = "Create project" %]</li>
|
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Project').action_for('create')) content = "Create project" %]</li>
|
||||||
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('users')) content = "Manage users" %]</li>
|
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('users')) content = "Manage users" %]</li>
|
||||||
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('news')) content = "Manage news" %]</li>
|
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('news')) content = "Manage news" %]</li>
|
||||||
|
<li>Queue
|
||||||
|
<ul>
|
||||||
|
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('clear_queue')) content = "Clear all non-running builds from queue." confirmmsg = "Are you sure you want to clear the queue?" %]</li>
|
||||||
|
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('clear_queue_non_current')) content = "Clear all non-running old builds from queue." confirmmsg = "Are you sure you want to clear the queue?" %]</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Caching
|
<li>Caching
|
||||||
<ul>
|
<ul>
|
||||||
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('clearfailedcache')) content = "Clear failed builds cache" confirmmsg = "Are you sure you want to clear the failed builds cache?" %]</li>
|
<li>[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('clearfailedcache')) content = "Clear failed builds cache" confirmmsg = "Are you sure you want to clear the failed builds cache?" %]</li>
|
||||||
|
|
Loading…
Reference in a new issue