* 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
31 lines
722 B
Ruby
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
|