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
ceb39b24
Commit
ceb39b24
authored
Dec 20, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move _used to helper
parent
32f9b43b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+6
-0
app/models/namespace.rb
app/models/namespace.rb
+4
-9
No files found.
app/helpers/groups_helper.rb
View file @
ceb39b24
...
...
@@ -74,6 +74,12 @@ module GroupsHelper
end
end
def
group_shared_runner_limits_percent_used
(
group
)
return
0
unless
group
.
shared_runners_minutes_limit_enabled?
100
*
group
.
shared_runners_minutes
/
group
.
shared_runners_minutes_limit
end
def
group_shared_runner_limits_progress_bar
(
group
)
percent
=
[
group
.
shared_runners_minutes_percent_used
,
100
].
min
...
...
app/models/namespace.rb
View file @
ceb39b24
...
...
@@ -182,18 +182,13 @@ class Namespace < ActiveRecord::Base
end
def
shared_runners_minutes_limit_enabled?
shared_runners_minutes_limit
.
nonzero?
end
def
shared_runners_minutes_used?
shared_runners_enabled?
&&
shared_runners_minutes_limit_enabled?
&&
shared_runners_minutes
.
to_i
>=
shared_runners_minutes_limit
shared_runners_minutes_limit
.
nonzero?
end
def
shared_runners_minutes_
percent_used
return
0
unless
shared_runners_enabled?
&&
shared_runners_minutes_limit_enabled?
100
*
shared_runners_minutes
.
to_i
/
shared_runners_minutes_limit
def
shared_runners_minutes_
used?
shared_runners_minutes_limit_enabled?
&&
shared_runners_minutes
>=
shared_runners_minutes_limit
end
def
full_name
...
...
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