|
|
|
@ -1,27 +1,27 @@ |
|
|
|
import { createRouter, createWebHistory } from 'vue-router' |
|
|
|
import { useUserStore } from '../store/user' |
|
|
|
import { useUserStore } from '@/stores/modules/userStore' |
|
|
|
import AppShell from '../layout/AppShell.vue' |
|
|
|
|
|
|
|
const routes = [ |
|
|
|
{ path: '/login', name: 'login', component: () => import('../views/Login.vue') }, |
|
|
|
{ path: '/login', name: 'login', component: () => import('../views/LoginView/LoginView.vue') }, |
|
|
|
{ |
|
|
|
path: '/', |
|
|
|
component: AppShell, |
|
|
|
redirect: '/monitor', |
|
|
|
children: [ |
|
|
|
{ path: 'monitor', name: 'monitor', component: () => import('../views/Monitor.vue') }, |
|
|
|
{ path: 'devices', name: 'devices', component: () => import('../views/Devices.vue') }, |
|
|
|
{ path: 'tasks', name: 'tasks', component: () => import('../views/Tasks.vue') }, |
|
|
|
{ path: 'replay/:key', name: 'replay', component: () => import('../views/Replay.vue') }, |
|
|
|
{ path: 'media', name: 'media', component: () => import('../views/Media.vue') }, |
|
|
|
{ path: 'account', name: 'account', component: () => import('../views/Account.vue') }, |
|
|
|
{ path: 'alarms', name: 'alarms', component: () => import('../views/Alarms.vue') }, |
|
|
|
{ path: 'system', name: 'system', component: () => import('../views/System.vue'), meta: { admin: true } }, |
|
|
|
{ path: 'users', name: 'users', component: () => import('../views/Users.vue'), meta: { admin: true } }, |
|
|
|
{ path: 'firmwares', name: 'firmwares', component: () => import('../views/Firmwares.vue'), meta: { admin: true } }, |
|
|
|
{ path: 'control/:id?', name: 'control', component: () => import('../views/Control.vue'), meta: { userOnly: true } }, |
|
|
|
{ path: 'logs', name: 'logs', component: () => import('../views/OperationLogs.vue'), meta: { userOnly: true } }, |
|
|
|
{ path: 'device/:id', name: 'device-detail', component: () => import('../views/DeviceDetail.vue') } |
|
|
|
{ path: 'monitor', name: 'monitor', component: () => import('../views/MonitorView/MonitorView.vue') }, |
|
|
|
{ path: 'devices', name: 'devices', component: () => import('../views/DevicesView/DevicesView.vue') }, |
|
|
|
{ path: 'tasks', name: 'tasks', component: () => import('../views/TasksView/TasksView.vue') }, |
|
|
|
{ path: 'replay/:key', name: 'replay', component: () => import('../views/ReplayView/ReplayView.vue') }, |
|
|
|
{ path: 'media', name: 'media', component: () => import('../views/MediaView/MediaView.vue') }, |
|
|
|
{ path: 'account', name: 'account', component: () => import('../views/AccountView/AccountView.vue') }, |
|
|
|
{ path: 'alarms', name: 'alarms', component: () => import('../views/AlarmsView/AlarmsView.vue') }, |
|
|
|
{ path: 'system', name: 'system', component: () => import('../views/SystemView/SystemView.vue'), meta: { admin: true } }, |
|
|
|
{ path: 'users', name: 'users', component: () => import('../views/UsersView/UsersView.vue'), meta: { admin: true } }, |
|
|
|
{ path: 'firmwares', name: 'firmwares', component: () => import('../views/FirmwaresView/FirmwaresView.vue'), meta: { admin: true } }, |
|
|
|
{ path: 'control/:id?', name: 'control', component: () => import('../views/ControlView/ControlView.vue'), meta: { userOnly: true } }, |
|
|
|
{ path: 'logs', name: 'logs', component: () => import('../views/OperationLogsView/OperationLogsView.vue'), meta: { userOnly: true } }, |
|
|
|
{ path: 'device/:id', name: 'device-detail', component: () => import('../views/DeviceDetailView/DeviceDetailView.vue') } |
|
|
|
] |
|
|
|
}, |
|
|
|
{ path: '/:pathMatch(.*)*', redirect: '/monitor' } |
|
|
|
|