v0.2 fleet overhaul

This commit is contained in:
serversdwn
2025-12-03 07:57:25 +00:00
parent 802601ae8d
commit dc853806bb
12 changed files with 1400 additions and 282 deletions

View File

@@ -1,25 +1,50 @@
<table class="fleet-table">
<thead>
<tr>
<th>ID</th>
<th>Status</th>
<th>Age</th>
<th>Last Seen</th>
<th>File</th>
<th>Note</th>
</tr>
</thead>
{% if units %}
<div class="space-y-2">
{% for unit_id, unit in units.items() %}
<div class="flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-700/50 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors">
<div class="flex items-center space-x-3 flex-1">
<!-- Status Indicator -->
<div class="flex-shrink-0">
{% if unit.status == 'OK' %}
<span class="w-3 h-3 rounded-full bg-green-500" title="OK"></span>
{% elif unit.status == 'Pending' %}
<span class="w-3 h-3 rounded-full bg-yellow-500" title="Pending"></span>
{% else %}
<span class="w-3 h-3 rounded-full bg-red-500" title="Missing"></span>
{% endif %}
</div>
<tbody>
{% for uid, u in units.items() %}
<tr>
<td>{{ uid }}</td>
<td>{{ u.status }}</td>
<td>{{ u.age }}</td>
<td>{{ u.last }}</td>
<td>{{ u.fname }}</td>
<td>{{ u.note }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<!-- Unit Info -->
<div class="flex-1 min-w-0">
<div class="flex items-center gap-2">
<a href="/unit/{{ unit_id }}" class="font-medium text-seismo-orange hover:text-seismo-burgundy hover:underline">
{{ unit_id }}
</a>
{% if unit.device_type == 'modem' %}
<span class="px-2 py-0.5 rounded-full bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 text-xs">
Modem
</span>
{% else %}
<span class="px-2 py-0.5 rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300 text-xs">
Seismograph
</span>
{% endif %}
</div>
{% if unit.note %}
<p class="text-xs text-gray-500 dark:text-gray-400 truncate">{{ unit.note }}</p>
{% endif %}
</div>
<!-- Age -->
<div class="text-right flex-shrink-0">
<span class="text-sm {% if unit.status == 'Missing' %}text-red-600 dark:text-red-400 font-semibold{% elif unit.status == 'Pending' %}text-yellow-600 dark:text-yellow-400{% else %}text-gray-500 dark:text-gray-400{% endif %}">
{{ unit.age }}
</span>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<p class="text-sm text-gray-500 dark:text-gray-400 text-center py-8">No active units</p>
{% endif %}