add clickable ips

This commit is contained in:
2025-03-29 17:03:13 +01:00
parent 4d00fd02cf
commit 320606ca3f
3 changed files with 53 additions and 16 deletions
+19 -4
View File
@@ -92,12 +92,12 @@ document.addEventListener('DOMContentLoaded', () => {
// --- WHOIS Lookup Specific Functions ---
function displayWhoisResults(data, outputEl) {
// WHOIS data can be large and unstructured, display as JSON or raw text
// Using JSON.stringify for consistency, but raw text might be better depending on the library's output
// WHOIS data can be large and unstructured, display as raw text
if (typeof data.result === 'string') {
outputEl.textContent = data.result; // Display raw text if it's a string
outputEl.textContent = data.result; // Display raw text
} else {
outputEl.textContent = JSON.stringify(data.result, null, 2); // Display JSON otherwise
// Fallback if the result is not a string (shouldn't happen with current backend)
outputEl.textContent = JSON.stringify(data.result, null, 2);
}
}
@@ -120,6 +120,18 @@ document.addEventListener('DOMContentLoaded', () => {
);
}
/** Prüft URL-Parameter und startet ggf. den Lookup */
function checkUrlParamsAndLookup() {
const urlParams = new URLSearchParams(window.location.search);
const queryFromUrl = urlParams.get('query');
if (queryFromUrl && whoisQueryInput) {
console.log(`Found query parameter in URL: ${queryFromUrl}`);
whoisQueryInput.value = queryFromUrl; // Set input field value
handleWhoisLookupClick(); // Trigger the lookup
}
}
// --- Initial Load & Event Listeners ---
fetchVersionInfo(); // Lade Versionsinfo für Footer
@@ -128,4 +140,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (event.key === 'Enter') handleWhoisLookupClick();
});
// Prüfe URL-Parameter nach dem Setup der Listener
checkUrlParamsAndLookup();
}); // End DOMContentLoaded