Browse Source

refactor(gui): move 404 page

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3685/head
Pranav C 2 years ago
parent
commit
07e248dc69
  1. 1
      packages/nc-gui/components.d.ts
  2. 4
      packages/nc-gui/composables/useProject.ts
  3. 7
      packages/nc-gui/pages/error/404.vue

1
packages/nc-gui/components.d.ts vendored

@ -195,6 +195,7 @@ declare module '@vue/runtime-core' {
MdiUpload: typeof import('~icons/mdi/upload')['default']
MdiUploadOutline: typeof import('~icons/mdi/upload-outline')['default']
MdiViewListOutline: typeof import('~icons/mdi/view-list-outline')['default']
MdiWarning: typeof import('~icons/mdi/warning')['default']
MdiWhatsapp: typeof import('~icons/mdi/whatsapp')['default']
MdiXml: typeof import('~icons/mdi/xml')['default']
MiCircleWarning: typeof import('~icons/mi/circle-warning')['default']

4
packages/nc-gui/composables/useProject.ts

@ -109,9 +109,9 @@ const [setup, use] = useInjectionState((_projectId?: MaybeRef<string>) => {
try {
const baseData = await api.public.sharedBaseGet(route.params.projectId as string)
project.value = await api.project.read(baseData.project_id!)
} catch (e) {
} catch (e: any) {
if (e?.response?.status === 404) {
return router.push('/404')
return router.push('/error/404')
}
throw e
}

7
packages/nc-gui/pages/404.vue → packages/nc-gui/pages/error/404.vue

@ -2,13 +2,16 @@
import { definePageMeta } from '#imports'
definePageMeta({
title: 'Page Not Found',
requiresAuth: false,
public: true,
})
</script>
<template>
<div class="w-full h-[300px] flex justify-center items-center text-4xl">
<h1 class="text-gray-400">Page Not Found</h1>
<div class="text-gray-400 flex gap-2 items-center">
<MdiWarning />
Page Not Found
</div>
</div>
</template>
Loading…
Cancel
Save