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