Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / controllers / virtual_machines_controller.rb
index a62ba81b0941cf46870ddc7f27bf3b97692fd172..19763b926c78077b97de261d49714d37c0c6b7bb 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class VirtualMachinesController < ApplicationController
   def index
     @objects ||= model_class.all
@@ -19,4 +23,14 @@ class VirtualMachinesController < ApplicationController
     end
     super
   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,
+    }
+    render layout: false
+  end
+
 end