mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add search for a tld via RDAP
This commit is contained in:
@@ -12,16 +12,22 @@ export function DomainDiagram({domain}: { domain: Domain }) {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const e = getLayoutedElements([
|
||||
const nodes = [
|
||||
domainToNode(domain),
|
||||
...domainEntitiesToNode(domain, true),
|
||||
tldToNode(domain.tld),
|
||||
...domain.nameservers.map(nsToNode)
|
||||
].flat(), [
|
||||
].flat()
|
||||
const edges = [
|
||||
domainEntitiesToEdges(domain, true),
|
||||
tldToEdge(domain),
|
||||
...domainNSToEdges(domain)
|
||||
].flat())
|
||||
].flat()
|
||||
|
||||
if (domain.tld.tld !== '.') {
|
||||
nodes.push(tldToNode(domain.tld))
|
||||
edges.push(tldToEdge(domain))
|
||||
}
|
||||
|
||||
const e = getLayoutedElements(nodes, edges)
|
||||
|
||||
setNodes(e.nodes)
|
||||
setEdges(e.edges)
|
||||
|
||||
@@ -23,7 +23,7 @@ export function DomainResult({domain}: { domain: Domain }) {
|
||||
<Badge.Ribbon text={
|
||||
<Tooltip
|
||||
title={tld.type === 'ccTLD' ? regionNames.of(getCountryCode(tld.tld)) : tld.type === 'gTLD' ? tld?.registryOperator : undefined}>
|
||||
{`.${domain.tld.tld.toUpperCase()} (${tld.type})`}
|
||||
{`${(domain.tld.tld === '.' ? '' : '.') + domain.tld.tld.toUpperCase()} (${tld.type})`}
|
||||
</Tooltip>
|
||||
}
|
||||
color={
|
||||
|
||||
@@ -19,7 +19,7 @@ export function DomainSearchBar({onFinish}: { onFinish: (values: FieldType) => v
|
||||
required: true,
|
||||
message: t`Required`
|
||||
}, {
|
||||
pattern: /^(?=.*\.)\S*[^.\s]$/,
|
||||
pattern: /^(?=.*\.)?\S*[^.\s]$/,
|
||||
message: t`This domain name does not appear to be valid`,
|
||||
max: 63,
|
||||
min: 2
|
||||
|
||||
@@ -47,7 +47,7 @@ export function watchlistToNodes(watchlist: Watchlist, withRegistrar = false, wi
|
||||
|
||||
const domains = watchlist.domains.map(domainToNode)
|
||||
const entities = [...new Set(watchlist.domains.map(d => domainEntitiesToNode(d, withRegistrar)).flat())]
|
||||
const tlds = [...new Set(watchlist.domains.map(d => d.tld))].map(tldToNode)
|
||||
const tlds = [...new Set(watchlist.domains.map(d => d.tld))].filter(t => t.tld !== '.').map(tldToNode)
|
||||
const nameservers = [...new Set(watchlist.domains.map(d => d.nameservers))].flat().map(nsToNode, withRegistrar)
|
||||
|
||||
return [...domains, ...entities, ...nameservers, ...(withTld ? tlds : [])]
|
||||
|
||||
Reference in New Issue
Block a user