-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (30 loc) · 981 Bytes
/
index.html
File metadata and controls
43 lines (30 loc) · 981 Bytes
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
42
43
<html>
<head>
<title>v4l2_web_ctl</title>
<script src="/static/jquery.js"></script>
</head>
<body>
<div id="ctls">
</div>
<script>
$.get("/get",(data)=>{
ctls = JSON.parse(data)
console.log(ctls)
out = "<table>"
for (c in ctls){
//for (cc in ctls[c]) out+= `${cc} `
if ("min" in ctls[c]) out += `<tr><td>${c}</td>
<td><input type="range" min="${ctls[c]['min']}" max="${ctls[c]['max']}" value="${ctls[c]['value']}" id="${c}"></td><td id="${c}_val">${ctls[c]['value']}</td></tr>`
}
$("#ctls").html(out)
$(":input").change((e)=>{
ctl = e['target']['id']
val = $(`#${ctl}`).val()
$.get(`/set?${ctl}=${val}`,(d)=>console.log(d))
$(`#${ctl}_val`).html(val)
})
out+="</table>"
})
</script>
</body>
</html>