ResMan update
This commit is contained in:
@@ -345,7 +345,7 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
|||||||
|
|
||||||
<label>IP Adresse</label> <input id="domain_ip">
|
<label>IP Adresse</label> <input id="domain_ip">
|
||||||
|
|
||||||
<label>Jährliche Kosten</label> <input id="domain_cost">
|
<label>Jährliche Kosten</label> <input id="domain_cost" type="number" step="0.01">>
|
||||||
|
|
||||||
<label>Notizen</label>
|
<label>Notizen</label>
|
||||||
|
|
||||||
@@ -843,9 +843,15 @@ if(cost){
|
|||||||
cost=cost.replace(",",".")
|
cost=cost.replace(",",".")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let domain=document.getElementById("domain_name").value
|
||||||
|
|
||||||
|
/* https:// entfernen */
|
||||||
|
|
||||||
|
domain=domain.replace("https://","").replace("http://","").replace("/","")
|
||||||
|
|
||||||
const data={
|
const data={
|
||||||
|
|
||||||
domain_name:document.getElementById("domain_name").value,
|
domain_name:domain,
|
||||||
provider:document.getElementById("domain_provider").value,
|
provider:document.getElementById("domain_provider").value,
|
||||||
ip_address:document.getElementById("domain_ip").value,
|
ip_address:document.getElementById("domain_ip").value,
|
||||||
yearly_cost:cost || null,
|
yearly_cost:cost || null,
|
||||||
@@ -853,6 +859,8 @@ notes:document.getElementById("domain_notes").value
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* speichern */
|
||||||
|
|
||||||
if(id){
|
if(id){
|
||||||
|
|
||||||
await fetch(API+"/domains/"+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()
|
closeDomainModal()
|
||||||
|
|
||||||
loadDomains()
|
loadDomains()
|
||||||
@@ -880,6 +907,7 @@ loadCosts()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function deleteDomain(id){
|
async function deleteDomain(id){
|
||||||
|
|
||||||
await fetch(API+"/domains/"+id,{method:"DELETE"})
|
await fetch(API+"/domains/"+id,{method:"DELETE"})
|
||||||
|
|||||||
Reference in New Issue
Block a user