mirror of
https://github.com/skidoodle/hostinfo
synced 2025-03-16 13:59:38 +01:00
first commit
This commit is contained in:
commit
38e6f714cb
26 changed files with 1856 additions and 0 deletions
16
components/Error.tsx
Normal file
16
components/Error.tsx
Normal file
|
@ -0,0 +1,16 @@
|
|||
export default function Error({ error }: { error: string }) {
|
||||
return (
|
||||
<div className="min-w-[300px] bg-gray-900 shadow-2xl p-6 text-white font-sans">
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<h2 className="text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
|
||||
Error
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex items-center space-x-3">
|
||||
<div>
|
||||
<p className="text-sm text-gray-300">{error}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
84
components/ServerInfo.tsx
Normal file
84
components/ServerInfo.tsx
Normal file
|
@ -0,0 +1,84 @@
|
|||
import { LinkIcon, ServerIcon, IdentificationIcon } from '@heroicons/react/24/outline';
|
||||
|
||||
export default function ServerInfo({ data }: { data: ServerData }) {
|
||||
|
||||
if (data.isBrowserResource) {
|
||||
return (
|
||||
<div className="min-w-[300px] bg-gray-900 shadow-2xl p-6 text-white font-sans">
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<h2 className="text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
|
||||
Browser Resource
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex items-center space-x-3">
|
||||
<div>
|
||||
<p className="text-sm text-gray-300">The requested document was obtained from the local computer</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (data.isLocal) {
|
||||
return (
|
||||
<div className="min-w-[300px] bg-gray-900 shadow-2xl p-6 text-white font-sans">
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<h2 className="text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
|
||||
Internal Network
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex items-center space-x-3">
|
||||
<ServerIcon className="w-6 h-6 text-yellow-400 flex-shrink-0" />
|
||||
<div>
|
||||
<p className="text-sm text-gray-400">IP Address</p>
|
||||
<p className="font-medium">{data.ip}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-w-[300px] bg-gray-900 shadow-2xl p-6 text-white font-sans">
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<h2 className="text-2xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">
|
||||
Host Information
|
||||
</h2>
|
||||
</div>
|
||||
<div className="space-y-4">
|
||||
|
||||
<div className="flex items-center space-x-3">
|
||||
<ServerIcon className="w-6 h-6 text-yellow-400 flex-shrink-0" />
|
||||
<div>
|
||||
<p className="text-sm text-gray-400">IP Address</p>
|
||||
<p className="font-medium hover:underline"><a href={`https://ip.albert.lol/${data.ip}`} target='_blank'>{data.ip}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-3">
|
||||
<LinkIcon className="w-6 h-6 text-green-400 flex-shrink-0" />
|
||||
<div>
|
||||
<p className="text-sm text-gray-400">Hostname</p>
|
||||
<p className="font-medium break-all">{data.hostname}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-3">
|
||||
<IdentificationIcon className="w-6 h-6 text-red-400 flex-shrink-0" />
|
||||
<div>
|
||||
<p className="text-sm text-gray-400">Org</p>
|
||||
<p className="font-medium hover:underline">
|
||||
<a href={`https://bgp.he.net/${data.org.split(' ')[0]}`} target='_blank'>{data.org}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 pt-4 border-t border-gray-700">
|
||||
<p className="text-xs text-gray-400 text-center hover:underline">
|
||||
<a href={`https://search.censys.io/search?resource=hosts&sort=RELEVANCE&per_page=25&virtual_hosts=EXCLUDE&q=${data.origin}`} target='_blank'>Search on Censys</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
24
components/Spinner.tsx
Normal file
24
components/Spinner.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
export function Spinner({ className }: { className?: string }) {
|
||||
return (
|
||||
<svg
|
||||
className={`animate-spin ${className}`}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<circle
|
||||
className="opacity-25"
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="10"
|
||||
stroke="currentColor"
|
||||
strokeWidth="4"
|
||||
/>
|
||||
<path
|
||||
className="opacity-75"
|
||||
fill="currentColor"
|
||||
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue