140 lines
4.6 KiB
HTML
140 lines
4.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Status</title>
|
|
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.png') }}">
|
|
<link href="https://fonts.googleapis.com/css2?family=Play:wght@400&display=swap" rel="stylesheet">
|
|
<style>
|
|
@import url('https://fonts.googleapis.com/css2?family=Play&display=swap');
|
|
body {
|
|
font-family: 'Play', sans-serif;
|
|
background-color: #292929; /* Hintergrundfarbe */
|
|
color: #fff; /* Textfarbe */
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
.container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 100vh;
|
|
}
|
|
.header {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 60px;
|
|
padding: 10px;
|
|
}
|
|
.time-date {
|
|
font-size: 30px; /* Schriftgröße für Uhr und Datum */
|
|
}
|
|
.logo {
|
|
height: 50px; /* Höhe des Logos */
|
|
width: auto; /* Breite automatisch anpassen */
|
|
margin: 0 20px; /* Abstand um das Logo */
|
|
}
|
|
.divider {
|
|
width: 100%;
|
|
height: 3px;
|
|
background-color: #ccc; /* Farbe des Trenners */
|
|
}
|
|
.status-container {
|
|
display: flex;
|
|
flex-wrap: wrap; /* Umbrüche ermöglichen */
|
|
justify-content: center; /* Zentrieren der Karten */
|
|
padding: 20px;
|
|
}
|
|
.status-card {
|
|
border-radius: 10px;
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5); /* Etwas dunklerer Schatten für besseren Kontrast */
|
|
margin: 10px;
|
|
padding: 20px;
|
|
width: 200px;
|
|
text-align: center;
|
|
transition: background-color 0.3s ease; /* Sanfter Übergang bei Farbänderung */
|
|
}
|
|
.status-card h2 {
|
|
margin-bottom: 5px;
|
|
}
|
|
.url {
|
|
font-size: 0.8em;
|
|
color: #acabab; /* Helle Farbe für die URL */
|
|
}
|
|
.online {
|
|
background-color: #008800; /* Sanftes Grün */
|
|
}
|
|
.offline {
|
|
background-color: #990000; /* Sanftes Rot */
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<div id="date" class="time-date"></div>
|
|
<img src="{{ url_for('static', filename='Bild.png') }}" alt="Logo" class="logo">
|
|
<div id="clock" class="time-date"></div>
|
|
</div>
|
|
<div class="divider"></div>
|
|
<div class="status-container">
|
|
{% for website in websites %}
|
|
<div class="status-card" id="card-{{ loop.index }}">
|
|
<h2>{{ website.title }}</h2>
|
|
<p class="status">Checking...</p>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
<div class="status-container">
|
|
{% for website in websites2 %}
|
|
<div class="status-card" id="card-{{ loop.index + websites|length }}">
|
|
<h2>{{ website.title }}</h2>
|
|
<p class="status">Checking...</p>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
<script>
|
|
function updateStatus() {
|
|
$.getJSON('/update_status', function(data) {
|
|
data.forEach(function(site, index) {
|
|
var card = $('#card-' + (index + 1));
|
|
var statusElement = card.find('.status');
|
|
statusElement.text(site.status ? 'Online' : 'Offline');
|
|
|
|
// Hintergrundfarbe basierend auf dem Status ändern
|
|
if (site.status) {
|
|
card.removeClass('offline').addClass('online');
|
|
} else {
|
|
card.removeClass('online').addClass('offline');
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
function updateTime() {
|
|
var now = new Date();
|
|
var timeString = now.toLocaleTimeString('de-DE');
|
|
var dateString = now.toLocaleDateString('de-DE');
|
|
$('#clock').text(timeString);
|
|
$('#date').text(dateString);
|
|
}
|
|
|
|
// Initial update
|
|
updateStatus();
|
|
updateTime();
|
|
|
|
// Update status every 5 seconds
|
|
setInterval(updateStatus, 5000);
|
|
|
|
// Update time every second
|
|
setInterval(updateTime, 1000);
|
|
</script>
|
|
</body>
|
|
</html> |