Add jukebox_maker web app v1.0
Go web application for filling USB drives with media files. Runs in Docker on Unraid with /media, /mnt/usb, /config volumes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
44
web/templates/layout.html
Normal file
44
web/templates/layout.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{{define "layout"}}<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.Title}} — Jukebox Maker</title>
|
||||
<link rel="stylesheet" href="/static/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header class="page-header">
|
||||
<h1>🎵 Jukebox Maker</h1>
|
||||
<nav class="header-nav">
|
||||
<a href="/" class="header-action {{if eq .Page "dashboard"}}active{{end}}">Dashboard</a>
|
||||
<a href="/settings" class="header-action {{if eq .Page "settings"}}active{{end}}">Настройки</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="page-main">
|
||||
{{template "content" .}}
|
||||
</main>
|
||||
|
||||
<div class="toast-container" id="toastContainer"></div>
|
||||
|
||||
<script>
|
||||
function toast(msg, type) {
|
||||
const c = document.getElementById('toastContainer');
|
||||
const t = document.createElement('div');
|
||||
t.className = 'toast toast-' + (type === 'error' ? 'error' : 'ok');
|
||||
t.textContent = msg;
|
||||
c.appendChild(t);
|
||||
setTimeout(() => t.remove(), 4000);
|
||||
}
|
||||
function fmtBytes(b) {
|
||||
if (!b) return '—';
|
||||
if (b >= 1e12) return (b/1e12).toFixed(1) + ' ТБ';
|
||||
if (b >= 1e9) return (b/1e9).toFixed(1) + ' ГБ';
|
||||
if (b >= 1e6) return (b/1e6).toFixed(1) + ' МБ';
|
||||
return (b/1e3).toFixed(0) + ' КБ';
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user