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
f4991d95
Commit
f4991d95
authored
Sep 28, 2021
by
Rajendra Kadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helpers for ip and repo size limit
parent
5e7b2f71
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
5 deletions
+24
-5
ee/app/helpers/admin/ip_restriction_helper.rb
ee/app/helpers/admin/ip_restriction_helper.rb
+9
-0
ee/app/helpers/admin/repo_size_limit_helper.rb
ee/app/helpers/admin/repo_size_limit_helper.rb
+9
-0
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+2
-1
ee/app/views/admin/application_settings/_repository_size_limit_setting.html.haml
...ication_settings/_repository_size_limit_setting.html.haml
+1
-1
ee/app/views/groups/settings/_ip_restriction.html.haml
ee/app/views/groups/settings/_ip_restriction.html.haml
+1
-1
ee/app/views/shared/_old_repository_size_limit_setting.html.haml
...views/shared/_old_repository_size_limit_setting.html.haml
+1
-1
ee/app/views/shared/_repository_size_limit_setting.html.haml
ee/app/views/shared/_repository_size_limit_setting.html.haml
+1
-1
No files found.
ee/app/helpers/admin/ip_restriction_helper.rb
0 → 100644
View file @
f4991d95
# frozen_string_literal: true
module
Admin
module
IpRestrictionHelper
def
ip_restriction_feature_available?
(
group
)
group
.
licensed_feature_available?
(
:group_ip_restriction
)
||
License
.
features_with_usage_ping
.
include?
(
:group_ip_restriction
)
end
end
end
ee/app/helpers/admin/repo_size_limit_helper.rb
0 → 100644
View file @
f4991d95
# frozen_string_literal: true
module
Admin
module
RepoSizeLimitHelper
def
repo_size_limit_feature_available?
License
.
feature_available?
(
:repository_size_limit
)
||
License
.
features_with_usage_ping
.
include?
(
:repository_size_limit
)
end
end
end
ee/app/models/ee/project.rb
View file @
f4991d95
...
...
@@ -10,6 +10,7 @@ module EE
extend
::
Gitlab
::
Utils
::
Override
extend
::
Gitlab
::
Cache
::
RequestCache
include
::
Gitlab
::
Utils
::
StrongMemoize
include
::
Admin
::
RepoSizeLimitHelper
GIT_LFS_DOWNLOAD_OPERATION
=
'download'
PUBLIC_COST_FACTOR_RELEASE_DAY
=
Date
.
new
(
2021
,
7
,
17
).
freeze
...
...
@@ -601,7 +602,7 @@ module EE
current_size_proc:
->
{
statistics
.
total_repository_size
},
limit:
actual_size_limit
,
namespace:
namespace
,
enabled:
License
.
feature_available?
(
:repository_size_limit
)
||
License
.
features_with_usage_ping
.
include?
(
:repository_size_limit
)
enabled:
repo_size_limit_feature_available?
)
end
end
...
...
ee/app/views/admin/application_settings/_repository_size_limit_setting.html.haml
View file @
f4991d95
-
return
unless
License
.
feature_available?
(
:repository_size_limit
)
||
License
.
features_with_usage_ping
.
include?
(
:repository_size_limit
)
-
return
unless
repo_size_limit_feature_available?
-
form
=
local_assigns
.
fetch
(
:form
)
...
...
ee/app/views/groups/settings/_ip_restriction.html.haml
View file @
f4991d95
-
return
if
!
(
group
.
licensed_feature_available?
(
:group_ip_restriction
)
||
License
.
features_with_usage_ping
.
include?
(
:group_ip_restriction
)
)
||
group
.
parent_id
.
present?
-
return
if
!
ip_restriction_feature_available?
(
group
)
||
group
.
parent_id
.
present?
-
hidden_input_id
=
'group_ip_restriction_ranges'
-
label_id
=
"
#{
hidden_input_id
}
_label"
...
...
ee/app/views/shared/_old_repository_size_limit_setting.html.haml
View file @
f4991d95
-
return
unless
current_user
.
admin?
&&
License
.
feature_available?
(
:repository_size_limit
)
||
License
.
features_with_usage_ping
.
include?
(
:repository_size_limit
)
-
return
unless
current_user
.
admin?
&&
repo_size_limit_feature_available?
-
form
=
local_assigns
.
fetch
(
:form
)
-
type
=
local_assigns
.
fetch
(
:type
)
...
...
ee/app/views/shared/_repository_size_limit_setting.html.haml
View file @
f4991d95
-
return
unless
current_user
.
admin?
&&
(
License
.
feature_available?
(
:repository_size_limit
)
||
License
.
features_with_usage_ping
.
include?
(
:repository_size_limit
))
-
return
unless
current_user
.
admin?
&&
repo_size_limit_feature_available?
-
form
=
local_assigns
.
fetch
(
:form
)
-
is_project
=
local_assigns
.
fetch
(
:type
)
==
:project
...
...
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