Skip to content

Commit

Permalink
Show progress
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Oct 12, 2023
1 parent 774fcd8 commit c255d9c
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions web/public/lite.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,30 @@
const token = urlParams.get('token');
const service_id = urlParams.get('service_id');
if(service_id){
const server = await hyphaWebsocketClient.connectToServer({"server_url": server_url, "workspace": workspace, "token": token})
await server.registerService({
"name": service_id,
"id": service_id,
"type": "imjoy-client",
"config": {
"visibility": "protected"
},
"api": api
}, {overwrite: true, _rkwargs: true})

app.imjoy.expose_api = true
await app.imjoy.init()
await app.showLoader(true)
try{
const server = await hyphaWebsocketClient.connectToServer({"server_url": server_url, "workspace": workspace, "token": token})
await server.registerService({
"name": service_id,
"id": service_id,
"type": "imjoy-client",
"config": {
"visibility": "protected"
},
"api": api
}, {overwrite: true, _rkwargs: true})

app.imjoy.expose_api = true
await app.imjoy.init()
await api.showMessage(`🎉Connected to the server (${server_url}) successfully! Workspace: ${workspace}, Service ID: ${service_id}`)
}
catch(e){
console.error(e)
alert(`Failed to connect to the server: ${e}`)
}
finally{
await app.showLoader(false)
}
}
});
</script>
Expand Down

0 comments on commit c255d9c

Please sign in to comment.