uploade
This commit is contained in:
20
templates/admin/index.html
Normal file
20
templates/admin/index.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{% extends 'admin/master.html' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mt-4">
|
||||
<h1>Willkommen im Admin-Bereich</h1>
|
||||
<p class="lead">
|
||||
Dies ist der zentrale Verwaltungsbereich für Ihre Uptime-Statistiken.
|
||||
</p>
|
||||
<p>
|
||||
Klicken Sie auf den Button unten, um direkt einen neuen Monitor zur Überwachung hinzuzufügen.
|
||||
</p>
|
||||
<a class="btn btn-primary btn-lg my-3" href="{{ url_for('monitor.create_view', url=url_for('monitor.index_view')) }}">
|
||||
<i class="bi bi-plus-circle"></i> Neuen Monitor hinzufügen
|
||||
</a>
|
||||
<hr>
|
||||
<p>
|
||||
Alternativ können Sie die Menüpunkte in der Navigationsleiste oben verwenden, um alle Monitore oder Benutzer anzuzeigen und zu bearbeiten.
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
43
templates/change_password.html
Normal file
43
templates/change_password.html
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block title %}Passwort ändern - Uptime Stats{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-lg-5">
|
||||
<div class="card shadow-lg">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title text-center mb-4">Passwort ändern</h2>
|
||||
<form method="POST" action="{{ url_for('change_password') }}" novalidate>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="mb-3">
|
||||
{{ form.current_password.label(class="form-label") }}
|
||||
{{ form.current_password(class="form-control is-invalid" if form.current_password.errors else "form-control") }}
|
||||
{% for error in form.current_password.errors %}
|
||||
<div class="invalid-feedback">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
{{ form.new_password.label(class="form-label") }}
|
||||
{{ form.new_password(class="form-control is-invalid" if form.new_password.errors else "form-control") }}
|
||||
{% for error in form.new_password.errors %}
|
||||
<div class="invalid-feedback">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
{{ form.confirm_password.label(class="form-label") }}
|
||||
{{ form.confirm_password(class="form-control is-invalid" if form.confirm_password.errors else "form-control") }}
|
||||
{% for error in form.confirm_password.errors %}
|
||||
<div class="invalid-feedback">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
{{ form.submit(class_="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
78
templates/index.html
Normal file
78
templates/index.html
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
{% 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>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
94
templates/layout.html
Normal file
94
templates/layout.html
Normal file
@@ -0,0 +1,94 @@
|
||||
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}Uptime Stats{% endblock %}</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>
|
||||
body {
|
||||
background-color: #e9ecef; /* Hellerer Hintergrund für mehr Kontrast */
|
||||
padding-bottom: 80px; /* Mehr Platz für den Footer */
|
||||
}
|
||||
.navbar {
|
||||
box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important;
|
||||
}
|
||||
.card {
|
||||
border: 1px solid rgba(0,0,0,0.1);
|
||||
border-top: 3px solid #0d6efd; /* Akzentfarbe oben */
|
||||
box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
.card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
|
||||
}
|
||||
|
||||
/* Pulsierende Animationen für Status */
|
||||
.status-badge.bg-success {
|
||||
border-top-color: #198754;
|
||||
animation: pulse-green 2s infinite;
|
||||
}
|
||||
.status-badge.bg-danger {
|
||||
border-top-color: #dc3545;
|
||||
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>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark mb-4">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="{{ url_for('index') }}"><i class="bi bi-bar-chart-line-fill"></i> Uptime Stats</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
{% if current_user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('admin.index') }}"><i class="bi bi-shield-lock"></i> Admin</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('change_password') }}"><i class="bi bi-key"></i> Passwort ändern</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('logout') }}"><i class="bi bi-box-arrow-right"></i> Logout</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('login') }}"><i class="bi bi-box-arrow-in-right"></i> Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="container">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="footer mt-auto py-3 bg-dark text-white fixed-bottom">
|
||||
<div class="container d-flex justify-content-between align-items-center">
|
||||
<span>Powered by <a href="https://rl-dev.de" target="_blank" class="text-light fw-bold">rl-dev.de</a></span>
|
||||
<a href="https://git.rl-dev.de/Robin/Uptime-Stats" target="_blank" class="text-light fs-4">
|
||||
<i class="bi bi-git"></i>
|
||||
</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
36
templates/login.html
Normal file
36
templates/login.html
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block title %}Login - Uptime Stats{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card shadow-lg">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title text-center mb-4">Admin Login</h2>
|
||||
<form method="POST" action="{{ url_for('login') }}" novalidate>
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="mb-3">
|
||||
{{ form.username.label(class="form-label") }}
|
||||
{{ form.username(class="form-control is-invalid" if form.username.errors else "form-control") }}
|
||||
{% for error in form.username.errors %}
|
||||
<div class="invalid-feedback">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
{{ form.password.label(class="form-label") }}
|
||||
{{ form.password(class="form-control is-invalid" if form.password.errors else "form-control") }}
|
||||
{% for error in form.password.errors %}
|
||||
<div class="invalid-feedback">{{ error }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
{{ form.submit(class_="btn btn-primary") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user