mirror of
https://github.com/knadh/listmonk.git
synced 2025-11-09 09:12:56 +08:00
Add a 404 page to the admin UI.
This commit is contained in:
parent
0db6f0c866
commit
1f31218639
3 changed files with 31 additions and 0 deletions
|
|
@ -520,6 +520,10 @@ body.is-noscroll {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-404 h1 {
|
||||||
|
font-size: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Dashboard */
|
/* Dashboard */
|
||||||
section.dashboard {
|
section.dashboard {
|
||||||
.title {
|
.title {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,12 @@ Vue.use(VueRouter);
|
||||||
|
|
||||||
// The meta.group param is used in App.vue to expand menu group by name.
|
// The meta.group param is used in App.vue to expand menu group by name.
|
||||||
const routes = [
|
const routes = [
|
||||||
|
{
|
||||||
|
path: '/404',
|
||||||
|
name: '404_page',
|
||||||
|
meta: { title: '404' },
|
||||||
|
component: () => import(/* webpackChunkName: "main" */ '../views/404.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'dashboard',
|
name: 'dashboard',
|
||||||
|
|
@ -116,6 +122,14 @@ const router = new VueRouter({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.beforeEach((to, from, next) => {
|
||||||
|
if (to.matched.length === 0) {
|
||||||
|
next('/404');
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
router.afterEach((to) => {
|
router.afterEach((to) => {
|
||||||
Vue.nextTick(() => {
|
Vue.nextTick(() => {
|
||||||
document.title = `${to.meta.title} / listmonk`;
|
document.title = `${to.meta.title} / listmonk`;
|
||||||
|
|
|
||||||
13
frontend/src/views/404.vue
Normal file
13
frontend/src/views/404.vue
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<template>
|
||||||
|
<section class="page-404">
|
||||||
|
<h1 class="title">404</h1>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Vue from 'vue';
|
||||||
|
|
||||||
|
export default Vue.extend({
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Loading…
Add table
Reference in a new issue