# HG changeset patch # User Matt Johnston # Date 1432737463 -28800 # Node ID c490de0cf17e166caeae4cf3e9ff5079922b908a # Parent 317a1738f15cbfeb4aec0d98f0b6720650af5ed7 scaled zooming works diff -r 317a1738f15c -r c490de0cf17e 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 317a1738f15c -r c490de0cf17e 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 317a1738f15c -r c490de0cf17e 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.