routeros_backup/templates/routers.html
2025-02-22 22:33:36 +01:00

64 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="container my-4">
<div class="d-flex justify-content-between align-items-center mb-3">
<h2>Moje Routery</h2>
<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="table-responsive">
<table class="table table-striped table-hover">
<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">
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Na pewno usunąć urządzenie?');">
<i class="bi bi-trash"></i> Usuń
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}