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
1a64afbc
Commit
1a64afbc
authored
Feb 15, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract ee-only code under /ee dir
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
8ab12abd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
app/controllers/admin/dashboard_controller.rb
app/controllers/admin/dashboard_controller.rb
+2
-4
ee/app/controllers/ee/admin/dashboard_controller.rb
ee/app/controllers/ee/admin/dashboard_controller.rb
+19
-0
ee/app/views/admin/dashboard/_roles_stats.html.haml
ee/app/views/admin/dashboard/_roles_stats.html.haml
+4
-2
No files found.
app/controllers/admin/dashboard_controller.rb
View file @
1a64afbc
class
Admin::DashboardController
<
Admin
::
ApplicationController
prepend
::
EE
::
Admin
::
DashboardController
def
index
@projects
=
Project
.
order_id_desc
.
without_deleted
.
with_route
.
limit
(
10
)
@users
=
User
.
order_id_desc
.
limit
(
10
)
@groups
=
Group
.
order_id_desc
.
with_route
.
limit
(
10
)
@license
=
License
.
current
# EE only
@admin_count
=
User
.
admins
.
count
@roles_count
=
ProjectAuthorization
.
roles_stats
end
end
ee/app/controllers/ee/admin/dashboard_controller.rb
0 → 100644
View file @
1a64afbc
# rubocop:disable Gitlab/ModuleWithInstanceVariables
module
EE
module
Admin
module
DashboardController
extend
ActiveSupport
::
Concern
prepended
do
before_action
:set_roles_count
,
only:
[
:index
]
end
private
def
set_roles_count
@admin_count
=
::
User
.
admins
.
count
@roles_count
=
::
ProjectAuthorization
.
roles_stats
end
end
end
end
ee/app/views/admin/dashboard/_roles_stats.html.haml
View file @
1a64afbc
%div
-
if
@admin_count
%p
Admin users
%span
.light.pull-right
=
@admin_count
-
if
@roles_count
-
@roles_count
.
reverse_each
do
|
row
|
%p
Users with highest role
%strong
#{
row
[
'kind'
]
}
%strong
=
row
[
'kind'
]
%span
.light.pull-right
=
row
[
'amount'
]
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