Permalink
Browse files

make the ui a little more mobile friendly

  • Loading branch information...
sirleech committed May 9, 2012
1 parent e47ada4 commit e7cab6e6f21d3decc9e851597db96cc473675412
Showing with 9 additions and 10 deletions.
  1. +3 −3 log.py
  2. +3 −3 temperature.py
  3. +3 −4 web/index.html
View
6 log.py
@@ -16,9 +16,9 @@
try:
temp = temperature.getValue()
utils.logDataPoint("temperature.rrd",temp)
- temperature.makePngGraph(twelveHours,'web/temperature-12hrs.png')
- temperature.makePngGraph(twoHours,'web/temperature-2hrs.png')
- temperature.makePngGraph(oneWeek,'web/temperature-1wk.png')
+ temperature.makePngGraph('Temp C 12 Hours',twelveHours,'web/temperature-12hrs.png')
+ temperature.makePngGraph('Temp C 2 Hours',twoHours,'web/temperature-2hrs.png')
+ temperature.makePngGraph('Temp C 1 Week',oneWeek,'web/temperature-1wk.png')
temperature.exportToJson(temp)
# terminal output
View
@@ -37,7 +37,7 @@ def exportToJson(temperature):
f.write(json.dumps(reading))
f.close()
-def makePngGraph(graphTimeRange,outfile):
+def makePngGraph(title,graphTimeRange,outfile):
import rrdtool
import time
@@ -47,7 +47,7 @@ def makePngGraph(graphTimeRange,outfile):
rrdtool.graph(outfile,
'--start', str(nowUnixTime-graphTimeRange),
'--end', str(nowUnixTime),
- '--title','Temperature (degrees c)',
- '--width','700',
+ '--title',title,
+ '--width','400',
'DEF:myspeed=temperature.rrd:temp:AVERAGE',
'LINE2:myspeed#FF0000')
View
@@ -51,10 +51,9 @@ <h1 id="measure">(loading...)</h1>
<h1 id="temp">(loading...)</h1>
Last Updated <span id="lastUpdated"></span>
</div>
- <img id="temperature-2hrs" src="temperature-2hrs.png"/>2 hours
- <img id="temperature-12hrs" src="temperature-12hrs.png"/>12 hours
- <img id="temperature-1wk" src="temperature-1wk.png"/>1 week
- <br/>
+ <img id="temperature-2hrs" src="temperature-2hrs.png"/><br/>
+ <img id="temperature-12hrs" src="temperature-12hrs.png"/><br/>
+ <img id="temperature-1wk" src="temperature-1wk.png"/><br/>
</body>

0 comments on commit e7cab6e

Please sign in to comment.