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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2767b83c
Commit
2767b83c
authored
Mar 22, 2019
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI for dependency proxy for containers
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
bbce6df7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
0 deletions
+58
-0
app/views/layouts/nav/sidebar/_group.html.haml
app/views/layouts/nav/sidebar/_group.html.haml
+1
-0
ee/app/controllers/groups/dependency_proxies_controller.rb
ee/app/controllers/groups/dependency_proxies_controller.rb
+30
-0
ee/app/helpers/ee/groups_helper.rb
ee/app/helpers/ee/groups_helper.rb
+1
-0
ee/app/views/groups/dependency_proxies/show.html.haml
ee/app/views/groups/dependency_proxies/show.html.haml
+20
-0
ee/app/views/groups/sidebar/_dependency_proxy.html.haml
ee/app/views/groups/sidebar/_dependency_proxy.html.haml
+4
-0
ee/config/routes/group.rb
ee/config/routes/group.rb
+2
-0
No files found.
app/views/layouts/nav/sidebar/_group.html.haml
View file @
2767b83c
...
...
@@ -46,6 +46,7 @@
=
_
(
'Contribution Analytics'
)
=
render_if_exists
'layouts/nav/group_insights_link'
=
render_if_exists
'groups/sidebar/dependency_proxy'
# EE-specific
=
render_if_exists
"layouts/nav/ee/epic_link"
,
group:
@group
...
...
ee/app/controllers/groups/dependency_proxies_controller.rb
0 → 100644
View file @
2767b83c
# frozen_string_literal: true
module
Groups
class
DependencyProxiesController
<
Groups
::
ApplicationController
before_action
:authorize_admin_group!
,
only: :update
before_action
:dependency_proxy
def
show
@blobs_count
=
group
.
dependency_proxy_blobs
.
count
@blobs_total_size
=
group
.
dependency_proxy_blobs
.
size_sum
end
def
update
dependency_proxy
.
update
(
dependency_proxy_params
)
redirect_to
group_dependency_proxy_path
(
group
)
end
private
def
dependency_proxy
@dependency_proxy
||=
group
.
dependency_proxy_setting
||
group
.
create_dependency_proxy_setting
end
def
dependency_proxy_params
params
.
require
(
:dependency_proxy_group_setting
).
permit
(
:enabled
)
end
end
end
ee/app/helpers/ee/groups_helper.rb
View file @
2767b83c
...
...
@@ -9,6 +9,7 @@ module EE
super
+
%w[
groups/security/dashboard#show
groups/insights#show
groups/dependency_proxies#show
]
end
...
...
ee/app/views/groups/dependency_proxies/show.html.haml
0 → 100644
View file @
2767b83c
-
page_title
"Dependency Proxy"
%h3
Dependency proxy for container registries
-
if
can?
(
current_user
,
:admin_group
,
@group
)
=
form_for
(
@dependency_proxy
,
method: :put
,
url:
group_dependency_proxy_path
(
@group
))
do
|
f
|
.form-check
=
f
.
check_box
:enabled
,
class:
'form-check-input'
=
f
.
label
:enabled
,
class:
'form-check-label'
do
%span
Enabled?
=
f
.
submit
'Save'
,
class:
'btn btn-success'
-
if
@dependency_proxy
.
enabled
%h5
Dependency proxy URL
%div
=
text_field_tag
:url
,
"
#{
group_url
(
@group
)
}
/dependency_proxy/containers"
,
class:
'form-control'
,
readonly:
true
.help-block.prepend-top-5
Contains
#{
@blobs_count
}
blobs of images (
#{
number_to_human_size
(
@blobs_total_size
)
}
)
ee/app/views/groups/sidebar/_dependency_proxy.html.haml
0 → 100644
View file @
2767b83c
-
if
@group
.
feature_available?
(
:dependency_proxy
)
=
nav_link
(
controller:
'groups/dependency_proxies'
)
do
=
link_to
group_dependency_proxy_path
(
@group
),
title:
_
(
'Dependency Proxy'
)
do
%span
=
_
(
'Dependency Proxy'
)
ee/config/routes/group.rb
View file @
2767b83c
...
...
@@ -106,6 +106,8 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
path
end
get
'boards(/*extra_params)'
,
as: :legacy_ee_group_boards_redirect
,
to:
legacy_ee_group_boards_redirect
resource
:dependency_proxy
,
only:
[
:show
,
:update
]
end
scope
(
path:
'groups/*group_id'
)
do
...
...
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