expose_action :webshell do
shell_in_a_box_url_config = Rails.configuration.shell_in_a_box_url
+
return render_not_found if not shell_in_a_box_url_config
+ return unprocessable "Missing parameters" if not params['login'] or not params['hostname']
+
@webshell_login = params['login']
- @webshell_hostname = params['hostname']
+ @webshell_hostname = params['hostname'].chomp('.shell')
if not shell_in_a_box_url_config.end_with?('/')
shell_in_a_box_url_config += '/'
</td>
<td>
<% if Rails.configuration.shell_in_a_box_url %>
- <%= link_to 'Login', webshell_path(login: @my_vm_logins[vm[:uuid]].first, hostname: vm[:hostname], vm_uuid: vm[:uuid]) %>
+ <% if @my_vm_logins[vm[:uuid]] %>
+ <% @my_vm_logins[vm[:uuid]].each do |login| %>
+ <%= link_to 'Login', webshell_path(login: login, hostname: vm[:hostname]) %>
+ <% end %>
+ <% end %>
<% end %>
</td>
</tr>