Setup wizard: show + override the backend push IP (multi-NIC hosts)
The backend IP baked into a push-capable device at assign time is auto-derived by subnet-matching a local NIC. That's non-deterministic when two NICs match the device subnet, and null when none does. Surface it: backendIpCandidates() lists all local IPv4 NICs (on-subnet first), GET /api/setup/backend-ips serves them, and the wizard renders an editable Backend push IP dropdown after a successful test (pre-filled with the auto-pick, warns when no NIC is on the device subnet). The chosen IP overrides the auto-pick on assign and is recorded in config.
This commit is contained in:
@@ -136,11 +136,27 @@ export function testDevice(driverId: string, config: DeviceConfig): Promise<Test
|
||||
});
|
||||
}
|
||||
|
||||
export interface BackendIpCandidate {
|
||||
ip: string;
|
||||
iface: string;
|
||||
onDeviceSubnet: boolean;
|
||||
}
|
||||
|
||||
/** Local IPs the device could push to (on-subnet first), for the wizard to
|
||||
* pre-fill/override. Matters on multi-NIC hosts. */
|
||||
export function fetchBackendIps(
|
||||
host: string,
|
||||
): Promise<{ candidates: BackendIpCandidate[]; port: number }> {
|
||||
return apiFetch(`/api/setup/backend-ips?host=${encodeURIComponent(host)}`);
|
||||
}
|
||||
|
||||
export interface AssignBody {
|
||||
lane: number;
|
||||
category: DeviceCategory;
|
||||
driverId: string;
|
||||
config: DeviceConfig;
|
||||
/** Backend IP the device should push to (overrides auto-pick). */
|
||||
backendIp?: string;
|
||||
}
|
||||
|
||||
/** Save + configure the device (preconditions, push setup), then persist. */
|
||||
|
||||
Reference in New Issue
Block a user