Improve error handling and ordering flows
This commit is contained in:
@@ -48,6 +48,7 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Produkt</th>
|
||||
<th>Provider</th>
|
||||
@@ -85,6 +86,7 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Domain</th>
|
||||
<th>Provider</th>
|
||||
<th>IP</th>
|
||||
@@ -131,6 +133,7 @@ Domains jährlich: <span id="costDomain">0</span> €<br>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Name</th>
|
||||
<th>Produkt</th>
|
||||
<th>Provider</th>
|
||||
|
||||
@@ -70,6 +70,10 @@ window.loadDomains = async function(){
|
||||
`).join("")
|
||||
|
||||
tr.innerHTML = `
|
||||
<td>
|
||||
<button onclick="moveDomain(${d.id}, 'up')">⬆</button>
|
||||
<button onclick="moveDomain(${d.id}, 'down')">⬇</button>
|
||||
</td>
|
||||
<td>
|
||||
${d.domain_name}
|
||||
${sublist}
|
||||
@@ -241,6 +245,24 @@ window.deleteDomain = async function(id){
|
||||
loadDomains()
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* =========================
|
||||
SUBDOMAIN CRUD
|
||||
|
||||
@@ -37,6 +37,10 @@ window.loadResources = async function(){
|
||||
|
||||
tr.innerHTML = `
|
||||
<td>
|
||||
<button onclick="moveResource(${r.id}, 'up')">⬆</button>
|
||||
<button onclick="moveResource(${r.id}, 'down')">⬇</button>
|
||||
</td>
|
||||
<td>
|
||||
<span style="cursor:pointer;color:#1e3a8a;font-weight:bold"
|
||||
onclick='openServerDetail(${JSON.stringify(r)})'>
|
||||
${r.name}
|
||||
@@ -311,3 +315,21 @@ window.cancelIPEdit = function(){
|
||||
document.getElementById("ipCancelBtn").style.display = "none"
|
||||
|
||||
}
|
||||
|
||||
window.moveResource = async function(id, direction){
|
||||
|
||||
try {
|
||||
|
||||
await api(API + "/resources/" + id + "/move", {
|
||||
method: "POST",
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ direction })
|
||||
})
|
||||
|
||||
loadResources()
|
||||
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user