dashboard_controller.rb 684 B

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