discourse/app/controllers/admin/dashboard_controller.rb

12 lines
342 B
Ruby
Raw Normal View History

class Admin::DashboardController < Admin::AdminController
def index
render_json_dump({
reports: ['visits', 'signups', 'topics', 'posts', 'flags'].map { |type| Report.find(type) },
total_users: User.count
}.merge(
SiteSetting.version_checks? ? {version_check: DiscourseUpdates.check_version} : {}
))
end
end