2018-09-14 05:42:05 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-01-20 11:20:50 +00:00
|
|
|
class Admin::DashboardController < Admin::ApplicationController
|
2018-05-16 06:06:55 +00:00
|
|
|
include CountHelper
|
|
|
|
|
2019-09-09 03:38:42 +00:00
|
|
|
COUNTED_ITEMS = [Project, User, Group].freeze
|
2018-05-25 21:28:16 +00:00
|
|
|
|
2020-10-05 21:08:47 +00:00
|
|
|
feature_category :not_owned
|
|
|
|
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2012-04-20 16:41:49 +00:00
|
|
|
def index
|
2018-05-25 21:28:16 +00:00
|
|
|
@counts = Gitlab::Database::Count.approximate_counts(COUNTED_ITEMS)
|
2017-08-15 10:27:37 +00:00
|
|
|
@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)
|
2020-02-25 03:08:49 +00:00
|
|
|
@notices = Gitlab::ConfigChecker::PumaRuggedChecker.check
|
2020-05-12 18:07:54 +00:00
|
|
|
@notices += Gitlab::ConfigChecker::ExternalDatabaseChecker.check
|
2021-09-30 18:11:31 +00:00
|
|
|
@redis_versions = [
|
|
|
|
Gitlab::Redis::Queues,
|
|
|
|
Gitlab::Redis::SharedState,
|
|
|
|
Gitlab::Redis::Cache,
|
|
|
|
Gitlab::Redis::TraceChunks,
|
2021-10-15 15:10:09 +00:00
|
|
|
Gitlab::Redis::RateLimiting,
|
|
|
|
Gitlab::Redis::Sessions
|
2021-09-30 18:11:31 +00:00
|
|
|
].map(&:version).uniq
|
2012-04-20 16:41:49 +00:00
|
|
|
end
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2019-10-19 00:06:14 +00:00
|
|
|
|
2020-04-08 09:09:43 +00:00
|
|
|
def stats
|
|
|
|
@users_statistics = UsersStatistics.latest
|
|
|
|
end
|
2012-04-20 16:41:49 +00:00
|
|
|
end
|
2019-09-13 13:26:31 +00:00
|
|
|
|
2021-05-11 21:10:21 +00:00
|
|
|
Admin::DashboardController.prepend_mod_with('Admin::DashboardController')
|