streamwatcher/templates/moments.html
2020-10-25 11:42:56 +01:00

39 lines
No EOL
1.2 KiB
HTML

{{template "base" .}}
{{define "head"}}
<script src="/static/js/moments.js"></script>
<link rel="stylesheet" href="/static/css/slider.css">
{{end}}
{{define "content"}}
<img src="#" id="moment_current_image">
<div class="flex-row">
<input type="button" onclick="play_moment()" value="Play">
<input type="button" onclick="pause_moment()" value="Pause">
<input type="range" min="0" max="1" value="0" class="moment-range" id="moment_slider">
</div>
<table class="pure-table pure-table-horizontal pure-table-striped">
<thead>
<th>Moment</th>
<th>Time</th>
<th>#</th>
<th>View</th>
</thead>
<tbody>
{{range $i, $moments := .Moments}}
<tr>
<td>{{$i}}</td>
<td>{{index $moments 0}}</td>
<td>{{len $moments}}</td>
<td><a href="#" onclick="set_current_moment({{$i}})">View</a></td>
</tr>
{{end}}
</tbody>
</table>
<script>
let streamName = "{{.Stream.Name}}";
let watchAreaName = "{{.WatchArea.Name}}";
let interval = {{.Stream.MotionInterval}};
let moments = {{.MomentsJSON}}
</script>
{{end}}