ui: back to table layout with segment assignments inline
This commit is contained in:
parent
ed34ea95ca
commit
cddea5ba4c
@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Add Device + Firmware oben -->
|
<!-- Neues Tuerschild + Firmware -->
|
||||||
<div class="row g-3 mb-4">
|
<div class="row g-3 mb-4">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@ -103,14 +103,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Device Cards -->
|
<!-- Geraete-Tabelle -->
|
||||||
<div class="row g-3 mb-4">
|
<div class="card">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover table-sm mb-0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th></th>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Hostname</th>
|
||||||
|
<th>MAC</th>
|
||||||
|
<th>Version</th>
|
||||||
|
<th>LEDs</th>
|
||||||
|
<th>Segmente</th>
|
||||||
|
<th>Letzte Aktivitaet</th>
|
||||||
|
<th>Aktionen</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
{% for device in devices %}
|
{% for device in devices %}
|
||||||
<div class="col-md-6 col-lg-4 col-xl-3">
|
<tr>
|
||||||
<div class="card busylight-card h-100">
|
<td>
|
||||||
<div class="card-header bg-white border-0 pb-0">
|
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
|
||||||
<strong>{{ device.name or device.hostname }}</strong>
|
|
||||||
{% if device.last_check %}
|
{% if device.last_check %}
|
||||||
{% if device.online %}
|
{% if device.online %}
|
||||||
<span class="status-dot" style="background: #28a745;" title="Online"></span>
|
<span class="status-dot" style="background: #28a745;" title="Online"></span>
|
||||||
@ -120,54 +134,25 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<span class="status-dot" style="background: #999;" title="Nicht geprueft"></span>
|
<span class="status-dot" style="background: #999;" title="Nicht geprueft"></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</td>
|
||||||
</div>
|
<td><strong>{{ device.name or '-' }}</strong></td>
|
||||||
<div class="card-body pt-2">
|
|
||||||
<table class="table table-sm table-borderless mb-2" style="font-size: 0.8rem;">
|
|
||||||
<tr>
|
|
||||||
<td class="text-muted" style="width:70px">Host</td>
|
|
||||||
<td><code class="small">{{ device.hostname }}</code></td>
|
<td><code class="small">{{ device.hostname }}</code></td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="text-muted">MAC</td>
|
|
||||||
<td><small class="font-monospace">{{ device.mac if device.mac else '-' }}</small></td>
|
<td><small class="font-monospace">{{ device.mac if device.mac else '-' }}</small></td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="text-muted">Version</td>
|
|
||||||
<td>{{ device.version if device.version else '-' }}</td>
|
<td>{{ device.version if device.version else '-' }}</td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="text-muted">LEDs</td>
|
|
||||||
<td>{{ device.leds if device.leds else '-' }}</td>
|
<td>{{ device.leds if device.leds else '-' }}</td>
|
||||||
</tr>
|
<td>
|
||||||
<tr>
|
|
||||||
<td class="text-muted">Segmente</td>
|
|
||||||
<td>{{ device.segment_count }}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- Segment Zuordnungen -->
|
|
||||||
{% if device.segments %}
|
{% if device.segments %}
|
||||||
<div class="border-top pt-2">
|
|
||||||
{% for seg in device.segments %}
|
{% for seg in device.segments %}
|
||||||
<div class="d-flex align-items-center mb-1">
|
<div><span class="badge bg-primary" style="font-size:0.6rem">{{ seg.segment }}</span> <small>{{ seg.display_name }}</small></div>
|
||||||
<span class="badge bg-primary me-2" style="font-size:0.65rem">Seg {{ seg.segment }}</span>
|
|
||||||
<small>{{ seg.display_name }}</small>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
{% else %}
|
||||||
|
<small class="text-muted">{{ device.segment_count }}x (leer)</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</td>
|
||||||
{% if device.last_activity %}
|
<td><small>{{ device.last_activity or '-' }}</small></td>
|
||||||
<div class="border-top pt-2 mt-2">
|
<td>
|
||||||
<small class="text-muted"><i class="bi bi-clock"></i> {{ device.last_activity }}</small>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="card-footer bg-white border-0 pt-0">
|
|
||||||
<div class="d-flex gap-1">
|
|
||||||
<form method="post" action="/api/devices/{{ device.id }}/check" class="d-inline">
|
<form method="post" action="/api/devices/{{ device.id }}/check" class="d-inline">
|
||||||
<button type="submit" class="btn btn-sm btn-outline-secondary" title="Jetzt pruefen">
|
<button type="submit" class="btn btn-sm btn-outline-secondary py-0" title="Jetzt pruefen">
|
||||||
<i class="bi bi-wifi"></i>
|
<i class="bi bi-wifi"></i>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@ -179,26 +164,24 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if needs_update %}
|
{% if needs_update %}
|
||||||
<button class="btn btn-sm btn-outline-warning" title="Firmware Update"
|
<button class="btn btn-sm btn-outline-warning py-0" title="Firmware Update"
|
||||||
data-bs-toggle="modal" data-bs-target="#ota-{{ device.id }}">
|
data-bs-toggle="modal" data-bs-target="#ota-{{ device.id }}">
|
||||||
<i class="bi bi-cloud-arrow-up"></i>
|
<i class="bi bi-cloud-arrow-up"></i>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button class="btn btn-sm btn-outline-primary" data-bs-toggle="modal"
|
<button class="btn btn-sm btn-outline-primary py-0" data-bs-toggle="modal"
|
||||||
data-bs-target="#edit-{{ device.id }}" title="Bearbeiten">
|
data-bs-target="#edit-{{ device.id }}" title="Bearbeiten">
|
||||||
<i class="bi bi-pencil"></i>
|
<i class="bi bi-pencil"></i>
|
||||||
</button>
|
</button>
|
||||||
<form method="post" action="/api/devices/{{ device.id }}/delete" class="d-inline"
|
<form method="post" action="/api/devices/{{ device.id }}/delete" class="d-inline"
|
||||||
onsubmit="return confirm('Tuerschild wirklich loeschen?')">
|
onsubmit="return confirm('Tuerschild wirklich loeschen?')">
|
||||||
<button type="submit" class="btn btn-sm btn-outline-danger" title="Loeschen">
|
<button type="submit" class="btn btn-sm btn-outline-danger py-0" title="Loeschen">
|
||||||
<i class="bi bi-trash"></i>
|
<i class="bi bi-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Edit Modal -->
|
<!-- Edit Modal -->
|
||||||
<div class="modal fade" id="edit-{{ device.id }}" tabindex="-1">
|
<div class="modal fade" id="edit-{{ device.id }}" tabindex="-1">
|
||||||
@ -271,13 +254,18 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if not devices %}
|
{% if not devices %}
|
||||||
<div class="col-12">
|
<tr>
|
||||||
<div class="text-center text-muted py-4">Noch keine Tuerschilder vorhanden.</div>
|
<td colspan="9" class="text-center text-muted py-4">
|
||||||
</div>
|
Noch keine Tuerschilder vorhanden.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="text-muted">
|
</div>
|
||||||
|
<div class="mt-2 text-muted">
|
||||||
<small>{{ devices|length }} Tuerschilder | Status wird alle 4 Minuten automatisch geprueft</small>
|
<small>{{ devices|length }} Tuerschilder | Status wird alle 4 Minuten automatisch geprueft</small>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user