feat(link): ConnectionHub 统一 WiFi/ECAT/BLE 端点与健康态
各页不再各自读写 dcu_esp_ip / dcu_ecat_adapter:deviceLink 提供 wifiBaseUrl/ecatPost/adapter API,OTA/CAN/motor/ecat_load/lab 走同一入口。 连接灯只覆盖在线布尔,保留调用方语义文案。
This commit is contained in:
+3
-1
@@ -9,6 +9,7 @@
|
||||
import {
|
||||
DEFAULT_ESP_IP, getSavedDeviceIp, saveDeviceIp
|
||||
} from '../common/base-url.js';
|
||||
import { deviceLink } from '../common/device-link.js';
|
||||
|
||||
// ==================== 共享状态 ====================
|
||||
export var state = {
|
||||
@@ -46,11 +47,12 @@ export function getDeviceIp() {
|
||||
return DEFAULT_ESP_IP;
|
||||
}
|
||||
|
||||
/** @description 记住设备 IP(status 回报或其它页写入)。 */
|
||||
/** @description 记住设备 IP(status 回报或其它页写入),并广播给 ConnectionHub。 */
|
||||
export function setDeviceIp(ip) {
|
||||
if (!ip || !String(ip).trim()) return;
|
||||
var v = String(ip).trim();
|
||||
saveDeviceIp(v);
|
||||
try { deviceLink.setIp(v); } catch (_) {}
|
||||
if (el.toolIp) el.toolIp.value = v;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user