-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (52 loc) · 1.67 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="apple-touch-icon" href="/favicon.ico" />
<link rel="image/vnd.microsoft.icon" rel="icon" href="/favicon.ico" />
<link rel="me" href="http://nparashuram.com" />
<link rel="canonical" href="http://nparashuram.com" />
<meta name="theme-color" content="#fff" />
<link href="main.css" rel="stylesheet" />
<title>OC835 - Cameras</title>
</head>
<body>
<div class="root">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
<script type="text/javascript">
const getCameras = async () => {
const cameras = JSON.parse(window.localStorage.getItem("cameras"));
if (cameras === null) {
const response = await fetch("api/cameras");
const data = await response.json();
window.localStorage.setItem("camera", JSON.stringify(data));
return data;
} else {
return cameras;
}
};
(function (window) {
getCameras().then((cameras) => {
document.getElementsByClassName("root")[0].innerHTML = cameras
.map(
(x) => `
<div class="card">
<a href="//${x}/img/video.mjpeg">
<img src="//${x}/img/video.mjpeg" />
</a>
</div>`
)
.join("\n");
});
})(window);
</script>
</body>
</html>