mirror of
https://github.com/FAUSheppy/icinga-webhook-gateway
synced 2025-12-06 07:21:38 +01:00
fix: improve layout & manual callback
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user