mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-22 19:52:15 +00:00
Update secure-gateway-setup.tsx
This commit is contained in:
@@ -22,11 +22,12 @@ import { fetchApi } from "../lib/api-config"
|
|||||||
|
|
||||||
interface NetworkInfo {
|
interface NetworkInfo {
|
||||||
interface: string
|
interface: string
|
||||||
type: string
|
type?: string
|
||||||
address: string
|
address?: string
|
||||||
|
ip?: string
|
||||||
subnet: string
|
subnet: string
|
||||||
prefixlen: number
|
prefixlen?: number
|
||||||
recommended: boolean
|
recommended?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AppStatus {
|
interface AppStatus {
|
||||||
@@ -145,11 +146,13 @@ export function SecureGatewaySetup() {
|
|||||||
const networksRes = await fetchApi("/api/oci/networks")
|
const networksRes = await fetchApi("/api/oci/networks")
|
||||||
if (networksRes.success) {
|
if (networksRes.success) {
|
||||||
setNetworks(networksRes.networks || [])
|
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]
|
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")
|
// 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)
|
setHostIp(ip)
|
||||||
console.log("[v0] Host IP for Host Only mode:", ip)
|
console.log("[v0] Host IP for Host Only mode:", ip)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user