+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
class VirtualMachinesController < ApplicationController
def index
@objects ||= model_class.all
end
super
end
+
+ def webshell
+ return render_not_found if Rails.configuration.Workbench.ShellInABoxURL == URI("")
+ webshell_url = URI(Rails.configuration.Workbench.ShellInABoxURL)
+ 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
+
end