debian-mirror-gitlab/app/views/projects/runners/_runner.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
2.7 KiB
Text
Raw Normal View History

2021-04-29 21:17:54 +05:30
%li{ id: dom_id(runner) }
.gl-display-flex.gl-justify-content-space-between
%div
= runner_status_icon(runner, size: 16)
- if @project_runners.include?(runner)
= link_to "##{runner.id} (#{runner.short_sha})", project_runner_path(@project, runner)
- else
%span
= "##{runner.id} (#{runner.short_sha})"
2017-09-10 17:25:29 +05:30
- if runner.locked?
2022-06-21 17:19:12 +05:30
%span.has-tooltip{ title: s_('Runners|Runner is locked and available for currently assigned projects only. Only administrators can change the assigned projects.') }
2020-10-24 23:57:45 +05:30
= sprite_icon('lock')
2021-04-29 21:17:54 +05:30
.gl-ml-2
.btn-group.btn-group-sm
- if @project_runners.include?(runner)
= link_to edit_project_runner_path(@project, runner), class: 'btn gl-button btn-icon', title: _('Edit'), aria: { label: _('Edit') }, data: { testid: 'edit-runner-link', toggle: 'tooltip', placement: 'top', container: 'body' } do
= sprite_icon('pencil')
- if runner.active?
2022-05-07 20:08:51 +05:30
= link_to pause_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-icon', title: s_('Runners|Pause from accepting jobs'), aria: { label: _('Pause') }, data: { toggle: 'tooltip', container: 'body', confirm: _("Are you sure?") } do
2021-04-29 21:17:54 +05:30
= sprite_icon('pause')
- else
2022-05-07 20:08:51 +05:30
= link_to resume_project_runner_path(@project, runner), method: :post, class: 'btn gl-button btn-icon', title: s_('Runners|Resume accepting jobs'), aria: { label: _('Resume') }, data: { toggle: 'tooltip', container: 'body' } do
2021-04-29 21:17:54 +05:30
= sprite_icon('play')
- if runner.belongs_to_one_project?
2022-06-21 17:19:12 +05:30
= link_to _('Remove runner'), project_runner_path(@project, runner), aria: { label: _('Remove') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'btn gl-button btn-danger'
2021-04-29 21:17:54 +05:30
- else
- runner_project = @project.runner_projects.find_by(runner_id: runner) # rubocop: disable CodeReuse/ActiveRecord
2022-06-21 17:19:12 +05:30
= link_to _('Disable for this project'), project_runner_project_path(@project, runner_project), aria: { label: _('Disable') }, data: { confirm: _("Are you sure?"), 'confirm-btn-variant': 'danger' }, method: :delete, class: 'btn gl-button btn-danger'
2021-04-29 21:17:54 +05:30
- elsif runner.project_type?
= form_for [@project, @project.runner_projects.new] do |f|
= f.hidden_field :runner_id, value: runner.id
= f.submit _('Enable for this project'), class: 'btn gl-button'
2015-09-25 12:07:36 +05:30
- if runner.description.present?
2021-04-29 21:17:54 +05:30
%p.gl-my-2
2015-09-25 12:07:36 +05:30
= runner.description
2021-01-29 00:20:46 +05:30
- if runner.tags.present?
2021-04-29 21:17:54 +05:30
.gl-my-2
2021-01-29 00:20:46 +05:30
- runner.tags.map(&:name).sort.each do |tag|
2022-01-26 12:08:38 +05:30
= gl_badge_tag tag, variant: :info, size: :sm