Fix VNC URL on production builds

This commit is contained in:
Pierre HUBERT 2023-12-12 17:04:19 +01:00
parent 32ae92d7aa
commit c837d70374
2 changed files with 2 additions and 1 deletions

View File

@ -338,7 +338,7 @@ export class VMApi {
let baseWSURL = APIClient.backendURL(); let baseWSURL = APIClient.backendURL();
if (!baseWSURL.includes("://")) if (!baseWSURL.includes("://"))
baseWSURL = baseWSURL =
window.location.protocol + "://" + window.location.hostname + baseWSURL; window.location.protocol + "//" + window.location.host + baseWSURL;
return ( return (
baseWSURL.replace("http", "ws") + baseWSURL.replace("http", "ws") +

View File

@ -57,6 +57,7 @@ function VNCInner(p: { vm: VMInfo }): React.ReactElement {
setToken(undefined); setToken(undefined);
const u = await VMApi.OneShotVNCURL(p.vm); const u = await VMApi.OneShotVNCURL(p.vm);
console.info("VNC URL", u);
if (!token) if (!token)
setToken({ setToken({