diaspora/app/controllers/admin/pods_controller.rb
Benjamin Neff acb91c79d2 improve pod connection check
* use port for check
* respect entries in /etc/hosts
* test /.well-known/host-meta
* don't allow redirects to other domains
2016-03-05 02:57:11 +01:00

32 lines
784 B
Ruby

module Admin
class PodsController < AdminController
respond_to :html, :json
def index
pods_json = PodPresenter.as_collection(Pod.all)
respond_with do |format|
format.html do
gon.preloads[:pods] = pods_json
gon.unchecked_count = Pod.unchecked.count
gon.version_failed_count = Pod.version_failed.count
gon.error_count = Pod.check_failed.count
render "admins/pods"
end
format.json { render json: pods_json }
end
end
def recheck
pod = Pod.find(params[:pod_id])
pod.test_connection!
respond_with do |format|
format.html { redirect_to admin_pods_path }
format.json { render json: PodPresenter.new(pod).as_json }
end
end
end
end