From a244225887c5c54d23e635a62b2b76c2f9c87f48 Mon Sep 17 00:00:00 2001 From: ecki Date: Mon, 9 Mar 2026 18:05:07 +0100 Subject: [PATCH] ResMan update --- backend/public/index.html | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/backend/public/index.html b/backend/public/index.html index e3d6b4e..e605c94 100644 --- a/backend/public/index.html +++ b/backend/public/index.html @@ -345,7 +345,7 @@ Domains jährlich: 0
- + > @@ -843,9 +843,15 @@ if(cost){ cost=cost.replace(",",".") } +let domain=document.getElementById("domain_name").value + +/* https:// entfernen */ + +domain=domain.replace("https://","").replace("http://","").replace("/","") + const data={ -domain_name:document.getElementById("domain_name").value, +domain_name:domain, provider:document.getElementById("domain_provider").value, ip_address:document.getElementById("domain_ip").value, yearly_cost:cost || null, @@ -853,6 +859,8 @@ notes:document.getElementById("domain_notes").value } +/* speichern */ + if(id){ await fetch(API+"/domains/"+id,{ @@ -871,6 +879,25 @@ body:JSON.stringify(data) } +/* DNS automatisch prüfen */ + +try{ + +const dnsRes = await fetch(API+"/dns/"+domain) +const result = await dnsRes.json() + +if(result.ips && result.ips.length){ + +data.ip_address=result.ips[0] + +} + +}catch(e){ + +console.log("DNS check failed") + +} + closeDomainModal() loadDomains() @@ -880,6 +907,7 @@ loadCosts() } + async function deleteDomain(id){ await fetch(API+"/domains/"+id,{method:"DELETE"})