feat: warn about static configured services deletion

This commit is contained in:
2023-07-07 06:50:59 +02:00
parent 0bc32a11fe
commit 20d37ef8ec
3 changed files with 21 additions and 1 deletions

View File

@@ -40,6 +40,8 @@ class Service(db.Model):
timeout = Column(Integer)
owner = Column(String)
staticly_configured = Column(Boolean)
class Status(db.Model):
__tablename__ = "states"
@@ -301,7 +303,9 @@ def create_app():
for key in config:
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()

View File

@@ -160,3 +160,13 @@ body{
border-color: aliceblue;
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;
}

View File

@@ -4,6 +4,12 @@
{% include "navbar.html" %}
<div class="container">
<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;"
href="/entry-form?service={{ service.service }}">Modify</a>