mirror of
https://github.com/skidoodle/hostinfo
synced 2026-04-28 09:37:37 +02:00
Bug fixes and performance improvements
This commit is contained in:
+11
-20
@@ -1,59 +1,50 @@
|
||||
import {
|
||||
ServerIcon,
|
||||
MapPinIcon,
|
||||
GlobeAltIcon,
|
||||
BuildingOfficeIcon
|
||||
} from '@heroicons/react/24/outline';
|
||||
import { ServerIcon, MapPinIcon, GlobeAltIcon, BuildingOfficeIcon } from '@heroicons/react/24/outline';
|
||||
import { Header } from './Header';
|
||||
import { InfoRow } from './Info';
|
||||
import type { HostInfo } from '@/utils/types';
|
||||
|
||||
export const PublicNetworkView = ({ data }: { data: HostInfo }) => {
|
||||
const { network, location, domain } = data;
|
||||
|
||||
if (!network) return null;
|
||||
import type { GeoData } from '@/utils/types';
|
||||
|
||||
export const PublicNetworkView = ({ data, domain }: { data: GeoData, domain: string }) => {
|
||||
return (
|
||||
<div className="w-80 bg-white dark:bg-gray-950 font-sans text-gray-900 dark:text-gray-100">
|
||||
<Header
|
||||
title="Host Information"
|
||||
flagCode={location?.countryCode || 'unknown'}
|
||||
flagCode={data.countryCode}
|
||||
/>
|
||||
|
||||
<div className="p-5 space-y-0.5">
|
||||
<InfoRow
|
||||
icon={ServerIcon}
|
||||
label="IP Address"
|
||||
value={network.ip}
|
||||
href={`https://ip.albert.lol/${network.ip}`}
|
||||
value={data.ip}
|
||||
href={`https://ip.albert.lol/${data.ip}`}
|
||||
canCopy
|
||||
iconColor="text-blue-500"
|
||||
/>
|
||||
<InfoRow
|
||||
icon={GlobeAltIcon}
|
||||
label="Hostname"
|
||||
value={network.hostname}
|
||||
value={domain}
|
||||
canCopy
|
||||
iconColor="text-indigo-500"
|
||||
/>
|
||||
<InfoRow
|
||||
icon={MapPinIcon}
|
||||
label="Location"
|
||||
value={location?.countryName || 'Unknown Location'}
|
||||
value={data.countryName || 'Unknown Location'}
|
||||
iconColor="text-emerald-500"
|
||||
/>
|
||||
<InfoRow
|
||||
icon={BuildingOfficeIcon}
|
||||
label="Organization / ASN"
|
||||
value={network.org}
|
||||
href={network.asn ? `https://bgp.he.net/${network.asn}` : undefined}
|
||||
value={data.org}
|
||||
href={data.asn ? `https://bgp.he.net/${data.asn}` : undefined}
|
||||
iconColor="text-violet-500"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="px-5 pb-5 pt-2">
|
||||
<a
|
||||
href={`https://platform.censys.io/search?q=${network.hostname || domain}`}
|
||||
href={`https://search.censys.io/hosts/${data.ip}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="flex items-center justify-center w-full py-2 px-4 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300 rounded-md transition-all text-xs font-medium shadow-sm hover:shadow cursor-pointer"
|
||||
|
||||
Reference in New Issue
Block a user