|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <html>
|
3 | 3 | <head>
|
4 |
| -<link rel=stylesheet type="text/css" |
5 |
| - href="/sprinkler/sprinkler.css" title="Sprinkler"> |
6 |
| -<script src="/sprinkler/sprinklerlib.js"></script> |
| 4 | +<link rel=stylesheet type="text/css" href="/house.css" title="House"> |
| 5 | +<script src="/events.js"></script> |
7 | 6 | <script>
|
8 | 7 | window.onload = function() {
|
9 |
| - |
10 |
| - function newColumn (text, index) { |
11 |
| - var column = document.createElement("td"); |
12 |
| - column.innerHTML = text; |
13 |
| - if (index & 1) column.setAttribute('bgcolor', '#E0E0E0'); |
14 |
| - return column; |
15 |
| - } |
16 |
| - |
17 |
| - var lastEventId = null; |
18 |
| - |
19 |
| - function updateEvents() { |
20 |
| - |
21 |
| - sprinklerEvents (function (response) { |
22 |
| - |
23 |
| - lastEventId = response.sprinkler.latest; |
24 |
| - |
25 |
| - var table = document.getElementsByClassName ('sprkrevent')[0]; |
26 |
| - for (var i = table.childNodes.length - 1; i > 1; i--) { |
27 |
| - table.removeChild(table.childNodes[i]); |
28 |
| - } |
29 |
| - for (var i = response.sprinkler.events.length-1; i >= 0; --i) { |
30 |
| - var event = response.sprinkler.events[i]; |
31 |
| - var timestamp = new Date(event[0]); |
32 |
| - var row = document.createElement("tr"); |
33 |
| - row.appendChild(newColumn(timestamp.toLocaleString(), i)); |
34 |
| - row.appendChild(newColumn(event[1], i)); |
35 |
| - row.appendChild(newColumn(event[2], i)); |
36 |
| - row.appendChild(newColumn(event[3], i)); |
37 |
| - row.appendChild(newColumn(event[4], i)); |
38 |
| - table.appendChild(row); |
39 |
| - } |
40 |
| - }); |
41 |
| - } |
42 |
| - |
43 |
| - function checkEvents () { |
44 |
| - sprinklerLatestEvent (function (latest) { |
45 |
| - if ((lastEventId == null) || (lastEventId != latest)) { |
46 |
| - updateEvents (); |
47 |
| - } |
48 |
| - }); |
49 |
| - } |
50 |
| - |
51 |
| - sprinklerUpdate(); |
52 |
| - updateEvents(); |
53 |
| - setInterval (function() {checkEvents()}, 1000); |
| 8 | + eventStart('/sprinkler'); |
54 | 9 | }
|
55 | 10 | </script>
|
56 | 11 | <head>
|
57 | 12 | <title></title>
|
58 | 13 | </head>
|
59 | 14 | <body>
|
60 |
| - <table class="sprkrtopcontainer"> |
| 15 | + <table class="housetopcontainer"> |
61 | 16 | <tr><td>
|
62 |
| - <table class="sprkrtop"> |
| 17 | + <table class="housetop"> |
63 | 18 | <tr>
|
64 |
| - <td><a class="sprkrtopitem" id="portal" href="/index.html">Portal</a></td> |
65 |
| - <td><A class="sprkrtopitem" HREF="/sprinkler/index.html">Sprinkler</A></td> |
66 |
| - <td><A class="sprkrtopitem" HREF="/sprinkler/zones.html">Zones</A></td> |
67 |
| - <td><A class="sprkrtopitem" HREF="/sprinkler/programs.html">Programs</A></td> |
68 |
| - <td><span class="sprkrtopcurrent">Events</span></td> |
69 |
| - <td><A class="sprkrtopitem" HREF="/sprinkler/valves.html">Valves</A></td> |
70 |
| - <td><A class="sprkrtopitem" HREF="/sprinkler/config.html">Config</A></td> |
| 19 | + <td><a id="portal" href="/index.html">Portal</a></td> |
| 20 | + <td><A HREF="/sprinkler/index.html">Sprinkler</A></td> |
| 21 | + <td><A HREF="/sprinkler/zones.html">Zones</A></td> |
| 22 | + <td><A HREF="/sprinkler/programs.html">Programs</A></td> |
| 23 | + <td><span>Events</span></td> |
| 24 | + <td><A HREF="/sprinkler/valves.html">Valves</A></td> |
| 25 | + <td><A HREF="/sprinkler/config.html">Config</A></td> |
71 | 26 | </tr>
|
72 | 27 | </table>
|
73 | 28 | </td></tr>
|
74 | 29 | </table>
|
75 | 30 | <h1><span class="hostname"></span></h1>
|
76 |
| - <table class="sprkrevent" border="0"> |
| 31 | + <table class="housewidetable eventlist" border="0"> |
77 | 32 | <tr>
|
78 | 33 | <th width="15%">Time</th>
|
79 | 34 | <th width="10%">Category</th>
|
|
0 commit comments