Add NAS dashboard MVP: Docker mgmt, Gitea, Files, Terminal
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<script>
|
||||
let { page = $bindable("dashboard") } = $props();
|
||||
const links = [
|
||||
{ id: "dashboard", label: "Dashboard", icon: "■" },
|
||||
{ id: "docker", label: "Docker", icon: "▶" },
|
||||
{ id: "gitea", label: "Gitea", icon: "📁" },
|
||||
{ id: "files", label: "Files", icon: "📄" },
|
||||
{ id: "terminal", label: "Terminal", icon: ">" },
|
||||
];
|
||||
const external = [
|
||||
{ label: "Navidrome", href: "//:4533", port: 4533 },
|
||||
{ label: "Immich", href: "//:2283", port: 2283 },
|
||||
{ label: "Emby", href: "//:8096", port: 8096 },
|
||||
{ label: "Gitea Web", href: "//:3300", port: 3300 },
|
||||
];
|
||||
function extHref(port) {
|
||||
return `${location.protocol}//${location.hostname}:${port}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<aside class="w-56 bg-gray-50 border-r border-gray-200 h-screen flex flex-col p-4 shrink-0">
|
||||
<h1 class="text-lg font-bold mb-6">NAS Dashboard</h1>
|
||||
<nav class="flex flex-col gap-1">
|
||||
{#each links as link}
|
||||
<button
|
||||
class="text-left px-3 py-2 rounded text-sm {page === link.id ? 'bg-blue-100 text-blue-700 font-medium' : 'hover:bg-gray-100 text-gray-700'}"
|
||||
onclick={() => page = link.id}
|
||||
>
|
||||
<span class="mr-2">{@html link.icon}</span>{link.label}
|
||||
</button>
|
||||
{/each}
|
||||
</nav>
|
||||
<hr class="my-4 border-gray-200" />
|
||||
<p class="text-xs text-gray-400 mb-2 px-3">External Services</p>
|
||||
<nav class="flex flex-col gap-1">
|
||||
{#each external as svc}
|
||||
<a href={extHref(svc.port)} target="_blank" class="text-left px-3 py-2 rounded text-sm hover:bg-gray-100 text-gray-700">
|
||||
{svc.label} ↗
|
||||
</a>
|
||||
{/each}
|
||||
</nav>
|
||||
</aside>
|
||||
Reference in New Issue
Block a user