Directory Config for other project
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -30,12 +30,11 @@ yarn-error.log*
|
||||
coverage
|
||||
/_PROVE
|
||||
/_LOCALE
|
||||
deploy.sh
|
||||
deploy_on_production.sh
|
||||
deploy_on_test_server.sh
|
||||
send_to_production.sh
|
||||
compileandserve.sh
|
||||
deploy_all.sh
|
||||
deploy_frontend.sh
|
||||
mongodb_delete_pc_locale_paolo.sh
|
||||
deploy_on_production.sh
|
||||
deploy_on_test_server.sh
|
||||
send_to_production.sh
|
||||
send_to_test.sh
|
||||
serve_on_localhost.sh
|
||||
|
||||
@@ -281,7 +281,7 @@ if (workbox) {
|
||||
|
||||
// Storage
|
||||
workbox.routing.registerRoute(
|
||||
new RegExp(/.*(?:storage.*$/),
|
||||
new RegExp(/.*(?:storage)/),
|
||||
workbox.strategies.staleWhileRevalidate({
|
||||
cacheName: 'storage',
|
||||
plugins: [
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { tools } from '../store/Modules/tools'
|
||||
|
||||
import { RouteNames } from '../router/route-names'
|
||||
|
||||
export default function auth({ next, router }) {
|
||||
const tok = tools.getItemLS(tools.localStorage.token)
|
||||
if (!tok) {
|
||||
return router.push({ name: RouteNames.login })
|
||||
return router.push({ name: 'login' })
|
||||
}
|
||||
|
||||
return next()
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { costanti } from "@src/store/Modules/costanti"
|
||||
import { UserStore } from "@store"
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
import { IAction } from '@src/model/Projects'
|
||||
|
||||
export interface IPost {
|
||||
|
||||
@@ -300,6 +300,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="padding bg-primary landing__swirl-bg" v-scroll-reveal.reset>
|
||||
<div class="landing__features row justify-between items-start q-col-gutter-sm">
|
||||
<div class="col-12 col-sm-5">
|
||||
|
||||
@@ -2,13 +2,14 @@ import Vue from 'vue'
|
||||
import VueRouter, { RouterMode } from 'vue-router'
|
||||
import { PositionResult } from 'vue-router/types/router'
|
||||
|
||||
import { IMyRoute, IMyRouteRecord, routesList } from './route-config'
|
||||
import { IMyRoute, IMyRouteRecord } from './route-config'
|
||||
import { ProgressBar } from '@src/store/Modules/Interface'
|
||||
import { isEqual } from 'lodash'
|
||||
import { UserStore } from '@store'
|
||||
import { RouteNames } from '@src/router/route-names'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
|
||||
import { cfgrouter } from '../../cfg_locale'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
/*
|
||||
* If not building with SSR mode, you can
|
||||
@@ -17,7 +18,7 @@ Vue.use(VueRouter)
|
||||
|
||||
const Router = new VueRouter({
|
||||
scrollBehavior: () => ({ x: 0, y: 0 } as PositionResult),
|
||||
routes: routesList,
|
||||
routes: cfgrouter.routes,
|
||||
|
||||
// Leave these as is and change from quasar.conf.js instead!
|
||||
// quasar.conf.js -> build -> vueRouterMode
|
||||
@@ -124,7 +125,7 @@ Router.beforeEach(async (to: IMyRoute, from: IMyRoute, next) => {
|
||||
// next('/')
|
||||
}
|
||||
|
||||
return Router.push({ name: RouteNames.login })
|
||||
return Router.push({ name: 'login' })
|
||||
}
|
||||
} else if (to.matched.some((m) => m.meta.noAuth) && UserStore.state.isLogged) {
|
||||
next('/')
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { RouteConfig, Route, RouteRecord } from 'vue-router/types'
|
||||
|
||||
import { RouteNames } from './route-names'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
|
||||
import auth from '../middleware/auth'
|
||||
import { Projects, Todos } from "@store"
|
||||
import { Projects, Todos } from '@store'
|
||||
|
||||
interface IMyMeta {
|
||||
title?: string,
|
||||
@@ -33,154 +32,3 @@ export interface IMyRouteConfig extends RouteConfig {
|
||||
children?: IMyRouteConfig[],
|
||||
meta?: IMyMeta
|
||||
}
|
||||
|
||||
export const routesList: IMyRouteConfig[] = [
|
||||
{
|
||||
path: '/',
|
||||
name: RouteNames.home,
|
||||
component: () => import('@/root/home/home.vue')
|
||||
},
|
||||
{
|
||||
path: '/signup',
|
||||
name: 'Registration',
|
||||
component: () => import('@/views/login/signup/signup.vue')
|
||||
},
|
||||
{
|
||||
path: '/signin',
|
||||
name: RouteNames.login,
|
||||
component: () => import('@/views/login/signin/signin.vue')
|
||||
},
|
||||
{
|
||||
path: '/vreg',
|
||||
name: 'Verify Reg',
|
||||
component: () => import('@/views/login/vreg/vreg.vue')
|
||||
},
|
||||
{
|
||||
path: '/todo/:category',
|
||||
name: 'Todos',
|
||||
component: () => import('@/views/todo-list/todo-list.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
async asyncData() {
|
||||
await Todos.actions.dbLoad({ checkPending: false })
|
||||
}
|
||||
// middleware: [auth]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/category',
|
||||
name: 'category',
|
||||
component: () => import('@/views/categories/category/category.vue')
|
||||
},
|
||||
{
|
||||
path: '/admin/cfgserv',
|
||||
name: 'cfgserv',
|
||||
component: () => import('@/views/admin/cfgServer/cfgServer.vue'),
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
// middleware: [auth]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/admin/testp1/:category',
|
||||
name: 'Categories',
|
||||
component: () => import('@/views/admin/testp1/testp1.vue')
|
||||
},
|
||||
{
|
||||
path: '/offline',
|
||||
name: 'Offline',
|
||||
component: () => import('@/views/offline/offline.vue')
|
||||
},
|
||||
// {
|
||||
// path: '/malaga',
|
||||
// name: 'malaga',
|
||||
// component: () => import('@/root/malaga/malaga.vue')
|
||||
// },
|
||||
{
|
||||
path: '/' + RouteNames.projectsall + '/:idProj',
|
||||
name: RouteNames.projectsall,
|
||||
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
||||
meta: {
|
||||
requiresAuth: false,
|
||||
async asyncData() {
|
||||
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true })
|
||||
}
|
||||
// middleware: [auth]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/' + RouteNames.myprojects + '/:idProj',
|
||||
name: RouteNames.myprojects,
|
||||
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
async asyncData() {
|
||||
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true })
|
||||
}
|
||||
// middleware: [auth]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/' + RouteNames.projectsshared + '/:idProj',
|
||||
name: RouteNames.projectsshared,
|
||||
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
async asyncData() {
|
||||
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true })
|
||||
}
|
||||
// middleware: [auth]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/' + RouteNames.listprojects,
|
||||
name: RouteNames.listprojects,
|
||||
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
async asyncData() {
|
||||
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true })
|
||||
}
|
||||
// middleware: [auth]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/' + RouteNames.favouriteprojects,
|
||||
name: RouteNames.favouriteprojects,
|
||||
component: () => import('@/views/projects/proj-list/proj-list.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
async asyncData() {
|
||||
await Projects.actions.dbLoad({ checkPending: false, onlyiffirsttime: true })
|
||||
}
|
||||
// middleware: [auth]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
{
|
||||
path: '/requestresetpwd',
|
||||
component: () => import('@/views/login/requestresetpwd.vue'),
|
||||
meta: { nametranslate: 'Reset your Password' }
|
||||
},
|
||||
{
|
||||
path: '/updatepwd',
|
||||
component: () => import('@/views/login/updatepassword.vue'),
|
||||
meta: { nametranslate: 'Update your Password' }
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
path: '/simpleform',
|
||||
component: () => import('@/views/form/simpleForm/simpleForm.vue'),
|
||||
meta: { nametranslate: 'SimpleForm' }
|
||||
},
|
||||
{
|
||||
path: '/embeeded',
|
||||
component: () => import('@/views/form/embeeded/embeeded.vue'),
|
||||
meta: { nametranslate: 'Embeeded' }
|
||||
}*/
|
||||
]
|
||||
|
||||
@@ -15,7 +15,8 @@ import * as ApiTables from '@src/store/Modules/ApiTables'
|
||||
import { GlobalStore, Projects, Todos, UserStore } from '@store'
|
||||
import messages from '../../statics/i18n'
|
||||
import globalroutines from './../../globalroutines/index'
|
||||
import { RouteNames } from '@src/router/route-names'
|
||||
|
||||
import { cfgrouter } from '../../../cfg_locale/index'
|
||||
|
||||
let stateConnDefault = 'online'
|
||||
|
||||
@@ -78,10 +79,6 @@ async function getstateConnSaved() {
|
||||
}
|
||||
}
|
||||
|
||||
function addRoute(myarr, values: IListRoutes) {
|
||||
myarr.push(values)
|
||||
}
|
||||
|
||||
const b = storeBuilder.module<IGlobalState>('GlobalModule', state)
|
||||
|
||||
// Getters
|
||||
@@ -117,147 +114,11 @@ namespace Getters {
|
||||
}, 'showtype')
|
||||
|
||||
const getmenu = b.read((state) => {
|
||||
console.log('getmenu')
|
||||
|
||||
const arrlista = GlobalStore.state.listatodo
|
||||
const lista: IListRoutes[] = []
|
||||
|
||||
arrlista.forEach((elem: IMenuList) => {
|
||||
const item: IListRoutes = {
|
||||
faIcon: 'fa fa-list-alt',
|
||||
materialIcon: 'todo',
|
||||
name: 'pages.' + elem.description,
|
||||
route: '/todo/' + elem.nametranslate
|
||||
}
|
||||
lista.push(item)
|
||||
})
|
||||
|
||||
const SHOW_PROJINTHEMENU = false
|
||||
|
||||
let arrlistafavourite = []
|
||||
let arrlistaprojtutti = []
|
||||
let arrlistaprojmiei = []
|
||||
if (SHOW_PROJINTHEMENU) {
|
||||
arrlistaprojtutti = Projects.getters.listaprojects(RouteNames.projectsall)
|
||||
arrlistaprojmiei = Projects.getters.listaprojects(RouteNames.myprojects)
|
||||
arrlistafavourite = Projects.getters.listaprojects(RouteNames.favouriteprojects)
|
||||
}
|
||||
|
||||
const arrMenu: IMenuList[] = []
|
||||
|
||||
// PROGETTI -> FAVORITI :
|
||||
if (arrlistafavourite.length > 0) {
|
||||
arrMenu.push({
|
||||
icon: 'favorite_border',
|
||||
nametranslate: 'pages.' + RouteNames.favouriteprojects,
|
||||
urlroute: RouteNames.favouriteprojects,
|
||||
level_parent: 0.0,
|
||||
level_child: 0.5,
|
||||
routes2: arrlistafavourite,
|
||||
idelem: ''
|
||||
})
|
||||
}
|
||||
|
||||
// PROGETTI -> TUTTI :
|
||||
arrMenu.push({
|
||||
icon: 'accessibility_new',
|
||||
nametranslate: 'pages.' + RouteNames.projectsall,
|
||||
urlroute: RouteNames.projectsall,
|
||||
level_parent: 0.0,
|
||||
level_child: 0.5,
|
||||
routes2: [],
|
||||
idelem: process.env.PROJECT_ID_MAIN
|
||||
})
|
||||
|
||||
// PROGETTI -> CONDIVISI :
|
||||
arrMenu.push({
|
||||
icon: 'people_outline',
|
||||
nametranslate: 'pages.' + RouteNames.projectsshared,
|
||||
urlroute: RouteNames.projectsshared,
|
||||
level_parent: 0.0,
|
||||
level_child: 0.5,
|
||||
routes2: arrlistaprojtutti,
|
||||
idelem: process.env.PROJECT_ID_MAIN
|
||||
})
|
||||
|
||||
// PROGETTI -> PERSONALI :
|
||||
arrMenu.push({
|
||||
icon: 'person',
|
||||
nametranslate: 'pages.' + RouteNames.myprojects,
|
||||
urlroute: RouteNames.myprojects,
|
||||
level_parent: 0.0,
|
||||
level_child: 0.5,
|
||||
routes2: arrlistaprojmiei,
|
||||
idelem: process.env.PROJECT_ID_MAIN
|
||||
})
|
||||
|
||||
const listaprojectMenu: IListRoutes[] = tools.convertMenuListInListRoutes(arrMenu)
|
||||
|
||||
const arrroutes: IListRoutes[] = []
|
||||
|
||||
addRoute(arrroutes, { route: '/', faIcon: 'fa fa-home', materialIcon: 'home', name: 'pages.home' }) // HOME
|
||||
|
||||
addRoute(arrroutes, {
|
||||
route: '/todo', faIcon: 'fa fa-list-alt', materialIcon: 'format_list_numbered', name: 'pages.Todo',
|
||||
routes2: lista,
|
||||
level_parent: 0.5,
|
||||
level_child: 0.5
|
||||
})
|
||||
|
||||
const myarrproj = []
|
||||
for (const myitem of listaprojectMenu) {
|
||||
addRoute(myarrproj, myitem)
|
||||
}
|
||||
|
||||
addRoute(arrroutes, {
|
||||
route: '', faIcon: 'fa fa-list-alt', materialIcon: 'next_week', name: 'pages.projects',
|
||||
routes2: myarrproj,
|
||||
level_parent: 0.0,
|
||||
level_child: 0.5
|
||||
})
|
||||
|
||||
console.log('arrroutes', arrroutes)
|
||||
console.log('listaprojectMenu', listaprojectMenu)
|
||||
// console.log('arrlistaprojmiei', arrlistaprojmiei)
|
||||
|
||||
if (UserStore.state.isAdmin) {
|
||||
addRoute(arrroutes, {
|
||||
route: '/category',
|
||||
faIcon: 'fa fa-list-alt',
|
||||
materialIcon: 'category',
|
||||
name: 'pages.Category',
|
||||
level_parent: 0.0,
|
||||
level_child: 0.0
|
||||
})
|
||||
addRoute(arrroutes, {
|
||||
route: '/admin/cfgserv',
|
||||
faIcon: 'fa fa-database',
|
||||
materialIcon: 'event_seat',
|
||||
name: 'pages.Admin',
|
||||
level_parent: 0.0,
|
||||
level_child: 0.0
|
||||
})
|
||||
addRoute(arrroutes, {
|
||||
route: '/admin/testp1/par1',
|
||||
faIcon: 'fa fa-database',
|
||||
materialIcon: 'restore',
|
||||
name: 'pages.Test1',
|
||||
level_parent: 0.0,
|
||||
level_child: 0.0
|
||||
})
|
||||
addRoute(arrroutes, {
|
||||
route: '/admin/testp1/par2',
|
||||
faIcon: 'fa fa-database',
|
||||
materialIcon: 'restore',
|
||||
name: 'pages.Test2',
|
||||
level_parent: 0.0,
|
||||
level_child: 0.0
|
||||
})
|
||||
}
|
||||
console.log('getmenu', cfgrouter.getmenu())
|
||||
|
||||
state.menulinks = {
|
||||
Dashboard: {
|
||||
routes: arrroutes,
|
||||
routes: cfgrouter.getmenu(),
|
||||
show: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1567,6 +1567,10 @@ export const tools = {
|
||||
|
||||
getprivacywritebytipoproj(tipoproj) {
|
||||
return Privacy.onlyme
|
||||
}
|
||||
},
|
||||
|
||||
addRoute(myarr, values) {
|
||||
myarr.push(values)
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user