mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
Update vue-router to use HTML5 history (#856)
closes #855 Only issues I see is that only HTML5 History API supported browsers support this which is fine given that the only thing that doesn't is probably the laptop they use to flash routers at competitions. The 404 page can be up for debate lol.
This commit is contained in:
@@ -16,6 +16,7 @@ modifiableFileExclude {
|
||||
\.gif$
|
||||
\.so$
|
||||
\.dll$
|
||||
\.webp$
|
||||
}
|
||||
|
||||
includeProject {
|
||||
|
||||
BIN
photon-client/src/assets/NotFound.webp
Normal file
BIN
photon-client/src/assets/NotFound.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -1,33 +1,47 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import VueRouter from "vue-router";
|
||||
|
||||
import Dashboard from "./views/PipelineView";
|
||||
import Cameras from "./views/CamerasView";
|
||||
import Settings from "./views/SettingsView";
|
||||
import Docs from "./views/DocsView";
|
||||
import NotFoundView from "./views/NotFoundView";
|
||||
|
||||
Vue.use(Router);
|
||||
|
||||
export default new Router({
|
||||
// mode: 'history',
|
||||
Vue.use(VueRouter);
|
||||
|
||||
export default new VueRouter({
|
||||
mode: 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes: [{
|
||||
path: '/',
|
||||
redirect: '/dashboard'
|
||||
}, {
|
||||
path: '/dashboard',
|
||||
name: 'Dashboard',
|
||||
component: Dashboard
|
||||
}, {
|
||||
path: '/cameras',
|
||||
name: 'Cameras',
|
||||
component: Cameras
|
||||
}, {
|
||||
path: '/settings',
|
||||
name: 'Settings',
|
||||
component: Settings
|
||||
}, {
|
||||
path: '/docs',
|
||||
name: 'Docs',
|
||||
component: Docs
|
||||
}]
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/dashboard'
|
||||
},
|
||||
{
|
||||
path: '/dashboard',
|
||||
name: 'Dashboard',
|
||||
component: Dashboard
|
||||
},
|
||||
{
|
||||
path: '/cameras',
|
||||
name: 'Cameras',
|
||||
component: Cameras
|
||||
},
|
||||
{
|
||||
path: '/settings',
|
||||
name: 'Settings',
|
||||
component: Settings
|
||||
},
|
||||
{
|
||||
path: '/docs',
|
||||
name: 'Docs',
|
||||
component: Docs
|
||||
},
|
||||
{
|
||||
path: "*",
|
||||
name: "NotFound",
|
||||
component: NotFoundView
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
35
photon-client/src/views/NotFoundView.vue
Normal file
35
photon-client/src/views/NotFoundView.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div class="not-found-container">
|
||||
<div>
|
||||
<v-card-title style="color: white; padding-bottom: 36px; font-size: 42px;">
|
||||
The page you are looking for isn't here
|
||||
</v-card-title>
|
||||
<v-card-subtitle style="color: white; font-size: 18px;">
|
||||
Please use the sidebar to find what you are looking for
|
||||
</v-card-subtitle>
|
||||
</div>
|
||||
<img
|
||||
src="../assets/NotFound.webp"
|
||||
alt="missing-page"
|
||||
style="margin-top: 64px"
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'NotFound'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.not-found-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user