Files
2026-06-12 14:38:57 +01:00

69 lines
3.7 KiB
HTML

{{define "layout"}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GoEncode</title>
<link rel="icon" type="image/png" href="/static/icon.png">
<link rel="stylesheet" href="/static/style.css">
<script>
// Global SSE listener setup early so components can attach to it
const sse = new EventSource('/api/sse');
window.sse = sse;
window.addEventListener('beforeunload', () => {
if (window.sse) {
window.sse.close();
}
});
</script>
</head>
<body>
<nav class="navbar">
<div class="navbar-brand" style="display: flex; align-items: center;">
<img src="/static/icon.png" alt="" style="height: 1.5rem; margin-right: 0.5rem; border-radius: 4px;">
Go<span>Encode</span>
<span style="font-size: 0.75rem; font-weight: normal; margin-left: 0.5rem; color: #888; background: #2a2a2a; padding: 2px 6px; border-radius: 4px;">{{if .Version}}v{{.Version}}{{else}}vdev{{end}}</span>
</div>
<div class="nav-links">
<a href="/" id="nav-dashboard">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
Dashboard
</a>
<a href="/folders" id="nav-folders">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"/></svg>
Watch Folders
</a>
<a href="/history" id="nav-history">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/></svg>
History
</a>
<a href="/logs" id="nav-logs">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"/><line x1="12" x2="20" y1="19" y2="19"/></svg>
Logs
</a>
{{if .AuthEnabled}}
<a href="/logout" style="color: #ff4444;">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" x2="9" y1="12" y2="12"/></svg>
Sign Out
</a>
{{end}}
</div>
</nav>
<div class="container">
{{template "content" .}}
</div>
<script>
// Set active nav link
const path = window.location.pathname;
if (path === "/") document.getElementById("nav-dashboard").classList.add("active");
else if (path.startsWith("/folders")) document.getElementById("nav-folders").classList.add("active");
else if (path.startsWith("/history")) document.getElementById("nav-history").classList.add("active");
else if (path.startsWith("/logs")) document.getElementById("nav-logs").classList.add("active");
</script>
</body>
</html>
{{end}}