Use one request to fetch dashboard report data and check version

This commit is contained in:
Neil Lalonde
2013-03-14 18:26:12 -04:00
parent 6690a2ba3e
commit 6c4d9ecfdc
9 changed files with 111 additions and 50 deletions

View 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