mirror of
https://github.com/FAUSheppy/icinga-webhook-gateway
synced 2025-12-06 07:21:38 +01:00
91 lines
3.3 KiB
HTML
91 lines
3.3 KiB
HTML
{% include "head.html" %}
|
|
<html>
|
|
<body>
|
|
{% include "navbar.html" %}
|
|
<div class="container">
|
|
|
|
<h2 class="service-name">Service: {{ service.service }}</h2>
|
|
{% if service.staticly_configured %}
|
|
{% endif %}
|
|
|
|
{% if not service.staticly_configured %}
|
|
<a class="service-info-button mt-3" style="background-color: orange;"
|
|
href="/entry-form?service={{ service.service }}">Modify</a>
|
|
<a class="service-info-button mt-3" style="background-color: red;"
|
|
href="/entry-form?service={{ service.service }}&operation=delete">Delete</a>
|
|
{% else %}
|
|
<div class="static-configured-info">
|
|
This service is staticly configured, to edit or delete it, you have to modify the
|
|
configuration file on the server.
|
|
</div>
|
|
{% endif %}
|
|
|
|
<a href="{{ icinga_link }}" style="clear: both;" class="last-status hover mr-3">
|
|
<p style="color: darkred;">Show in Icinga</p>
|
|
</a>
|
|
|
|
<div class="last-status">
|
|
{% if status_list | length > 0 %}
|
|
<p class="{{ status_list[0].status }}">
|
|
{{ status_list[0].status }} submitted on {{ status_list[0].human_date() }}
|
|
</p>
|
|
{% else %}
|
|
<p style="color: darkred;">No status for this service submitted</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="clear p-4 box mt-4 mb-3" style="display: none;">
|
|
<div class="service-timeout">Timeout: {{ service.timeout }} days</div>
|
|
<div class="service-timeout">Owner: {{ service.owner }}</div>
|
|
<div style="display: none;"
|
|
class="service-token">Secret Token: {{ service.token }}</div>
|
|
</div>
|
|
|
|
<h5 class="clear my-4">Curl</h5>
|
|
<div class="ml-3 example">
|
|
curl -X POST \ <br>
|
|
<div class="example-indent">
|
|
-H "Content-Type: application/json" \ <br>
|
|
-d '{ "service" : "{{ service.service }}",
|
|
"token" : "{{ service.token }}", <br>
|
|
"status" : "OK", "info" : "Free Text Information here" }' \<br>
|
|
{{ flask.request.url_root.replace("http://", "https://" )}}report
|
|
</div>
|
|
</div>
|
|
|
|
<h5 class="my-4">Python</h5>
|
|
<div class="ml-3 example">
|
|
import requests
|
|
requests.post("{{ flask.request.url_root.replace("http://", "https://")}}report",
|
|
<br>
|
|
<div class="example-indent-double">
|
|
json= { "service_name" : "{{ service.service }}", <br>
|
|
<div class="example-indent-double">
|
|
"token" : "{{ service.token }}", <br>
|
|
"status" : "OK", </br>
|
|
"info" : "additional information" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<table class="mb-4 mt-5 status-table">
|
|
<thead>
|
|
<th>Date</th>
|
|
<th>Status</th>
|
|
<th>Info</th>
|
|
</thead>
|
|
|
|
<tbody class="mt-2">
|
|
{% for status in status_list %}
|
|
<tr>
|
|
<td>{{ status.human_date() }}</td>
|
|
<td class="{{ status.status }}">{{ status.status }}</td>
|
|
<td>{{ status.info_text }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
</html>
|