mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-07-06 03:54:18 +01:00
Added notebookServerInfo
This commit is contained in:
parent
c0bd74ce1b
commit
78e5c88e3c
@ -465,7 +465,6 @@ export default class Explorer {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const provisionData = {
|
const provisionData = {
|
||||||
cosmosKey: userContext.masterKey,
|
|
||||||
cosmosEndpoint: userContext.databaseAccount.properties.documentEndpoint,
|
cosmosEndpoint: userContext.databaseAccount.properties.documentEndpoint,
|
||||||
resourceId: userContext.databaseAccount.id,
|
resourceId: userContext.databaseAccount.id,
|
||||||
dbAccountName: userContext.databaseAccount.name,
|
dbAccountName: userContext.databaseAccount.name,
|
||||||
@ -480,25 +479,11 @@ export default class Explorer {
|
|||||||
},
|
},
|
||||||
body: JSON.stringify(provisionData)
|
body: JSON.stringify(provisionData)
|
||||||
})
|
})
|
||||||
const websocketId = await response.text();
|
var notebookServerInfo = await response.json();
|
||||||
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)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
this.notebookServerInfo({
|
this.notebookServerInfo({
|
||||||
notebookServerEndpoint: userContext.features.notebookServerUrl || `http://localhost:443/api/containerpooling/resid${userContext.databaseAccount.id}/forward/`,
|
notebookServerEndpoint: userContext.features.notebookServerUrl || `http://localhost:443/api/containerpooling/${notebookServerInfo.forwardingId}/forward/`,
|
||||||
authToken: userContext.features.notebookServerToken || "token",
|
authToken: userContext.features.notebookServerToken || notebookServerInfo.notebookServerToken,
|
||||||
});
|
});
|
||||||
this.notebookServerInfo.valueHasMutated();
|
this.notebookServerInfo.valueHasMutated();
|
||||||
this.refreshNotebookList();
|
this.refreshNotebookList();
|
||||||
|
@ -255,7 +255,9 @@ export class NotebookContentClient {
|
|||||||
|
|
||||||
private fetchNotebookFiles(path: string): Promise<NotebookContentItem[]> {
|
private fetchNotebookFiles(path: string): Promise<NotebookContentItem[]> {
|
||||||
return this.contentProvider
|
return this.contentProvider
|
||||||
.get(this.getServerConfig(), path + "/directory", {})
|
.get(this.getServerConfig(), path, {
|
||||||
|
type: "directory",
|
||||||
|
})
|
||||||
.toPromise()
|
.toPromise()
|
||||||
.then((xhr) => {
|
.then((xhr) => {
|
||||||
if (xhr.status !== 200) {
|
if (xhr.status !== 200) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user