git add templates/! REFACOR INTERFEJSU git add templates/
This commit is contained in:
@ -1,27 +1,92 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Historia aktualizacji{% endblock %}
|
||||
|
||||
{% block extra_head %}
|
||||
<style>
|
||||
/* === Styl dopasowany do trybu ciemnego i jasnego === */
|
||||
|
||||
/* Tło karty w trybie ciemnym */
|
||||
body.dark-mode .card {
|
||||
background-color: #1e1e1e;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
/* Nagłówek karty w trybie ciemnym */
|
||||
body.dark-mode .card .card-header.bg-light {
|
||||
background-color: #333 !important;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
|
||||
/* Tabela w trybie ciemnym: jaśniejsze wyróżnienie nagłówka */
|
||||
body.dark-mode .card table thead {
|
||||
background-color: #2a2a2a;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
/* Tło wierszy tabeli w trybie ciemnym */
|
||||
body.dark-mode .card table tbody tr {
|
||||
background-color: #1e1e1e;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
/* Obramowanie w trybie ciemnym */
|
||||
body.dark-mode .table-bordered > :not(caption) > * > * {
|
||||
border-color: #444 !important;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2 class="mb-4">Historia aktualizacji</h2>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
<th>Urządzenie</th>
|
||||
<th>Typ aktualizacji</th>
|
||||
<th>Szczegóły</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td>{{ history.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
|
||||
<td>{{ history.device.name or history.device.ip }}</td>
|
||||
<td>{{ history.update_type }}</td>
|
||||
<td>{{ history.details }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card border-0 shadow mb-4">
|
||||
<!-- Nagłówek karty -->
|
||||
<div class="card-header bg-light">
|
||||
<h4 class="mb-0">Historia aktualizacji</h4>
|
||||
</div>
|
||||
|
||||
<!-- Zawartość karty -->
|
||||
<div class="card-body p-0">
|
||||
<!-- Jeśli mamy cokolwiek w histories -->
|
||||
{% if histories %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover table-sm align-middle mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="text-nowrap">Data</th>
|
||||
<th class="text-nowrap">Urządzenie</th>
|
||||
<th class="text-nowrap">Typ aktualizacji</th>
|
||||
<th class="text-nowrap">Szczegóły</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td>{{ history.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
|
||||
<td>
|
||||
{{ history.device.name or history.device.ip }}
|
||||
</td>
|
||||
<td>
|
||||
{# Prosty przykład wyróżnienia typów aktualizacji #}
|
||||
{% if history.update_type == "system" %}
|
||||
<span class="badge bg-primary">System</span>
|
||||
{% elif history.update_type == "firmware" %}
|
||||
<span class="badge bg-success">Firmware</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">{{ history.update_type }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ history.details }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="p-3">
|
||||
<p class="mb-0">Brak historii aktualizacji.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user