-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support any extension on another server
- Loading branch information
Showing
1 changed file
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1385,7 +1385,30 @@ <h3 class="text-center">Welcome to BioImage.IO Chatbot</h3> | |
for (let ext of extension_services) { | ||
try { | ||
console.log("Getting extension service:", ext) | ||
const extSvc = await server.getService(ext) | ||
let svcId, extServer; | ||
debugger | ||
// format my_workspace/client:[email protected] | ||
if(ext.includes("@")){ | ||
svcId = ext.split("@")[0] | ||
const serverUrl = ext.split("@")[1] | ||
try{ | ||
const server = await hyphaWebsocketClient.connectToServer({ | ||
"server_url": `https://${serverUrl}`, | ||
"token": token, | ||
}) | ||
extServer = server | ||
} | ||
catch(e){ | ||
console.error("Failed to connect to extension server:", serverUrl, e) | ||
alert(`Failed to connect to extension server: ${serverUrl}, error: ${e}`) | ||
break; | ||
} | ||
} | ||
else{ | ||
svcId = ext | ||
extServer = server | ||
} | ||
const extSvc = await extServer.getService(svcId) | ||
console.log("Got extension service:", ext, extSvc) | ||
extSvc._rintf = true | ||
extSvc.id = extSvc.id.split(":")[1] | ||
|