mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Use one request to fetch dashboard report data and check version
This commit is contained in:
11
app/controllers/admin/dashboard_controller.rb
Normal file
11
app/controllers/admin/dashboard_controller.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class Admin::DashboardController < Admin::AdminController
|
||||
|
||||
def index
|
||||
render_json_dump({
|
||||
reports: ['visits', 'signups', 'topics', 'posts', 'total_users', 'flags'].map { |type| Report.find(type) }
|
||||
}.merge(
|
||||
SiteSetting.version_checks? ? {version_check: DiscourseUpdates.check_version} : {}
|
||||
))
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user