Skip to content

Commit

Permalink
JupyterHub+lab new connect url parser
Browse files Browse the repository at this point in the history
Should fix interactivity on NCI ARE
  • Loading branch information
OKaluza committed Oct 11, 2024
1 parent b985bcd commit f334f67
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lavavu/html/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,17 @@ function WindowInteractor(id, uid, port) {
} else {

//Several possible modes to try
//JupyterHub URL
var regex = /\/user\/[a-z0-9-]+\//i;
//Modern JupyterHub lab URL
var regex = /\/lab\//;
var parsed = regex.exec(loc.href);
if (parsed && parsed.length > 0) {
var base = parsed[0];
connect(loc.href.substring(0,parsed.index) + base + "proxy/" + port);
connect(loc.href.substring(0,parsed.index) + "/proxy/" + port);
}
//Old JupyterHub URL
regex = /\/user\/[a-z0-9-]+\//i;
parsed = regex.exec(loc.href);
if (parsed && parsed.length > 0) {
connect(loc.href.substring(0,parsed.index) + parsed[0] + "proxy/" + port);
}

if (loc.protocol != 'file:') {
Expand Down

0 comments on commit f334f67

Please sign in to comment.