Files
dougal-software/lib/www/client/source/src/router/index.js

183 lines
4.5 KiB
JavaScript
Raw Normal View History

2020-08-08 23:59:13 +02:00
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
2020-10-11 17:56:32 +02:00
import Login from '../views/Login.vue'
import Logout from '../views/Logout.vue'
2020-08-08 23:59:13 +02:00
import Project from '../views/Project.vue'
import ProjectList from '../views/ProjectList.vue'
import ProjectSummary from '../views/ProjectSummary.vue'
import LineList from '../views/LineList.vue'
2020-10-08 16:38:37 +02:00
import Plan from '../views/Plan.vue'
2020-08-08 23:59:13 +02:00
import LineSummary from '../views/LineSummary.vue'
import SequenceList from '../views/SequenceList.vue'
import SequenceSummary from '../views/SequenceSummary.vue'
import Calendar from '../views/Calendar.vue'
import Log from '../views/Log.vue'
import QC from '../views/QC.vue'
2021-09-04 19:15:16 +02:00
import Graphs from '../views/Graphs.vue'
2020-08-08 23:59:13 +02:00
import Map from '../views/Map.vue'
import DougalAppBarExtensionProject from '../components/app-bar-extension-project'
2020-08-08 23:59:13 +02:00
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
},
{
path: '/feed/:source',
name: 'Feed',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/Feed.vue')
},
{
path: "/settings/equipment",
name: "equipment",
component: () => import(/* webpackChunkName: "about" */ '../views/Equipment.vue')
},
2020-08-08 23:59:13 +02:00
{
pathToRegexpOptions: { strict: true },
2020-10-11 17:56:32 +02:00
path: "/login",
redirect: "/login/"
},
{
pathToRegexpOptions: { strict: true },
name: "Login",
path: "/login/",
component: Login,
meta: {
// breadcrumbs: [
// { text: "Projects", href: "/projects", disabled: true }
// ]
}
},
{
// pathToRegexpOptions: { strict: true },
path: "/logout",
component: Logout,
},
{
pathToRegexpOptions: { strict: true },
2020-08-08 23:59:13 +02:00
path: "/projects",
redirect: "/projects/"
},
{
pathToRegexpOptions: { strict: true },
path: "/projects/",
component: ProjectList,
meta: {
breadcrumbs: [
{ text: "Projects", href: "/projects", disabled: true }
]
}
},
{
pathToRegexpOptions: { strict: true },
path: "/projects/:project",
redirect: "/projects/:project/"
},
{
pathToRegexpOptions: { strict: true },
path: "/projects/:project/",
name: "Project",
component: Project,
meta: {
breadcrumbs: [
{ text: "Projects", href: "/projects" },
{
text: (ctx) => ctx.$store.state.project.projectName || "…",
href: (ctx) => `/projects/${ctx.$store.state.project.projectId || ctx.$route.params.project || ""}/`
}
],
appBarExtension: {
component: DougalAppBarExtensionProject
}
2020-08-08 23:59:13 +02:00
},
children: [
{
path: "",
redirect: "summary"
},
{
path: "summary",
component: ProjectSummary
},
{
path: "lines/",
name: "LineList",
component: LineList
},
2020-10-08 16:38:37 +02:00
{
path: "plan/",
name: "Plan",
component: Plan
},
2020-08-08 23:59:13 +02:00
{
path: "lines/:line",
name: "Line",
component: LineSummary
},
{
path: "sequences",
component: SequenceList
},
{
path: "sequences/:sequence",
component: SequenceSummary
},
{
path: "calendar",
component: Calendar
},
{
path: "log",
component: Log,
children: [
{ path: "sequence/:sequence", name: "logBySequence" },
{ path: "date/:date0", name: "logByDate" },
{ path: "date/:date0/:date1", name: "logByDates" }
]
2020-08-08 23:59:13 +02:00
},
{
path: "qc",
component: QC
},
2021-09-04 19:15:16 +02:00
{
path: "graphs",
component: Graphs,
children: [
{ path: "sequence/:sequence", name: "graphsBySequence" },
{ path: "sequence/:sequence0/:sequence1", name: "graphsBySequences" },
{ path: "date/:date0", name: "graphsByDate" },
{ path: "date/:date0/:date1", name: "graphsByDates" }
]
},
2020-08-08 23:59:13 +02:00
{
path: "map",
name: "map",
2020-08-08 23:59:13 +02:00
component: Map
}
]
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router