Commit 397a69f8 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Allow admins to assign locked runners:

And show information about locked status.

Help! This looks bad :o
parent b5c8d58a
...@@ -4,8 +4,6 @@ class Admin::RunnerProjectsController < Admin::ApplicationController ...@@ -4,8 +4,6 @@ class Admin::RunnerProjectsController < Admin::ApplicationController
def create def create
@runner = Ci::Runner.find(params[:runner_project][:runner_id]) @runner = Ci::Runner.find(params[:runner_project][:runner_id])
return head(403) if @runner.locked?
runner_project = @runner.assign_to(@project, current_user) runner_project = @runner.assign_to(@project, current_user)
if runner_project.persisted? if runner_project.persisted?
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
%span.label.label-success shared %span.label.label-success shared
- else - else
%span.label.label-info specific %span.label.label-info specific
- if runner.locked?
%span.label.label-danger locked
- unless runner.active? - unless runner.active?
%span.label.label-danger paused %span.label.label-danger paused
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
%li %li
%span.label.label-info specific %span.label.label-info specific
\- run builds from assigned projects \- run builds from assigned projects
%li
%span.label.label-danger locked
\- runner cannot be assigned to other projects
%li %li
%span.label.label-danger paused %span.label.label-danger paused
\- runner will not receive any new builds \- runner will not receive any new builds
......
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
= project.name_with_namespace = project.name_with_namespace
%td %td
.pull-right .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| = form_for [:admin, project.namespace.becomes(Namespace), project, project.runner_projects.new] do |f|
= f.hidden_field :runner_id, value: @runner.id = f.hidden_field :runner_id, value: @runner.id
= f.submit 'Enable', class: 'btn btn-xs' = f.submit 'Enable', class: 'btn btn-xs'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment