From 5c9762eb709a4cead67af51518d509924bd3920f Mon Sep 17 00:00:00 2001 From: RonniSkansing Date: Thu, 1 Oct 2026 20:51:44 +0200 Subject: [PATCH] fix normalize fetch code for asn Signed-off-by: RonniSkansing --- frontend/src/lib/api/api.js | 10 +++++++ frontend/src/routes/tools/panels/ASN.svelte | 30 +++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/frontend/src/lib/api/api.js b/frontend/src/lib/api/api.js index 75e4c165..f2d5010a 100644 --- a/frontend/src/lib/api/api.js +++ b/frontend/src/lib/api/api.js @@ -3340,6 +3340,16 @@ export class API { ); }, + /** + * Look up the autonomous systems that announce the given IP address. + * + * @param {string} ip + * @returns {Promise} + */ + lookupASN: async (ip) => { + return await getJSON(this.getPath(`/ipdata/asn/lookup?ip=${encodeURIComponent(ip)}`)); + }, + /** * Resolve configured ASN numbers to their details. ASNs absent from the * dataset are left out of the result so the UI can flag them. diff --git a/frontend/src/routes/tools/panels/ASN.svelte b/frontend/src/routes/tools/panels/ASN.svelte index 0db643f8..3eeb7e41 100644 --- a/frontend/src/routes/tools/panels/ASN.svelte +++ b/frontend/src/routes/tools/panels/ASN.svelte @@ -1,5 +1,6 @@