2022-01-13 12:14:38 +00:00
|
|
|
- runner_name = "##{@runner.id} (#{@runner.short_sha})"
|
2022-05-06 03:08:30 +00:00
|
|
|
- breadcrumb_title _('Edit')
|
|
|
|
- page_title _('Edit'), runner_name
|
|
|
|
- add_to_breadcrumbs _('Runners'), admin_runners_path
|
|
|
|
- add_to_breadcrumbs runner_name, admin_runner_path(@runner)
|
2021-03-30 12:10:51 +00:00
|
|
|
|
2022-05-05 12:08:03 +00:00
|
|
|
#js-admin-runner-edit{ data: {runner_id: @runner.id, runner_path: admin_runner_path(@runner) } }
|
2015-08-26 01:42:46 +00:00
|
|
|
|
2022-04-26 09:08:59 +00:00
|
|
|
- if @runner.project_type?
|
|
|
|
.gl-overflow-auto
|
|
|
|
%h4.gl-font-lg.gl-my-5= _('Restrict projects for this runner')
|
2015-08-26 01:42:46 +00:00
|
|
|
|
2022-04-26 09:08:59 +00:00
|
|
|
- if @runner.runner_projects.any?
|
|
|
|
%table.table{ data: { testid: 'assigned-projects' } }
|
|
|
|
%thead
|
2015-08-26 01:42:46 +00:00
|
|
|
%tr
|
2022-04-26 09:08:59 +00:00
|
|
|
%th= _('Assigned projects')
|
|
|
|
- @runner.runner_projects.each do |runner_project|
|
|
|
|
- project = runner_project.project
|
|
|
|
- if project
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= render Pajamas::AlertComponent.new(variant: :danger,
|
|
|
|
dismissible: false,
|
2022-05-06 00:07:56 +00:00
|
|
|
title: project.full_name) do |c|
|
|
|
|
= c.actions do
|
2022-04-26 09:08:59 +00:00
|
|
|
= link_to _('Disable'), admin_namespace_project_runner_project_path(project.namespace, project, runner_project), method: :delete, class: 'btn gl-alert-action btn-confirm btn-md gl-button'
|
2022-04-21 03:09:30 +00:00
|
|
|
|
2022-04-26 09:08:59 +00:00
|
|
|
%table.table{ data: { testid: 'unassigned-projects' } }
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th= s_('Runners|Select projects to assign to this runner')
|
|
|
|
%th
|
2022-04-21 03:09:30 +00:00
|
|
|
|
|
|
|
%tr
|
|
|
|
%td
|
2022-04-26 09:08:59 +00:00
|
|
|
= form_tag edit_admin_runner_path(@runner), id: 'runner-projects-search', class: 'form-inline', method: :get do
|
|
|
|
.input-group
|
|
|
|
= search_field_tag :search, params[:search], class: 'form-control gl-form-input', spellcheck: false
|
|
|
|
.input-group-append
|
|
|
|
= submit_tag _('Search'), class: 'gl-button btn btn-default'
|
|
|
|
|
2022-04-21 03:09:30 +00:00
|
|
|
%td
|
2022-04-26 09:08:59 +00:00
|
|
|
- @projects.each do |project|
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= project.full_name
|
|
|
|
%td
|
|
|
|
.float-right
|
|
|
|
= form_for project.runner_projects.new, url: admin_namespace_project_runner_projects_path(project.namespace, project), method: :post do |f|
|
|
|
|
= f.hidden_field :runner_id, value: @runner.id
|
|
|
|
= f.submit _('Enable'), class: 'gl-button btn btn-sm'
|
|
|
|
= paginate_without_count @projects
|