lib/controllers/dashboard.rb in wackamole-0.0.9 vs lib/controllers/dashboard.rb in wackamole-0.1.2
- old
+ new
@@ -3,12 +3,16 @@
module Dashboard
# ---------------------------------------------------------------------------
# Show application dashboard
- get '/dashboard/:app_name/:stage' do
- Wackamole::Control.switch_mole_db!( params[:app_name].downcase, params[:stage] )
+ get '/dashboard/:zone/:app/:stage' do
+ zone = params[:zone]
+ app = params[:app]
+ stage = params[:stage]
+
+ switch_context!( zone, app, stage )
@info = Wackamole::MoledInfo.collect_dashboard_info( @updated_on )
# Reset app info
load_app_info
@@ -20,9 +24,10 @@
end
# ---------------------------------------------------------------------------
# Refresh dashboard
get '/dashboard/refresh' do
+ Wackamole::Control.ensure_db( session[:context] )
@info = Wackamole::MoledInfo.collect_dashboard_info( @updated_on )
erb :'dashboard/refresh_js', :layout => false
end
\ No newline at end of file