mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-07-05 19:43:51 +01:00
Added notebookServerInfo
This commit is contained in:
parent
c0bd74ce1b
commit
78e5c88e3c
@ -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();
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user