fix: improve layout & manual callback

This commit is contained in:
2023-11-12 08:38:43 +01:00
parent c1addbf9fb
commit 163854d7bd

View File

@@ -5,20 +5,28 @@
<div class="container">
<script>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function submit_manual(){
await fetch("/report", {
fetch("/report", {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
method: "POST",
body: JSON.stringify({
"service" : "{{ service.service }}",
"token" : "{{ service.token }}",
"status" : "OK",
"info" : "Submitted from Web-Interface" })
}
)
}).then( () => {
sleep(1000).then( () => {
window.location.reload()
})
}).catch( () => {
alert("Submission failed, see console for details.")
})
}
</script>
@@ -42,7 +50,7 @@
<p style="color: darkred;">Show in Icinga</p>
</a>
<button style="clear: both;" class="hover mr-3" onclick="submit_manual()">
<button style="clear: both;" class="last-status hover mr-3" onclick="submit_manual()">
<p style="color: darkred;">Submit manual OK</p>
</button>