Webinterface

This commit is contained in:
2025-09-26 15:51:18 +00:00
parent f057dc65c5
commit 85d7872934
8 changed files with 81 additions and 33 deletions

View File

@@ -2,7 +2,7 @@
<html>
<head>
<title>Devices</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body class="p-5">

View File

@@ -2,18 +2,7 @@
<html>
<head>
<title>Device Dashboard</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<style>
.device-card {
width: 150px;
margin: 5px;
text-align: center;
}
.status-badge {
font-size: 0.9rem;
margin-top: 5px;
}
</style>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body class="p-3">
@@ -28,20 +17,28 @@
<p>Prüfintervall: <strong>{{ interval }} Minuten</strong></p>
<div class="d-flex flex-wrap">
{% for d in devices %}
<div class="card device-card">
<div class="card-body">
<h6 class="card-title">{{ d['name'] }}</h6>
<table class="table table-bordered table-striped">
<thead class="table-dark">
<tr>
<th>Device-Name</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for d in devices %}
<tr>
<td>{{ d['name'] }}</td>
<td>
{% if status[d['name']] == 'online' %}
<span class="badge bg-success status-badge">Online</span>
<span class="badge bg-success">Online</span>
{% else %}
<span class="badge bg-danger status-badge">Offline</span>
<span class="badge bg-danger">Offline</span>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -2,7 +2,7 @@
<html>
<head>
<title>Login</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body class="p-5">
<h2>Login</h2>

View File

@@ -2,12 +2,36 @@
<html>
<head>
<title>Live Log</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<meta http-equiv="refresh" content="5"> <!-- alle 5 Sekunden neu laden -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<meta http-equiv="refresh" content="5"> <!-- automatische Aktualisierung alle 5 Sekunden -->
</head>
<body class="p-3">
<h2>Live Log: {{ log_name }}</h2>
<a href="{{ url_for('index') }}" class="btn btn-secondary mb-3">Zurück zum Dashboard</a>
<pre style="height:80vh; overflow:auto; background:#f8f9fa; padding:10px;">{{ log_content }}</pre>
<body>
<h2>Live Log</h2>
<div class="mb-3">
<a href="{{ url_for('index') }}" class="btn btn-secondary">Dashboard</a>
<a href="{{ url_for('devices') }}" class="btn btn-secondary">Devices verwalten</a>
<a href="{{ url_for('switches') }}" class="btn btn-secondary">Switches verwalten</a>
</div>
<table class="table table-bordered table-striped">
<thead class="table-dark">
<tr>
<th>Timestamp</th>
<th>Log</th>
</tr>
</thead>
<tbody>
{% for line in log_lines %}
<tr>
{% set parts = line.split(' ', 1) %}
<td>{{ parts[0] if parts|length > 0 else '' }}</td>
<td>{{ parts[1] if parts|length > 1 else line }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -2,7 +2,7 @@
<html>
<head>
<title>Einstellungen</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body class="p-5">

View File

@@ -2,7 +2,7 @@
<html>
<head>
<title>Switches</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body class="p-5">