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.
+23
-1
@@ -15,4 +15,26 @@ body {
|
||||
.card:hover {
|
||||
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>
|
||||
|
||||
+12
-7
@@ -5,14 +5,19 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}Mould King Control{% endblock %}</title>
|
||||
|
||||
<!-- Bootstrap 5.3 CSS CDN -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||
crossorigin="anonymous">
|
||||
<!-- Bootstrap 5.3 CSS CDN -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||
crossorigin="anonymous">
|
||||
|
||||
<!-- Eigenes CSS (optional – später erweitern) -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/custom.css') }}">
|
||||
<!-- 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') }}">
|
||||
|
||||
{% block head_extra %}{% endblock %}
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user