gitlab-org--gitlab-foss/app/views/profiles/keys/_key_details.html.haml
Vincent Wong b6df93a51f Record and show last used date of SSH Keys
Addresses: Issue #13810

1. Adds a last_used_at attribute to the Key table/model
2. Update a key's last_used_at whenever it gets used
3. Display how long ago an ssh key was last used
2017-01-09 04:15:39 +11:00

26 lines
745 B
Text

- is_admin = defined?(admin) ? true : false
.row.prepend-top-default
.col-md-4
.panel.panel-default
.panel-heading
SSH Key
%ul.well-list
%li
%span.light Title:
%strong= @key.title
%li
%span.light Created on:
%strong= @key.created_at.to_s(:medium)
%li
%span.light Last used on:
%strong= @key.last_used_at.try(:to_s, :medium) || 'N/A'
.col-md-8
%p
%span.light Fingerprint:
%code.key-fingerprint= @key.fingerprint
%pre.well-pre
= @key.key
.col-md-12
.pull-right
= link_to 'Remove', path_to_key(@key, is_admin), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key"