Skip to content

Commit

Permalink
Allow choosing default interface with default_url option
Browse files Browse the repository at this point in the history
Can be set in helm values

Ref 2i2c-org/infrastructure#1961
  • Loading branch information
yuvipanda committed Dec 13, 2022
1 parent 5d1b14a commit fe1c1e1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions jupyterhub_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
jupyterhub_config purely used for testing changes to templates.
See README.md for information on how to test this out.
"""
import pathlib
from oauthenticator.generic import GenericOAuthenticator
from jupyterhub.spawner import SimpleLocalProcessSpawner
Expand All @@ -18,6 +23,7 @@
c.JupyterHub.template_vars = {
'custom': {
"interface_selector": True,
"default_url": "/rstudio",
'org': {
'name': 'University of Foo',
'logo_url': 'https://jupyter.org/assets/nav_logo.svg',
Expand Down
18 changes: 15 additions & 3 deletions templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,25 @@
<div class="form-group interface-selector">
<label>After logging in, open: </label>
<label class="radio-inline">
<input type="radio" name="interface" value="tree" checked>Jupyter Notebook
<input type="radio" name="interface" value="tree"
{% if "default_url" not in custom or custom["default_url"] == "/tree" %}
checked
{% endif %}
>Jupyter Notebook
</label>
<label class="radio-inline">
<input type="radio" name="interface" value="rstudio">RStudio
<input type="radio" name="interface" value="rstudio"
{% if "default_url" in custom and custom["default_url"] == "/rstudio" %}
checked
{% endif %}
>RStudio
</label>
<label class="radio-inline">
<input type="radio" name="interface" value="lab">JupyterLab
<input type="radio" name="interface" value="lab"
{% if "default_url" in custom and custom["default_url"] == "/lab" %}
checked
{% endif %}
>JupyterLab
</label>
</div>
</form>
Expand Down

0 comments on commit fe1c1e1

Please sign in to comment.