feat: add simplified windows x86 support

This commit is contained in:
yankun
2026-06-27 18:33:59 +08:00
parent 7de0777748
commit 67c995db83
12 changed files with 400 additions and 84 deletions
+24
View File
@@ -6,6 +6,7 @@ const { hasInternet, hasWiredInternetProbe, hasSavedWifiConnection, connectSaved
const { DnsHijack } = require('./dns-hijack');
const { CaptiveServer } = require('./captive-server');
const led = require('./led');
const { IS_WINDOWS } = require('./platform-paths');
const MONITOR_INTERVAL_MS = 15_000;
const WIFI_RECONNECT_MAX_ROUNDS = 3;
@@ -40,6 +41,16 @@ class ProvisionManager extends EventEmitter {
isApMode() { return this._state === 'ap'; }
async start() {
if (IS_WINDOWS) {
led.off();
this._state = hasInternet() ? 'wired' : 'idle';
log.info('provision', 'Windows/x86 mode: AP provisioning is disabled; waiting for existing network');
if (this._state === 'wired') this._emitNetworkReady();
else led.display.showAP();
this._startMonitor();
return;
}
led.off(); // WiFi 灯初始状态:熄灭
// WiFi STA 已连接 → 直接进入 STA 模式
@@ -228,6 +239,19 @@ class ProvisionManager extends EventEmitter {
}
async _monitorTick() {
if (IS_WINDOWS) {
if (hasInternet()) {
if (this._state !== 'wired') {
this._state = 'wired';
this._emitNetworkReady();
}
} else if (this._state !== 'idle') {
this._state = 'idle';
led.display.showAP();
}
return;
}
if (this._state === 'connecting') return;
const wifiUp = isWifiStaConnected();