|
| 1 | +<!DOCTYPE html> |
1 | 2 | <html> |
2 | 3 | <head> |
3 | 4 | <title> |
4 | 5 | Charlestown Power |
5 | 6 | </title> |
| 7 | +<style> |
| 8 | +body |
| 9 | +{ |
| 10 | +background-color:AntiqueWhite; |
| 11 | +} |
| 12 | +table, th, td |
| 13 | +{ |
| 14 | +border: 1px solid #CABFAF; |
| 15 | +} |
| 16 | +</style> |
6 | 17 | </head> |
7 | | -<body style="font-family:Verdana;"> |
8 | | - |
9 | | -<table border="1"><tr> |
10 | | -<td> |
11 | | -<table id="myTablePower" border="1"><tr> |
12 | | -<td id="sensors/power/0">Total power</td> |
13 | | -<td id="sensors/power/0"></td> |
| 18 | +<body> |
| 19 | +Current total current power consumption <span id="sensors/power/0"></span> |
| 20 | +<table> |
| 21 | +<tr> |
| 22 | +<td><table id="myTablePower"><tr> |
14 | 23 | </tr> |
15 | 24 | </table> |
16 | 25 | </td> |
17 | 26 | <td> |
18 | | -<table id="myTableTemp" border="1"></table> |
| 27 | +<table id="myTableTemp"></table> |
19 | 28 | </td> |
20 | 29 | <td> |
21 | | -<table id="myTableHumidity" border="1"></table> |
| 30 | +<table id="myTableHumidity"></table> |
22 | 31 | </td> |
23 | 32 | </tr></table> |
24 | | -<table id="myTableNO2" border="1"></table> |
25 | | -<table id="myTablePressure" border="1"></table> |
26 | | -<table id="myTableCO" border="1"></table> |
| 33 | +<table id="myTableNO2"></table> |
| 34 | +<table id="myTablePressure"></table> |
| 35 | +<table id="myTableCO"></table> |
27 | 36 | <P> |
28 | | -Total power consumed since start <div id="powercumulative"></div> |
| 37 | +Total power consumed since start <span id="powercumulative"></span> |
29 | 38 | <P> |
30 | 39 | <canvas id="mycanvas" width="500" height="100"></canvas> |
31 | 40 | <P> |
|
83 | 92 |
|
84 | 93 | var row=table.insertRow(0); |
85 | 94 | var cell=row.insertCell(0); |
| 95 | + cell.id = data.topic; |
| 96 | + var cell=row.insertCell(0); |
86 | 97 | cell.id = data.topic + "name"; |
87 | | - document.getElementById(data.topic + "name").style.textAlign="right"; |
| 98 | + document.getElementById(data.topic).style.textAlign="right"; |
88 | 99 | document.getElementById(data.topic + "name").innerHTML= data.topic; |
89 | | - var cell=row.insertCell(0); |
90 | | - cell.id = data.topic; |
91 | 100 | } |
92 | 101 | // new we know there is a target, update it |
93 | 102 | // console.log("Setting target " + data.topic + " to " + data.value); |
|
0 commit comments