# HG changeset patch # User Matt Johnston # Date 1432737463 -28800 # Node ID b3dc81bee5b3f8aea2d5f7657eaed29598491f63 # Parent 7689af9f56a8f175b4e621ed64d5bea0ff92fae3 scaled zooming works diff -r 7689af9f56a8 -r b3dc81bee5b3 web/templog.py --- a/web/templog.py Wed May 27 22:17:39 2015 +0800 +++ b/web/templog.py Wed May 27 22:37:43 2015 +0800 @@ -107,7 +107,8 @@ if 'zoom' in request.query: orig_start = end - timedelta(minutes=minutes) orig_end = end - xpos = int(request.query.x) + scale = float(request.query.scaledwidth) / config.GRAPH_WIDTH + xpos = int(request.query.x) / scale xpos -= config.GRAPH_LEFT_MARGIN * config.ZOOM if xpos >= 0 and xpos < config.GRAPH_WIDTH * config.ZOOM: diff -r 7689af9f56a8 -r b3dc81bee5b3 web/templog.wsgi --- a/web/templog.wsgi Wed May 27 22:17:39 2015 +0800 +++ b/web/templog.wsgi Wed May 27 22:37:43 2015 +0800 @@ -1,5 +1,6 @@ #from gevent import monkey; monkey.patch_all() + import os import sys # Change working directory so relative paths (and template lookup) work again diff -r 7689af9f56a8 -r b3dc81bee5b3 web/views/top.tpl --- a/web/views/top.tpl Wed May 27 22:17:39 2015 +0800 +++ b/web/views/top.tpl Wed May 27 22:37:43 2015 +0800 @@ -14,16 +14,29 @@ font-size: 70%; text-align: right; } + +#mainimage { + width: 100%; + max-width: {{graphwidth}}px; +} //--> +
- + +
Click to zoom in, click the left axis to zoom out. Source code for the Raspberry Pi controller and this web interface. Adjustments by phone.