about summary refs log tree commit diff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authornullkal <nullkal@nil.nu>2017-09-13 19:30:07 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-13 12:30:07 +0200
commitda77f65c4684a8a9ee25c3e18f6f09824c765c2d (patch)
treee006c2dbdebdb23d55c4b2e57ff66c7585fb0215 /app/controllers/admin
parent9e2ff3ef71e917ba88a9062814f3e828f9199009 (diff)
Add instance search feature (#4925)
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/instances_controller.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/admin/instances_controller.rb b/app/controllers/admin/instances_controller.rb
index 3296e08db..22f02e5d0 100644
--- a/app/controllers/admin/instances_controller.rb
+++ b/app/controllers/admin/instances_controller.rb
@@ -14,8 +14,12 @@ module Admin
 
     private
 
+    def filtered_instances
+      InstanceFilter.new(filter_params).results
+    end
+
     def paginated_instances
-      Account.remote.by_domain_accounts.page(params[:page])
+      filtered_instances.page(params[:page])
     end
 
     helper_method :paginated_instances
@@ -27,5 +31,11 @@ module Admin
     def subscribeable_accounts
       Account.with_followers.remote.where(domain: params[:by_domain])
     end
+
+    def filter_params
+      params.permit(
+        :domain_name
+      )
+    end
   end
 end