Sha256: e2a79e375cc355cb6d4aef6aed36bdce8816b49351f58f8f3501822a38493b32

Contents?: true

Size: 853 Bytes

Versions: 15

Compression:

Stored size: 853 Bytes

Contents

class RhoconnectConsole::Server
  
  get '/adapter' do
    if params[:xhr] or request.xhr?
      @adapter = nil
      handle_api_error("Can't load adapter url") do
        @adapter = RhoconnectApi::get_adapter(session[:server],session[:token])['adapter_url']
        @domain  = ENV['RHODES_URL'] || request.session[:server_url] + "/application"
      end
      erb :adapter, :layout => false 
    else
       render_page url_path("/adapter")
     end
  end
  
  post '/adapter/create' do
    session[:errors] = nil
    verify_format_of :adapter_url, "url must start with http(s)"
    unless session[:errors]             
      handle_api_error("Can't save adapter url") do  
        RhoconnectApi::save_adapter(session[:server],
          session[:token],params[:adapter_url])
      end      
    end
    redirect url_path( '/adapter'), 303
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rhoconnect-3.1.2 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.1.1 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.1.0 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.1.0.beta2 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.1.0.beta1 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.6 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.5 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.4 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.3 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.2 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.1 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.0 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.0.rc1 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.0.beta3 lib/rhoconnect/console/app/routes/adapter.rb
rhoconnect-3.0.0.beta1 lib/rhoconnect/console/app/routes/adapter.rb