Commit 66824e09 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix/reuse-runner-edit-form-in-admin-area' into 'master'

Reuse runners edit form in admin and project area

Reuse runners edit form in admin and project area.

![reuse_runner_form](/uploads/d16e3ee196151b68f584d947f38a7c29/reuse_runner_form.png)

See merge request !4094
parents 5298c3cc a2934f45
......@@ -58,6 +58,6 @@ class Admin::RunnersController < Admin::ApplicationController
end
def runner_params
params.require(:runner).permit(:token, :description, :tag_list, :active)
params.require(:runner).permit(Ci::Runner::FORM_EDITABLE)
end
end
......@@ -64,6 +64,6 @@ class Projects::RunnersController < Projects::ApplicationController
end
def runner_params
params.require(:runner).permit(:description, :tag_list, :active)
params.require(:runner).permit(Ci::Runner::FORM_EDITABLE)
end
end
......@@ -3,7 +3,8 @@ module Ci
extend Ci::Model
LAST_CONTACT_TIME = 5.minutes.ago
AVAILABLE_SCOPES = ['specific', 'shared', 'active', 'paused', 'online']
AVAILABLE_SCOPES = %w[specific shared active paused online]
FORM_EDITABLE = %i[description tag_list active]
has_many :builds, class_name: 'Ci::Build'
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
......
......@@ -22,25 +22,9 @@
%h4 This runner will process builds only from ASSIGNED projects
%p You can't make this a shared runner.
%hr
= form_for @runner, url: admin_runner_path(@runner), html: { class: 'form-horizontal' } do |f|
.form-group
= label_tag :token, class: 'control-label' do
Token
.col-sm-10
= f.text_field :token, class: 'form-control', readonly: true
.form-group
= label_tag :description, class: 'control-label' do
Description
.col-sm-10
= f.text_field :description, class: 'form-control'
.form-group
= label_tag :tag_list, class: 'control-label' do
Tags
.col-sm-10
= f.text_field :tag_list, value: @runner.tag_list.to_s, class: 'form-control'
.help-block You can setup builds to only use runners with specific tags
.form-actions
= f.submit 'Save', class: 'btn btn-save'
.append-bottom-20
= render '/projects/runners/form', runner: @runner, runner_form_url: admin_runner_path(@runner)
.row
.col-md-6
......
= form_for runner, url: runner_form_url, html: { class: 'form-horizontal' } do |f|
.form-group
= label :active, "Active", class: 'control-label'
.col-sm-10
.checkbox
= f.check_box :active
%span.light Paused runners don't accept new builds
.form-group
= label_tag :token, class: 'control-label' do
Token
.col-sm-10
= f.text_field :token, class: 'form-control', readonly: true
.form-group
= label_tag :description, class: 'control-label' do
Description
.col-sm-10
= f.text_field :description, class: 'form-control'
.form-group
= label_tag :tag_list, class: 'control-label' do
Tags
.col-sm-10
= f.text_field :tag_list, value: runner.tag_list.to_s, class: 'form-control'
.help-block You can setup jobs to only use runners with specific tags
.form-actions
= f.submit 'Save changes', class: 'btn btn-save'
......@@ -2,28 +2,4 @@
%h4 Runner ##{@runner.id}
%hr
= form_for @runner, url: runner_path(@runner), html: { class: 'form-horizontal' } do |f|
.form-group
= label :active, "Active", class: 'control-label'
.col-sm-10
.checkbox
= f.check_box :active
%span.light Paused runners don't accept new builds
.form-group
= label_tag :token, class: 'control-label' do
Token
.col-sm-10
= f.text_field :token, class: 'form-control', readonly: true
.form-group
= label_tag :description, class: 'control-label' do
Description
.col-sm-10
= f.text_field :description, class: 'form-control'
.form-group
= label_tag :tag_list, class: 'control-label' do
Tags
.col-sm-10
= f.text_field :tag_list, value: @runner.tag_list.to_s, class: 'form-control'
.help-block You can setup jobs to only use runners with specific tags
.form-actions
= f.submit 'Save changes', class: 'btn btn-save'
= render 'form', runner: @runner, runner_form_url: runner_path(@runner)
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