fix: add asn-cache on filesystem

This commit is contained in:
2026-03-05 20:09:53 +01:00
parent 6552d198cf
commit f21b06e6ad
7 changed files with 132 additions and 115 deletions

View File

@@ -181,11 +181,12 @@
Suite</span></h1>
<nav>
<ul>
<li><a href="/">IP Info & Tools</a></li>
<li><a href="/">IP Info &amp; Tools</a></li>
<li><a href="/subnet">Subnetz Rechner</a></li>
<li><a href="/dns" class="active-link">DNS Lookup</a></li>
<li><a href="/whois">WHOIS Lookup</a></li>
<li><a href="/mac">MAC Lookup</a></li>
<li><a href="/asn">ASN Lookup</a></li>
</ul>
</nav>
</header>

View File

@@ -182,11 +182,12 @@
Suite</span></h1>
<nav>
<ul>
<li><a href="/">IP Info & Tools</a></li>
<li><a href="/">IP Info &amp; Tools</a></li>
<li><a href="/subnet">Subnetz Rechner</a></li>
<li><a href="/dns">DNS Lookup</a></li>
<li><a href="/whois">WHOIS Lookup</a></li>
<li><a href="/mac" class="active-link">MAC Lookup</a></li>
<li><a href="/asn">ASN Lookup</a></li>
</ul>
</nav>
</header>

View File

@@ -287,13 +287,16 @@ document.addEventListener('DOMContentLoaded', () => {
updateField(coordsEl, data.geo?.latitude ? `${data.geo.latitude}, ${data.geo.longitude}` : null);
updateField(timezoneEl, data.geo?.timezone, geoLoader); // Hide loader on last geo field
updateField(asnNumberEl, data.asn?.number
? `AS${data.asn.number}`
: null, null, asnErrorEl);
// Make ASN a clickable link to ASN Lookup
if (data.asn?.number && asnNumberEl) {
// ASN — render as clickable link if has a number (not an error object)
const asnNum = (data.asn && !data.asn.error) ? data.asn.number : null;
if (asnNum && asnNumberEl) {
// Reveal the hidden data container manually (updateField won't run the link path via error branch)
const asnContainer = asnNumberEl.closest('div:not(.loader)');
if (asnContainer) asnContainer.classList.remove('hidden');
asnNumberEl.innerHTML =
`<a href="/asn?asn=${data.asn.number}" class="hover:text-purple-200 underline decoration-dotted transition-colors" title="Open ASN Lookup">AS${data.asn.number}</a>`;
`<a href="/asn?asn=${asnNum}" class="hover:text-purple-200 underline decoration-dotted transition-colors" title="Open ASN Lookup">AS${asnNum}</a>`;
} else {
updateField(asnNumberEl, null, null, asnErrorEl, data.asn?.error || '-');
}
updateField(asnOrgEl, data.asn?.organization, asnLoader);

View File

@@ -165,11 +165,12 @@
Suite</span></h1>
<nav>
<ul>
<li><a href="/">IP Info & Tools</a></li>
<li><a href="/">IP Info &amp; Tools</a></li>
<li><a href="/subnet" class="active-link">Subnetz Rechner</a></li>
<li><a href="/dns">DNS Lookup</a></li>
<li><a href="/whois">WHOIS Lookup</a></li>
<li><a href="/mac">MAC Lookup</a></li>
<li><a href="/asn">ASN Lookup</a></li>
</ul>
</nav>
</header>

View File

@@ -181,11 +181,12 @@
Suite</span></h1>
<nav>
<ul>
<li><a href="/">IP Info & Tools</a></li>
<li><a href="/">IP Info &amp; Tools</a></li>
<li><a href="/subnet">Subnetz Rechner</a></li>
<li><a href="/dns">DNS Lookup</a></li>
<li><a href="/whois" class="active-link">WHOIS Lookup</a></li>
<li><a href="/mac">MAC Lookup</a></li>
<li><a href="/asn">ASN Lookup</a></li>
</ul>
</nav>
</header>