This commit is contained in:
@@ -86,9 +86,15 @@ export default function ServerConsolePage() {
|
||||
|
||||
const wsProto = location.protocol === "https:" ? "wss" : "ws";
|
||||
const wsUrl = `${wsProto}://${location.host}${ws_path}`;
|
||||
const connectData = `token=${encodeURIComponent(token)}`;
|
||||
|
||||
if (containerRef.current) {
|
||||
const rect = containerRef.current.getBoundingClientRect();
|
||||
const dpi = Math.round(96 * (window.devicePixelRatio || 1));
|
||||
const connectData =
|
||||
`token=${encodeURIComponent(token)}` +
|
||||
`&width=${Math.floor(rect.width)}` +
|
||||
`&height=${Math.floor(rect.height)}` +
|
||||
`&dpi=${dpi}`;
|
||||
const conn = openConsole(containerRef.current, wsUrl, connectData);
|
||||
connectionRef.current = conn;
|
||||
setConnected(true);
|
||||
|
||||
Reference in New Issue
Block a user