jupyterlab-hub
jupyterlab-hub copied to clipboard
Check for running server and prompt to restart
polls /api/status, showing dialog on failure
- adds restart-server action
- restart-server action opens new tab pointed to /hub/spawn to trigger the new spawn
Improvements that could be made:
- restart with API request instead of new tab (not reliable because API token may not still be valid with the Hub after stop)
- use
/hub/spawn/:user/:serverspawn urls, which are new in Hub 1.0. This PR won't properly restart named servers. This also requires jupyterlab to make the username and server name available to PageConfig (or we can parse the url). - hook into lab's existing Connection Lost event
Fixes #83
Screenshots
Wow @minrk this is an excellent idea I think!
I wonder what happens if this competes with other errors that tend to show when you loose connectivity to the server, will you get two dialog boxes, one after the other, will you only get one?
If this works properly, this would be a big UX win!! :tada:
I cannot do much insightful review of the technical changes though, but I picked up some insights while reading them. I'm excited about this PR! :D
That's what I was referring to with the hook into lab's existing Connection Lost event. That event will can still occur, so there can be a bit of a fight for which dialog the user is shown. Ideally, we would override the connection lost dialog with this as well.
Hey all, jupyterlab/jupyterlab#6399 provides a new IConnectionLost token, which can be overridden by extensions, to handle a lost server connection. This should get around the dialog race. It won't be usable until a release, but should allow this PR to move forwards.