- 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