2016-04-15 07:36:44 +00:00
|
|
|
- page_title "Personal Access Tokens"
|
|
|
|
- header_title page_title, profile_personal_access_tokens_path
|
|
|
|
|
|
|
|
.row.prepend-top-default
|
|
|
|
.col-lg-3.profile-settings-sidebar
|
|
|
|
%h4.prepend-top-0
|
|
|
|
= page_title
|
|
|
|
%p
|
|
|
|
You can generate a personal access token for each application you use that needs access to GitLab.
|
|
|
|
.col-lg-9
|
|
|
|
%h5.prepend-top-0
|
|
|
|
Add a Personal Access Token
|
|
|
|
%p.profile-settings-content
|
|
|
|
Pick a name for the application, and we'll give you a unique token.
|
2016-06-01 09:01:16 +00:00
|
|
|
= form_for [:profile, @personal_access_token],
|
2016-04-20 06:27:45 +00:00
|
|
|
method: :post, html: { class: 'js-requires-input' } do |f|
|
2016-04-15 07:36:44 +00:00
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.label :name, class: 'label-light'
|
|
|
|
= f.text_field :name, class: "form-control", required: true
|
|
|
|
|
2016-04-18 10:18:54 +00:00
|
|
|
.form-group
|
|
|
|
= f.label :expires_at, class: 'label-light'
|
2016-04-25 09:00:59 +00:00
|
|
|
= f.hidden_field :expires_at, class: "form-control", required: false
|
|
|
|
.datepicker
|
2016-04-18 10:18:54 +00:00
|
|
|
|
2016-04-15 07:36:44 +00:00
|
|
|
.prepend-top-default
|
|
|
|
= f.submit 'Add Personal Access Token', class: "btn btn-create"
|
|
|
|
|
|
|
|
%hr
|
|
|
|
|
2016-06-01 09:01:16 +00:00
|
|
|
%h5 Active Personal Access Tokens (#{@active_personal_access_tokens.length})
|
2016-04-15 07:36:44 +00:00
|
|
|
|
2016-04-20 08:50:24 +00:00
|
|
|
- if @active_personal_access_tokens.present?
|
2016-04-15 07:36:44 +00:00
|
|
|
.table-responsive
|
2016-04-20 06:28:48 +00:00
|
|
|
%table.table.table-striped.table-hover.active-personal-access-tokens
|
2016-04-15 07:36:44 +00:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th Token
|
2016-04-19 09:58:35 +00:00
|
|
|
%th Created
|
|
|
|
%th Expires
|
2016-04-15 15:24:20 +00:00
|
|
|
%th Actions
|
2016-04-15 07:36:44 +00:00
|
|
|
%tbody
|
2016-04-20 08:50:24 +00:00
|
|
|
- @active_personal_access_tokens.each do |token|
|
2016-04-15 07:36:44 +00:00
|
|
|
%tr
|
|
|
|
%td= token.name
|
2016-04-19 09:58:35 +00:00
|
|
|
%td.input-group.personal-access-tokens-token-column
|
2016-05-11 04:55:21 +00:00
|
|
|
%input.form-control{ type: "text", value: token.token, readonly: true }
|
2016-04-19 09:58:35 +00:00
|
|
|
%div.input-group-btn
|
2016-05-11 04:55:21 +00:00
|
|
|
%button.btn.btn-default{ type: "button", data: { clipboard_text: token.token } }
|
2016-04-19 09:58:35 +00:00
|
|
|
%i.fa.fa-clipboard
|
2016-06-01 09:01:16 +00:00
|
|
|
%td= token.created_at.to_date.to_s(:medium)
|
2016-04-18 10:18:54 +00:00
|
|
|
- if token.expires_at.present?
|
2016-06-01 09:01:16 +00:00
|
|
|
%td= token.expires_at.to_date.to_s(:medium)
|
2016-04-18 10:18:54 +00:00
|
|
|
- else
|
|
|
|
%td
|
|
|
|
%span.personal-access-tokens-never-expires-label Never
|
2016-05-11 04:55:21 +00:00
|
|
|
%td= link_to "Revoke", revoke_profile_personal_access_token_path(token), method: :put, class: "btn btn-danger", data: { confirm: "Are you sure? This cannot be undone." }
|
2016-04-15 15:24:20 +00:00
|
|
|
|
2016-04-15 07:36:44 +00:00
|
|
|
- else
|
2016-04-19 09:58:35 +00:00
|
|
|
%span You don't have any active tokens yet.
|
|
|
|
|
|
|
|
%hr
|
|
|
|
|
2016-06-01 09:01:16 +00:00
|
|
|
%h5 Inactive Personal Access Tokens (#{@inactive_personal_access_tokens.length})
|
2016-04-19 09:58:35 +00:00
|
|
|
|
2016-04-20 08:50:24 +00:00
|
|
|
- if @inactive_personal_access_tokens.present?
|
2016-04-19 09:58:35 +00:00
|
|
|
.table-responsive
|
2016-04-20 06:28:48 +00:00
|
|
|
%table.table.table-striped.table-hover.inactive-personal-access-tokens
|
2016-04-19 09:58:35 +00:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th Token
|
|
|
|
%th Created
|
|
|
|
%tbody
|
2016-04-20 08:50:24 +00:00
|
|
|
- @inactive_personal_access_tokens.each do |token|
|
2016-04-19 09:58:35 +00:00
|
|
|
%tr
|
|
|
|
%td= token.name
|
|
|
|
%td.input-group.personal-access-tokens-token-column
|
2016-05-11 04:55:21 +00:00
|
|
|
%input.form-control{ type: "text", value: token.token, readonly: true }
|
2016-04-19 09:58:35 +00:00
|
|
|
%div.input-group-btn
|
2016-05-11 04:55:21 +00:00
|
|
|
%button.btn.btn-default{ type: "button", data: { clipboard_text: token.token } }
|
2016-04-19 09:58:35 +00:00
|
|
|
%i.fa.fa-clipboard
|
2016-06-01 09:01:16 +00:00
|
|
|
%td= token.created_at.to_date.to_s(:medium)
|
2016-04-19 09:58:35 +00:00
|
|
|
|
|
|
|
- else
|
|
|
|
%span No inactive tokens.
|
|
|
|
|
2016-04-18 10:18:54 +00:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(".datepicker").datepicker({
|
|
|
|
dateFormat: "yy-mm-dd",
|
2016-04-25 09:00:59 +00:00
|
|
|
onSelect: function(dateText, inst) { $("#personal_access_token_params_expires_at").val(dateText) }
|
|
|
|
}).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#personal_access_token_params_expires_at').val()));
|