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
c0530a76
Commit
c0530a76
authored
Dec 20, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add group shared runner usage overview page
parent
fd9597d4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
117 additions
and
8 deletions
+117
-8
app/assets/stylesheets/pages/groups.scss
app/assets/stylesheets/pages/groups.scss
+36
-0
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+0
-8
app/controllers/groups/pipeline_quota_controller.rb
app/controllers/groups/pipeline_quota_controller.rb
+9
-0
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+22
-0
app/models/namespace.rb
app/models/namespace.rb
+5
-0
app/views/groups/pipeline_quota/index.html.haml
app/views/groups/pipeline_quota/index.html.haml
+40
-0
app/views/layouts/nav/_group_settings.html.haml
app/views/layouts/nav/_group_settings.html.haml
+4
-0
config/routes/group.rb
config/routes/group.rb
+1
-0
No files found.
app/assets/stylesheets/pages/groups.scss
View file @
c0530a76
...
...
@@ -90,3 +90,39 @@
}
}
}
.panel
{
.shared_runners_limit_under_quota
{
color
:
$gl-success
;
}
.shared_runners_limit_over_quota
{
color
:
$gl-danger
;
}
}
.pipeline-quota
{
border-top
:
1px
solid
$table-border-color
;
border-bottom
:
1px
solid
$table-border-color
;
margin
:
0
0
$gl-padding
;
.row
{
padding-top
:
10px
;
padding-bottom
:
10px
;
}
.right
{
text-align
:
right
;
}
.progress
{
height
:
6px
;
width
:
100%
;
margin-bottom
:
0
;
margin-top
:
4px
;
}
}
table
.pipeline-project-metrics
tr
td
{
padding
:
$gl-padding
;
}
app/assets/stylesheets/pages/projects.scss
View file @
c0530a76
...
...
@@ -368,14 +368,6 @@ a.deploy-project-label {
color
:
$gl-warning
;
}
.shared_runners_limit_under_quota
{
color
:
$gl-success
;
}
.shared_runners_limit_over_quota
{
color
:
$gl-danger
;
}
.breadcrumb.repo-breadcrumb
{
padding
:
0
;
background
:
transparent
;
...
...
app/controllers/groups/pipeline_quota_controller.rb
0 → 100644
View file @
c0530a76
class
Groups::PipelineQuotaController
<
Groups
::
ApplicationController
before_action
:authorize_admin_group!
layout
'group_settings'
def
index
@projects
=
@group
.
projects
.
page
(
params
[
:page
])
end
end
app/helpers/groups_helper.rb
View file @
c0530a76
...
...
@@ -67,6 +67,28 @@ module GroupsHelper
end
end
def
group_shared_runner_limits_progress_bar
(
group
)
percent
=
[
group
.
shared_runners_minutes_percent_used
,
100
].
min
status
=
if
percent
==
100
'danger'
elsif
percent
>=
80
'warning'
else
'success'
end
options
=
{
class:
"progress-bar progress-bar-
#{
status
}
"
,
style:
"width:
#{
percent
}
%;"
}
content_tag
:div
,
class:
'progress'
do
content_tag
:div
,
nil
,
options
end
end
def
group_issues
(
group
)
IssuesFinder
.
new
(
current_user
,
group_id:
group
.
id
).
execute
end
...
...
app/models/namespace.rb
View file @
c0530a76
...
...
@@ -192,6 +192,11 @@ class Namespace < ActiveRecord::Base
shared_runners_minutes
.
to_i
>=
shared_runners_minutes_limit
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
end
private
def
repository_storage_paths
...
...
app/views/groups/pipeline_quota/index.html.haml
0 → 100644
View file @
c0530a76
-
page_title
"Pipeline Quota"
%h3
.page-title
Group Pipeline Quota
%p
.light
Monthly build minutes usage across shared runners for
#{
@group
.
name
}
.pipeline-quota.container-fluid
.row
.col-sm-6
%strong
Current Period Usage
%div
=
group_shared_runner_limits_quota
(
@group
)
minutes
.col-sm-6.right
-
if
@group
.
shared_runners_minutes_limit_enabled?
=
"
#{
@group
.
shared_runners_minutes_percent_used
}
% used"
-
else
Unlimited
=
group_shared_runner_limits_progress_bar
(
@group
)
%table
.table.pipeline-project-metrics
%thead
%tr
%th
Project
%th
Minutes
%tbody
-
@projects
.
each
do
|
project
|
%tr
%td
.avatar-container.s20
=
project_icon
(
project
,
alt:
''
,
class:
'avatar project-avatar s20'
)
%strong
=
link_to
project
.
name
,
project
%td
=
project
.
shared_runners_minutes
.
to_i
-
if
@projects
.
blank?
%tr
%td
{
colspan:
2
}
.nothing-here-block
This group has no projects
=
paginate
@projects
,
theme:
"gitlab"
app/views/layouts/nav/_group_settings.html.haml
View file @
c0530a76
...
...
@@ -28,5 +28,9 @@
=
link_to
group_audit_events_path
(
@group
),
title:
"Audit Events"
do
%span
Audit Events
=
nav_link
(
controller: :pipeline_quota
)
do
=
link_to
group_pipeline_quota_path
(
@group
),
title:
"Pipeline Quota"
do
%span
Pipeline Quota
%li
=
link_to
'Edit Group'
,
edit_group_path
(
@group
)
config/routes/group.rb
View file @
c0530a76
...
...
@@ -26,6 +26,7 @@ scope(path: 'groups/*group_id',
## EE-specific
resource
:notification_setting
,
only:
[
:update
]
resources
:audit_events
,
only:
[
:index
]
resources
:pipeline_quota
,
only:
[
:index
]
## EE-specific
## EE-specific
...
...
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