summaryrefslogtreecommitdiff
path: root/src/router
diff options
context:
space:
mode:
authorDixsie Wolmers <dixsie@ibm.com>2020-08-26 22:53:01 +0300
committerGunnar Mills <gmills@us.ibm.com>2020-09-03 23:06:06 +0300
commit11e655ca77827f3d1be9bfeebbe245987dfb8370 (patch)
tree247727f3e0f88e3e19885ae2894b361900a583fb /src/router
parentf88968f51bc648815eccaa2e58e80b231d14d362 (diff)
downloadwebui-vue-11e655ca77827f3d1be9bfeebbe245987dfb8370.tar.xz
Add 404 page
- User will be redirected to 404 page when navigating to undefined routes Signed-off-by: Dixsie Wolmers <dixsie@ibm.com> Change-Id: I5d7bbcfdd279b6f6c993370e3adb39a516dbb1ba
Diffstat (limited to 'src/router')
-rw-r--r--src/router/index.js97
1 files changed, 53 insertions, 44 deletions
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';
@@ -34,6 +35,54 @@ Vue.use(VueRouter);
// 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: {
requiresAuth: true
@@ -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'
}
}
]