hosts_app/templates/dashboard.html
Mateusz Gruszczyński d8020b95f0 refactor web interface
2025-02-25 10:56:44 +01:00

75 lines
2.0 KiB
HTML

{% extends "base.html" %}
{% block title %}Dashboard - /etc/hosts Manager{% endblock %}
{% block content %}
<h2>Dashboard</h2>
<div class="row">
<!-- Karty statystyk -->
<div class="col-md-3">
<div class="card text-white bg-primary mb-3">
<div class="card-body">
<h5 class="card-title">Liczba hostów</h5>
<p class="card-text fs-4">{{ stats.host_count }}</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-white bg-success mb-3">
<div class="card-body">
<h5 class="card-title">Łącznie wdrożeń</h5>
<p class="card-text fs-4">{{ stats.total_deployments }}</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-white bg-info mb-3">
<div class="card-body">
<h5 class="card-title">Udane wdrożenia</h5>
<p class="card-text fs-4">{{ stats.successful_deployments }}</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card text-white bg-danger mb-3">
<div class="card-body">
<h5 class="card-title">Nieudane wdrożenia</h5>
<p class="card-text fs-4">{{ stats.failed_deployments }}</p>
</div>
</div>
</div>
</div>
<!-- Nowy wiersz z dużym przyciskiem do ręcznego wdrożenia -->
<div class="row mb-4">
<div class="col text-center">
<a href="{{ url_for('deploy_now') }}" class="btn btn-lg btn-warning">
Ręczne wdrożenie /etc/hosts na wszystkich serwerach
</a>
</div>
</div>
<!-- Tabela logów -->
<div class="row mt-4">
<div class="col">
<h4>Ostatnie logi</h4>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Czas</th>
<th>Wiadomość</th>
</tr>
</thead>
<tbody>
{% for log in logs %}
<tr>
<td>{{ log.timestamp.strftime("%Y-%m-%d %H:%M:%S") }}</td>
<td>{{ log.details }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}