Refactor build and start scripts in package.json; add plugin to exclude debug files from production build in vite.config.ts; remove ConnectScreen component and replace with ConnectionPlaceholder in multiple pages; update DeviceContext to auto-connect using device IP from URL; enhance locale files with new device IP labels.

This commit is contained in:
yangy
2026-05-22 15:54:11 +08:00
parent 747331c850
commit 32f15217ad
13 changed files with 199 additions and 173 deletions
+11
View File
@@ -0,0 +1,11 @@
/** 从地址栏 ?ip= 读取设备 IPhash 路由下 query 仍在 search 上) */
export function getDeviceIpFromUrl(): string | null {
if (typeof window === "undefined") return null;
const ip = new URLSearchParams(window.location.search).get("ip");
const trimmed = ip?.trim();
return trimmed || null;
}
export function resolveInitialDeviceIp(): string {
return getDeviceIpFromUrl() ?? localStorage.getItem("luxsin_ip") ?? "192.168.2.30";
}