From a10343d37e58196a9f446ede6ad4ec847b9d3ff9 Mon Sep 17 00:00:00 2001 From: Tim Eertmoed Date: Mon, 29 Sep 2025 18:17:58 +0000 Subject: [PATCH] Devices is_active + Table --- srv/poe_manager/app.py | 3 +- srv/poe_manager/sqlite.db | Bin 40960 -> 40960 bytes srv/poe_manager/static/css/style.css | 9 ++-- srv/poe_manager/templates/index.html | 12 +++++- srv/poe_manager/templates/switche.html | 55 +++++++++++++++++-------- srv/poe_manager/templates/users.html | 14 +++---- 6 files changed, 62 insertions(+), 31 deletions(-) diff --git a/srv/poe_manager/app.py b/srv/poe_manager/app.py index 3b867d9..689a13d 100644 --- a/srv/poe_manager/app.py +++ b/srv/poe_manager/app.py @@ -86,7 +86,8 @@ def logout(): def index(): conn = sqlite3.connect("sqlite.db") c = conn.cursor() - c.execute("SELECT mac, name FROM devices") + # is_active mit abfragen + c.execute("SELECT mac, name, is_active FROM devices") devices = c.fetchall() conn.close() diff --git a/srv/poe_manager/sqlite.db b/srv/poe_manager/sqlite.db index 5b2147921f4a5b977d07c48cd053abbff80d9e29..e52fe2841b153a39d7eb7385837d6b321d5b5613 100644 GIT binary patch delta 26 icmZoTz|?SnX@WGP!9*EnMuUwBGwc{SHvhC^PXqvX$Oyy$ delta 26 icmZoTz|?SnX@WGP{zMsPM*WQmGwc{SH~+L_PXqvXu?WKe diff --git a/srv/poe_manager/static/css/style.css b/srv/poe_manager/static/css/style.css index 2ad9bdf..997de8a 100644 --- a/srv/poe_manager/static/css/style.css +++ b/srv/poe_manager/static/css/style.css @@ -117,13 +117,14 @@ pre { } .custom-table .col-ip { - width: 120px; /* IP-Adresse schmaler */ + width: 140px; /* IP-Adresse schmaler */ } .custom-table .col-mac { - width: 120px; /* MAC-Adresse schmaler */ + width: 140px; /* MAC-Adresse schmaler */ } + /* Checkbox sichtbar auch bei disabled */ .checkbox-visible:disabled { opacity: 1; /* nicht ausgegraut */ @@ -145,7 +146,7 @@ label.text-white { } .custom-actions { - gap: 0.5rem; /* horizontaler Abstand zwischen Buttons */ - margin: auto 0; + margin: auto 0; background: #fff; } + diff --git a/srv/poe_manager/templates/index.html b/srv/poe_manager/templates/index.html index 2e8f299..0ef9f3d 100644 --- a/srv/poe_manager/templates/index.html +++ b/srv/poe_manager/templates/index.html @@ -8,8 +8,16 @@
{{ d[1] }}
- - {% if status[d[0]] %}{{ status[d[0]]|capitalize }}{% else %}unbekannt{% endif %} + + {% if d[2] == 0 %} + Deaktiviert + {% else %} + {% if status[d[0]] %}{{ status[d[0]]|capitalize }}{% else %}Unbekannt{% endif %} + {% endif %}
diff --git a/srv/poe_manager/templates/switche.html b/srv/poe_manager/templates/switche.html index 6f106e9..a98ed81 100644 --- a/srv/poe_manager/templates/switche.html +++ b/srv/poe_manager/templates/switche.html @@ -7,20 +7,21 @@

Neuen Switch hinzufügen

-
-
-
+
+
+
{% endif %} - +
- - - + + + + {% if current_user.is_admin %}{% endif %} @@ -28,26 +29,46 @@ {% for s in switches %} {% if current_user.is_admin %} - - - - - - - + + + + - + + {% else %} + {% endif %} {% endfor %}
HostnameIP-AdresseUsernameHostnameIP-AdresseUsernamePasswordAktionen
- + + + + + + + + + + + + +
-
{{ s['hostname'] }} {{ s['ip'] }} {{ s['username'] }}******
+ + {% endblock %} diff --git a/srv/poe_manager/templates/users.html b/srv/poe_manager/templates/users.html index 339e0e2..12188cf 100644 --- a/srv/poe_manager/templates/users.html +++ b/srv/poe_manager/templates/users.html @@ -8,21 +8,21 @@ {% endif %} - +
- - + + {% if current_user.is_admin %}{% endif %} {% for u in users %} - - + + {% if current_user.is_admin %} -
UsernameRolleUsernameRolleAktionen
{{ u['username'] }}{% if u['is_admin'] %}Admin{% else %}User{% endif %}{{ u['username'] }}{% if u['is_admin'] %}Admin{% else %}User{% endif %} +
+