mirror of
https://github.com/skidoodle/hostinfo
synced 2026-04-28 17:47:36 +02:00
fix hostname
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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,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;
|
||||||
|
|||||||
Reference in New Issue
Block a user