Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
1efe1054
Commit
1efe1054
authored
Feb 29, 2016
by
Phil Hughes
Committed by
Robert Speicher
Mar 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSH keys settings
Closes #13860
parent
ba869ae5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
50 deletions
+64
-50
app/assets/stylesheets/framework/lists.scss
app/assets/stylesheets/framework/lists.scss
+1
-0
app/assets/stylesheets/pages/profile.scss
app/assets/stylesheets/pages/profile.scss
+10
-0
app/controllers/profiles/keys_controller.rb
app/controllers/profiles/keys_controller.rb
+3
-2
app/views/profiles/keys/_form.html.haml
app/views/profiles/keys/_form.html.haml
+6
-8
app/views/profiles/keys/_key.html.haml
app/views/profiles/keys/_key.html.haml
+14
-11
app/views/profiles/keys/_key_details.html.haml
app/views/profiles/keys/_key_details.html.haml
+1
-1
app/views/profiles/keys/_key_table.html.haml
app/views/profiles/keys/_key_table.html.haml
+3
-17
app/views/profiles/keys/index.html.haml
app/views/profiles/keys/index.html.haml
+26
-11
No files found.
app/assets/stylesheets/framework/lists.scss
View file @
1efe1054
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
*
*
*/
*/
.well-list
{
.well-list
{
position
:
relative
;
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
list-style
:
none
;
list-style
:
none
;
...
...
app/assets/stylesheets/pages/profile.scss
View file @
1efe1054
...
@@ -145,3 +145,13 @@
...
@@ -145,3 +145,13 @@
width
:
auto
;
width
:
auto
;
}
}
}
}
.key-icon
{
color
:
#8F8F8F
;
font-size
:
18px
;
line-height
:
42px
;
}
.key-created-at
{
line-height
:
42px
;
}
app/controllers/profiles/keys_controller.rb
View file @
1efe1054
...
@@ -3,6 +3,7 @@ class Profiles::KeysController < Profiles::ApplicationController
...
@@ -3,6 +3,7 @@ class Profiles::KeysController < Profiles::ApplicationController
def
index
def
index
@keys
=
current_user
.
keys
@keys
=
current_user
.
keys
@key
=
flash
[
:key
]
||
Key
.
new
end
end
def
show
def
show
...
@@ -10,7 +11,7 @@ class Profiles::KeysController < Profiles::ApplicationController
...
@@ -10,7 +11,7 @@ class Profiles::KeysController < Profiles::ApplicationController
end
end
def
new
def
new
@key
=
current_user
.
keys
.
new
redirect_to
profile_keys_path
end
end
def
create
def
create
...
@@ -19,7 +20,7 @@ class Profiles::KeysController < Profiles::ApplicationController
...
@@ -19,7 +20,7 @@ class Profiles::KeysController < Profiles::ApplicationController
if
@key
.
save
if
@key
.
save
redirect_to
profile_key_path
(
@key
)
redirect_to
profile_key_path
(
@key
)
else
else
re
nder
'new'
re
direct_to
profile_keys_path
,
flash:
{
key:
@key
}
end
end
end
end
...
...
app/views/profiles/keys/_form.html.haml
View file @
1efe1054
%div
%div
=
form_for
[
:profile
,
@key
],
html:
{
class:
'
form-horizontal
js-requires-input'
}
do
|
f
|
=
form_for
[
:profile
,
@key
],
html:
{
class:
'js-requires-input'
}
do
|
f
|
-
if
@key
.
errors
.
any?
-
if
@key
.
errors
.
any?
.alert.alert-danger
.alert.alert-danger
%ul
%ul
...
@@ -7,13 +7,11 @@
...
@@ -7,13 +7,11 @@
%li
=
msg
%li
=
msg
.form-group
.form-group
=
f
.
label
:key
,
class:
'control-label'
=
f
.
label
:key
,
class:
'label-light'
.col-sm-10
=
f
.
text_area
:key
,
class:
"form-control"
,
rows:
8
,
required:
true
=
f
.
text_area
:key
,
class:
"form-control"
,
rows:
8
,
autofocus:
true
,
required:
true
.form-group
.form-group
=
f
.
label
:title
,
class:
'
control-label
'
=
f
.
label
:title
,
class:
'
label-light
'
.col-sm-10
=
f
.
text_field
:title
,
class:
"form-control"
,
required:
true
=
f
.
text_field
:title
,
class:
"form-control"
,
required:
true
.
form-actions
.
prepend-top-default
=
f
.
submit
'Add key'
,
class:
"btn btn-create"
=
f
.
submit
'Add key'
,
class:
"btn btn-create"
=
link_to
"Cancel"
,
profile_keys_path
,
class:
"btn btn-cancel"
app/views/profiles/keys/_key.html.haml
View file @
1efe1054
%tr
%li
.key-list-item
%td
.pull-left.append-right-10
=
link_to
path_to_key
(
key
,
is_admin
)
do
=
icon
'key'
,
class:
"key-icon"
%strong
=
key
.
title
.pull-left
%td
=
link_to
path_to_key
(
key
,
is_admin
),
class:
"title"
do
%code
.key-fingerprint
=
key
.
fingerprint
=
key
.
title
%td
.description
%span
.cgray
=
key
.
fingerprint
added
#{
time_ago_with_tooltip
(
key
.
created_at
)
}
.pull-right
%td
%span
.key-created-at
=
link_to
'Remove'
,
path_to_key
(
key
,
is_admin
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
"btn btn-sm btn-remove delete-key pull-right"
created
#{
time_ago_with_tooltip
(
key
.
created_at
)
}
ago
=
link_to
path_to_key
(
key
,
is_admin
),
data:
{
confirm:
'Are you sure?'
},
method: :delete
,
class:
"btn btn-transparent prepend-left-10"
do
%span
.sr-only
Remove
=
icon
(
'trash'
)
app/views/profiles/keys/_key_details.html.haml
View file @
1efe1054
-
is_admin
=
defined?
(
admin
)
?
true
:
false
-
is_admin
=
defined?
(
admin
)
?
true
:
false
.row
.row
.prepend-top-default
.col-md-4
.col-md-4
.panel.panel-default
.panel.panel-default
.panel-heading
.panel-heading
...
...
app/views/profiles/keys/_key_table.html.haml
View file @
1efe1054
-
is_admin
=
defined?
(
admin
)
?
true
:
false
-
is_admin
=
defined?
(
admin
)
?
true
:
false
-
if
@keys
.
any?
-
if
@keys
.
any?
.table-holder
%ul
.well-list
%table
.table
-
@keys
.
each
do
|
key
|
%thead
.panel-heading
=
render
'profiles/keys/key'
,
key:
key
,
is_admin:
is_admin
%tr
%th
Title
%th
Fingerprint
%th
Added at
%th
%tbody
-
@keys
.
each
do
|
key
|
=
render
'profiles/keys/key'
,
key:
key
,
is_admin:
is_admin
-
else
.nothing-here-block
-
if
is_admin
User has no ssh keys
-
else
There are no SSH keys with access to your account.
app/views/profiles/keys/index.html.haml
View file @
1efe1054
-
page_title
"SSH Keys"
-
page_title
"SSH Keys"
-
header_title
page_title
,
profile_keys_path
-
header_title
page_title
,
profile_keys_path
-
is_admin
=
defined?
(
admin
)
?
true
:
false
.top-area
.row.prepend-top-default
.nav-text
.col-lg-3.profile-settings-sidebar
Before you can add an SSH key you need to
%h4
.prepend-top-0
=
link_to
"generate it."
,
help_page_path
(
"ssh"
,
"README"
)
=
page_title
.nav-controls
%p
=
link_to
new_profile_key_path
,
class:
"btn btn-new"
do
SSH keys allow you to establish a secure connection between your computer and GitLab.
=
icon
(
'plus'
)
.col-lg-9
Add SSH Key
%h5
.prepend-top-0
Add an SSH key
.prepend-top-default
%p
=
render
'key_table'
Before you can add an SSH key you need to
=
link_to
"generate it."
,
help_page_path
(
"ssh"
,
"README"
)
=
render
'form'
%hr
%h5
Your SSH keys (
#{
@keys
.
count
}
)
%div
.append-bottom-default
-
if
@keys
.
any?
=
render
'key_table'
-
else
%p
.profile-settings-message.text-center
-
if
is_admin
User has no ssh keys
-
else
There are no SSH keys with access to your account.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment