Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_key_details.html.haml « keys « profiles « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 94671b69b5ef21bcba56f273be6c5f0f10048d50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
- is_admin = defined?(admin) ? true : false

%h1.gl-font-size-h-display
  = s_('Profiles|SSH Key: %{title}').html_safe % { title: @key.title }

= render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0'}) do |c|
  - c.with_header do
    .gl-new-card-title-wrapper
      .gl-new-card-title
        = _('Key details')
  - c.with_body do
    .table-holder
      %table.table.b-table.gl-table.b-table-stacked-md.ssh-keys-list
        %thead
          %th= s_('Profiles|Usage type')
          %th= s_('Profiles|Created')
          %th= s_('Profiles|Last used')
          %th= s_('Profiles|Expires')
        %tbody
          %tr
            %td{ data: { label: s_('Profiles|Usage type'), testid: 'usage' } }
              = ssh_key_usage_types.invert[@key.usage_type]
            %td{ data: { label: s_('Profiles|Created'), testid: 'created' } }
              = @key.created_at.to_fs(:medium)
            %td{ data: { label: s_('Profiles|Last used'), testid: 'last-used' } }
              = @key.last_used_at&.to_fs(:medium) || _('Never')
            %td{ data: { label: s_('Profiles|Expires'), testid: 'expires' } }
              - if @key.expired?
                %span.gl-text-red-500
                  = s_('Profiles|Expired')
                  = @key.expires_at&.to_fs(:medium)
              - elsif @key.expires_at
                = @key.expires_at&.to_fs(:medium)
              - else
                = _('Never')

.gl-mt-5
  = form_errors(@key, type: 'key') unless @key.valid?

  = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0 gl-overflow-hidden'}) do |c|
    - c.with_header do
      .gl-new-card-title-wrapper
        .gl-new-card-title
          = _('SSH Key')
    - c.with_body do
      .gl-display-flex
        %pre.well-pre.gl-pl-5.gl-mb-0.gl-border-0
          = @key.key
        = clipboard_button(title: s_('Profiles|Copy SSH key'), text: @key.key, category: :tertiary, size: :medium)

  = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0'}) do |c|
    - c.with_header do
      .gl-new-card-title-wrapper
        .gl-new-card-title
          = _('Fingerprints')
    - c.with_body do
      .table-holder
        %table.table.b-table.gl-table.b-table-stacked-md
          %tbody
            %tr
              %th= _('MD5')
              %td.gl-font-monospace.key-fingerprint= @key.fingerprint
            - if @key.fingerprint_sha256.present?
              %tr
                %th= _('SHA256')
                %td.gl-font-monospace.key-fingerprint= @key.fingerprint_sha256

.gl-mt-5.gl-float-right
  - if @key.can_delete?
    = render 'shared/ssh_keys/key_delete', button_data: ssh_key_delete_modal_data(@key, path_to_key(@key, is_admin))