101 lines
3.6 KiB
HTML
101 lines
3.6 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Dashboard - RouterOS Update{% endblock %}
|
||
{% block content %}
|
||
<div class="container">
|
||
<h2 class="mb-4">Dashboard</h2>
|
||
|
||
<!-- Pierwszy wiersz z podstawowymi statystykami -->
|
||
<div class="row">
|
||
<!-- Karta z liczbą urządzeń -->
|
||
<div class="col-md-3">
|
||
<div class="card text-white bg-primary mb-3">
|
||
<div class="card-body">
|
||
<h5 class="card-title">Urządzenia</h5>
|
||
<p class="card-text display-6">{{ devices_count }}</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Karta z urządzeniami wymagającymi aktualizacji -->
|
||
<div class="col-md-3">
|
||
<div class="card text-white bg-danger mb-3">
|
||
<div class="card-body">
|
||
<h5 class="card-title">Wymagają aktualizacji</h5>
|
||
<p class="card-text display-6">{{ pending_updates_count }}</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Karta z liczbą logów -->
|
||
<div class="col-md-3">
|
||
<div class="card text-white bg-success mb-3">
|
||
<div class="card-body">
|
||
<h5 class="card-title">Logi</h5>
|
||
<p class="card-text display-6">{{ logs_count }}</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Karta z wykonanymi aktualizacjami -->
|
||
<div class="col-md-3">
|
||
<div class="card text-white bg-info mb-3">
|
||
<div class="card-body">
|
||
<h5 class="card-title">Wykonane aktualizacje</h5>
|
||
<p class="card-text display-6">{{ update_history_count }}</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Nowy wiersz z najnowszymi wersjami systemu -->
|
||
<div class="row mb-4">
|
||
<div class="col-md-6">
|
||
<div class="card text-white bg-secondary mb-3">
|
||
<div class="card-body">
|
||
<h5 class="card-title">Najnowsza wersja RouterOS 7.x (Stable)</h5>
|
||
{% if latest_version_7 %}
|
||
<p class="card-text display-6">{{ latest_version_7.version | format_version }}</p>
|
||
<p><small>{{ latest_version_7.timestamp.strftime('%Y-%b-%d') }}</small></p>
|
||
<a href="{{ url_for('routeros_changelog', channel=latest_version_7.release_type, series='7.x', version=latest_version_7.version) }}" class="btn btn-light btn-sm">Czytaj changelog</a>
|
||
{% else %}
|
||
<p>Brak danych</p>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="col-md-6">
|
||
<div class="card text-white bg-secondary mb-3">
|
||
<div class="card-body">
|
||
<h5 class="card-title">Najnowsza wersja RouterOS 6.x (Stable)</h5>
|
||
{% if latest_version_6 %}
|
||
<p class="card-text display-6">{{ latest_version_6.version | format_version }}</p>
|
||
<p><small>{{ latest_version_6.timestamp.strftime('%Y-%b-%d') }}</small></p>
|
||
<a href="{{ url_for('routeros_changelog', channel=latest_version_6.release_type, series='6.x', version=latest_version_6.version) }}" class="btn btn-light btn-sm">Czytaj changelog</a>
|
||
{% else %}
|
||
<p>Brak danych</p>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Sekcja Ostatnie zdarzenia -->
|
||
<div class="card mb-3 border-0">
|
||
<div class="card-header bg-light py-2">
|
||
<h6 class="mb-0">Ostatnie zdarzenia</h6>
|
||
</div>
|
||
|
||
{% if recent_logs %}
|
||
<ul class="list-group list-group-flush">
|
||
{% for log in recent_logs %}
|
||
<li class="list-group-item p-1 border-top-0 border-bottom">
|
||
<small class="text-muted">{{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</small>
|
||
– {{ log.message|truncate(100) }}
|
||
</li>
|
||
{% endfor %}
|
||
</ul>
|
||
{% else %}
|
||
<p class="mb-0">Brak ostatnich zdarzeń.</p>
|
||
{% endif %}
|
||
|
||
</div>
|
||
</div>
|
||
{% endblock %}
|