git add templates/! REFACOR INTERFEJSU git add templates/
This commit is contained in:
@ -1,27 +1,80 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Wykryte anomalie{% endblock %}
|
||||
|
||||
{% block extra_head %}
|
||||
<style>
|
||||
/* Karta w trybie ciemnym */
|
||||
body.dark-mode .card {
|
||||
background-color: #1e1e1e;
|
||||
color: #ccc;
|
||||
border-color: #444;
|
||||
}
|
||||
body.dark-mode .card .card-header.bg-light {
|
||||
background-color: #333 !important;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
|
||||
/* Tabela w trybie ciemnym */
|
||||
body.dark-mode .table thead {
|
||||
background-color: #2a2a2a;
|
||||
color: #ccc;
|
||||
}
|
||||
body.dark-mode .table-bordered > :not(caption) > * > * {
|
||||
border-color: #444 !important;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2 class="mb-4">Wykryte anomalie</h2>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
<th>Urządzenie</th>
|
||||
<th>Opis</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for anomaly in anomalies %}
|
||||
<tr>
|
||||
<td>{{ anomaly.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
|
||||
<td>{{ anomaly.device.name or anomaly.device.ip if anomaly.device }}</td>
|
||||
<td>{{ anomaly.description }}</td>
|
||||
<td>{{ 'Rozwiązana' if anomaly.resolved else 'Otwarta' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card border-0 shadow">
|
||||
<div class="card-header bg-light">
|
||||
<h4 class="mb-0">Wykryte anomalie</h4>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
{% if anomalies and anomalies|length > 0 %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover table-sm align-middle mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="white-space: nowrap;">Data</th>
|
||||
<th style="white-space: nowrap;">Urządzenie</th>
|
||||
<th>Opis</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for anomaly in anomalies %}
|
||||
<tr>
|
||||
<td style="white-space: nowrap;">
|
||||
{{ anomaly.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
|
||||
</td>
|
||||
<td>
|
||||
{% if anomaly.device %}
|
||||
{{ anomaly.device.name or anomaly.device.ip }}
|
||||
{% else %}
|
||||
<span class="text-muted">Brak</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ anomaly.description }}</td>
|
||||
<td>
|
||||
{% if anomaly.resolved %}
|
||||
<span class="badge bg-success">Rozwiązana</span>
|
||||
{% else %}
|
||||
<span class="badge bg-danger">Otwarta</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="p-3">
|
||||
<p class="mb-0">Brak aktualnych anomalii.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user