initial commit
This commit is contained in:
commit
3053f89410
39 changed files with 4567 additions and 0 deletions
48
pkg/srv/templates.go
Normal file
48
pkg/srv/templates.go
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
// Copyright (C) 2022 Marius Schellenberger
|
||||
|
||||
package srv
|
||||
|
||||
import "html/template"
|
||||
|
||||
var (
|
||||
index = template.Must(template.New("index").Parse(`<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body { text-align: center; padding: 0 150px 0 150px; font: 20px Helvetica, sans-serif; color: #333; }
|
||||
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
|
||||
table { text-align: left; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<article>
|
||||
<pre>
|
||||
[v]: show video
|
||||
[n]: skip file caching
|
||||
[p]: preload file
|
||||
</pre>
|
||||
<table>
|
||||
<tr><th>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 href="{{$s}}">{{$s}}</a></td>
|
||||
<td><a href="{{$s}}?v=t">[v]</a> <a href="{{$s}}?n=t">[n]</a> <a href="{{$s}}?p=t">[p]</a></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>`))
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue