From d7b8dbb2b53ca7aee76966681b159a67862bd5c0 Mon Sep 17 00:00:00 2001 From: Sebastian Jeltsch Date: Sat, 17 May 2025 21:10:19 +0200 Subject: [PATCH] Fix admin dash's short-cut links when on /_/admin. #61 --- .../js/admin/src/components/IndexPage.tsx | 17 +++++++++-------- .../js/admin/src/components/NavBar.tsx | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/trailbase-assets/js/admin/src/components/IndexPage.tsx b/trailbase-assets/js/admin/src/components/IndexPage.tsx index 9089fca5..cb0f8cca 100644 --- a/trailbase-assets/js/admin/src/components/IndexPage.tsx +++ b/trailbase-assets/js/admin/src/components/IndexPage.tsx @@ -64,36 +64,37 @@ type Element = { href: string; }; +const BASE = import.meta.env.BASE_URL; const elements = [ { icon: TbDatabase, content: "Browse, create or alter your Tables, Indexes, and Views.", - href: "table", + href: `${BASE}/table`, }, { icon: TbEdit, content: "Untethered script access letting you execute arbitrary SQL.", - href: "editor", + href: `${BASE}/editor`, }, { icon: TbChartDots3, content: "Visualize Database Schema as Entity-Relationship-Diagram", - href: "erd", + href: `${BASE}/erd`, }, { icon: TbUsers, content: "Browse and manage your application's user registry.", - href: "auth", + href: `${BASE}/auth`, }, { icon: TbTimeline, content: "Access logs for your application", - href: "logs", + href: `${BASE}/logs`, }, { icon: TbSettings, content: "Server settings", - href: "settings", + href: `${BASE}/settings`, }, ] as Element[]; @@ -173,12 +174,12 @@ export function IndexPage() { + {tooltip} );