diff --git a/src/electron/renderer/src/server/globals.ts b/src/electron/renderer/src/server/globals.ts index 698243dc9..535c4d823 100644 --- a/src/electron/renderer/src/server/globals.ts +++ b/src/electron/renderer/src/server/globals.ts @@ -56,7 +56,7 @@ export const activateServer = () => { export const serverGlobals = { species: new Promise((res, rej) => { onServerOpen(() => { - fetch(new URL("get-recommended-species", baseUrl)) + fetch(new URL("/dandi/get-recommended-species", baseUrl)) .then((res) => res.json()) .then((species) => { res(species) @@ -67,7 +67,7 @@ export const serverGlobals = { }), cpus: new Promise((res, rej) => { onServerOpen(() => { - fetch(new URL("cpus", baseUrl)) + fetch(new URL("/system/cpus", baseUrl)) .then((res) => res.json()) .then((cpus) => { res(cpus) diff --git a/src/electron/renderer/src/stories/pages/preview/PreviewPage.js b/src/electron/renderer/src/stories/pages/preview/PreviewPage.js index 4436038cd..e6de3b95a 100644 --- a/src/electron/renderer/src/stories/pages/preview/PreviewPage.js +++ b/src/electron/renderer/src/stories/pages/preview/PreviewPage.js @@ -18,7 +18,12 @@ export class PreviewPage extends Page { updatePath = async (path) => { if (path) { - const result = await fetch(`${baseUrl}/files/${path}`, { method: "POST" }).then((res) => res.text()); + // Enable access to the explicit file path + const result = await fetch(`${baseUrl}/files/${path}`, { + method: "POST", + }).then((res) => res.text()); + + // Set Neurosift to access the returned URL if (result) this.neurosift.url = result; } else this.neurosift.url = undefined; }; diff --git a/src/electron/renderer/src/stories/preview/NWBFilePreview.js b/src/electron/renderer/src/stories/preview/NWBFilePreview.js index cb496d591..cd268a90e 100644 --- a/src/electron/renderer/src/stories/preview/NWBFilePreview.js +++ b/src/electron/renderer/src/stories/preview/NWBFilePreview.js @@ -56,7 +56,10 @@ class NWBPreviewInstance extends LitElement { const isOnline = navigator.onLine; return isOnline - ? new Neurosift({ url: getURLFromFilePath(this.file, this.project), fullscreen: false }) + ? new Neurosift({ + url: getURLFromFilePath(this.file, this.project), + fullscreen: false, + }) : until( (async () => { const htmlRep = await run("html", { nwbfile_path: this.file }, { swal: false }); diff --git a/src/electron/renderer/src/stories/preview/Neurosift.js b/src/electron/renderer/src/stories/preview/Neurosift.js index c70c9d5fc..3f85327d8 100644 --- a/src/electron/renderer/src/stories/preview/Neurosift.js +++ b/src/electron/renderer/src/stories/preview/Neurosift.js @@ -80,7 +80,9 @@ export class Neurosift extends LitElement { render() { return this.url ? html`