X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/060d38d627bd1e51dd2b3c6e7de9af6aa7d7b6f3..bcb16d1825fd2e3105a51a2a2f9a119d71f33c8d:/apps/workbench/app/controllers/virtual_machines_controller.rb diff --git a/apps/workbench/app/controllers/virtual_machines_controller.rb b/apps/workbench/app/controllers/virtual_machines_controller.rb index 19763b926c..c743773141 100644 --- a/apps/workbench/app/controllers/virtual_machines_controller.rb +++ b/apps/workbench/app/controllers/virtual_machines_controller.rb @@ -10,7 +10,7 @@ class VirtualMachinesController < ApplicationController Link.where(tail_uuid: current_user.uuid, head_uuid: @objects.collect(&:uuid), link_class: 'permission', - name: 'can_login'). + name: 'can_login').with_count("none"). each do |perm_link| if perm_link.properties.andand[:username] @vm_logins[perm_link.head_uuid] ||= [] @@ -25,11 +25,14 @@ class VirtualMachinesController < ApplicationController end def webshell - return render_not_found if not Rails.configuration.shell_in_a_box_url - @webshell_url = Rails.configuration.shell_in_a_box_url % { - uuid: @object.uuid, - hostname: @object.hostname, - } + return render_not_found if Rails.configuration.Services.WebShell.ExternalURL == URI("") + webshell_url = URI(Rails.configuration.Services.WebShell.ExternalURL) + if webshell_url.host.index("*") != nil + webshell_url.host = webshell_url.host.sub("*", @object.hostname) + else + webshell_url.path = "/#{@object.hostname}" + end + @webshell_url = webshell_url.to_s render layout: false end