121 lines
3.7 KiB
HTML
121 lines
3.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>RFID Status Tracker</title>
|
|
<style>
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
margin: 20px;
|
|
background-color: #f4f7fa; /* Heller Hintergrund */
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
.container {
|
|
width: 100%;
|
|
max-width: 900px;
|
|
background: white;
|
|
padding: 30px;
|
|
border-radius: 12px;
|
|
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
|
|
}
|
|
h1 {
|
|
text-align: center;
|
|
color: #333;
|
|
margin-bottom: 10px;
|
|
}
|
|
p.connection-info {
|
|
text-align: center;
|
|
font-size: 1em;
|
|
color: #555;
|
|
border-bottom: 1px solid #eee;
|
|
padding-bottom: 20px;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
/* Statusanzeige */
|
|
.card-status {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 18px 20px;
|
|
margin-bottom: 15px;
|
|
border-radius: 8px;
|
|
background-color: #ffffff; /* Weißer Hintergrund für jeden Chip */
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
|
|
border-left: 5px solid #007bff; /* Akzentstreifen links */
|
|
}
|
|
|
|
.chip-info {
|
|
flex-grow: 2;
|
|
font-size: 1.3em;
|
|
color: #0056b3;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.chip-details span {
|
|
font-size: 0.9em;
|
|
color: #888;
|
|
}
|
|
|
|
.status-container {
|
|
text-align: center;
|
|
margin-right: 20px;
|
|
}
|
|
|
|
/* Status-Indikator (Das Quadrat) */
|
|
.status-indicator {
|
|
padding: 10px 25px;
|
|
border-radius: 30px;
|
|
font-weight: bold;
|
|
font-size: 1.4em;
|
|
min-width: 90px; /* Stellt sicher, dass die Breite konstant ist */
|
|
text-align: center;
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* Status Styling basierend auf der Variable 'Status' (1 oder 0) */
|
|
.status-active {
|
|
background-color: #e6ffe9; /* Hellgrün für Hintergrund */
|
|
color: #28a745; /* Dunkelgrüner Text */
|
|
border: 1px solid #28a745;
|
|
}
|
|
.status-inactive {
|
|
background-color: #fdecec; /* Hellrot für Hintergrund */
|
|
color: #dc3545; /* Dunkelroter Text */
|
|
border: 1px solid #dc3545;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>RFID Chip Status Übersicht</h1>
|
|
<p class="connection-info">Daten werden über MQTT von Topic "{{ mqtt_topic }}" empfangen.</p>
|
|
|
|
{% for chip_id, data in rfid_data.items() %}
|
|
<div class="card-status">
|
|
<!-- Name und ID -->
|
|
<span class="chip-info">
|
|
{{ data.Name }}
|
|
<div class="chip-details"><span>(ID: {{ data.ID }})</span></div>
|
|
</span>
|
|
|
|
<!-- Statusbereich -->
|
|
<div class="status-container">
|
|
<p style="font-size: 0.9em; color: #555;">Status:</p>
|
|
<!-- Dynamisches Styling basierend auf dem Status -->
|
|
{% set status_class = 'status-active' if data.Status == 1 else 'status-inactive' %}
|
|
<span class="status-indicator {{ status_class }}">
|
|
{{ data.Status }}
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
{% endfor %}
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|