update for log files viewer
This commit is contained in:
@@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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; }
|
||||||
@@ -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;">
|
||||||
{{ logs | safe }}
|
<code class="language-log">
|
||||||
|
{{ 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>
|
||||||
|
|||||||
+12
-7
@@ -5,14 +5,19 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>{% block title %}Mould King Control{% endblock %}</title>
|
<title>{% block title %}Mould King Control{% endblock %}</title>
|
||||||
|
|
||||||
<!-- Bootstrap 5.3 CSS CDN -->
|
<!-- Bootstrap 5.3 CSS CDN -->
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||||
crossorigin="anonymous">
|
crossorigin="anonymous">
|
||||||
|
|
||||||
<!-- Eigenes CSS (optional – später erweitern) -->
|
<!-- highlight.js für Syntax-Highlighting in Logs -->
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/custom.css') }}">
|
<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 %}
|
{% block head_extra %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user