demo mount to fastapi

This commit is contained in:
Xin Wang
2026-05-22 10:23:17 +08:00
parent 0d82acc0d2
commit 2c7f0f440b
10 changed files with 86 additions and 22 deletions

View File

@@ -18,6 +18,11 @@ const PROTOCOL = "va.ws.v1";
const MAX_WS_LOG_LINES = 120;
const AUDIO_DELTA_LOG_INTERVAL_MS = 1000;
function defaultWsUrl() {
const scheme = location.protocol === "https:" ? "wss:" : "ws:";
return `${scheme}//${location.host}/ws-product`;
}
const els = {
url: document.getElementById("ws-url"),
connectBtn: document.getElementById("connect-btn"),
@@ -885,6 +890,8 @@ window.addEventListener("beforeunload", () => {
}
});
els.url.value = defaultWsUrl();
setStatus("idle", "Disconnected");
setConnectButton();
setMicButton();