2025-02-28 16:26:27 +01:00

68 lines
2.5 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="container my-4">
<div class="card border-0 shadow-sm">
<div class="card-header bg-light d-flex justify-content-between align-items-center">
<h4 class="mb-0">Lista urządzeń</h4>
<a href="{{ url_for('add_router') }}" class="btn btn-success">
<i class="bi bi-plus-lg"></i> Dodaj nowe urządzenie
</a>
</div>
<div class="card-body">
<div class="table-responsive-sm">
<table class="table table-striped table-hover align-middle">
<thead class="table-primary">
<tr>
<th>Nazwa</th>
<th>Host</th>
<th>Port</th>
<th>Exporty</th>
<th>Backupy binarne</th>
<th>Test Połączenia</th>
<th>Akcje</th>
</tr>
</thead>
<tbody>
{% for router in routers %}
<tr>
<td>{{ router.name }}</td>
<td>{{ router.host }}</td>
<td>{{ router.port }}</td>
<td>
<span class="badge bg-success">
{{ router.backups|selectattr("backup_type", "equalto", "export")|list|length }}
</span>
</td>
<td>
<span class="badge bg-info">
{{ router.backups|selectattr("backup_type", "equalto", "binary")|list|length }}
</span>
</td>
<td>
<button type="button" class="btn btn-sm btn-info" onclick="openTestConnectionModal({{ router.id }})">
<i class="bi bi-wifi"></i> Test
</button>
</td>
<td>
<a href="{{ url_for('router_details', router_id=router.id) }}" class="btn btn-sm btn-primary">
<i class="bi bi-eye"></i> Szczegóły
</a>
<a href="{{ url_for('edit_router', router_id=router.id) }}" class="btn btn-sm btn-warning">
<i class="bi bi-pencil"></i> Edytuj
</a>
<form action="{{ url_for('delete_router', router_id=router.id) }}" method="POST" class="d-inline" onsubmit="return confirm('Na pewno usunąć urządzenie?');">
<button type="submit" class="btn btn-sm btn-danger">
<i class="bi bi-trash"></i> Usuń
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}