Kachel Log hinzugefügt

This commit is contained in:
hubobel 2026-06-20 19:01:33 +02:00
parent b90946956f
commit 36d5701b06
7 changed files with 130 additions and 6 deletions

28
app.py
View file

@ -398,7 +398,35 @@ def maintenance():
week=week
)
@app.route("/log")
def show_log():
if sys.platform.startswith("win"):
log_file = BASE_DIR / "logs" / "ing.log"
else:
log_file = Path.home() / "logs" / "ing.log"
if not log_file.exists():
return render_template(
"log.html",
log_content="Logdatei nicht gefunden."
)
with open(
log_file,
encoding="utf-8",
errors="replace"
) as f:
lines = f.readlines()
log_content = "".join(lines[-200:])
return render_template(
"log.html",
log_content=log_content
)
if __name__ == "__main__":
app.run(

View file

@ -259,4 +259,23 @@ text-decoration: underline;
font-weight: bold;
color: #ff6200;
margin-top: 0;
}
.log-viewer {
background: #1e1e1e;
color: #dcdcdc;
padding: 15px;
border-radius: 8px;
overflow-x: auto;
overflow-y: auto;
max-height: 700px;
font-family: Consolas, monospace;
font-size: 13px;
white-space: pre-wrap;
}

View file

@ -52,6 +52,7 @@
<a href="/">Dashboard</a>
<a href="/categories">Kategorien</a>
<a href="/maintenance">Wartung</a>
<a href="/log">Log</a>
</div>

View file

@ -52,9 +52,9 @@
<a href="/">Dashboard</a>
<a href="/categories">Kategorien</a>
<a href="/maintenance">Wartung</a>
<a href="/log">Log</a>
</div>
<div class="container">
```

View file

@ -52,6 +52,7 @@
<a href="/">Dashboard</a>
<a href="/categories">Kategorien</a>
<a href="/maintenance">Wartung</a>
<a href="/log">Log</a>
</div>

76
templates/log.html Normal file
View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>
Logdatei
</title>
<link rel="stylesheet"
href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<div class="header">
<div class="header-left">
<img class="logo-ing"
src="{{ url_for('static', filename='logo_ing.png') }}">
<div>
<div class="title">
ING Finanzen
</div>
<div class="subtitle">
Logdatei
</div>
</div>
</div>
<img class="logo-hintergasse"
src="{{ url_for('static', filename='logo_hintergasse.png') }}">
</div>
<div class="navbar">
<a href="/">Dashboard</a>
<a href="/categories">Kategorien</a>
<a href="/maintenance">Wartung</a>
<a href="/log">Log</a>
</div>
<div class="container">
<div class="card">
<h2>
Letzte 200 Logzeilen
</h2>
<pre class="log-viewer">{{ log_content }}</pre>
</div>
</div>
<div class="footer">
Hintergasse © 2026
</div>
</body>
</html>

View file

@ -49,11 +49,10 @@
<div class="navbar">
```
<a href="/">Dashboard</a>
<a href="/categories">Kategorien</a>
<a href="/maintenance">Wartung</a>
```
<a href="/">Dashboard</a>
<a href="/categories">Kategorien</a>
<a href="/maintenance">Wartung</a>
<a href="/log">Log</a>
</div>