X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/461b2b4bfa50a11acb257817d13e70d030700dc0..927524f1be454de021180b74999d682780b8cb6b:/apps/workbench/app/views/users/welcome.html.erb diff --git a/apps/workbench/app/views/users/welcome.html.erb b/apps/workbench/app/views/users/welcome.html.erb index e11382f826..92fd6dad46 100644 --- a/apps/workbench/app/views/users/welcome.html.erb +++ b/apps/workbench/app/views/users/welcome.html.erb @@ -1,20 +1,75 @@ -<%= image_tag "dax.png", style: "float: left; max-width: 25%; margin-right: 2em" %> -

Hi there! Please log in to use Arvados Workbench.

-
-
+<%# Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: AGPL-3.0 %> + +<% content_for :breadcrumbs do raw '' end %> + +<%= javascript_tag do %> + function controller_password_authenticate(event) { + event.preventDefault() + document.getElementById('login-authenticate-error').innerHTML = ''; + fetch('<%= "#{Rails.configuration.Services.Controller.ExternalURL}" %>arvados/v1/users/authenticate', { + method: 'POST', + + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({ + username: document.getElementById('login-username').value, + password: document.getElementById('login-password').value, + }), + }).then(function(resp) { + if (!resp.ok) { + resp.json().then(function(respj) { + document.getElementById('login-authenticate-error').innerHTML = "

"+respj.errors[0]+"

"; + }); + return; + } + + var redir = document.getElementById('login-return-to').value + if (redir.indexOf('?') > 0) { + redir += '&' + } else { + redir += '?' + } + resp.json().then(function(respj) { + document.location = redir + "api_token=v2/" + respj.uuid + "/" + respj.api_token; + }); + }); + } + function clear_authenticate_error() { + document.getElementById('login-authenticate-error').innerHTML = ""; + } +<% end %> + +
+
-

When you click on the button below you will be taken to a Google sign-in page. - After entering your information, you will be redirected back to the Arvados - Workbench. If you have never used Arvados before, logging in for the first - time will also create a new user account. Arvados uses your your name and - email address from Google services only for identification, and will never - access any personal information.

-

- - Click here to log in to Arvados Workbench with a Google account -

+ + <%= raw(Rails.configuration.Workbench.WelcomePageHTML) %> + + <% case %> + <% when Rails.configuration.Login.PAM.Enable, + Rails.configuration.Login.LDAP.Enable, + Rails.configuration.Login.Test.Enable %> +
+

username

+

password

+ " id="login-return-to"> +

+ +
+ <% else %> +
+ <%= link_to arvados_api_client.arvados_login_url(return_to: request.url), class: "btn btn-primary" do %> + Log in to <%= Rails.configuration.Workbench.SiteName %> + + <% end %> +
+ <% end %> +
- -