This commit is contained in:
Mateusz Gruszczyński
2025-02-23 17:47:54 +01:00
parent a53ff42934
commit 0267e4c2bb
13 changed files with 944 additions and 0 deletions

47
templates/devices.html Normal file
View File

@ -0,0 +1,47 @@
{% extends "base.html" %}
{% block title %}Moje urządzenia - RouterOS Update{% endblock %}
{% block content %}
<h2>Moje urządzenia</h2>
<button type="button" class="btn btn-success mb-3" onclick="window.location.href='{{ url_for('add_device') }}'">Dodaj nowe urządzenie</button>
<table class="table table-bordered table-hover">
<thead class="table-dark">
<tr>
<th>Nazwa / Adres IP</th>
<th>Ostatnie sprawdzenie</th>
<th>Status</th>
<th>System / Firmware</th>
<th>Akcje</th>
</tr>
</thead>
<tbody>
{% for device in devices %}
<tr>
<td>{{ device.name or device.ip }}</td>
<td>{{ device.last_check.strftime('%Y-%m-%d %H:%M:%S') if device.last_check else 'Brak' }}</td>
<td>
{% if device.update_required %}
<span class="badge bg-danger">Wymaga aktualizacji</span>
{% else %}
<span class="badge bg-success">Aktualny</span>
{% endif %}
</td>
<td>
<small>
<strong>System:</strong> {{ device.current_version or 'Brak' }}<br>
<strong>Firmware:</strong> {{ device.current_firmware or 'Brak' }}
</small>
</td>
<td>
<button type="button" class="btn btn-info btn-sm" onclick="window.location.href='{{ url_for('device_detail', device_id=device.id) }}'">Szczegóły</button>
<button type="button" class="btn btn-secondary btn-sm" onclick="window.location.href='{{ url_for('force_check', device_id=device.id) }}'">Wymuś sprawdzenie</button>
<button type="button" class="btn btn-warning btn-sm" onclick="window.location.href='{{ url_for('edit_device', device_id=device.id) }}'">Edytuj</button>
</td>
</tr>
{% else %}
<tr>
<td colspan="5" class="text-center">Brak dodanych urządzeń.</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}