diff --git a/extra-assets/css/login.css b/extra-assets/css/login.css deleted file mode 100644 index fb33bf6..0000000 --- a/extra-assets/css/login.css +++ /dev/null @@ -1,81 +0,0 @@ -#home { - margin-top: 32px -} - -.login-container { - margin-top: 32px; -} - -#login-button { - margin-top: 32px; -} -#operated-by { - margin-top: 8px; - color: darkgrey; -} - -#operated-by a { - color:grey; - font-weight: bold; -} - -.details { - margin-top: 32px; -} - -.details-welcome { - color: black; -} - -.details-logos img { - margin: 12px; - text-align: right; -} - -.details p { - color: grey; -} - -.announcements { - margin-top: 8px; -} - -.announcements > div { - margin-top: 16px; - padding-top: 4px; - padding-bottom: 5px; - border: 2px dotted orange; -} - -.announcements-text { - padding-left: 10px; -} - -.questions { - margin-top: 12px; -} - -.questions > div { - margin-top: 32px; - padding-bottom: 32px; - border-bottom: 2px lightgrey dotted; -} - -.footer { - padding-top: 64px; - text-align: center; - color: darkgrey; -} - -.footer a { - color: darkgrey; - text-decoration: underline; -} - -p.hub-login-text { - font-size: 1.5em; -} - -div.login-header img.hub-logo { - width: 40%; -} diff --git a/extra-assets/images/home-hero.png b/extra-assets/images/home-hero.png deleted file mode 100644 index aa1206f..0000000 Binary files a/extra-assets/images/home-hero.png and /dev/null differ diff --git a/extra-assets/images/jupyter-logo.svg b/extra-assets/images/jupyter-logo.svg deleted file mode 100644 index fb2921a..0000000 --- a/extra-assets/images/jupyter-logo.svg +++ /dev/null @@ -1,88 +0,0 @@ - -logo.svg -Created using Figma 0.90 - - - - - - - - - - - - - - - - - - diff --git a/extra-assets/images/rstudio-logo.svg b/extra-assets/images/rstudio-logo.svg deleted file mode 100644 index b0401ca..0000000 --- a/extra-assets/images/rstudio-logo.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extra-assets/js/login.js b/extra-assets/js/login.js index 96290f7..b4552ed 100644 --- a/extra-assets/js/login.js +++ b/extra-assets/js/login.js @@ -1,32 +1,20 @@ -function redirectIfNeeded() { - // Only redirect utoronto.2i2c.cloud, lets us keep staging at staging.utoronto.2i2c.cloud - if (window.location.hostname === 'utoronto.2i2c.cloud') { - // Let's give users an indication that something is happening - document.write("Redirecting you to jupyter.utoronto.ca"); - window.location.hostname = 'jupyter.utoronto.ca'; - } +// This code must be run *as early as possible*, as we care about redirecting the user +// *somewhere* immediately. So this isn't wrapped in a window.onload or similar, but bare. +// This code is also loaded directly in , so it will block page load. +const curUrl = new URL(document.location); +// if next query param is presentm just do nothing +const nextUrl = curUrl.searchParams.get('next'); +// /hub/ being next should be treated same as no next present +if (!nextUrl || nextUrl === "/hub/") { + // The 'unified' home page for all the hubs is at https://datatools.utoronto.ca, + // so anyone landing on the home page should just be redirected. + window.location.replace("https://datatools.utoronto.ca"); +} else { + // The user has landed on this page, which means they are not actually logged in, + // and need to login to continue to wherever they are going. So let's construct the + // appropriate oauth_login URL for them to go to. + let oauthLoginUrl = new URL(document.location); + // Pass along all url parameters we got, just change from /login to /oauth_login + oauthLoginUrl.pathname = "/oauth_login"; + window.location.replace(oauthLoginUrl); } -function setInterface(interfaceUrl) { - let loginUrl = new URL($('#home').data('authenticator-login-url'), document.location.origin); - loginUrl.searchParams.set('next', '/hub/user-redirect/' + interfaceUrl) - $('#login-button').attr( - 'href', - loginUrl.toString() - ); -} -$(function() { - redirectIfNeeded(); - // if next query param is presentm just do nothing - const nextPresent = new URL(document.location).searchParams.get('next'); - // /hub/ being next should be treated same as no next present - if (!nextPresent || nextPresent === "/hub/") { - setInterface($("input[name='interface']:checked").val()); - - $("input[name='interface']").change(function() { - if (this.checked) { - setInterface(this.value) - } - }); - } - -}) \ No newline at end of file diff --git a/templates/error.html b/templates/error.html index 4c04c19..e5b2c69 100644 --- a/templates/error.html +++ b/templates/error.html @@ -1,7 +1,7 @@ {% extends "templates/error.html" %} {% block error_detail %} -{% if status_code == 403 %} +{% if status_code == 500 %}
- - Looks like you have NOT been added to the list of allowed users for this hub. Please contact the hub administrators. -
-
- - Tap to try a different account - + + We are investigating an issue that causes login failures for some users. + As a temporary workaround, please login to mail.utoronto.ca first, and then you should be able to login to the JupyterHub.
{% else %} diff --git a/templates/login.html b/templates/login.html index 0512c69..8b612dd 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,158 +1,11 @@ -{% extends "templates/login.html" %} - - -{% block nav_bar %} -{% endblock %} - -{% block stylesheet %} -{{ super() }} - -{% endblock %} - -{% block script %} -{{ super() }} - -{% endblock %} - -{% block main %} -
-
-
- - - - -
-
- {% if "interface_selector" in custom and custom["interface_selector"] and (not next or next == "%2Fhub%2F") %} -
-
- - - - -
-
- - Log in to start - - {% else %} - - Log in to continue - - {% endif %} -
- -
-
- - Welcome to the {{ custom.org.name }} 2i2c JupyterHub. - -
-
- This is a pilot service running on open source infrastructure. - See the 2i2c Pilot documentation for usage and deployment information.

-
-
-
- - Jupyter - -
-
- - RStudio - -
-
- -
- - {% if custom.announcements is defined %} -
- {% for announcement in custom.announcements %} -
- {{ announcement | safe }} -
- {% endfor %} -
- {% endif %} - -
-
-

Where can I learn more?

- - The 2i2c Pilot Hubs Documentation has all of the information that you need to use the hub, as well as information about the deployment technology. -
-
-

What is a Jupyter Notebook?

- - Jupyter Notebook is an open-source web application that allows you to create and - share documents that contain live code, equations, visualizations and narrative - text. Uses include: data cleaning and transformation, numerical simulation, - statistical modeling, data visualization, machine learning, and much more. - -
- -
-

What is JupyterHub?

- JupyterHub brings - the power of notebooks to groups of users. It gives users access to - computational environments and resources without burdening the users with - installation and maintenance tasks. Users - including students, - researchers, and data scientists - can get their work done in their own - workspaces on shared resources which can be managed efficiently by system - administrators. -
- -
-

Who can use this service?

- - This JupyterHub service is open to anyone that a hub administrator has approved. - Generally this means instructors and students. As this - is a proof-of-concept service, students should ensure they are backing up - their notebooks regularly if they are using this service for course - activities. -
- - -
-{% endblock %} +{# This template *intentionally* does not inherit from any other template, as we want to redirect the end user as soon + as possible. The logic for the redirection is in redirect.js, which is loaded in in a blocking manner. + #} + + + + + + Redirecting you appropriately... + + \ No newline at end of file