1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class VirtualMachinesController < ApplicationController
7 @objects ||= model_class.all
9 if @objects.andand.first
10 Link.where(tail_uuid: current_user.uuid,
11 head_uuid: @objects.collect(&:uuid),
12 link_class: 'permission',
13 name: 'can_login').with_count("none").
15 if perm_link.properties.andand[:username]
16 @vm_logins[perm_link.head_uuid] ||= []
17 @vm_logins[perm_link.head_uuid] << perm_link.properties[:username]
21 vm.current_user_logins = @vm_logins[vm.uuid].andand.compact || []
28 return render_not_found if Rails.configuration.Services.WebShell.ExternalURL == URI("")
29 webshell_url = URI(Rails.configuration.Services.WebShell.ExternalURL)
30 if webshell_url.host.index("*") != nil
31 webshell_url.host = webshell_url.host.sub("*", @object.hostname)
33 webshell_url.path = "/#{@object.hostname}"
35 @webshell_url = webshell_url.to_s