summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-06-28 19:55:12 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-06-28 19:55:12 +0800
commit397a69f834ad8854301df4c09035e16d35ac5158 (patch)
tree51339239664ebec1acad15ece41893cf88e4dd24
parentb5c8d58afb7840acd9c26129b2ff0c0fe3f2586e (diff)
downloadgitlab-ce-397a69f834ad8854301df4c09035e16d35ac5158.tar.gz
Allow admins to assign locked runners:
And show information about locked status. Help! This looks bad :o
-rw-r--r--app/controllers/admin/runner_projects_controller.rb2
-rw-r--r--app/views/admin/runners/_runner.html.haml2
-rw-r--r--app/views/admin/runners/index.html.haml3
-rw-r--r--app/views/admin/runners/show.html.haml3
4 files changed, 8 insertions, 2 deletions
diff --git a/app/controllers/admin/runner_projects_controller.rb b/app/controllers/admin/runner_projects_controller.rb
index 5de06b4ad14..bc65dcc33d3 100644
--- a/app/controllers/admin/runner_projects_controller.rb
+++ b/app/controllers/admin/runner_projects_controller.rb
@@ -4,8 +4,6 @@ class Admin::RunnerProjectsController < Admin::ApplicationController
def create
@runner = Ci::Runner.find(params[:runner_project][:runner_id])
- return head(403) if @runner.locked?
-
runner_project = @runner.assign_to(@project, current_user)
if runner_project.persisted?
diff --git a/app/views/admin/runners/_runner.html.haml b/app/views/admin/runners/_runner.html.haml
index 36b21eefdee..875fa086dbf 100644
--- a/app/views/admin/runners/_runner.html.haml
+++ b/app/views/admin/runners/_runner.html.haml
@@ -4,6 +4,8 @@
%span.label.label-success shared
- else
%span.label.label-info specific
+ - if runner.locked?
+ %span.label.label-danger locked
- unless runner.active?
%span.label.label-danger paused
diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml
index 5eff77aff2d..24b2312d202 100644
--- a/app/views/admin/runners/index.html.haml
+++ b/app/views/admin/runners/index.html.haml
@@ -40,6 +40,9 @@
%span.label.label-info specific
\- run builds from assigned projects
%li
+ %span.label.label-danger locked
+ \- runner cannot be assigned to other projects
+ %li
%span.label.label-danger paused
\- runner will not receive any new builds
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml
index 61abfc6ecbe..6b3aa122c84 100644
--- a/app/views/admin/runners/show.html.haml
+++ b/app/views/admin/runners/show.html.haml
@@ -64,6 +64,9 @@
= project.name_with_namespace
%td
.pull-right
+ - if @runner.locked?
+ = icon('lock', class: 'has-tooltip', title: 'Locked to current projects')
+
= form_for [:admin, project.namespace.becomes(Namespace), project, project.runner_projects.new] do |f|
= f.hidden_field :runner_id, value: @runner.id
= f.submit 'Enable', class: 'btn btn-xs'