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"})