Class: Federails::Server::NodeinfoController
- Inherits:
-
Federails::ServerController
- Object
- ActionController::Base
- Federails::ServerController
- Federails::Server::NodeinfoController
- Defined in:
- app/controllers/federails/server/nodeinfo_controller.rb
Instance Method Summary collapse
- #index ⇒ Object
-
#show ⇒ Object
rubocop:todo Metrics/AbcSize.
Instance Method Details
#index ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/federails/server/nodeinfo_controller.rb', line 4 def index render formats: [:nodeinfo] end |
#show ⇒ Object
rubocop:todo Metrics/AbcSize
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/federails/server/nodeinfo_controller.rb', line 10 def show # rubocop:todo Metrics/AbcSize @total = @active_halfyear = @active_month = 0 @has_user_counts = false Federails::Configuration.actor_types.each_value do |config| next unless (method = config[:user_count_method]&.to_sym) @has_user_counts = true model = config[:class] @total += model.send(method, nil) @active_month += model.send(method, (30.days.ago)...Time.current) @active_halfyear += model.send(method, (180.days.ago)...Time.current) end render formats: [:nodeinfo] end |