Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #148 from jabbera/hub_extension
Browse files Browse the repository at this point in the history
Enable hub-extension
  • Loading branch information
jtpio authored May 31, 2021
2 parents b28c91c + e834c7f commit 0f7c026
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 16 deletions.
4 changes: 3 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ async function main() {
// so new terminals can be create from the menu
require('@jupyterlab/terminal-extension'),
require('@jupyterlab/theme-light-extension'),
require('@jupyterlab/theme-dark-extension')
require('@jupyterlab/theme-dark-extension'),
// Add the "Hub Control Panel" menu option when running in JupyterHub
require('@jupyterlab/hub-extension')
];

// The motivation here is to only load a specific set of plugins dependending on
Expand Down
3 changes: 3 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@jupyterlab/filebrowser-extension": "~3.1.0-alpha.8",
"@jupyterlab/fileeditor": "~3.1.0-alpha.8",
"@jupyterlab/fileeditor-extension": "~3.1.0-alpha.8",
"@jupyterlab/hub-extension": "~3.1.0-alpha.8",
"@jupyterlab/javascript-extension": "~3.1.0-alpha.8",
"@jupyterlab/json-extension": "~3.1.0-alpha.8",
"@jupyterlab/mainmenu": "~3.1.0-alpha.8",
Expand Down Expand Up @@ -93,6 +94,7 @@
"@jupyterlab/docmanager-extension": "^3.1.0-alpha.8",
"@jupyterlab/filebrowser-extension": "^3.1.0-alpha.8",
"@jupyterlab/fileeditor-extension": "^3.1.0-alpha.8",
"@jupyterlab/hub-extension": "3.1.0-alpha.8",
"@jupyterlab/javascript-extension": "^3.1.0-alpha.8",
"@jupyterlab/json-extension": "^3.1.0-alpha.8",
"@jupyterlab/mainmenu-extension": "^3.1.0-alpha.8",
Expand Down Expand Up @@ -158,6 +160,7 @@
"@jupyterlab/docmanager-extension",
"@jupyterlab/filebrowser-extension",
"@jupyterlab/fileeditor-extension",
"@jupyterlab/hub-extension",
"@jupyterlab/mainmenu-extension",
"@jupyterlab/mathjax2-extension",
"@jupyterlab/notebook-extension",
Expand Down
13 changes: 13 additions & 0 deletions retrolab/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ def get_page_config(self):
"retroLogo": app.retro_logo,
}

if 'hub_prefix' in app.serverapp.tornado_settings:
tornado_settings = app.serverapp.tornado_settings
hub_prefix = tornado_settings['hub_prefix']
page_config['hubPrefix'] = hub_prefix
page_config['hubHost'] = tornado_settings['hub_host']
page_config['hubUser'] = tornado_settings['user']
page_config['shareUrl'] = ujoin(hub_prefix, 'user-redirect')
# Assume the server_name property indicates running JupyterHub 1.0.
if hasattr(app.serverapp, 'server_name'):
page_config['hubServerName'] = app.serverapp.server_name
api_token = os.getenv('JUPYTERHUB_API_TOKEN', '')
page_config['token'] = api_token

