diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-11-08 09:43:34 +0200 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-11-08 09:43:34 +0200 |
| commit | 740935e8936df84a73f89eb5512355584e10fe11 (patch) | |
| tree | 16866f094e362e30bc0d40fe843f0a4f2924650b | |
| parent | 06649f30a429222fd564020257340c63245bc675 (diff) | |
Add timestamp support
| -rw-r--r-- | geshem.py | 4 | ||||
| -rw-r--r-- | templates/index.html | 6 |
2 files changed, 9 insertions, 1 deletions
@@ -34,9 +34,11 @@ def home(): try: latests = redis.pipeline().get('latest_140').get('latest_280').execute() latest_140, latest_280 = map(lambda x: x.decode(), latests) + ts = datetime.strptime(latest_280, '%Y%m%d_%H%M%S') except ConnectionError: latest_140, latest_280 = 'dev', 'dev' - return render_template('index.html', latest_140=latest_140, latest_280=latest_280) + ts = datetime.now() + return render_template('index.html', ts=ts, latest_140=latest_140, latest_280=latest_280) @app.after_request def update_images(response): diff --git a/templates/index.html b/templates/index.html index 6e36f61..1b7e034 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,11 +8,17 @@ <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.2/mapbox-gl.css' rel='stylesheet' /> <style> body { margin:0; padding:0; } + #datetime { position:fixed; color: #ee8877; z-index: 100; font-family: monospace; padding: 5px; } + #date { font-size: 0.7em; } #map { position:absolute; top:0; bottom:0; width:100%; } </style> </head> <body> +<div id='datetime'> + <div id='date'>{{ ts.strftime('%d/%m/%Y') }}</div> + <div id='hour'>{{ ts.strftime('%H:%M') }}</div> +</div> <div id='map'></div> <script> |
