diaspora/app/controllers/admin/pods_controller.rb
Florian Staudacher ea397ffdfb Add connection test for pods in the network
* add a class for checking pod connectivity
* extend pod model to handle new functionality
* add an admin frontend to list pods and re-trigger checks manually
* add a daily worker to run through all the pods
* add unit tests for most of the new code
2015-08-24 22:04:53 +02:00

31 lines
722 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.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