1
0

dashboard_controller.rb 735 B

123456789101112131415161718192021222324252627282930
  1. # frozen_string_literal: true
  2. module Admin
  3. class DashboardController < BaseController
  4. include Redisable
  5. def index
  6. authorize :dashboard, :index?
  7. @system_checks = Admin::SystemCheck.perform(current_user)
  8. @time_period = (29.days.ago.to_date...Time.now.utc.to_date)
  9. @pending_users_count = User.pending.count
  10. @pending_reports_count = Report.unresolved.count
  11. @pending_tags_count = Tag.pending_review.count
  12. @pending_appeals_count = Appeal.pending.count
  13. end
  14. private
  15. def redis_info
  16. @redis_info ||= begin
  17. if redis.is_a?(Redis::Namespace)
  18. redis.redis.info
  19. else
  20. redis.info
  21. end
  22. end
  23. end
  24. end
  25. end