diff --git a/src/app/(dashboard)/intelligence/page.tsx b/src/app/(dashboard)/intelligence/page.tsx index 5153634..3418107 100644 --- a/src/app/(dashboard)/intelligence/page.tsx +++ b/src/app/(dashboard)/intelligence/page.tsx @@ -9,6 +9,7 @@ import { } from "@/lib/api-advanced"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card"; import { DataTable, Column } from "@/components/ui/DataTable"; +import { IpDetails } from "@/components/ui/IpDetails"; import { Loader2, Bitcoin, Shield, Server, Lock, AlertTriangle, Key, Globe, Network, ShieldAlert } from "lucide-react"; export default function IntelligencePage() { @@ -123,7 +124,15 @@ export default function IntelligencePage() { columns={[ { header: "IP Address", accessor: (row: any) => row.ip_address }, { header: "VPN Type", accessor: (row: any) => row.vpn_type }, - { header: "Remote IP", accessor: (row: any) => row.remote_ip }, + { + header: "Remote IP", + accessor: (row: any) => row.remote_ip ? ( +
+ {row.remote_ip} + +
+ ) : "—" + }, { header: "Country", accessor: (row: any) => row.country }, ]} /> @@ -133,7 +142,15 @@ export default function IntelligencePage() { row.ip_address }, + { + header: "IP Address", + accessor: (row: any) => row.ip_address ? ( +
+ {row.ip_address} + +
+ ) : "—" + }, { header: "Reputation", accessor: (row: any) => row.reputation }, { header: "App", accessor: (row: any) => row.app_label }, { header: "Country", accessor: (row: any) => row.country }, @@ -190,7 +207,15 @@ export default function IntelligencePage() { row.ip_address }, + { + header: "IP Address", + accessor: (row: any) => row.ip_address ? ( +
+ {row.ip_address} + +
+ ) : "—" + }, { header: "Server Type", accessor: (row: any) => row.server_type }, { header: "Port", accessor: (row: any) => row.port }, { header: "OS", accessor: (row: any) => row.os_label }, diff --git a/src/app/(dashboard)/network-infrastructure/page.tsx b/src/app/(dashboard)/network-infrastructure/page.tsx index 63412e0..ea618b6 100644 --- a/src/app/(dashboard)/network-infrastructure/page.tsx +++ b/src/app/(dashboard)/network-infrastructure/page.tsx @@ -9,6 +9,7 @@ import { useIpVersions, useRemoteIps, useMacBandwidth, useFlowTypes, useFlowOrigins } from "@/lib/api-advanced"; +import { IpDetails } from "@/components/ui/IpDetails"; export default function NetworkInfrastructurePage() { // Routing & Geography Tab @@ -135,7 +136,15 @@ export default function NetworkInfrastructurePage() { data={remoteIps} isLoading={loadingRemoteIps} columns={[ - { header: "IP Address", accessor: (row: any) => row.remote_ip }, + { + header: "IP Address", + accessor: (row: any) => row.remote_ip ? ( +
+ {row.remote_ip} + +
+ ) : "—" + }, { header: "IP Version", accessor: (row) => `IPv${row.ip_version}` }, { header: "Download", accessor: (row) => formatBytes(row.download) }, { header: "Upload", accessor: (row) => formatBytes(row.upload) }, diff --git a/src/app/(dashboard)/threats/page.tsx b/src/app/(dashboard)/threats/page.tsx index ecd8d5a..8ef8ae4 100644 --- a/src/app/(dashboard)/threats/page.tsx +++ b/src/app/(dashboard)/threats/page.tsx @@ -6,6 +6,7 @@ import { Badge } from "@/components/ui/Badge"; import { useState, useEffect } from "react"; import { ShieldCheck, Loader2 } from "lucide-react"; import { useThreats, ThreatStat } from "@/lib/api"; +import { IpDetails } from "@/components/ui/IpDetails"; export default function ThreatsPage() { const [mounted, setMounted] = useState(false); @@ -31,7 +32,15 @@ export default function ThreatsPage() { { header: "Type", accessor: (row) => row.threat_type || 'Unknown' }, { header: "Severity", accessor: (row) => getSeverityBadge(row.severity) }, { header: "Source IP", accessor: (row) => {row.ip_address || '-'} }, - { header: "Dest IP", accessor: (row) => row.dst_ip || '-' }, + { + header: "Dest IP", + accessor: (row) => row.dst_ip ? ( +
+ {row.dst_ip} + +
+ ) : '-' + }, { header: "MAC Address", accessor: (row) => row.mac_address ? {row.mac_address} : '-' }, { header: "App", accessor: (row) => row.app_label || '-' }, { header: "Domain", accessor: (row) => row.domain || '-' }, diff --git a/src/components/ui/AgentDetailModal.tsx b/src/components/ui/AgentDetailModal.tsx index 330b3e2..20bc773 100644 --- a/src/components/ui/AgentDetailModal.tsx +++ b/src/components/ui/AgentDetailModal.tsx @@ -4,6 +4,7 @@ import { useState, useEffect } from "react"; import { fetchAgentDetails, AgentDetails } from "@/lib/api"; import { fmtBytes } from "@/lib/utils"; import { DeviceDetailModal } from "@/components/ui/DeviceDetailModal"; +import { IpDetails } from "@/components/ui/IpDetails"; import { Loader2, X, Server, Monitor, Activity, Globe, Shield, Bell, Wifi, AlertTriangle, Lock, Unlock, ChevronRight, @@ -242,8 +243,13 @@ export function AgentDetailModal({ agentUuid, agentLabel, onClose }: Props) { {data.flows.map((f, i) => ( {f.src_ip || "—"} - - {f.dst_ip || "—"}{f.dst_port ? :{f.dst_port} : ""} + +
+ + {f.dst_ip || "—"}{f.dst_port ? :{f.dst_port} : ""} + + {f.dst_ip && } +
{f.app_label || f.domain || "—"} {f.protocol || "—"} @@ -350,7 +356,14 @@ export function AgentDetailModal({ agentUuid, agentLabel, onClose }: Props) { {r.app_label || "—"} - {r.dst_ip ? `${r.dst_ip}:${r.dst_port ?? "?"}` : "—"} + +
+ + {r.dst_ip ? `${r.dst_ip}:${r.dst_port ?? "?"}` : "—"} + + {r.dst_ip && } +
+ {fmtBytes(r.download)} {fmtBytes(r.upload)} @@ -373,7 +386,14 @@ export function AgentDetailModal({ agentUuid, agentLabel, onClose }: Props) { return ( {r.ip_address || "—"} - {r.dst_ip ? `${r.dst_ip}:${r.dst_port ?? "?"}` : "—"} + +
+ + {r.dst_ip ? `${r.dst_ip}:${r.dst_port ?? "?"}` : "—"} + + {r.dst_ip && } +
+ {r.protocol || "—"} {r.username || "—"} @@ -452,7 +472,10 @@ export function AgentDetailModal({ agentUuid, agentLabel, onClose }: Props) { {r.ip_address || "—"} {r.vpn_type || "—"} -
Remote: {r.remote_ip || "—"} • {r.country || "—"}
+
+ Remote: {r.remote_ip || "—"} • {r.country || "—"} + {r.remote_ip && } +
{r.confidence &&
Confidence: {(r.confidence * 100).toFixed(0)}%
} ))} @@ -470,7 +493,12 @@ export function AgentDetailModal({ agentUuid, agentLabel, onClose }: Props) { {data.server_discovery!.map((r, i) => ( - {r.ip_address || "—"} + +
+ {r.ip_address || "—"} + {r.ip_address && } +
+ {r.hostname || "—"} {r.server_type || "—"} {r.port ?? "—"} diff --git a/src/components/ui/DeviceDetailModal.tsx b/src/components/ui/DeviceDetailModal.tsx index 5b0900c..b499543 100644 --- a/src/components/ui/DeviceDetailModal.tsx +++ b/src/components/ui/DeviceDetailModal.tsx @@ -546,7 +546,12 @@ export function DeviceDetailModal({ ip, deviceLabel, macAddress, onClose }: Prop {data.unencrypted_passwords.map((p, i) => ( - {p.dst_ip || "—"} + +
+ {p.dst_ip || "—"} + {p.dst_ip && } +
+ {p.dst_port ?? "—"} {p.protocol || "—"} {p.username || "—"} @@ -569,7 +574,12 @@ export function DeviceDetailModal({ ip, deviceLabel, macAddress, onClose }: Prop {data.ip_reputation.map((r, i) => ( - {r.remote_ip || "—"} + +
+ {r.remote_ip || "—"} + {r.remote_ip && } +
+ {r.reputation || "—"} {r.score ?? "—"} {r.country || "—"} @@ -605,7 +615,12 @@ export function DeviceDetailModal({ ip, deviceLabel, macAddress, onClose }: Prop {v.vpn_type || "Unknown VPN"} {v.country || "—"} - {v.remote_ip &&

→ {v.remote_ip}

} + {v.remote_ip && ( +
+ → {v.remote_ip} + +
+ )}
{v.protocol || "—"} {v.confidence !== null && v.confidence !== undefined && (