update for log files viewer

This commit is contained in:
2026-02-14 11:25:08 +01:00
parent e5d5d74523
commit 8ddeb0a1f8
18 changed files with 43 additions and 12 deletions
Vendored
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -292,6 +292,7 @@ def admin_logs(date=None):
date = datetime.now().strftime('%d') date = datetime.now().strftime('%d')
today = datetime.now().strftime('%Y-%m') # ← Hier definieren! today = datetime.now().strftime('%Y-%m') # ← Hier definieren!
current_month = datetime.now().strftime('%Y-%m')
log_dir = os.path.join(LOG_DIR, today) log_dir = os.path.join(LOG_DIR, today)
@@ -322,7 +323,7 @@ def admin_logs(date=None):
logs=log_content, logs=log_content,
date=date, date=date,
dates=dates, dates=dates,
today=today) # ← Hier mit übergeben! today=current_month)
@app.route('/configs/<path:filename>') @app.route('/configs/<path:filename>')
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+22
View File
@@ -16,3 +16,25 @@ body {
transform: translateY(-4px); transform: translateY(-4px);
box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important; box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
} }
/* Syntax-Highlighting */
pre code.hljs {
background: #1e1e1e;
color: #d4d4d4;
padding: 1rem;
border-radius: 0.5rem;
display: block;
overflow-x: auto;
white-space: pre-wrap;
word-wrap: break-word;
}
.hljs-comment, .hljs-quote { color: #6a9955; }
.hljs-keyword, .hljs-selector-tag { color: #569cd6; }
.hljs-string, .hljs-regexp { color: #ce9178; }
.hljs-number { color: #b5cea8; }
.hljs-title { color: #dcdcaa; }
.hljs-function { color: #dcdcaa; }
.hljs-built_in { color: #4ec9b0; }
.hljs-symbol { color: #d16969; }
.hljs-literal { color: #d16969; }
+5 -2
View File
@@ -4,7 +4,8 @@
{% block content %} {% block content %}
<div class="container my-5"> <div class="container my-5">
<h1>Logs {{ date }}. {{ today[:4] }}-{{ today[5:] }}</h1>
<h1>Logs {{ date }}. {{ today }}</h1>
<div class="mb-4"> <div class="mb-4">
<label for="date-select" class="form-label">Tag auswählen:</label> <label for="date-select" class="form-label">Tag auswählen:</label>
@@ -15,8 +16,10 @@
</select> </select>
</div> </div>
<pre class="bg-dark text-light p-4 rounded" style="max-height: 70vh; overflow-y: auto; font-size: 0.95rem; white-space: pre-wrap;"> <pre class="bg-dark text-light p-4 rounded" style="max-height: 70vh; overflow-y: auto; font-size: 0.95rem;">
<code class="language-log">
{{ logs | safe }} {{ logs | safe }}
</code>
</pre> </pre>
<a href="{{ url_for('admin') }}" class="btn btn-secondary mt-3">Zurück zum Admin</a> <a href="{{ url_for('admin') }}" class="btn btn-secondary mt-3">Zurück zum Admin</a>
+5
View File
@@ -11,6 +11,11 @@
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
crossorigin="anonymous"> crossorigin="anonymous">
<!-- highlight.js für Syntax-Highlighting in Logs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/styles/default.min.css" integrity="sha512-3xLMEigMNYLDJLAgaGlDSxpGykyb+nQnJBzbkQy2a0gyVKL2ZpNOPIj1rD8IPFaJbwAgId/atho1+LBpWu5DhA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/highlight.min.js" integrity="sha512-TDKKr+IvoqZnPzc3l35hdjpHD0m+b2EC2SrLEgKDRWpxf2rFCxemkgvJ5kfU48ip+Y+m2XVKyOCD85ybtlZDmw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>hljs.highlightAll();</script>
<!-- Eigenes CSS (optional später erweitern) --> <!-- Eigenes CSS (optional später erweitern) -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/custom.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/custom.css') }}">