diff --git a/app/routes.py b/app/routes.py index 891df29c1c62495c709d88089550ab69b21c8485..c54ec7a93132b43376fe716041a05959638c762c 100644 --- a/app/routes.py +++ b/app/routes.py @@ -102,6 +102,12 @@ def index(): return render_template('plots.html', plots=expand_wildcards(PLOTS)) +@app.route('/plot_<plot>.html') +@requires_auth +def single_plot(plot): + return render_template('plot.html', plot=plot) + + @app.route('/ahrs.html') @requires_auth def ahrs(): diff --git a/app/static/css/main.css b/app/static/css/main.css index e570e9f1344f0852f30a2edbeadb5e1e2cee654a..7ce85f95873ac1244eacf713e5981c131ab8511d 100644 --- a/app/static/css/main.css +++ b/app/static/css/main.css @@ -33,3 +33,7 @@ img.plot { #logs a { margin: 5px; } + +#plot img { + margin: 0 auto +} diff --git a/app/templates/plot.html b/app/templates/plot.html new file mode 100644 index 0000000000000000000000000000000000000000..fe668dda485d25249400872b184e022e5e73be48 --- /dev/null +++ b/app/templates/plot.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} + +{% block main %} + + <div class="container-fluid" id="plot"> + <a href="plots/{{ plot }}.png"> + <img + class="img-responsive" + src="plots/{{ plot }}.png" + alt="{{ plot }}"/> + </a> + </div> + + <script type = "text/javascript"> + $(document).ready(function(){ + setInterval(function(){ + $("#plot").attr("src", "plots/{{ plot }}.png?"+new Date().getTime()); + }, 45000); + }); + </script> + +{% endblock %} diff --git a/app/templates/plots.html b/app/templates/plots.html index df86529a53ad5e5132aa4f3ee116672a53af3aba..8e1e77e7726e3ca9d97e5e620e1e4ba550617d7c 100644 --- a/app/templates/plots.html +++ b/app/templates/plots.html @@ -13,7 +13,7 @@ <div class="row"> {% for plot in row %} <div class="col-md-{{ (12/(row|length))|int }} plot-container"> - <a href="plots/{{ plot }}.png"> + <a href="plot_{{ plot }}.html"> <img id="{{ plot }}" class="plot img-responsive" src="plots/{{ plot }}.png"