2019-03-21 20:43:15 +01:00
|
|
|
import { RouteConfig, Route, RouteRecord } from 'vue-router/types'
|
2018-11-02 15:56:29 +01:00
|
|
|
|
2018-11-08 01:09:33 +01:00
|
|
|
import { RouteNames } from './route-names'
|
2019-03-05 23:44:48 +01:00
|
|
|
import { tools } from '@src/store/Modules/tools'
|
|
|
|
|
|
|
|
|
|
import auth from '../middleware/auth'
|
2019-03-28 12:58:34 +01:00
|
|
|
import { Projects, Todos } from "@store"
|
2019-03-05 23:44:48 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
interface IMyMeta {
|
|
|
|
|
title?: string,
|
|
|
|
|
headerShadow?: boolean,
|
|
|
|
|
contentProp?: boolean,
|
|
|
|
|
transparent?: boolean,
|
|
|
|
|
isModal?: boolean,
|
|
|
|
|
requiresAuth?: boolean,
|
|
|
|
|
isTab?: boolean,
|
|
|
|
|
noAuth?: boolean,
|
|
|
|
|
asyncData?: (to?: IMyRoute | IMyRouteRecord) => Promise<{title?: string} | void>,
|
|
|
|
|
isAuthorized?: (to?: any) => boolean
|
|
|
|
|
middleware?: any[]
|
|
|
|
|
}
|
2018-11-08 01:09:33 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
export interface IMyRoute extends Route {
|
|
|
|
|
meta: IMyMeta,
|
|
|
|
|
matched: IMyRouteRecord[]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IMyRouteRecord extends RouteRecord {
|
|
|
|
|
meta: IMyMeta,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IMyRouteConfig extends RouteConfig {
|
|
|
|
|
children?: IMyRouteConfig[],
|
|
|
|
|
meta?: IMyMeta
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const routesList: IMyRouteConfig[] = [
|
2018-11-08 01:09:33 +01:00
|
|
|
{
|
|
|
|
|
path: '/',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: RouteNames.home,
|
|
|
|
|
component: () => import('@/root/home/home.vue')
|
2018-11-08 01:09:33 +01:00
|
|
|
},
|
2019-01-02 01:58:47 +01:00
|
|
|
{
|
|
|
|
|
path: '/signup',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: 'Registration',
|
|
|
|
|
component: () => import('@/views/login/signup/signup.vue')
|
2019-01-02 01:58:47 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/signin',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: RouteNames.login,
|
|
|
|
|
component: () => import('@/views/login/signin/signin.vue')
|
2019-01-02 01:58:47 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/vreg',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: 'Verify Reg',
|
|
|
|
|
component: () => import('@/views/login/vreg/vreg.vue')
|
2019-01-05 20:11:41 +01:00
|
|
|
},
|
2019-01-14 22:40:30 +01:00
|
|
|
{
|
2019-01-29 03:12:18 +01:00
|
|
|
path: '/todo/:category',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: 'Todos',
|
2019-03-22 15:32:32 +01:00
|
|
|
component: () => import('@/views/todo/todo.vue'),
|
2019-03-05 23:44:48 +01:00
|
|
|
meta: {
|
2019-03-21 20:43:15 +01:00
|
|
|
requiresAuth: true,
|
|
|
|
|
async asyncData() {
|
2019-03-28 12:58:34 +01:00
|
|
|
await Todos.actions.dbLoad({ checkPending: false })
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
|
|
|
|
// middleware: [auth]
|
2019-03-05 23:44:48 +01:00
|
|
|
}
|
2019-01-14 22:40:30 +01:00
|
|
|
},
|
2019-01-05 20:11:41 +01:00
|
|
|
{
|
|
|
|
|
path: '/category',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: 'category',
|
2019-03-22 15:32:32 +01:00
|
|
|
component: () => import('@/views/categories/category/category.vue')
|
2019-02-12 12:06:01 +01:00
|
|
|
},
|
2019-02-22 10:23:00 +01:00
|
|
|
{
|
|
|
|
|
path: '/admin/cfgserv',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: 'cfgserv',
|
2019-03-22 15:32:32 +01:00
|
|
|
component: () => import('@/views/admin/cfgServer/cfgServer.vue'),
|
2019-03-08 02:04:56 +01:00
|
|
|
meta: {
|
2019-03-21 20:43:15 +01:00
|
|
|
requiresAuth: true
|
|
|
|
|
// middleware: [auth]
|
2019-03-08 02:04:56 +01:00
|
|
|
}
|
2019-02-22 10:23:00 +01:00
|
|
|
},
|
2019-02-27 02:58:41 +01:00
|
|
|
{
|
|
|
|
|
path: '/admin/testp1/:category',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: 'Categories',
|
2019-03-22 15:32:32 +01:00
|
|
|
component: () => import('@/views/admin/testp1/testp1.vue')
|
2019-02-27 02:58:41 +01:00
|
|
|
},
|
2019-02-12 12:06:01 +01:00
|
|
|
{
|
|
|
|
|
path: '/offline',
|
2019-03-05 23:44:48 +01:00
|
|
|
name: 'Offline',
|
2019-03-22 15:32:32 +01:00
|
|
|
component: () => import('@/views/offline/offline.vue')
|
2019-03-21 20:43:15 +01:00
|
|
|
},
|
|
|
|
|
{
|
2019-03-30 02:57:40 +01:00
|
|
|
path: '/projects/:idProj',
|
2019-03-21 20:43:15 +01:00
|
|
|
name: 'progetti',
|
2019-03-22 15:32:32 +01:00
|
|
|
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
2019-03-21 20:43:15 +01:00
|
|
|
meta: {
|
2019-03-28 12:58:34 +01:00
|
|
|
requiresAuth: true,
|
|
|
|
|
async asyncData() {
|
2019-03-30 02:57:40 +01:00
|
|
|
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true })
|
2019-03-28 12:58:34 +01:00
|
|
|
}
|
2019-03-21 20:43:15 +01:00
|
|
|
// middleware: [auth]
|
|
|
|
|
}
|
2019-01-02 01:58:47 +01:00
|
|
|
}
|
2019-03-21 20:43:15 +01:00
|
|
|
|
2018-11-05 22:28:59 +01:00
|
|
|
/*
|
2019-03-21 20:43:15 +01:00
|
|
|
|
2018-11-02 20:10:45 +01:00
|
|
|
{
|
|
|
|
|
path: '/requestresetpwd',
|
2018-11-02 20:30:53 +01:00
|
|
|
component: () => import('@/views/login/requestresetpwd.vue'),
|
2019-04-02 00:18:01 +02:00
|
|
|
meta: { nametranslate: 'Reset your Password' }
|
2018-11-02 20:10:45 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/updatepwd',
|
2018-11-02 20:30:53 +01:00
|
|
|
component: () => import('@/views/login/updatepassword.vue'),
|
2019-04-02 00:18:01 +02:00
|
|
|
meta: { nametranslate: 'Update your Password' }
|
2019-01-01 03:22:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-11-02 20:10:45 +01:00
|
|
|
{
|
|
|
|
|
path: '/simpleform',
|
2018-11-02 20:30:53 +01:00
|
|
|
component: () => import('@/views/form/simpleForm/simpleForm.vue'),
|
2019-04-02 00:18:01 +02:00
|
|
|
meta: { nametranslate: 'SimpleForm' }
|
2018-11-02 20:10:45 +01:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/embeeded',
|
2018-11-02 20:30:53 +01:00
|
|
|
component: () => import('@/views/form/embeeded/embeeded.vue'),
|
2019-04-02 00:18:01 +02:00
|
|
|
meta: { nametranslate: 'Embeeded' }
|
2018-11-02 22:15:48 +01:00
|
|
|
}*/
|
|
|
|
|
]
|