From 11e655ca77827f3d1be9bfeebbe245987dfb8370 Mon Sep 17 00:00:00 2001 From: Dixsie Wolmers Date: Wed, 26 Aug 2020 14:53:01 -0500 Subject: Add 404 page - User will be redirected to 404 page when navigating to undefined routes Signed-off-by: Dixsie Wolmers Change-Id: I5d7bbcfdd279b6f6c993370e3adb39a516dbb1ba --- src/router/index.js | 97 +++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 44 deletions(-) (limited to 'src/router') diff --git a/src/router/index.js b/src/router/index.js index 4f66ae73..68340452 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -17,6 +17,7 @@ import Firmware from '@/views/Configuration/Firmware'; import Kvm from '@/views/Control/Kvm'; import ManagePowerUsage from '@/views/Control/ManagePowerUsage'; import NetworkSettings from '@/views/Configuration/NetworkSettings'; +import PageNotFound from '@/views/PageNotFound'; import RebootBmc from '@/views/Control/RebootBmc'; import ServerLed from '@/views/Control/ServerLed'; import SerialOverLan from '@/views/Control/SerialOverLan'; @@ -33,6 +34,54 @@ Vue.use(VueRouter); // Meta title is translated using i18n in App.vue and PageTitle.Vue // Example meta: {title: 'appPageTitle.overview'} const routes = [ + { + path: '/login', + component: LoginLayout, + children: [ + { + path: '', + name: 'login', + component: Login, + meta: { + title: 'appPageTitle.login' + } + }, + { + path: '/change-password', + name: 'change-password', + component: ChangePassword, + meta: { + title: 'appPageTitle.changePassword', + requiresAuth: true + } + } + ] + }, + { + path: '/console', + component: ConsoleLayout, + meta: { + requiresAuth: true + }, + children: [ + { + path: 'serial-over-lan-console', + name: 'serial-over-lan-console', + component: SerialOverLanConsole, + meta: { + title: 'appPageTitle.serialOverLan' + } + }, + { + path: 'kvm', + name: 'kvm-console', + component: KvmConsole, + meta: { + title: 'appPageTitle.kvm' + } + } + ] + }, { path: '/', meta: { @@ -191,53 +240,13 @@ const routes = [ meta: { title: 'appPageTitle.unauthorized' } - } - ] - }, - { - path: '/login', - component: LoginLayout, - children: [ - { - path: '', - name: 'login', - component: Login, - meta: { - title: 'appPageTitle.login' - } - }, - { - path: '/change-password', - name: 'change-password', - component: ChangePassword, - meta: { - title: 'appPageTitle.changePassword', - requiresAuth: true - } - } - ] - }, - { - path: '/console', - component: ConsoleLayout, - meta: { - requiresAuth: true - }, - children: [ - { - path: 'serial-over-lan-console', - name: 'serial-over-lan-console', - component: SerialOverLanConsole, - meta: { - title: 'appPageTitle.serialOverLan' - } }, { - path: 'kvm', - name: 'kvm-console', - component: KvmConsole, + path: '*', + name: 'page-not-found', + component: PageNotFound, meta: { - title: 'appPageTitle.kvm' + title: 'appPageTitle.pageNotFound' } } ] -- cgit v1.2.3