fix hostname

This commit is contained in:
2026-03-07 00:27:14 +01:00
parent 55b3b61bbf
commit 56ed5909c7
3 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -23,14 +23,14 @@ export const PublicNetworkView = ({ data, domain }: { data: GeoData, domain: str
<InfoRow <InfoRow
icon={GlobeAltIcon} icon={GlobeAltIcon}
label="Hostname" label="Hostname"
value={domain} value={data.hostname || 'N/A'}
canCopy canCopy
iconColor="text-indigo-500" iconColor="text-indigo-500"
/> />
<InfoRow <InfoRow
icon={MapPinIcon} icon={MapPinIcon}
label="Location" label="Location"
value={data.countryName || 'Unknown Location'} value={data.countryName || 'N/A'}
iconColor="text-emerald-500" iconColor="text-emerald-500"
/> />
<InfoRow <InfoRow
+3
View File
@@ -30,6 +30,7 @@ export const GeoService = {
console.warn('Geo lookup failed for', ip, error); console.warn('Geo lookup failed for', ip, error);
return { return {
ip, ip,
hostname: null,
countryCode: null, countryCode: null,
countryName: 'Unknown', countryName: 'Unknown',
city: null, city: null,
@@ -46,6 +47,7 @@ export const GeoService = {
getLocalData(ip: string): GeoData { getLocalData(ip: string): GeoData {
return { return {
ip, ip,
hostname: null,
countryCode: null, countryCode: null,
countryName: 'Local Network', countryName: 'Local Network',
city: null, city: null,
@@ -61,6 +63,7 @@ export const GeoService = {
transform(ip: string, apiData: any): GeoData { transform(ip: string, apiData: any): GeoData {
return { return {
ip, ip,
hostname: apiData.hostname || null,
countryCode: apiData.country || null, countryCode: apiData.country || null,
countryName: apiData.country ? (codes[apiData.country.toLowerCase()] || apiData.country) : null, countryName: apiData.country ? (codes[apiData.country.toLowerCase()] || apiData.country) : null,
city: apiData.city || null, city: apiData.city || null,
+1
View File
@@ -1,5 +1,6 @@
export interface GeoData { export interface GeoData {
ip: string; ip: string;
hostname: string | null;
countryCode: string | null; countryCode: string | null;
countryName: string | null; countryName: string | null;
city: string | null; city: string | null;