+ update emblemed support in iframe and list view

This commit is contained in:
Robin
2025-10-06 12:54:41 +02:00
parent 988ab003ad
commit ca02212004
8 changed files with 416 additions and 98 deletions

View File

@@ -1,78 +1,86 @@
{% extends 'layout.html' %}
{% block title %}Statusübersicht - Uptime Stats{% endblock %}
{% block content %}
<div class="container">
<h1 class="mb-4">Statusübersicht</h1>
{% if not monitors %}
<div class="alert alert-info text-center">
<h4>Noch keine Monitore konfiguriert.</h4>
<p>Bitte fügen Sie im <a href="{{ url_for('admin.index') }}" class="alert-link">Admin-Bereich</a> einen Monitor hinzu, um mit der Überwachung zu beginnen.</p>
</div>
{% else %}
<div class="row">
{% for monitor in monitors %}
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100 shadow-sm">
<div class="card-body">
<h5 class="card-title d-flex justify-content-between">
{{ monitor.name }}
{# Manuelle Statusanzeige priorisieren #}
{% if monitor.status_override == 'MAINTENANCE' %}
<span class="badge bg-primary status-badge">Wartung <i class="bi bi-tools"></i></span>
{% elif monitor.status_override == 'DEGRADED' %}
<span class="badge bg-warning text-dark status-badge">Probleme <i class="bi bi-exclamation-triangle"></i></span>
{% elif monitor.status_override == 'OPERATIONAL' %}
<span class="badge bg-success status-badge">Funktionsfähig <i class="bi bi-check-circle"></i></span>
{# Automatische Statusanzeige, wenn kein manueller Status gesetzt ist #}
{% elif monitor.is_up == True %}
<span class="badge bg-success status-badge">Up <i class="bi bi-check-circle"></i></span>
{% elif monitor.is_up == False %}
<span class="badge bg-danger status-badge">Down <i class="bi bi-x-circle"></i></span>
{% else %}
<span class="badge bg-secondary status-badge">Unbekannt <i class="bi bi-question-circle"></i></span>
{% endif %}
</h5>
{# Status-Nachricht anzeigen, wenn vorhanden #}
{% if monitor.status_override_message %}
<div class="alert alert-info mt-2 p-2">
<small>{{ monitor.status_override_message }}</small>
</div>
{% endif %}
<p class="card-text">
{% if monitor.monitor_type == 'TCP' %}
<span class="text-muted text-break">{{ monitor.url }}:{{ monitor.port }}</span>
{% else %}
<a href="{{ monitor.url }}" target="_blank" class="text-muted text-break">{{ monitor.url }}</a>
{% endif %}
</p>
<div>
<span class="badge rounded-pill bg-primary">{{ monitor.monitor_type }}</span>
{% if monitor.monitor_type == 'KEYWORD' and monitor.keyword %}
<span class="badge rounded-pill bg-light text-dark">Keyword: {{ monitor.keyword }}</span>
{% endif %}
</div>
</div>
<div class="card-footer text-muted">
<small>Zuletzt geprüft:
{% if monitor.last_checked != 'Nie' %}
{{ monitor.last_checked.strftime('%d.%m.%Y %H:%M:%S UTC') }}
{% else %}
Nie
{% endif %}
</small>
</div>
</div>
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Uptime Status</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<style>
.status-badge.bg-danger {
animation: pulse-red 1.5s infinite;
}
@keyframes pulse-green {
0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7); }
70% { box-shadow: 0 0 0 10px rgba(25, 135, 84, 0); }
100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}
@keyframes pulse-red {
0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
</style>
</head>
<body class="d-flex flex-column vh-100">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<i class="bi bi-bar-chart-line-fill"></i> Uptime Status
</a>
<div class="ms-auto">
<a href="{{ url_for('admin.index') }}" class="btn btn-outline-light">
<i class="bi bi-person-circle"></i> Admin-Bereich
</a>
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endblock %}
</nav>
<main class="container mt-4 flex-grow-1">
<h1 class="mb-4">Statusübersicht</h1>
{% if not monitors_with_status %}
<div class="alert alert-info text-center">
<h4>Keine Monitore konfiguriert.</h4>
<p>Bitte loggen Sie sich in den <a href="{{ url_for('admin.index') }}" class="alert-link">Admin-Bereich</a> ein, um neue Monitore hinzuzufügen.</p>
</div>
{% else %}
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead class="table-light">
<tr>
<th>Dienst</th>
<th>Status</th>
<th>Letzte Prüfung</th>
</tr>
</thead>
<tbody>
{% for monitor, last_log in monitors_with_status %}
<tr>
<td>
<a href="{{ url_for('monitor_details', monitor_id=monitor.id) }}" class="text-decoration-none fw-bold">{{ monitor.name }}</a>
{% if monitor.status_override_message %}
<div class="text-muted fst-italic small">
<i class="bi bi-info-circle"></i> {{ monitor.status_override_message }}
</div>
{% endif %}
</td>
{% include '_status_badge.html' %}
<td>
{% if last_log %}
{{ last_log.timestamp.strftime('%d.%m.%Y %H:%M:%S UTC') }}
{% else %}
<span class="text-muted">Nie</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</main>
{% include '_footer.html' %}
<script src="ht
</html>