Allow inspection of containers and all_containers variables

This commit is contained in:
Sebastian Serth
2020-03-23 13:38:33 +01:00
parent d9d77fbd97
commit baf1ac06da
3 changed files with 12 additions and 0 deletions

View File

@ -13,5 +13,13 @@ module Admin
format.json { render(json: dashboard_data) } format.json { render(json: dashboard_data) }
end end
end end
def dump_docker
authorize(self)
respond_to do |format|
format.html { render(json: DockerContainerPool.dump_info) }
format.json { render(json: DockerContainerPool.dump_info) }
end
end
end end
end end

View File

@ -1,4 +1,7 @@
module Admin module Admin
class DashboardPolicy < AdminOnlyPolicy class DashboardPolicy < AdminOnlyPolicy
def dump_docker?
admin?
end
end end
end end

View File

@ -38,6 +38,7 @@ Rails.application.routes.draw do
namespace :admin do namespace :admin do
get 'dashboard', to: 'dashboard#show' get 'dashboard', to: 'dashboard#show'
get 'dashboard/dump_docker', to: 'dashboard#dump_docker'
end end
get '/insights', to: 'flowr#insights' get '/insights', to: 'flowr#insights'