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/templates/
|
||||||
share/jupyterhub/static/js/admin-react.js
|
share/jupyterhub/static/js/admin-react.js
|
||||||
|
jupyterhub/singleuser/templates/
|
||||||
|
@@ -7,6 +7,7 @@ import os
|
|||||||
from .mixins import HubAuthenticatedHandler, make_singleuser_app
|
from .mixins import HubAuthenticatedHandler, make_singleuser_app
|
||||||
|
|
||||||
if os.environ.get("JUPYTERHUB_SINGLEUSER_EXTENSION", "") not in ("", "0"):
|
if os.environ.get("JUPYTERHUB_SINGLEUSER_EXTENSION", "") not in ("", "0"):
|
||||||
|
_as_extension = True
|
||||||
# check for conflict in singleuser entrypoint environment variables
|
# check for conflict in singleuser entrypoint environment variables
|
||||||
if os.environ.get("JUPYTERHUB_SINGLEUSER_APP", "") not in {
|
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}."
|
f"Cannot use JUPYTERHUB_SINGLEUSER_EXTENSION={ext} with JUPYTERHUB_SINGLEUSER_APP={app}."
|
||||||
" Please pick one or the other."
|
" Please pick one or the other."
|
||||||
)
|
)
|
||||||
_as_extension = True
|
|
||||||
from .extension import main
|
from .extension import main
|
||||||
else:
|
else:
|
||||||
_as_extension = False
|
_as_extension = False
|
||||||
|
@@ -911,12 +911,14 @@ def make_singleuser_app(App):
|
|||||||
empty_parent_app = App()
|
empty_parent_app = App()
|
||||||
log = empty_parent_app.log
|
log = empty_parent_app.log
|
||||||
|
|
||||||
# detect base classes
|
# detect base handler classes
|
||||||
if not getattr(empty_parent_app, "login_handler_class", None) and hasattr(
|
if not getattr(empty_parent_app, "login_handler_class", None) and hasattr(
|
||||||
empty_parent_app, "identity_provider_class"
|
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)
|
has_handlers = empty_parent_app.identity_provider_class(parent=empty_parent_app)
|
||||||
else:
|
else:
|
||||||
|
# prior to Jupyter Server 2, the app itself had handler class config
|
||||||
has_handlers = empty_parent_app
|
has_handlers = empty_parent_app
|
||||||
LoginHandler = has_handlers.login_handler_class
|
LoginHandler = has_handlers.login_handler_class
|
||||||
LogoutHandler = has_handlers.logout_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>
|
<span>
|
||||||
<a
|
<a
|
||||||
href="{{hub_control_panel_url}}"
|
href="{{hub_control_panel_url}}"
|
||||||
@@ -10,9 +22,14 @@
|
|||||||
Control Panel
|
Control Panel
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% endblock %} {% block logo %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block logo %}
|
||||||
<img src="{{logo_url}}" alt="Jupyter Notebook" />
|
<img src="{{logo_url}}" alt="Jupyter Notebook" />
|
||||||
{% endblock logo %} {% block script %} {{ super() }}
|
{% endblock logo %}
|
||||||
|
|
||||||
|
{% block script %}
|
||||||
|
{{ super() }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function _remove_redirects_param() {
|
function _remove_redirects_param() {
|
||||||
// remove ?redirects= param from URL so that
|
// remove ?redirects= param from URL so that
|
||||||
|
Reference in New Issue
Block a user