From 7557aabed7470f82879bc63e007a76edadef2307 Mon Sep 17 00:00:00 2001 From: Tamas Gal <tgal@km3net.de> Date: Mon, 30 Sep 2019 08:29:22 +0200 Subject: [PATCH] Add preliminary log viewer --- app/routes.py | 7 +++++++ app/templates/logs.html | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 app/templates/logs.html diff --git a/app/routes.py b/app/routes.py index 17b1d6a..890348f 100644 --- a/app/routes.py +++ b/app/routes.py @@ -151,6 +151,13 @@ def trigger(): return render_template('plots.html', plots=expand_wildcards(TRIGGER_PLOTS)) +@app.route('/logs.html') +@requires_auth +def logs(): + msg_logs = glob("logs/MSG*.log") + return render_template('logs.html', logs=msg_logs) + + @app.route('/plots/<path:filename>') @requires_auth def custom_static(filename): diff --git a/app/templates/logs.html b/app/templates/logs.html new file mode 100644 index 0000000..24ff332 --- /dev/null +++ b/app/templates/logs.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block logs %} + + <div class="container-fluid" id="logs"> + {% for filename in logs %} + <div class="row"> + <div class="col-md-12"> + {{ filename }} + </div> + </div> + {% endfor %} + </div> + +{% endblock %} -- GitLab