add base url to all the redirects and links

This commit is contained in:
maxDorninger
2025-07-17 16:56:34 +02:00
parent ea7556de39
commit 5ff55f1a1d
20 changed files with 83 additions and 63 deletions

View File

@@ -9,53 +9,55 @@
Settings,
TvIcon
} from 'lucide-svelte';
import { base } from '$app/paths';
import { PUBLIC_VERSION } from '$env/static/public';
const data = {
navMain: [
{
title: 'Dashboard',
url: '/dashboard',
url: base+'/dashboard',
icon: Home,
isActive: true
},
{
title: 'TV',
url: '/dashboard/tv',
url: base+'/dashboard/tv',
icon: TvIcon,
isActive: true,
items: [
{
title: 'Add a show',
url: '/dashboard/tv/add-show'
url: base+'/dashboard/tv/add-show'
},
{
title: 'Torrents',
url: '/dashboard/tv/torrents'
url: base+'/dashboard/tv/torrents'
},
{
title: 'Requests',
url: '/dashboard/tv/requests'
url: base+'/dashboard/tv/requests'
}
]
},
{
title: 'Movies',
url: '/dashboard/movies',
url: base+'/dashboard/movies',
icon: Clapperboard,
isActive: true,
items: [
{
title: 'Add a movie',
url: '/dashboard/movies/add-movie'
url: base+'/dashboard/movies/add-movie'
},
{
title: 'Torrents',
url: '/dashboard/movies/torrents'
url: base+'/dashboard/movies/torrents'
},
{
title: 'Requests',
url: '/dashboard/movies/requests'
url: base+'/dashboard/movies/requests'
}
]
}
@@ -63,12 +65,12 @@
navSecondary: [
{
title: 'Notifications',
url: '/dashboard/notifications',
url: base+'/dashboard/notifications',
icon: Bell
},
{
title: 'Settings',
url: '/dashboard/settings',
url: base+'/dashboard/settings',
icon: Settings
},
{
@@ -83,7 +85,7 @@
},
{
title: 'About',
url: '/dashboard/about',
url: base+'/dashboard/about',
icon: Info
}
]
@@ -97,7 +99,6 @@
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
import type { ComponentProps } from 'svelte';
import logo from '$lib/images/logo.svg';
import { base } from '$app/paths';
let { ref = $bindable(null), ...restProps }: ComponentProps<typeof Sidebar.Root> = $props();
</script>

View File

@@ -8,6 +8,7 @@
import * as Tabs from '$lib/components/ui/tabs/index.js';
import { toast } from 'svelte-sonner';
import LoadingBar from '$lib/components/loading-bar.svelte';
import { base } from '$app/paths';
const apiUrl = env.PUBLIC_API_URL;
@@ -44,7 +45,7 @@
console.log('Received User Data: ', response);
errorMessage = 'Login successful! Redirecting...';
toast.success(errorMessage);
goto('/dashboard');
goto(base + '/dashboard');
} else {
let errorText = await response.text();
try {
@@ -184,7 +185,7 @@
<div class="grid gap-2">
<div class="flex items-center">
<Label for="password">Password</Label>
<a class="ml-auto inline-block text-sm underline" href="/login/forgot-password">
<a class="ml-auto inline-block text-sm underline" href="{base}/login/forgot-password">
Forgot your password?
</a>
</div>

View File

@@ -4,6 +4,7 @@
import { Skeleton } from '$lib/components/ui/skeleton';
import { Button } from '$lib/components/ui/button';
import { ChevronRight } from 'lucide-svelte';
import { base } from '$app/paths';
let {
media,
@@ -30,12 +31,12 @@
{/each}
{/if}
{#if isShow}
<Button class="md:col-start-2" variant="secondary" href="/dashboard/tv/add-show">
<Button class="md:col-start-2" variant="secondary" href="{base}/dashboard/tv/add-show">
More recommendations
<ChevronRight />
</Button>
{:else}
<Button class="md:col-start-2" variant="secondary" href="/dashboard/movies/add-movie">
<Button class="md:col-start-2" variant="secondary" href="{base}/dashboard/movies/add-movie">
More recommendations
<ChevronRight />
</Button>