Skip to content

Commit b4f0202

Browse files
Align the event page to standard HousePortal CSS definitions
1 parent de07318 commit b4f0202

File tree

1 file changed

+13
-58
lines changed

1 file changed

+13
-58
lines changed

public/events.html

+13-58
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,34 @@
11
<!DOCTYPE html>
22
<html>
33
<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>
76
<script>
87
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');
549
}
5510
</script>
5611
<head>
5712
<title></title>
5813
</head>
5914
<body>
60-
<table class="sprkrtopcontainer">
15+
<table class="housetopcontainer">
6116
<tr><td>
62-
<table class="sprkrtop">
17+
<table class="housetop">
6318
<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>
7126
</tr>
7227
</table>
7328
</td></tr>
7429
</table>
7530
<h1><span class="hostname"></span></h1>
76-
<table class="sprkrevent" border="0">
31+
<table class="housewidetable eventlist" border="0">
7732
<tr>
7833
<th width="15%">Time</th>
7934
<th width="10%">Category</th>

0 commit comments

Comments
 (0)