This commit is contained in:
@@ -93,9 +93,11 @@ func main() {
|
||||
http.Error(w, "upstream error", http.StatusBadGateway)
|
||||
}
|
||||
|
||||
r.Handle("/static/*", http.StripPrefix("/static",
|
||||
http.FileServer(http.FS(ui.FS)),
|
||||
))
|
||||
r.Handle("/static/*",
|
||||
http.StripPrefix("/static",
|
||||
http.FileServer(http.FS(ui.StaticFS)),
|
||||
),
|
||||
)
|
||||
|
||||
r.Handle("/hls/*", http.StripPrefix("/hls", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.Contains(r.URL.Path, "..") {
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
<title>Streams</title>
|
||||
<link rel="preload" href="/static/fonts/inter-regular.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="/static/fonts/inter-semibold.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="/static/fonts/inter-extrabold.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="stylesheet" href="/static/fonts/inter.css">
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<div class="title">
|
||||
<h1 style="margin:0">🎬 Streams</h1>
|
||||
<h1 class="title-no-margin">🎬 Streams</h1>
|
||||
<div class="row">
|
||||
<input id="filter" placeholder="Filter (z. B. stream1)">
|
||||
<a href="/refresh" class="pill">Neu laden</a>
|
||||
|
||||
@@ -15,3 +15,4 @@ video{width:100%;border-radius:12px;background:#000}
|
||||
.meta{margin-top:10px;display:flex;gap:10px;align-items:center}
|
||||
input{width:220px;padding:8px 10px;border-radius:10px;border:1px solid #36446c;background:#0f1530;color:#e6eaf2}
|
||||
a{color:#90cdf4;text-decoration:none}
|
||||
.title-no-margin { margin: 0; }
|
||||
@@ -1,15 +1,3 @@
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('/static/fonts/inter-regular.woff2') format('woff2');
|
||||
font-weight: 400; font-style: normal; font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('/static/fonts/inter-semibold.woff2') format('woff2');
|
||||
font-weight: 600; font-style: normal; font-display: swap;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
src: url('/static/fonts/inter-extrabold.woff2') format('woff2');
|
||||
font-weight: 800; font-style: normal; font-display: swap;
|
||||
}
|
||||
@font-face { font-family: 'Inter'; src: url('/static/fonts/inter-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
|
||||
@font-face { font-family: 'Inter'; src: url('/static/fonts/inter-semibold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
|
||||
@font-face { font-family: 'Inter'; src: url('/static/fonts/inter-extrabold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
<title>{{.Name}}</title>
|
||||
<link rel="preload" href="/static/fonts/inter-regular.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="/static/fonts/inter-semibold.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="/static/fonts/inter-extrabold.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="stylesheet" href="/static/fonts/inter.css">
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<a href="/">← Zurück</a>
|
||||
<h1 style="margin:8px 0">{{.Name}} <span id="live" class="pill off">Offline</span></h1>
|
||||
<h1 class="title-no-margin">{{.Name}} <span id="live" class="pill off">Offline</span></h1>
|
||||
<div class="card">
|
||||
<video id="v" controls playsinline></video>
|
||||
<div class="meta">
|
||||
@@ -21,7 +22,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script defer src="/static/vendor/hls.min.js"></script>
|
||||
<script defer src="/static/js/hls.min.js"></script>
|
||||
<script defer src="/static/js/stream.js"></script>
|
||||
<script>window.__STREAM_NAME__={{.JSONName}};</script>
|
||||
</body>
|
||||
|
||||
@@ -3,5 +3,8 @@ package ui
|
||||
import "embed"
|
||||
|
||||
//go:embed *.html
|
||||
//go:embed static/**
|
||||
var FS embed.FS
|
||||
|
||||
// Embed nur echte Dateien; keine leeren Ordner!
|
||||
//go:embed static/**/*.js static/**/*.css static/**/*.woff2
|
||||
var StaticFS embed.FS
|
||||
|
||||
Reference in New Issue
Block a user