Use current host in landing page (#1792)

Update WebSocketUrlField.jsx
This commit is contained in:
machenmusik authored and GitHub committed 2023-04-21 02:37:46 -04:00
1 parent f84ad7352e
commit 3addd32b36
1 file changed
+3 -1
@@ -29,6 +29,8 @@ export default function WebSocketUrlField() {
} }
}; };
const currentHost = `${window.location.protocol}//${window.location.host}`;
return ( return (
<div> <div>
<TextField <TextField
@@ -42,7 +44,7 @@ export default function WebSocketUrlField() {
helperText={testWebSocket(websocket_url) ? 'Invalid websocket URL' : ''} helperText={testWebSocket(websocket_url) ? 'Invalid websocket URL' : ''}
/> />
<Link href={`/?websocket_url=${websocket_url}`}> <Link href={`/?websocket_url=${websocket_url}`}>
viewer.nerf.studio?websocket_url={websocket_url} {currentHost}?websocket_url={websocket_url}
</Link> </Link>
</div> </div>
); );