feat: 增加日志模块

This commit is contained in:
2026-04-18 12:52:32 +08:00
parent 7cd464bc6a
commit 2ca70d556b
15 changed files with 1263 additions and 186 deletions

View File

@@ -24,6 +24,19 @@ export function buildVideoFrameUrl(frameKey: number) {
return `${API_BASE}/api/video/frame/?frame=${frameKey}&t=${Date.now()}`
}
export async function postVideoDisplayProbe(payload: Record<string, unknown>) {
const response = await fetch(`${API_BASE}/api/video/display-probe/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
})
if (!response.ok) {
throw new Error(`display probe post failed: ${response.status} ${response.statusText}`)
}
}
export function buildControlWebSocketUrl() {
const url = new URL(API_BASE, window.location.origin)
const basePath = url.pathname.replace(/\/$/, '')