109 lines
3.8 KiB
HTML
109 lines
3.8 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>
|
|
<div class="card-body p-0">
|
|
{% if recent_logs %}
|
|
<ul class="list-group list-group-flush">
|
|
{% for log in recent_logs %}
|
|
<li class="list-group-item">
|
|
<!-- Data w nieco mniejszej czcionce, np. "small text-muted" -->
|
|
<div class="small text-muted">{{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</div>
|
|
<!-- Treść zdarzenia; "truncate(100)" żeby skrócić tekst -->
|
|
<div class="mt-1">
|
|
{{ log.message|truncate(100) }}
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<div class="p-3">
|
|
Brak ostatnich zdarzeń.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|