fix system link in container sheet when serving on subpath

This commit is contained in:
henrygd
2025-10-18 20:02:58 -04:00
parent 77ed90cb4a
commit f4abbd1a5b

View File

@@ -28,8 +28,9 @@ import { Button } from "@/components/ui/button"
import { $allSystemsById } from "@/lib/stores" import { $allSystemsById } from "@/lib/stores"
import { MaximizeIcon, RefreshCwIcon } from "lucide-react" import { MaximizeIcon, RefreshCwIcon } from "lucide-react"
import { Separator } from "../ui/separator" import { Separator } from "../ui/separator"
import { Link } from "../router" import { $router, Link } from "../router"
import { listenKeys } from "nanostores" import { listenKeys } from "nanostores"
import { getPagePath } from "@nanostores/router"
const syntaxTheme = "github-dark-dimmed" const syntaxTheme = "github-dark-dimmed"
@@ -327,7 +328,7 @@ function ContainerSheet({ sheetOpen, setSheetOpen, activeContainer }: { sheetOpe
<SheetHeader> <SheetHeader>
<SheetTitle>{container.name}</SheetTitle> <SheetTitle>{container.name}</SheetTitle>
<SheetDescription className="flex items-center gap-2"> <SheetDescription className="flex items-center gap-2">
<Link className="hover:underline" href={`/system/${container.system}`}>{$allSystemsById.get()[container.system]?.name ?? ""}</Link> <Link className="hover:underline" href={getPagePath($router, "system", { id: container.system })}>{$allSystemsById.get()[container.system]?.name ?? ""}</Link>
<Separator orientation="vertical" className="h-2.5 bg-muted-foreground opacity-70" /> <Separator orientation="vertical" className="h-2.5 bg-muted-foreground opacity-70" />
{container.status} {container.status}
<Separator orientation="vertical" className="h-2.5 bg-muted-foreground opacity-70" /> <Separator orientation="vertical" className="h-2.5 bg-muted-foreground opacity-70" />