debian-mirror-gitlab/app/views/admin/runners/_runner.html.haml
2021-09-30 23:02:18 +05:30

80 lines
3.8 KiB
Text

-# Note: This file should stay aligned with:
-# `app/views/groups/runners/_runner.html.haml`
.gl-responsive-table-row{ data: { testid: "runner-row-#{runner.id}" } }
.table-section.section-10.section-wrap
.table-mobile-header{ role: 'rowheader' }= _('Type')
.table-mobile-content
- if runner.instance_type?
%span.badge.badge-pill.gl-badge.sm.badge-success= s_('Runners|shared')
- elsif runner.group_type?
%span.badge.badge-pill.gl-badge.sm.badge-success= s_('Runners|group')
- else
%span.badge.badge-pill.gl-badge.sm.badge-info= s_('Runners|specific')
- if runner.locked?
%span.badge.badge-pill.gl-badge.sm.badge-warning= s_('Runners|locked')
- unless runner.active?
%span.badge.badge-pill.gl-badge.sm.badge-danger= s_('Runners|paused')
.table-section.section-30
.table-mobile-header{ role: 'rowheader' }= s_('Runners|Runner')
.table-mobile-content
= link_to("##{runner.id} (#{runner.short_sha})", admin_runner_path(runner))
.gl-text-truncate
%span{ title: runner.description, data: { toggle: 'tooltip', container: 'body' } }
= runner.description
.table-section.section-10
.table-mobile-header{ role: 'rowheader' }= _('Version')
.table-mobile-content.str-truncated.has-tooltip{ title: runner.version }
= runner.version
.table-section.section-10
.table-mobile-header{ role: 'rowheader' }= _('IP Address')
.table-mobile-content.str-truncated.has-tooltip{ title: runner.ip_address }
= runner.ip_address
.table-section.section-5
.table-mobile-header{ role: 'rowheader' }= _('Projects')
.table-mobile-content
- if runner.instance_type? || runner.group_type?
= _('n/a')
- else
= runner.projects.count(:all)
.table-section.section-5
.table-mobile-header{ role: 'rowheader' }= _('Jobs')
.table-mobile-content
= limited_counter_with_delimiter(runner.builds)
.table-section.section-10.section-wrap
.table-mobile-header{ role: 'rowheader' }= _('Tags')
.table-mobile-content
- runner.tags.map(&:name).sort.each do |tag|
%span.badge.badge-primary.str-truncated.has-tooltip{ title: tag }
= tag
.table-section.section-10
.table-mobile-header{ role: 'rowheader' }= _('Last contact')
.table-mobile-content
- contacted_at = runner_contacted_at(runner)
- if contacted_at
= time_ago_with_tooltip contacted_at
- else
= _('Never')
.table-section.table-button-footer.section-10
.btn-group.table-action-buttons
.btn-group
= link_to admin_runner_path(runner), class: 'gl-button btn btn-default btn-icon has-tooltip', title: _('Edit'), ref: 'tooltip', aria: { label: _('Edit') }, data: { placement: 'top', container: 'body'} do
= sprite_icon('pencil', css_class: 'gl-icon')
.btn-group
- if runner.active?
= link_to [:pause, :admin, runner], method: :post, class: 'gl-button btn btn-default btn-icon has-tooltip', title: _('Pause'), ref: 'tooltip', aria: { label: _('Pause') }, data: { placement: 'top', container: 'body', confirm: _('Are you sure?') } do
= sprite_icon('pause', css_class: 'gl-icon')
- else
= link_to [:resume, :admin, runner], method: :post, class: 'gl-button btn btn-default btn-icon has-tooltip gl-px-3', title: _('Resume'), ref: 'tooltip', aria: { label: _('Resume') }, data: { placement: 'top', container: 'body'} do
= sprite_icon('play', css_class: 'gl-icon')
.btn-group
= link_to [:admin, runner], method: :delete, class: 'gl-button btn btn-danger btn-icon has-tooltip', title: _('Remove'), ref: 'tooltip', aria: { label: _('Remove') }, data: { placement: 'top', container: 'body', confirm: _('Are you sure?') } do
= sprite_icon('close', css_class: 'gl-icon')