mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 01:54:09 +00:00
singleuser: add some clarifying comments
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
share/jupyterhub/templates/
|
||||
share/jupyterhub/static/js/admin-react.js
|
||||
jupyterhub/singleuser/templates/
|
||||
|
@@ -7,6 +7,7 @@ import os
|
||||
from .mixins import HubAuthenticatedHandler, make_singleuser_app
|
||||
|
||||
if os.environ.get("JUPYTERHUB_SINGLEUSER_EXTENSION", "") not in ("", "0"):
|
||||
_as_extension = True
|
||||
# check for conflict in singleuser entrypoint environment variables
|
||||
if os.environ.get("JUPYTERHUB_SINGLEUSER_APP", "") not in {
|
||||
"",
|
||||
@@ -21,7 +22,6 @@ if os.environ.get("JUPYTERHUB_SINGLEUSER_EXTENSION", "") not in ("", "0"):
|
||||
f"Cannot use JUPYTERHUB_SINGLEUSER_EXTENSION={ext} with JUPYTERHUB_SINGLEUSER_APP={app}."
|
||||
" Please pick one or the other."
|
||||
)
|
||||
_as_extension = True
|
||||
from .extension import main
|
||||
else:
|
||||
_as_extension = False
|
||||
|
@@ -911,12 +911,14 @@ def make_singleuser_app(App):
|
||||
empty_parent_app = App()
|
||||
log = empty_parent_app.log
|
||||
|
||||
# detect base classes
|
||||
# detect base handler classes
|
||||
if not getattr(empty_parent_app, "login_handler_class", None) and hasattr(
|
||||
empty_parent_app, "identity_provider_class"
|
||||
):
|
||||
# Jupyter Server 2 moves the login handler classes to the identity provider
|
||||
has_handlers = empty_parent_app.identity_provider_class(parent=empty_parent_app)
|
||||
else:
|
||||
# prior to Jupyter Server 2, the app itself had handler class config
|
||||
has_handlers = empty_parent_app
|
||||
LoginHandler = has_handlers.login_handler_class
|
||||
LogoutHandler = has_handlers.logout_handler_class
|
||||
|
@@ -1,5 +1,17 @@
|
||||
{% extends "templates/page.html" %} {% block header_buttons %} {{super()}}
|
||||
{#
|
||||
this template customizes all pages (classic notebook, not jupyterlab) served by the single-user server
|
||||
|
||||
It makes the following modifications:
|
||||
|
||||
- add jupyterhub control panel link to the header
|
||||
- update logo url to jupyterhub
|
||||
- remove `?redirects` url param that may be added by jupyterhub
|
||||
#}
|
||||
|
||||
{% extends "templates/page.html" %}
|
||||
|
||||
{% block header_buttons %}
|
||||
{{ super() }}
|
||||
<span>
|
||||
<a
|
||||
href="{{hub_control_panel_url}}"
|
||||
@@ -10,9 +22,14 @@
|
||||
Control Panel
|
||||
</a>
|
||||
</span>
|
||||
{% endblock %} {% block logo %}
|
||||
{% endblock %}
|
||||
|
||||
{% block logo %}
|
||||
<img src="{{logo_url}}" alt="Jupyter Notebook" />
|
||||
{% endblock logo %} {% block script %} {{ super() }}
|
||||
{% endblock logo %}
|
||||
|
||||
{% block script %}
|
||||
{{ super() }}
|
||||
<script type="text/javascript">
|
||||
function _remove_redirects_param() {
|
||||
// remove ?redirects= param from URL so that
|
||||
|
Reference in New Issue
Block a user