2018-07-16 09:11:53 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Admin
|
|
|
|
class DashboardController < BaseController
|
2022-04-29 01:47:34 +10:00
|
|
|
include Redisable
|
|
|
|
|
2018-07-16 09:11:53 +10:00
|
|
|
def index
|
2022-07-05 10:41:40 +10:00
|
|
|
authorize :dashboard, :index?
|
|
|
|
|
|
|
|
@system_checks = Admin::SystemCheck.perform(current_user)
|
2021-11-25 23:07:38 +11:00
|
|
|
@time_period = (29.days.ago.to_date...Time.now.utc.to_date)
|
2019-08-08 00:13:34 +10:00
|
|
|
@pending_users_count = User.pending.count
|
2021-10-15 05:44:59 +11:00
|
|
|
@pending_reports_count = Report.unresolved.count
|
2019-08-08 00:13:34 +10:00
|
|
|
@pending_tags_count = Tag.pending_review.count
|
2022-02-15 07:27:53 +11:00
|
|
|
@pending_appeals_count = Appeal.pending.count
|
2018-07-16 09:11:53 +10:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def redis_info
|
2023-02-19 09:09:40 +11:00
|
|
|
@redis_info ||= if redis.is_a?(Redis::Namespace)
|
|
|
|
redis.redis.info
|
|
|
|
else
|
|
|
|
redis.info
|
|
|
|
end
|
2018-07-16 09:11:53 +10:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|