mathjax_config = self.settings.get("mathjax_config", "TeX-AMS_HTML-full,Safe")
# TODO Remove CDN usage.
mathjax_url = self.settings.get(
Expand Down
42 changes: 27 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,18 @@
"@lumino/widgets" "^1.19.0"
react "^17.0.1"

"@jupyterlab/hub-extension@3.1.0-alpha.8":
version "3.1.0-alpha.8"
resolved "https://registry.yarnpkg.com/@jupyterlab/hub-extension/-/hub-extension-3.1.0-alpha.8.tgz#b3bbfea2072c33da0323277e2668f031ff8464e9"
integrity sha512-CZBrrbbFQwE8/zN4+FUwfhHrmT48O7GCNA8JTtopKQ90YTPDYRZIZnmWMPHTGSZFnKoFl5idG9hwTww+gWBnpA==
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/apputils" "^3.1.0-alpha.8"
"@jupyterlab/coreutils" "^5.1.0-alpha.8"
"@jupyterlab/mainmenu" "^3.1.0-alpha.8"
"@jupyterlab/services" "^6.1.0-alpha.8"
"@jupyterlab/translation" "^3.1.0-alpha.8"

"@jupyterlab/javascript-extension@^3.1.0-alpha.8":
version "3.1.0-alpha.8"
resolved "https://registry.yarnpkg.com/@jupyterlab/javascript-extension/-/javascript-extension-3.1.0-alpha.8.tgz#4369eb648dfb8cb29cb6ce92620298e2e5da9371"
Expand Down Expand Up @@ -3214,7 +3226,7 @@
integrity sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==

"@retrolab/application-extension@file:packages/application-extension":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/apputils" "^3.1.0-alpha.8"
Expand All @@ -3228,11 +3240,11 @@
"@jupyterlab/settingregistry" "^3.1.0-alpha.8"
"@jupyterlab/translation" "^3.1.0-alpha.8"
"@lumino/widgets" "^1.23.0"
"@retrolab/application" "^0.2.0"
"@retrolab/ui-components" "^0.2.0"
"@retrolab/application" "^0.3.0-alpha.2"
"@retrolab/ui-components" "^0.3.0-alpha.2"

"@retrolab/application@file:packages/application":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/coreutils" "^5.1.0-alpha.8"
Expand All @@ -3247,7 +3259,7 @@
"@lumino/widgets" "^1.23.0"

"@retrolab/docmanager-extension@file:packages/docmanager-extension":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/coreutils" "^5.1.0-alpha.8"
Expand All @@ -3257,15 +3269,15 @@
"@lumino/algorithm" "^1.6.0"

"@retrolab/help-extension@file:packages/help-extension":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/apputils" "^3.1.0-alpha.8"
"@jupyterlab/mainmenu" "^3.1.0-alpha.8"
"@retrolab/ui-components" "^0.2.0"
"@retrolab/ui-components" "^0.3.0-alpha.2"

"@retrolab/lab-extension@file:packages/lab-extension":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/apputils" "^3.1.0-alpha.8"
Expand All @@ -3275,29 +3287,29 @@
"@jupyterlab/notebook" "^3.1.0-alpha.8"
"@lumino/commands" "^1.15.0"
"@lumino/disposable" "^1.7.0"
"@retrolab/ui-components" "^0.2.0"
"@retrolab/ui-components" "^0.3.0-alpha.2"

"@retrolab/notebook-extension@file:packages/notebook-extension":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/apputils" "^3.1.0-alpha.8"
"@jupyterlab/docmanager" "^3.1.0-alpha.8"
"@jupyterlab/notebook" "^3.1.0-alpha.8"
"@lumino/polling" "^1.6.0"
"@lumino/widgets" "^1.23.0"
"@retrolab/application" "^0.2.0"
"@retrolab/application" "^0.3.0-alpha.2"

"@retrolab/terminal-extension@file:packages/terminal-extension":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/coreutils" "^5.1.0-alpha.8"
"@jupyterlab/terminal" "^3.1.0-alpha.8"
"@lumino/algorithm" "^1.6.0"

"@retrolab/tree-extension@file:packages/tree-extension":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/application" "^3.1.0-alpha.8"
"@jupyterlab/apputils" "^3.1.0-alpha.8"
Expand All @@ -3313,10 +3325,10 @@
"@lumino/algorithm" "^1.6.0"
"@lumino/commands" "^1.15.0"
"@lumino/widgets" "^1.23.0"
"@retrolab/application" "^0.2.0"
"@retrolab/application" "^0.3.0-alpha.2"

"@retrolab/ui-components@file:packages/ui-components":
version "0.2.0"
version "0.3.0-alpha.2"
dependencies:
"@jupyterlab/ui-components" "^3.1.0-alpha.8"
react "^17.0.1"
Expand Down

0 comments on commit 0f7c026

Please sign in to comment.