vor subdomain UX anpassung
This commit is contained in:
@@ -15,7 +15,7 @@ async function getDNS(domain){
|
||||
|
||||
try{
|
||||
|
||||
const res = await api(API + "/dns/" + domain)
|
||||
const res = await api(API + "/dns/" + domain, {}, { showError: false })
|
||||
const ips = res.ips || []
|
||||
|
||||
dnsCache[domain] = {
|
||||
@@ -47,6 +47,7 @@ window.loadDomains = async function(){
|
||||
|
||||
const domains = await api(API + "/domains")
|
||||
const subs = await api(API + "/subdomains")
|
||||
window.domainList = domains
|
||||
|
||||
const table = document.getElementById("domains")
|
||||
table.innerHTML = ""
|
||||
@@ -208,28 +209,34 @@ window.saveDomain = async function(){
|
||||
notes: domain_notes.value
|
||||
}
|
||||
|
||||
if(id){
|
||||
await runAction(
|
||||
async () => {
|
||||
if(id){
|
||||
|
||||
await api(API+"/domains/"+id,{
|
||||
method:"PUT",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
await api(API+"/domains/"+id,{
|
||||
method:"PUT",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
|
||||
}else{
|
||||
}else{
|
||||
|
||||
await api(API+"/domains",{
|
||||
method:"POST",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
await api(API+"/domains",{
|
||||
method:"POST",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
closeDomainModal()
|
||||
loadDomains()
|
||||
loadMapping()
|
||||
loadCosts()
|
||||
}
|
||||
},
|
||||
async () => {
|
||||
closeDomainModal()
|
||||
await loadDomains()
|
||||
await loadMapping()
|
||||
loadCosts()
|
||||
loadInfrastructure()
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
@@ -238,29 +245,36 @@ window.deleteDomain = async function(id){
|
||||
|
||||
if(!confirm("Domain löschen?")) return
|
||||
|
||||
await api(API + "/domains/" + id, {
|
||||
method: "DELETE"
|
||||
})
|
||||
|
||||
loadDomains()
|
||||
await runAction(
|
||||
async () => {
|
||||
await api(API + "/domains/" + id, {
|
||||
method: "DELETE"
|
||||
})
|
||||
},
|
||||
async () => {
|
||||
await loadDomains()
|
||||
await loadMapping()
|
||||
loadCosts()
|
||||
loadInfrastructure()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
window.moveDomain = async function(id, direction){
|
||||
|
||||
try{
|
||||
|
||||
await api(API + "/domains/" + id + "/move", {
|
||||
method: "POST",
|
||||
headers: {'Content-Type':'application/json'},
|
||||
body: JSON.stringify({ direction })
|
||||
})
|
||||
|
||||
loadDomains()
|
||||
loadMapping()
|
||||
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
}
|
||||
await runAction(
|
||||
async () => {
|
||||
await api(API + "/domains/" + id + "/move", {
|
||||
method: "POST",
|
||||
headers: {'Content-Type':'application/json'},
|
||||
body: JSON.stringify({ direction })
|
||||
})
|
||||
},
|
||||
async () => {
|
||||
await loadDomains()
|
||||
await loadMapping()
|
||||
loadInfrastructure()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -277,26 +291,33 @@ window.saveSubdomain = async function(){
|
||||
|
||||
const data = { domain_id, subdomain, ip_address }
|
||||
|
||||
if(id){
|
||||
await runAction(
|
||||
async () => {
|
||||
if(id){
|
||||
|
||||
await api(API+"/subdomains/"+id,{
|
||||
method:"PUT",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
await api(API+"/subdomains/"+id,{
|
||||
method:"PUT",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
|
||||
}else{
|
||||
}else{
|
||||
|
||||
await api(API+"/subdomains",{
|
||||
method:"POST",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
await api(API+"/subdomains",{
|
||||
method:"POST",
|
||||
headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify(data)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
closeSubModal()
|
||||
loadDomains()
|
||||
}
|
||||
},
|
||||
async () => {
|
||||
closeSubModal()
|
||||
await loadDomains()
|
||||
await loadMapping()
|
||||
loadInfrastructure()
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
@@ -305,11 +326,18 @@ window.deleteSub = async function(id){
|
||||
|
||||
if(!confirm("Subdomain löschen?")) return
|
||||
|
||||
await api(API + "/subdomains/" + id, {
|
||||
method: "DELETE"
|
||||
})
|
||||
|
||||
loadDomains()
|
||||
await runAction(
|
||||
async () => {
|
||||
await api(API + "/subdomains/" + id, {
|
||||
method: "DELETE"
|
||||
})
|
||||
},
|
||||
async () => {
|
||||
await loadDomains()
|
||||
await loadMapping()
|
||||
loadInfrastructure()
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user