49 lines
1.4 KiB
Go
49 lines
1.4 KiB
Go
// Copyright (C) 2022 Marius Schellenberger
|
|
|
|
package srv
|
|
|
|
import "html/template"
|
|
|
|
var (
|
|
index = template.Must(template.New("index").Parse(`<!doctype html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
body { padding: 0 150px 0 150px; font: 20px Helvetica, sans-serif; color: #333; }
|
|
article { display: block; text-align: left; margin: 0 auto; }
|
|
table { text-align: left; width: 100%; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<article>
|
|
<pre>
|
|
[v]: show video
|
|
[n]: skip file caching
|
|
[p]: preload file
|
|
[s]: stop preloading
|
|
</pre>
|
|
<table>
|
|
<tr><th style="width:100%;">Path</th><th>Options</th></tr>
|
|
<tr><td><a href="../">../</a></td><td></td></tr>
|
|
{{range $s := .Dirs -}}
|
|
<tr><td><a href="{{$s}}">{{$s}}</a></td><td></td></tr>
|
|
{{end -}}
|
|
{{range $s := .Files -}}
|
|
<tr><td><a id="{{$s.Anchor}}" href="{{$s.Name}}">{{$s.Name}}</a></td>
|
|
<td><a href="{{$s.Name}}?o=v">[v]</a> <a href="{{$s.Name}}?o=n">[n]</a> <a href="{{$s.Name}}?o=p">[p]</a> <a href="{{$s.Name}}?o=s">[s]</a> {{if ne $s.Status -1}}{{$s.Status}}%{{end}}</td></tr>
|
|
{{end -}}
|
|
</table>
|
|
</article>
|
|
</body>
|
|
</html>`))
|
|
video = template.Must(template.New("video").Parse(`<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta name="viewport" content="width=device-width">
|
|
</head>
|
|
<body>
|
|
<video id="video" style="width: 100%; height: 100%;" src="{{.}}" controls=""></video>
|
|
<script>document.getElementById("video").volume = 0.5;</script>
|
|
</body>
|
|
</html>`))
|
|
)
|