From f7fb0e69a3e78f6af1185a967dc8aaaf5a1ee4a2 Mon Sep 17 00:00:00 2001 From: Eliot Berriot <contact@eliotberriot.com> Date: Fri, 15 Dec 2017 22:45:33 +0100 Subject: [PATCH] Fixed #48: basic 404 error template --- CHANGELOG | 1 + front/src/components/PageNotFound.vue | 34 +++++++++++++++++++++++++++ front/src/router/index.js | 5 ++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 front/src/components/PageNotFound.vue diff --git a/CHANGELOG b/CHANGELOG index d67dac695..dd6aa44ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ Changelog - Import: can now specify search template when querying import sources (#45) - Player: better handling of errors when fetching the audio file (#46) - Login form: now redirect to previous page after login (#2) +- 404: a decent 404 template, at least (#48) 0.2.4 (2017-12-14) diff --git a/front/src/components/PageNotFound.vue b/front/src/components/PageNotFound.vue new file mode 100644 index 000000000..3b88a6921 --- /dev/null +++ b/front/src/components/PageNotFound.vue @@ -0,0 +1,34 @@ +<template> + <div class="main pusher"> + <div class="ui vertical stripe segment"> + <div class="ui text container"> + <h1 class="ui huge header"> + <i class="warning icon"></i> + <div class="content"> + <strike>Whale</strike> Page not found! + </div> + </h1> + <p>We're sorry, the page you asked for does not exists.</p> + <p>Requested URL: <a :href="path">{{ path }}</a></p> + <router-link class="ui icon button" to="/"> + Go to home page + <i class="right arrow icon"></i> + </router-link> + </div> + </div> + </div> +</template> + +<script> +export default { + data: function () { + return { + path: window.location.href + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style scoped> +</style> diff --git a/front/src/router/index.js b/front/src/router/index.js index e3d008f58..d727276fc 100644 --- a/front/src/router/index.js +++ b/front/src/router/index.js @@ -1,5 +1,6 @@ import Vue from 'vue' import Router from 'vue-router' +import PageNotFound from '@/components/PageNotFound' import Home from '@/components/Home' import Login from '@/components/auth/Login' import Profile from '@/components/auth/Profile' @@ -72,7 +73,7 @@ export default new Router({ }, { path: 'import/batches/:id', name: 'library.import.batches.detail', component: BatchDetail, props: true } ] - } - + }, + { path: '*', component: PageNotFound } ] }) -- GitLab