Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button to UI for managing named servers #32

Open
jhgoebbert opened this issue Oct 22, 2019 · 7 comments
Open

Button to UI for managing named servers #32

jhgoebbert opened this issue Oct 22, 2019 · 7 comments

Comments

@jhgoebbert
Copy link

Hello jtpio,

another real helpful button could be one in JupyterHub scenario, which sends the user back to the control panel, which lists all running jupyter notebook servers in jupyterhub 1.x:
https://miro.medium.com/max/1482/1*VozbyUHN9qTICXzQSKQvfw.png

I tried to use jupyterlab-logout for that and make it point to
https:///integration/hub/start
with
function () { router.navigate('/hub/start', { hard: true })
which is obviously wrong as it points to
https:///integration/user/<user_name>/<server_name>/hub/start

Do you have any idea how that could be possible?
Perhaps that could be another button for jupyterlab-topbar.

Best regards,
Jens Henrik

@jtpio
Copy link
Member

jtpio commented Oct 22, 2019

@jhgoebbert if by pointing it to /hub/home?

@jtpio
Copy link
Member

jtpio commented Oct 22, 2019

Or rather: router.navigate('/home')

@jhgoebbert
Copy link
Author

If that leads to the page for named server, which was introduced with JupyterHub 1.0 ( https://blog.jupyter.org/announcing-jupyterhub-1-0-8fff78acad7f ), it would be perfekt. I will test it.

@jtpio
Copy link
Member

jtpio commented Oct 22, 2019

They should indeed show up on the home page.

If that works maybe it's worth making a new jupyterlab-hub extension, that could expose some of these shortcuts to the user when used in a JupyterHub environment.

The existing hub-extension in JupyterLab core already has some integration with JupyterHub, limited to Control Panel and Log Out for now:

image

@jhgoebbert
Copy link
Author

Great.
The hub-integration extension is hiding the "Log Out" and "Hub Control Panel" in the File menu. Users often do not find it there and are not aware of this functionality. Having a button would fix that.

@kreuzert
Copy link

Hey jtpio,
I hope you don't mind that I created a package for this ( https://www.npmjs.com/package/jupyterlab-control ) and linked you there. The only problem right now is that JupyterLab has no /home path. One has to add a redirect rule to the proxy, to catch the /home path of the JupyterLab.

An example for our nginx (where users name are emails, and JupyterLab Names are restricted to [a-z0-9_]):
location ~ "/user/([a-z0-9_.-]+)@([\da-z.-]+).([a-z.]{2,6})/[a-z0-9_]+/home" {
return 301 /hub/home;
}

If you want to add such a package by yourself I can remove my package.

@jtpio
Copy link
Member

jtpio commented Nov 14, 2019

That's great, thanks @kreuzert for sharing!

I hope you don't mind that I created a package for this ( https://www.npmjs.com/package/jupyterlab-control ) and linked you there.

No problem at all! Credit is not required but thanks for the shout-out :)

The only problem right now is that JupyterLab has no /home path. One has to add a redirect rule to the proxy, to catch the /home path of the JupyterLab.

Maybe there could be some logic that checks whether JupyterLab is running in a hub environment, like this: https://github.com/jupyterlab/jupyterlab/blob/master/packages/hub-extension/src/index.ts#L49-L52

If you want to add such a package by yourself I can remove my package.

I had no plans to create such package. If you want we can add a link to it in the list of topbar extensions: https://github.com/jtpio/jupyterlab-topbar#extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants