feat: 实现设备注册和精准控制功能,支持双屏管理;更新相关逻辑以优化设备状态跟踪

This commit is contained in:
Pine
2026-08-19 14:19:37 +08:00
parent 93b27cf227
commit e72442dae0
15 changed files with 264 additions and 53 deletions
+17
View File
@@ -7,6 +7,23 @@ import { getApiBase } from "./config";
import { invoke } from "@tauri-apps/api/core";
import "./styles/global.css";
/* 全局致命错误捕获:任何模块加载/运行/异步错误 → 显示到页面(替代白屏),便于副屏等定位 */
function installFatalErrorDiagnostics() {
const show = (label, err) => {
const el = document.getElementById("fatal-error");
if (!el || el.style.display === "block") return;
const text = document.getElementById("fatal-error-text");
if (text) {
const msg = (err && (err.stack || err.message)) || String(err);
text.textContent = `${label}\n${msg}`;
}
el.style.display = "block";
};
window.addEventListener("error", (e) => show("加载错误:", e.error || e.message));
window.addEventListener("unhandledrejection", (e) => show("未处理异常:", e.reason));
}
installFatalErrorDiagnostics();
/* =========================================================
启动引导(打包部署关键)—— 地址解析优先级:
1. exe 旁 config.jsonTauri 命令读取,部署免重打包改 IP)★