Added notebookServerInfo

This commit is contained in:
Srinath Narayanan 2021-08-22 12:38:15 -07:00
parent c0bd74ce1b
commit 78e5c88e3c
2 changed files with 6 additions and 19 deletions

View File

@ -465,7 +465,6 @@ export default class Explorer {
*/
const provisionData = {
cosmosKey: userContext.masterKey,
cosmosEndpoint: userContext.databaseAccount.properties.documentEndpoint,
resourceId: userContext.databaseAccount.id,
dbAccountName: userContext.databaseAccount.name,
@ -480,25 +479,11 @@ export default class Explorer {
},
body: JSON.stringify(provisionData)
})
const websocketId = await response.text();
const unprovisionData = {
resourceId: userContext.databaseAccount.id,
websocketId: websocketId
}
window.addEventListener("beforeunload", async () => {
const response = await window.fetch("http://localhost:443/api/containerpooling/unprovision", {
method: "POST",
headers: {
[HttpHeaders.contentType]: "application/json",
},
body: JSON.stringify(unprovisionData)
})
})
var notebookServerInfo = await response.json();
this.notebookServerInfo({
notebookServerEndpoint: userContext.features.notebookServerUrl || `http://localhost:443/api/containerpooling/resid${userContext.databaseAccount.id}/forward/`,
authToken: userContext.features.notebookServerToken || "token",
notebookServerEndpoint: userContext.features.notebookServerUrl || `http://localhost:443/api/containerpooling/${notebookServerInfo.forwardingId}/forward/`,
authToken: userContext.features.notebookServerToken || notebookServerInfo.notebookServerToken,
});
this.notebookServerInfo.valueHasMutated();
this.refreshNotebookList();

View File

@ -255,7 +255,9 @@ export class NotebookContentClient {
private fetchNotebookFiles(path: string): Promise<NotebookContentItem[]> {
return this.contentProvider
.get(this.getServerConfig(), path + "/directory", {})
.get(this.getServerConfig(), path, {
type: "directory",
})
.toPromise()
.then((xhr) => {
if (xhr.status !== 200) {