-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainT.html
41 lines (35 loc) · 1.04 KB
/
mainT.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<head>
<script>
function httpGetAsync(theUrl, callback)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp.responseText);
}
xmlHttp.open("GET", theUrl, true); // true for asynchronous
xmlHttp.send(null);
};
function dummy_callback(){};
function async_action_target_action_dt(target,action,dt){
// target is dummy for now
return httpGetAsync("/" + target + "_"
+ action + dt + "s", dummy_callback);
};
</script>
</head>
<body>
{% for device in Appliances %}
<div>{{ device['idname'] }}
{% for op in device['timeActionsSym'] %}
<span>
<a href="#" onclick="async_action_target_action_dt('{{ device['idname'] }}', 'open', '{{ op }}')">
open {{ op }}s </a> |
</span>
<span>
<a href="#" onclick="async_action_target_action_dt('{{ device['idname'] }}', 'close', '{{ op }}')"> close {{ op }}s </a> |
</span>
{% end for %}
</div>
{% end for %}
</body>