feat: implement manual submission button

This commit is contained in:
2023-11-12 08:09:41 +01:00
parent 6c1afa82ff
commit 3b89f534dd

View File

@@ -4,6 +4,24 @@
{% include "navbar.html" %} {% include "navbar.html" %}
<div class="container"> <div class="container">
<script>
function submit_manual(){
await fetch("/report", {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
method: "POST",
body: JSON.stringify({
"token" : "{{ service.token }}",
"status" : "OK",
"info" : "Submitted from Web-Interface" })
}
)
window.location.reload()
}
</script>
<h2 class="service-name">Service: {{ service.service }}</h2> <h2 class="service-name">Service: {{ service.service }}</h2>
{% if service.staticly_configured %} {% if service.staticly_configured %}
{% endif %} {% endif %}
@@ -24,6 +42,10 @@
<p style="color: darkred;">Show in Icinga</p> <p style="color: darkred;">Show in Icinga</p>
</a> </a>
<button style="clear: both;" class="hover mr-3" onclick="submit_manual()">
<p style="color: darkred;">Submit manual OK</p>
</button>
<div class="last-status"> <div class="last-status">
{% if status_list | length > 0 %} {% if status_list | length > 0 %}
<p class="{{ status_list[0].status }}"> <p class="{{ status_list[0].status }}">