diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-13 12:08:13 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-13 12:08:13 +0300 |
commit | 9c14ed0689ba3e667adbcc179793d7d14d776f79 (patch) | |
tree | b6405e97498338975511e302dc7c43f6430a1ecf /app/views/admin | |
parent | 0c24192fb1190f94e8b324605cf2cd972cc62c0c (diff) | |
parent | 6237cae1f16475d874ea761a62350344bdbff617 (diff) |
Merge branch 'public-deploy-keys' into 'master'
Allow admin to create public deploy keys that are accessible to any project.
Addresses private issue https://dev.gitlab.org/gitlab/gitlabhq/issues/1774.
Project settings:
![Screen_Shot_2015-03-27_at_14.46.48](https://gitlab.com/gitlab-org/gitlab-ce/uploads/01799ff912671ba6db3f828ea1aca1a6/Screen_Shot_2015-03-27_at_14.46.48.png)
The "Public deploy keys" section is only shown when there are any. If there are public deploy keys but no project deploy keys, only public deploy keys are shown. If there are no public deploy keys and no project deploy keys, the current "Deploy keys from projects you have access to will be displayed here" placeholder is shown.
The list of projects below the public key has been changed to only show projects the user has access to.
"Public deploy key" seems to be repeated on the left, but the first is just the title. The label is always visible for public deploy keys.
Admin index:
![Screen_Shot_2015-03-27_at_14.47.06](https://gitlab.com/gitlab-org/gitlab-ce/uploads/ea889d274cfd3f0694d47d602f4f3e94/Screen_Shot_2015-03-27_at_14.47.06.png)
Admin detail page:
![Screen_Shot_2015-03-27_at_14.47.16](https://gitlab.com/gitlab-org/gitlab-ce/uploads/8c8475e05bf6b497da3b9f1bc102329f/Screen_Shot_2015-03-27_at_14.47.16.png)
Projects using the deploy key are listed on the left and can be disabled easily.
See merge request !469
Diffstat (limited to 'app/views/admin')
-rw-r--r-- | app/views/admin/deploy_keys/index.html.haml | 27 | ||||
-rw-r--r-- | app/views/admin/deploy_keys/new.html.haml | 26 | ||||
-rw-r--r-- | app/views/admin/deploy_keys/show.html.haml | 34 |
3 files changed, 87 insertions, 0 deletions
diff --git a/app/views/admin/deploy_keys/index.html.haml b/app/views/admin/deploy_keys/index.html.haml new file mode 100644 index 00000000000..2ae83ab95f7 --- /dev/null +++ b/app/views/admin/deploy_keys/index.html.haml @@ -0,0 +1,27 @@ +.panel.panel-default + .panel-heading + Public deploy keys (#{@deploy_keys.count}) + .panel-head-actions + = link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm" + - if @deploy_keys.any? + %table.table + %thead.panel-heading + %tr + %th Title + %th Fingerprint + %th Added at + %th + %tbody + - @deploy_keys.each do |deploy_key| + %tr + %td + = link_to admin_deploy_key_path(deploy_key) do + %strong= deploy_key.title + %td + %span + (#{deploy_key.fingerprint}) + %td + %span.cgray + added #{time_ago_with_tooltip(deploy_key.created_at)} + %td + = link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right" diff --git a/app/views/admin/deploy_keys/new.html.haml b/app/views/admin/deploy_keys/new.html.haml new file mode 100644 index 00000000000..c00049424c5 --- /dev/null +++ b/app/views/admin/deploy_keys/new.html.haml @@ -0,0 +1,26 @@ +%h3.page-title New public deploy key +%hr + +%div + = form_for [:admin, @deploy_key], html: { class: 'deploy-key-form form-horizontal' } do |f| + -if @deploy_key.errors.any? + .alert.alert-danger + %ul + - @deploy_key.errors.full_messages.each do |msg| + %li= msg + + .form-group + = f.label :title, class: "control-label" + .col-sm-10= f.text_field :title, class: 'form-control' + .form-group + = f.label :key, class: "control-label" + .col-sm-10 + %p.light + Paste a machine public key here. Read more about how to generate it + = link_to "here", help_page_path("ssh", "README") + = f.text_area :key, class: "form-control thin_area", rows: 5 + + .form-actions + = f.submit 'Create', class: "btn-create btn" + = link_to "Cancel", admin_deploy_keys_path, class: "btn btn-cancel" + diff --git a/app/views/admin/deploy_keys/show.html.haml b/app/views/admin/deploy_keys/show.html.haml new file mode 100644 index 00000000000..cfa2adf92ee --- /dev/null +++ b/app/views/admin/deploy_keys/show.html.haml @@ -0,0 +1,34 @@ +.row + .col-md-4 + .panel.panel-default + .panel-heading + Deploy Key + %ul.well-list + %li + %span.light Title: + %strong= @deploy_key.title + %li + %span.light Created on: + %strong= @deploy_key.created_at.stamp("Aug 21, 2011") + + .panel.panel-default + .panel-heading Projects (#{@deploy_key.deploy_keys_projects.count}) + - if @deploy_key.deploy_keys_projects.any? + %ul.well-list + - @deploy_key.projects.each do |project| + %li + %span + %strong + = link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project] + .pull-right + = link_to disable_namespace_project_deploy_key_path(project.namespace, project, @deploy_key), data: { confirm: "Are you sure?" }, method: :put, class: "btn-xs btn btn-remove", title: 'Remove deploy key from project' do + %i.fa.fa-times.fa-inverse + + .col-md-8 + %p + %span.light Fingerprint: + %strong= @deploy_key.fingerprint + %pre.well-pre + = @deploy_key.key + .pull-right + = link_to 'Remove', admin_deploy_key_path(@deploy_key), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key" |