-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add shutdown button option #3004
Conversation
Aha, you beat me to it, thanks :-)
This also reminds me that I don't think we should be showing a 'logout' button when the user is authenticated by a token, since from their perspective they're not 'logged in'. |
From JupyterHub's perspective, this would mean that the server died and the Hub would take a finite (generally short) period of time to notice. It would probably be best in the future for SingleUserServer to override the method to trigger shutdown via the Hub API, so if it's easy to override that would be ideal. |
How about "Disconnect"?
Seems like it should be simple to override. Here is the shutdown handler: https://github.com/jupyter/notebook/blob/master/notebook/services/shutdown.py |
I like disconnect even less ;-). Disconnect implies something will remain to which you can reconnect later. |
Since this is not shutting down the machine and is not disconnecting how about "HALT JUPYTER" or "HALT SERVICE" as a label? Either should make it clear what is going on. Regarding default enabling or not if the option is added to the configuration file options and included in the default generated by |
Returning to this, I think we need to:
@gnestor do you have time to come back to this? |
Just a suggestion how about "Terminate" possibly with a hover of "Shutdown Jupyter Server Backend" this rather than "Shutdown" - it rightly sounds more drastic than close/exit/etc. but does not imply that the machine will shutdown. I like the idea of a countdown, (especially if the length of the countdown is a configurable item), but would suggest that it would be a good idea to have a "Now" button as well as a "Cancel" - everybody on Windows swears regularly at the "Applying Updates: Do not switch off...." message when they are in a hurry to get their machine shutdown so that they can go home or catch a bus/train/flight and I would like to avoid being in the same category. |
'Terminate' could work, though it sounds a bit violent ;-) Or maybe 'Quit'? If we're trying to get this into 5.5, I'd probably leave the countdown for a future version to keep things simple. |
I've rebased this, enabled the button by default, changed the label to 'Quit', made sure all the human readable text is marked for translation, and made it display a dialog on successful shutdown. The dialog looks pretty ugly, but it's better than not showing anything. We can improve on it later. Min and I agreed that Jupyterhub can simply disable this button and show its own buttons. Shutdown via the hub involves a HTTP DELETE request, so it would have to have config options for both the URL and the HTTP verb. |
@takluyver Thanks for doing this. I was just about to dig into it. I'm not sure if "Quit" is better than "Shutdown"... We are using "shutdown_button" as the name for the module, so I guess that we should rename that as well if we go with "quit." You're call. Feel free to merge 👍 |
My rationale is that 'shutdown' is clearer for people who understand the idea of a local HTTP server, and 'quit' is clearer for people who don't. But on reflection, I think the config name should match what the button says. I'll update it. |
I've renamed the config option to |
Closes #1530
Introduces a new option
--NotebookApp.shutdown_button
which will add a button to the dashboard header that when clicked will shutdown the notebook server.