about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-18 15:09:07 -0400
committerEugen <eugen@zeonfederated.com>2017-04-18 21:09:07 +0200
commit55e150352204bc790345cf81ef02bfcb1d7e0594 (patch)
treeb9c58621d9d6921a1d970a48f8e0713eef790345 /app/controllers
parent66d8f99a30f9e6062f1bff37d5115beddce9b55d (diff)
Instances list in admin (#2095)
* Add admin/instances index action

* Add link to instances admin page

* View lists instances

* Instances, grouped by domain, ordered by count

* Use Account.remote scope

* Extract method: Account.by_domain_accounts
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/instances_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/admin/instances_controller.rb b/app/controllers/admin/instances_controller.rb
new file mode 100644
index 000000000..b8f170ec2
--- /dev/null
+++ b/app/controllers/admin/instances_controller.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module Admin
+  class InstancesController < BaseController
+    def index
+      @instances = ordered_instances.page(params[:page])
+    end
+
+    private
+
+    def ordered_instances
+      Account.remote.by_domain_accounts
+    end
+  end
+end