Skip to content

Commit

Permalink
Merge pull request #125 from davidbrochart/dev_mode
Browse files Browse the repository at this point in the history
Pass dev_mode to JupyterLab front-end
  • Loading branch information
davidbrochart authored Dec 1, 2021
2 parents 8556dbf + 926b9c1 commit 4876875
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions plugins/jupyterlab/fps_jupyterlab/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ async def get_lab(
auth_config=Depends(get_auth_config),
):
return HTMLResponse(
get_index("default", auth_config.collaborative, lab_config.base_url)
get_index(
"default", auth_config.collaborative, config.dev_mode, lab_config.base_url
)
)


Expand All @@ -53,7 +55,9 @@ async def load_workspace(
path, lab_config=Depends(get_lab_config), auth_config=Depends(get_auth_config)
):
return HTMLResponse(
get_index("default", auth_config.collaborative, lab_config.base_url)
get_index(
"default", auth_config.collaborative, config.dev_mode, lab_config.base_url
)
)


Expand Down Expand Up @@ -85,7 +89,9 @@ async def get_workspace(
lab_config=Depends(get_lab_config),
auth_config=Depends(get_auth_config),
):
return get_index(name, auth_config.collaborative, lab_config.base_url)
return get_index(
name, auth_config.collaborative, config.dev_mode, lab_config.base_url
)


INDEX_HTML = """\
Expand Down Expand Up @@ -122,7 +128,7 @@ async def get_workspace(
"""


def get_index(workspace, collaborative, base_url="/"):
def get_index(workspace, collaborative, dev_mode, base_url="/"):
for path in (static_lab_dir).glob("main.*.js"):
main_id = path.name.split(".")[1]
break
Expand All @@ -144,6 +150,7 @@ def get_index(workspace, collaborative, base_url="/"):
"baseUrl": base_url,
"cacheFiles": False,
"collaborative": collaborative,
"devMode": dev_mode,
"disabledExtensions": disabled_extension,
"exposeAppInBrowser": False,
"extraLabextensionsPath": [],
Expand Down

0 comments on commit 4876875

Please sign in to comment.