From 397a69f834ad8854301df4c09035e16d35ac5158 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 28 Jun 2016 19:55:12 +0800 Subject: Allow admins to assign locked runners: And show information about locked status. Help! This looks bad :o --- app/controllers/admin/runner_projects_controller.rb | 2 -- app/views/admin/runners/_runner.html.haml | 2 ++ app/views/admin/runners/index.html.haml | 3 +++ app/views/admin/runners/show.html.haml | 3 +++ 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 @@ -39,6 +39,9 @@ %li %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' -- cgit v1.2.1