Skip to content

Commit 6d2f3ad

Browse files
committed
fix: show 404 page when recource wrong
1 parent 0f7f962 commit 6d2f3ad

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

adminforth/spa/src/components/BreadcrumbsWithButtons.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,8 @@
66
<slot></slot>
77
</div>
88
</div>
9-
<div class="flex items-center justify-between mb-3 flex-wrap gap-y-2 gap-2" v-if="coreStore.resourceColumnsError">
10-
<div class="p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400" role="alert">
11-
<span class="font-medium">{{ $t('Error!') }}</span>
12-
{{ coreStore.resourceColumnsError }}
13-
</div>
14-
</div>
15-
16-
<div class="absolute inset-0 z-50 bg-white " v-if="!coreStore.resource && !coreStore.isResourceFetching">
17-
<PageNotFound />
9+
<div v-if="!coreStore.resource && !coreStore.isResourceFetching" >
10+
<PageNotFound :errorMessage="coreStore.resourceColumnsError" />
1811
</div>
1912
</div>
2013

adminforth/spa/src/views/PageNotFound.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="mx-auto max-w-screen-sm text-center">
55
<h1 class="mb-4 text-7xl tracking-tight font-extrabold lg:text-9xl text-lightPrimary dark:text-darkPrimary">404</h1>
66
<p class="mb-4 text-3xl tracking-tight font-bold text-gray-900 md:text-4xl dark:text-white">{{ $t("Something's missing.") }}</p>
7-
<p class="mb-4 text-lg font-light text-gray-500 dark:text-gray-400">{{ $t("Sorry, we can't find that page. You'll find lots to explore on the home page.") }} </p>
7+
<p class="mb-4 text-lg font-light text-gray-500 dark:text-gray-400">{{ props.errorMessage ? $t(props.errorMessage) : $t("Sorry, we can't find that page. You'll find lots to explore on the home page.") }} </p>
88
<div class="flex justify-center">
99
<LinkButton to="/">{{ $t('Go back home') }}</LinkButton>
1010
</div>
@@ -17,4 +17,8 @@
1717
1818
import { LinkButton } from '@/afcl';
1919
20+
const props = defineProps<{
21+
errorMessage?: string
22+
}>();
23+
2024
</script>

0 commit comments

Comments
 (0)