From a3f4277bdcedd66cfa3fb6a256dbb41ec936e3d2 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sat, 14 Mar 2026 20:53:42 +0100 Subject: [PATCH] Update secure-gateway-setup.tsx --- AppImage/components/secure-gateway-setup.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/AppImage/components/secure-gateway-setup.tsx b/AppImage/components/secure-gateway-setup.tsx index c50fc38f..6cfac000 100644 --- a/AppImage/components/secure-gateway-setup.tsx +++ b/AppImage/components/secure-gateway-setup.tsx @@ -22,11 +22,12 @@ import { fetchApi } from "../lib/api-config" interface NetworkInfo { interface: string - type: string - address: string + type?: string + address?: string + ip?: string subnet: string - prefixlen: number - recommended: boolean + prefixlen?: number + recommended?: boolean } interface AppStatus { @@ -145,11 +146,13 @@ export function SecureGatewaySetup() { const networksRes = await fetchApi("/api/oci/networks") if (networksRes.success) { setNetworks(networksRes.networks || []) - // Get host IP for "Host Only" mode - extract just the IP without CIDR + // Get host IP for "Host Only" mode const primaryNetwork = networksRes.networks?.find((n: NetworkInfo) => n.recommended) || networksRes.networks?.[0] - if (primaryNetwork?.address) { + // Backend returns "ip" field with the host IP address + const hostIpValue = primaryNetwork?.ip || primaryNetwork?.address + if (hostIpValue) { // Remove CIDR notation if present (e.g., "192.168.0.55/24" -> "192.168.0.55") - const ip = primaryNetwork.address.split("/")[0] + const ip = hostIpValue.split("/")[0] setHostIp(ip) console.log("[v0] Host IP for Host Only mode:", ip) }