update for log files viewer
This commit is contained in:
@@ -292,6 +292,7 @@ def admin_logs(date=None):
|
||||
date = datetime.now().strftime('%d')
|
||||
|
||||
today = datetime.now().strftime('%Y-%m') # ← Hier definieren!
|
||||
current_month = datetime.now().strftime('%Y-%m')
|
||||
|
||||
log_dir = os.path.join(LOG_DIR, today)
|
||||
|
||||
@@ -322,7 +323,7 @@ def admin_logs(date=None):
|
||||
logs=log_content,
|
||||
date=date,
|
||||
dates=dates,
|
||||
today=today) # ← Hier mit übergeben!
|
||||
today=current_month)
|
||||
|
||||
|
||||
@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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,3 +16,25 @@ body {
|
||||
transform: translateY(-4px);
|
||||
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; }
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="container my-5">
|
||||
<h1>Logs – {{ date }}. {{ today[:4] }}-{{ today[5:] }}</h1>
|
||||
|
||||
<h1>Logs – {{ date }}. {{ today }}</h1>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="date-select" class="form-label">Tag auswählen:</label>
|
||||
@@ -15,8 +16,10 @@
|
||||
</select>
|
||||
</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;">
|
||||
{{ logs | safe }}
|
||||
<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 }}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<a href="{{ url_for('admin') }}" class="btn btn-secondary mt-3">Zurück zum Admin</a>
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||
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) -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/custom.css') }}">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user