14794: Adds Workbench2 menu item.
[arvados.git] / apps / workbench / app / views / layouts / body.html.erb
index b017b4a29ae2bbd35877301f5a6f021555eb6f11..c1dc15fa91ec6805a47597ec4bca60baceb26c53 100644 (file)
@@ -82,6 +82,18 @@ SPDX-License-Identifier: AGPL-3.0 %>
                      </form>
                     </li>
                   <% end %>
+                <li role="menuitem">
+                  <%
+                  protocol, hostname = arvados_api_client.discovery[:workbenchUrl].split("://")
+                  workbench2_url = "#{protocol}://workbench2.#{hostname.split(".")[1..-1].join(".")}"
+                  %>
+                  <form action="<%= workbench2_url %>/token" method="GET">
+                    <input type="hidden" name="api_token" value="<%= Thread.current[:arvados_api_token] %>">
+                    <button role="menuitem" type="submit">
+                      <i class="fa fa-lg fa-share-square fa-fw"></i> Go to new Workbench
+                    </button>
+                  </form>
+                </li>
                 <li role="menuitem">
                   <%= link_to virtual_machines_user_path(current_user), role: 'menu-item' do %>
                     <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines