]>
cat aescling's git repositories - mastodon.git/blob - app/controllers/admin/dashboard_controller.rb
1 # frozen_string_literal: true
5 class DashboardController
< BaseController
7 @users_count = User
.count
8 @registrations_week = Redis
.current
.get("activity:accounts:local:#{current_week}") || 0
9 @logins_week = Redis
.current
.pfcount("activity:logins:#{current_week}")
10 @interactions_week = Redis
.current
.get("activity:interactions:#{current_week}") || 0
11 @relay_enabled = Relay
.enabled
.exists
?
12 @single_user_mode = Rails
.configuration
.x
.single_user_mode
13 @registrations_enabled = Setting
.open_registrations
14 @deletions_enabled = Setting
.open_deletion
15 @invites_enabled = Setting
.min_invite_role
== 'user'
16 @search_enabled = Chewy
.enabled
?
17 @version = Mastodon
::Version.to_s
18 @database_version = ActiveRecord
::Base.connection
.execute('SELECT VERSION()').first
['version'].match(/\A(?:PostgreSQL |)([^\s]+).*\z/)[1]
19 @redis_version = redis_info
['redis_version']
20 @reports_count = Report
.unresolved
.count
21 @queue_backlog = Sidekiq
::Stats.new
.enqueued
22 @recent_users = User
.confirmed
.recent
.includes(:account).limit(4)
23 @database_size = ActiveRecord
::Base.connection
.execute('SELECT pg_database_size(current_database())').first
['pg_database_size']
24 @redis_size = redis_info
['used_memory']
25 @ldap_enabled = ENV['LDAP_ENABLED'] == 'true'
26 @cas_enabled = ENV['CAS_ENABLED'] == 'true'
27 @saml_enabled = ENV['SAML_ENABLED'] == 'true'
28 @pam_enabled = ENV['PAM_ENABLED'] == 'true'
29 @hidden_service = ENV['ALLOW_ACCESS_TO_HIDDEN_SERVICE'] == 'true'
30 @trending_hashtags = TrendingTags
.get(7)
36 @current_week ||= Time
.now
.utc
.to_date
.cweek
40 @redis_info ||= Redis
.current
.info
This page took 0.090686 seconds and 4 git commands to generate.