Improve error handling and ordering flows

This commit is contained in:
ecki
2026-04-06 17:50:00 +02:00
parent 8aa85d47a7
commit fef108cf53
8 changed files with 488 additions and 110 deletions
+22
View File
@@ -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)
}
}