From ae98811c232973a727d0b0ec1e62814b3002d726 Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Sun, 22 Feb 2026 16:59:33 +0800 Subject: [PATCH] Smart LAN routing for Navidrome sidebar link --- dashboard/frontend/src/components/Sidebar.svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dashboard/frontend/src/components/Sidebar.svelte b/dashboard/frontend/src/components/Sidebar.svelte index 40628e0..68d38bf 100644 --- a/dashboard/frontend/src/components/Sidebar.svelte +++ b/dashboard/frontend/src/components/Sidebar.svelte @@ -21,18 +21,18 @@ } const external = [ - { label: "Navidrome", href: "https://music.jimmygan.com", icon: "music" }, + { label: "Navidrome", port: 4533, remoteHref: "https://music.jimmygan.com", icon: "music" }, { label: "Immich", port: 2283, icon: "image" }, { label: "Jellyfin", port: 8096, icon: "play" }, { label: "Gitea Web", port: 3300, icon: "git" }, { label: "Speedtest", port: 8080, icon: "speedtest" }, ]; - function extHref(port) { - if (lanReachable && location.hostname !== LAN_IP) { - return `http://${LAN_IP}:${port}`; - } - return `${location.protocol}//${location.hostname}:${port}`; + function extHref(svc) { + if (lanReachable && svc.port) return `http://${LAN_IP}:${svc.port}`; + if (svc.remoteHref) return svc.remoteHref; + if (svc.port) return `${location.protocol}//${location.hostname}:${svc.port}`; + return svc.href; } function navigate(id) { @@ -95,7 +95,7 @@

Services

{#each external as svc}