debian-mirror-gitlab/app/controllers/admin/dashboard_controller.rb

14 lines
492 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
class Admin::DashboardController < Admin::ApplicationController
2018-10-15 14:42:47 +05:30
include CountHelper
2018-11-08 19:23:39 +05:30
COUNTED_ITEMS = [Project, User, Group, ForkedProjectLink, Issue, MergeRequest,
Note, Snippet, Key, Milestone].freeze
2014-09-02 18:07:02 +05:30
def index
2018-11-08 19:23:39 +05:30
@counts = Gitlab::Database::Count.approximate_counts(COUNTED_ITEMS)
2018-03-17 18:26:18 +05:30
@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)
2014-09-02 18:07:02 +05:30
end
end