2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
class Admin::DashboardController < Admin::ApplicationController
|
2018-10-15 14:42:47 +05:30
|
|
|
include CountHelper
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
COUNTED_ITEMS = [Project, User, Group].freeze
|
2018-11-08 19:23:39 +05:30
|
|
|
|
2022-06-21 17:19:12 +05:30
|
|
|
feature_category :not_owned # rubocop:todo Gitlab/AvoidFeatureCategoryNotOwned
|
2021-01-03 14:25:43 +05:30
|
|
|
|
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)
|
2020-04-08 14:13:33 +05:30
|
|
|
@notices = Gitlab::ConfigChecker::PumaRuggedChecker.check
|
2020-05-24 23:13:21 +05:30
|
|
|
@notices += Gitlab::ConfigChecker::ExternalDatabaseChecker.check
|
2021-11-18 22:05:49 +05:30
|
|
|
@redis_versions = [
|
|
|
|
Gitlab::Redis::Queues,
|
|
|
|
Gitlab::Redis::SharedState,
|
|
|
|
Gitlab::Redis::Cache,
|
|
|
|
Gitlab::Redis::TraceChunks,
|
|
|
|
Gitlab::Redis::RateLimiting,
|
|
|
|
Gitlab::Redis::Sessions
|
|
|
|
].map(&:version).uniq
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
def stats
|
|
|
|
@users_statistics = UsersStatistics.latest
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Admin::DashboardController.prepend_mod_with('Admin::DashboardController')
|