350 lines
12 KiB
HTML
350 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Media Server Dashboard</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Outfit', sans-serif;
|
|
min-height: 100vh;
|
|
background:
|
|
radial-gradient(ellipse at 20% 0%, rgba(72, 49, 157, 0.4) 0%, transparent 50%),
|
|
radial-gradient(ellipse at 80% 100%, rgba(49, 130, 157, 0.3) 0%, transparent 50%),
|
|
linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 50%, #16213e 100%);
|
|
background-attachment: fixed;
|
|
padding: 2rem;
|
|
}
|
|
|
|
header {
|
|
text-align: center;
|
|
margin-bottom: 3rem;
|
|
animation: fadeInDown 0.6s ease-out;
|
|
}
|
|
|
|
@keyframes fadeInDown {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(-30px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
h1 {
|
|
font-size: 2.5rem;
|
|
font-weight: 700;
|
|
color: #fff;
|
|
letter-spacing: -0.5px;
|
|
text-shadow: 0 4px 30px rgba(100, 140, 255, 0.3);
|
|
}
|
|
|
|
h1 span {
|
|
background: linear-gradient(90deg, #64b3f4, #c2e59c);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
|
|
.subtitle {
|
|
color: rgba(255, 255, 255, 0.5);
|
|
font-weight: 300;
|
|
margin-top: 0.5rem;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
#appsGrid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 1.5rem;
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.card {
|
|
position: relative;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 2rem 1.5rem;
|
|
border-radius: 20px;
|
|
text-decoration: none;
|
|
color: #fff;
|
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
overflow: hidden;
|
|
min-height: 180px;
|
|
box-shadow:
|
|
0 4px 20px rgba(0, 0, 0, 0.3),
|
|
inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
animation: fadeInUp 0.5s ease-out backwards;
|
|
}
|
|
|
|
.card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.card:hover {
|
|
transform: translateY(-8px) scale(1.02);
|
|
box-shadow:
|
|
0 20px 40px rgba(0, 0, 0, 0.4),
|
|
inset 0 1px 0 rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
.card:active {
|
|
transform: translateY(-4px) scale(1.01);
|
|
}
|
|
|
|
@keyframes fadeInUp {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(30px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.status {
|
|
position: absolute;
|
|
top: 12px;
|
|
right: 12px;
|
|
width: 12px;
|
|
height: 12px;
|
|
border-radius: 50%;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
box-shadow: 0 0 10px currentColor;
|
|
transition: background 0.3s ease, box-shadow 0.3s ease;
|
|
}
|
|
|
|
.status.online {
|
|
background: #00ff88;
|
|
box-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
|
|
}
|
|
|
|
.status.offline {
|
|
background: #ff4757;
|
|
box-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
|
|
}
|
|
|
|
.card img {
|
|
width: 64px;
|
|
height: 64px;
|
|
object-fit: contain;
|
|
margin-bottom: 1rem;
|
|
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
|
|
transition: transform 0.3s ease;
|
|
}
|
|
|
|
.card:hover img {
|
|
transform: scale(1.1);
|
|
}
|
|
|
|
.card h2 {
|
|
font-size: 1.1rem;
|
|
font-weight: 500;
|
|
text-align: center;
|
|
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
.card .port {
|
|
font-size: 0.75rem;
|
|
opacity: 0.6;
|
|
margin-top: 0.3rem;
|
|
font-weight: 300;
|
|
}
|
|
|
|
.vnc-badge {
|
|
position: absolute;
|
|
top: 12px;
|
|
left: 12px;
|
|
background: rgba(0,0,0,0.4);
|
|
padding: 2px 6px;
|
|
border-radius: 4px;
|
|
font-size: 0.65rem;
|
|
opacity: 0.7;
|
|
}
|
|
|
|
.toast {
|
|
position: fixed;
|
|
bottom: 2rem;
|
|
left: 50%;
|
|
transform: translateX(-50%) translateY(100px);
|
|
background: rgba(0,0,0,0.9);
|
|
color: #fff;
|
|
padding: 1rem 1.5rem;
|
|
border-radius: 12px;
|
|
font-size: 0.95rem;
|
|
z-index: 1000;
|
|
opacity: 0;
|
|
transition: all 0.3s ease;
|
|
text-align: center;
|
|
max-width: 90%;
|
|
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
|
|
border: 1px solid rgba(255,255,255,0.1);
|
|
}
|
|
|
|
.toast.show {
|
|
opacity: 1;
|
|
transform: translateX(-50%) translateY(0);
|
|
}
|
|
|
|
.toast kbd {
|
|
background: #333;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
font-family: monospace;
|
|
margin: 0 2px;
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
body {
|
|
padding: 1rem;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 1.8rem;
|
|
}
|
|
|
|
#appsGrid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 1rem;
|
|
}
|
|
|
|
.card {
|
|
min-height: 150px;
|
|
padding: 1.5rem 1rem;
|
|
}
|
|
|
|
.card img {
|
|
width: 48px;
|
|
height: 48px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Media <span>Server</span></h1>
|
|
<p class="subtitle">Homelab Dashboard</p>
|
|
</header>
|
|
|
|
<div id="appsGrid"></div>
|
|
<div class="toast" id="toast"></div>
|
|
|
|
<script>
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
try {
|
|
const apps = [
|
|
{ name: "SabNZBd", port: 8080, icon: "https://raw.githubusercontent.com/walkxcode/dashboard-icons/master/svg/sabnzbd.svg", color: "#3498db" },
|
|
{ name: "qBittorrent", port: 8081, icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/New_qBittorrent_Logo.svg/1280px-New_qBittorrent_Logo.svg.png", color: "#1abc9c" },
|
|
{ name: "jDownloader", port: 8082, icon: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/webp/jdownloader2.webp", color: "#e67e22", vnc: true },
|
|
{ name: "meTube", port: 8083, icon: "https://raw.githubusercontent.com/walkxcode/dashboard-icons/master/svg/metube.svg", color: "#8c372f" },
|
|
{ name: "FileBot", port: 5800, icon: "https://raw.githubusercontent.com/walkxcode/dashboard-icons/master/svg/filebot.svg", color: "#f39c12" },
|
|
{ name: "Krusader", port: 6081, icon: "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/User-krusader.svg/3840px-User-krusader.svg.png", color: "#9b59b6", extra: "/vnc.html?resize=remote&host=IP&port=6081&&autoconnect=1", vnc: true },
|
|
{ name: "HandBrake", port: 7803, icon: "https://upload.wikimedia.org/wikipedia/commons/d/d9/HandBrake_Icon.png", color: "#95a5a6", vnc: true },
|
|
{ name: "MediaElch", port: 3001, protocol: "https", icon: "https://www.kvibes.de/img/mediaelch/icon.png", color: "#2ecc71", vnc: true },
|
|
{ name: "Unmanic", port: 8899, protocol: "http", icon: "https://docs.unmanic.app/img/icon.png", color: "#dfcea1" },
|
|
{ name: "MediaInfo", port: 5810, protocol: "http", icon: "https://upload.wikimedia.org/wikipedia/commons/1/19/MediaInfo_Logo.svg", color: "#dfcea1" }
|
|
];
|
|
|
|
const ip = window.location.hostname;
|
|
const grid = document.getElementById("appsGrid");
|
|
|
|
apps.forEach((app, index) => {
|
|
const protocol = app.protocol || "http";
|
|
let url = `${protocol}://${ip}:${app.port}`;
|
|
|
|
if (app.auth) {
|
|
const { username, password } = app.auth;
|
|
url = `${protocol}://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${ip}:${app.port}`;
|
|
}
|
|
|
|
if (app.extra) {
|
|
url += app.extra.replace("IP", ip);
|
|
} else {
|
|
url = url.replace(/\/?$/, "/");
|
|
}
|
|
|
|
const card = document.createElement("a");
|
|
card.className = "card";
|
|
card.target = "_blank";
|
|
card.rel = "noreferrer noopener";
|
|
card.href = url;
|
|
card.style.background = `linear-gradient(145deg, ${app.color}, ${adjustColor(app.color, -30)})`;
|
|
card.style.animationDelay = `${index * 0.08}s`;
|
|
|
|
// VNC-Apps: Zeige Hinweis beim Klick
|
|
if (app.vnc) {
|
|
card.addEventListener("click", () => {
|
|
showToast("Falls 'Connecting...' erscheint: <kbd>F5</kbd> oder <kbd>⌘R</kbd> drücken");
|
|
});
|
|
}
|
|
|
|
card.innerHTML = `
|
|
<div class="status" id="status-${app.name}"></div>
|
|
${app.vnc ? '<span class="vnc-badge">VNC</span>' : ''}
|
|
<img src="${app.icon}" alt="${app.name} Logo" loading="lazy">
|
|
<h2>${app.name}</h2>
|
|
<span class="port">:${app.port}</span>
|
|
`;
|
|
|
|
grid.appendChild(card);
|
|
|
|
// Status-Check
|
|
checkStatus(app, url);
|
|
});
|
|
} catch (error) {
|
|
console.error("Error initializing apps grid:", error);
|
|
}
|
|
});
|
|
|
|
function adjustColor(hex, amount) {
|
|
const num = parseInt(hex.replace('#', ''), 16);
|
|
const r = Math.min(255, Math.max(0, (num >> 16) + amount));
|
|
const g = Math.min(255, Math.max(0, ((num >> 8) & 0x00FF) + amount));
|
|
const b = Math.min(255, Math.max(0, (num & 0x0000FF) + amount));
|
|
return `#${(1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1)}`;
|
|
}
|
|
|
|
function checkStatus(app, url) {
|
|
const statusEl = document.getElementById(`status-${app.name}`);
|
|
|
|
fetch(url, { method: "HEAD", mode: "no-cors" })
|
|
.then(() => {
|
|
statusEl.classList.add('online');
|
|
})
|
|
.catch(() => {
|
|
statusEl.classList.add('offline');
|
|
});
|
|
}
|
|
|
|
function showToast(message) {
|
|
const toast = document.getElementById("toast");
|
|
toast.innerHTML = message;
|
|
toast.classList.add("show");
|
|
setTimeout(() => toast.classList.remove("show"), 4000);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|