diff options
author | pluralcafe-docker <git@plural.cafe> | 2019-01-12 04:24:01 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2019-01-12 04:24:01 +0000 |
commit | a6e0ff72f552dc172c18f5a10bbca071b067ab51 (patch) | |
tree | f845d5a7e328c3babfde43066325262c1dbdbed0 /app/controllers/admin/instances_controller.rb | |
parent | 74134e490c49d8a7d88cc69720e22cd88cee9233 (diff) | |
parent | 2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/controllers/admin/instances_controller.rb')
-rw-r--r-- | app/controllers/admin/instances_controller.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/app/controllers/admin/instances_controller.rb b/app/controllers/admin/instances_controller.rb index 6f8eaf65c..431ce6f4d 100644 --- a/app/controllers/admin/instances_controller.rb +++ b/app/controllers/admin/instances_controller.rb @@ -4,14 +4,21 @@ module Admin class InstancesController < BaseController def index authorize :instance, :index? + @instances = ordered_instances end - def resubscribe - authorize :instance, :resubscribe? - params.require(:by_domain) - Pubsubhubbub::SubscribeWorker.push_bulk(subscribeable_accounts.pluck(:id)) - redirect_to admin_instances_path + def show + authorize :instance, :show? + + @instance = Instance.new(Account.by_domain_accounts.find_by(domain: params[:id]) || DomainBlock.find_by!(domain: params[:id])) + @following_count = Follow.where(account: Account.where(domain: params[:id])).count + @followers_count = Follow.where(target_account: Account.where(domain: params[:id])).count + @reports_count = Report.where(target_account: Account.where(domain: params[:id])).count + @blocks_count = Block.where(target_account: Account.where(domain: params[:id])).count + @available = DeliveryFailureTracker.available?(Account.select(:shared_inbox_url).where(domain: params[:id]).first&.shared_inbox_url) + @media_storage = MediaAttachment.where(account: Account.where(domain: params[:id])).sum(:file_file_size) + @domain_block = DomainBlock.find_by(domain: params[:id]) end private @@ -27,17 +34,11 @@ module Admin helper_method :paginated_instances def ordered_instances - paginated_instances.map { |account| Instance.new(account) } - end - - def subscribeable_accounts - Account.remote.where(protocol: :ostatus).where(domain: params[:by_domain]) + paginated_instances.map { |resource| Instance.new(resource) } end def filter_params - params.permit( - :domain_name - ) + params.permit(:limited) end end end |