File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 1
1
share /jupyterhub /templates /
2
2
share /jupyterhub /static /js /admin-react.js
3
+ jupyterhub /singleuser /templates /
Original file line number Diff line number Diff line change 7
7
from .mixins import HubAuthenticatedHandler , make_singleuser_app
8
8
9
9
if os .environ .get ("JUPYTERHUB_SINGLEUSER_EXTENSION" , "" ) not in ("" , "0" ):
10
+ _as_extension = True
10
11
# check for conflict in singleuser entrypoint environment variables
11
12
if os .environ .get ("JUPYTERHUB_SINGLEUSER_APP" , "" ) not in {
12
13
"" ,
21
22
f"Cannot use JUPYTERHUB_SINGLEUSER_EXTENSION={ ext } with JUPYTERHUB_SINGLEUSER_APP={ app } ."
22
23
" Please pick one or the other."
23
24
)
24
- _as_extension = True
25
25
from .extension import main
26
26
else :
27
27
_as_extension = False
Original file line number Diff line number Diff line change @@ -911,12 +911,14 @@ def make_singleuser_app(App):
911
911
empty_parent_app = App ()
912
912
log = empty_parent_app .log
913
913
914
- # detect base classes
914
+ # detect base handler classes
915
915
if not getattr (empty_parent_app , "login_handler_class" , None ) and hasattr (
916
916
empty_parent_app , "identity_provider_class"
917
917
):
918
+ # Jupyter Server 2 moves the login handler classes to the identity provider
918
919
has_handlers = empty_parent_app .identity_provider_class (parent = empty_parent_app )
919
920
else :
921
+ # prior to Jupyter Server 2, the app itself had handler class config
920
922
has_handlers = empty_parent_app
921
923
LoginHandler = has_handlers .login_handler_class
922
924
LogoutHandler = has_handlers .logout_handler_class
Original file line number Diff line number Diff line change 1
- {% extends "templates/page.html" %} {% block header_buttons %} {{super()}}
1
+ {#
2
+ this template customizes all pages (classic notebook, not jupyterlab) served by the single-user server
2
3
4
+ It makes the following modifications:
5
+
6
+ - add jupyterhub control panel link to the header
7
+ - update logo url to jupyterhub
8
+ - remove `?redirects` url param that may be added by jupyterhub
9
+ #}
10
+
11
+ {% extends "templates/page.html" %}
12
+
13
+ {% block header_buttons %}
14
+ {{ super() }}
3
15
< span >
4
16
< a
5
17
href ="{{hub_control_panel_url}} "
10
22
Control Panel
11
23
</ a >
12
24
</ span >
13
- {% endblock %} {% block logo %}
25
+ {% endblock %}
26
+
27
+ {% block logo %}
14
28
< img src ="{{logo_url}} " alt ="Jupyter Notebook " />
15
- {% endblock logo %} {% block script %} {{ super() }}
29
+ {% endblock logo %}
30
+
31
+ {% block script %}
32
+ {{ super() }}
16
33
< script type ="text/javascript ">
17
34
function _remove_redirects_param ( ) {
18
35
// remove ?redirects= param from URL so that
You can’t perform that action at this time.
0 commit comments