mirror of
https://github.com/FAUSheppy/icinga-webhook-gateway
synced 2025-12-06 15:31:38 +01:00
feat: warn about static configured services deletion
This commit is contained in:
@@ -40,6 +40,8 @@ class Service(db.Model):
|
|||||||
timeout = Column(Integer)
|
timeout = Column(Integer)
|
||||||
owner = Column(String)
|
owner = Column(String)
|
||||||
|
|
||||||
|
staticly_configured = Column(Boolean)
|
||||||
|
|
||||||
class Status(db.Model):
|
class Status(db.Model):
|
||||||
|
|
||||||
__tablename__ = "states"
|
__tablename__ = "states"
|
||||||
@@ -301,7 +303,9 @@ def create_app():
|
|||||||
|
|
||||||
for key in config:
|
for key in config:
|
||||||
timeout = timeparse.timeparse(config[key]["timeout"])
|
timeout = timeparse.timeparse(config[key]["timeout"])
|
||||||
db.session.merge(Service(service=key, token=config[key]["token"], timeout=timeout))
|
staticly_configured = True
|
||||||
|
db.session.merge(Service(service=key, token=config[key]["token"],
|
||||||
|
staticly_configured=staticly_configured, timeout=timeout))
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -160,3 +160,13 @@ body{
|
|||||||
border-color: aliceblue;
|
border-color: aliceblue;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.static-configured-info{
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: aliceblue;
|
||||||
|
text-align: center;
|
||||||
|
padding: 8px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: red;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
{% include "navbar.html" %}
|
{% include "navbar.html" %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2 class="service-name">Service: {{ service.service }}</h2>
|
<h2 class="service-name">Service: {{ service.service }}</h2>
|
||||||
|
{% if service.staticly_configured %}
|
||||||
|
<h4 class="static-configured-info">
|
||||||
|
This service is staticly configured, to permanently delete it, you have to remove
|
||||||
|
it from the configuration file on the server.
|
||||||
|
</h4>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<a class="service-info-button mt-3" style="background-color: orange;"
|
<a class="service-info-button mt-3" style="background-color: orange;"
|
||||||
href="/entry-form?service={{ service.service }}">Modify</a>
|
href="/entry-form?service={{ service.service }}">Modify</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user