Add more stats to version check

This commit is contained in:
Sam 2014-05-12 09:06:28 +10:00
parent eb0872c5d4
commit 42bf010f8a
1 changed files with 12 additions and 4 deletions

View File

@ -60,19 +60,27 @@ module DiscourseHub
end
end
def self.discourse_version_check
get('/version_check', {
def self.version_check_payload
{
installed_version: Discourse::VERSION::STRING,
forum_title: SiteSetting.title,
forum_description: SiteSetting.site_description,
forum_url: Discourse.base_url,
contact_email: SiteSetting.contact_email,
topic_count: Topic.listable_topics.count,
post_count: Post.count,
user_count: User.count,
topics_7_days: Topic.listable_topics.where('created_at > ?', 7.days.ago).count,
posts_7_days: Post.where('created_at > ?', 7.days.ago).count,
users_7_days: User.where('created_at > ?', 7.days.ago).count,
login_required: SiteSetting.login_required,
locale: SiteSetting.default_locale
})
}
end
def self.discourse_version_check
get('/version_check', version_check_payload)
end