Merge branch 'master' of github.com:jumpserver/lina

This commit is contained in:
ibuler
2020-05-11 12:00:17 +08:00
9 changed files with 177 additions and 92 deletions

View File

@@ -24,7 +24,14 @@ import Layout from '@/layout'
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
*/
const requireContext = require.context('@/views/', true, /\.js$/)
import UsersRoute from '@/views/users'
import AssetsRoute from '@/views/assets'
import ApplicationsRoute from '@/views/applications'
import PermsRoute from '@/views/perms'
import SessionsRoute from '@/views/sessions'
import OpsRoutes from '@/views/jobcenter'
import TicketsRoutes from '@/views/tickets'
import AuditsRoutes from '@/views/audits'
/**
* constantRoutes
@@ -52,6 +59,71 @@ export const constantRoutes = [
}
]
},
{
path: '/users',
component: Layout,
redirect: '/users/users/',
name: 'Users',
meta: {
title: 'Users',
icon: 'users'
},
children: UsersRoute
},
{
path: '/assets',
component: Layout,
redirect: '/assets/assets/',
name: 'assets',
meta: { title: 'Assets', icon: 'inbox' },
children: AssetsRoute
},
{
path: '/applications/',
component: Layout,
redirect: '/applications/remote-apps/',
name: 'applications',
meta: { title: 'Applications', icon: 'th' },
children: ApplicationsRoute
},
{
path: '/perms/',
component: Layout,
redirect: '/perms/asset-permissions/',
name: 'Perms',
meta: { title: 'Perms', icon: 'edit' },
children: PermsRoute
},
{
path: '/terminal/',
component: Layout,
redirect: '/terminal/session-online/',
name: 'Sessions',
meta: { title: 'Sessions', icon: 'rocket' },
children: SessionsRoute
},
{
path: '/ops/',
component: Layout,
redirect: '/ops/tasks/',
name: 'JobCenter',
meta: { title: 'JobCenter', icon: 'coffee' },
children: OpsRoutes
},
{
path: '/tickets/',
component: Layout,
redirect: '/tickets/tickets/',
children: TicketsRoutes
},
{
path: '/audits/',
component: Layout,
redirect: '/audits/login-log/',
name: 'Audits',
meta: { title: 'Audits', icon: 'history' },
children: AuditsRoutes
},
{
path: '/settings',
component: Layout,
@@ -69,8 +141,7 @@ export const constantRoutes = [
name: 'CeleryTaskLog',
hidden: true,
meta: { title: 'CeleryTaskLog' }
},
...requireContext.keys().map(key => requireContext(key).default)
}
]
/**
@@ -79,6 +150,99 @@ export const constantRoutes = [
*/
// 权限路由
export const asyncRoutes = [
// {
// path: '/nested',
// component: Layout,
// redirect: '/nested/menu1',
// name: 'Nested',
// meta: {
// title: 'Nested',
// icon: 'nested'
// },
// children: [
// {
// path: 'menu1',
// component: () => import('@/views/nested/menu1/index'), // Parent router-view
// name: 'Menu1',
// meta: { title: 'Menu1' },
// children: [
// {
// path: 'menu1-1',
// component: () => import('@/views/nested/menu1/menu1-1'),
// name: 'Menu1-1',
// meta: { title: 'Menu1-1' }
// },
// {
// path: 'menu1-2',
// component: () => import('@/views/nested/menu1/menu1-2'),
// name: 'Menu1-2',
// meta: { title: 'Menu1-2' },
// children: [
// {
// path: 'menu1-2-1',
// component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
// name: 'Menu1-2-1',
// meta: { title: 'Menu1-2-1' }
// },
// {
// path: 'menu1-2-2',
// component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
// name: 'Menu1-2-2',
// meta: { title: 'Menu1-2-2' }
// }
// ]
// },
// {
// path: 'menu1-3',
// component: () => import('@/views/nested/menu1/menu1-3'),
// name: 'Menu1-3',
// meta: { title: 'Menu1-3' }
// }
// ]
// },
// {
// path: 'menu2',
// component: () => import('@/views/nested/menu2/index'),
// meta: { title: 'menu2' }
// }
// ]
// },
// {
// path: '/users',
// component: Layout,
// redirect: '/users/list',
// name: 'Users',
// meta: {
// title: 'Users',
// icon: 'nested'
// },
// children: [
// {
// path: 'user/list',
// component: () => import('@/views/users/UserList.vue'), // Parent router-view
// name: 'UserList',
// meta: { title: 'List' }
// },
// {
// path: 'user/:id',
// component: () => import('@/views/users/UserCreate.vue'), // Parent router-view
// name: 'UserEdit',
// meta: { title: 'Edit' },
// hidden: true
// }
// ]
// },
// {
// path: 'external-link',
// component: Layout,
// children: [
// {
// path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
// meta: { title: 'External Link', icon: 'link' }
// }
// ]
// },
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]

View File

@@ -1,6 +1,4 @@
import Layout from '@/layout'
const ApplicationsRoute = [
export default [
{
path: 'remote-apps',
name: 'RemoteAppList',
@@ -20,12 +18,3 @@ const ApplicationsRoute = [
meta: { title: 'DatabaseApp' }
}
]
export default {
path: '/applications/',
component: Layout,
redirect: '/applications/remote-apps/',
name: 'applications',
meta: { title: 'Applications', icon: 'th' },
children: ApplicationsRoute
}

View File

@@ -1,6 +1,4 @@
import Layout from '@/layout'
const AssetsRoute = [
export default [
{
path: 'assets',
name: 'AssetList',
@@ -169,11 +167,3 @@ const AssetsRoute = [
meta: { title: 'PlatformList' }
}
]
export default {
path: '/assets',
component: Layout,
redirect: '/assets/assets/',
name: 'assets',
meta: { title: 'Assets', icon: 'inbox' },
children: AssetsRoute
}

View File

@@ -1,5 +1,4 @@
import Layout from '@/layout'
const AuditsRoutes = [
export default [
{
path: 'login-log',
name: 'LoginLog',
@@ -31,12 +30,3 @@ const AuditsRoutes = [
meta: { title: 'BatchCommand' }
}
]
export default {
path: '/audits/',
component: Layout,
redirect: '/audits/login-log/',
name: 'Audits',
meta: { title: 'Audits', icon: 'history' },
children: AuditsRoutes
}

View File

@@ -1,5 +1,4 @@
import Layout from '@/layout'
const OpsRoutes = [
export default [
{
path: 'tasks',
name: 'TaskList',
@@ -34,11 +33,3 @@ const OpsRoutes = [
meta: { title: 'BatchCommand' }
}
]
export default {
path: '/ops/',
component: Layout,
redirect: '/ops/tasks/',
name: 'JobCenter',
meta: { title: 'JobCenter', icon: 'coffee' },
children: OpsRoutes
}

View File

@@ -1,5 +1,5 @@
import Layout from '@/layout'
const PermsRoute = [
export default [
{
path: 'asset-permissions',
name: 'AssetPermissionList',
@@ -82,12 +82,3 @@ const PermsRoute = [
meta: { title: 'DatabaseAppPermissionDetail', activeMenu: '/perms/database-app-permissions' }
}
]
export default {
path: '/perms/',
component: Layout,
redirect: '/perms/asset-permissions/',
name: 'Perms',
meta: { title: 'Perms', icon: 'edit' },
children: PermsRoute
}

View File

@@ -1,5 +1,5 @@
import Layout from '@/layout'
const SessionsRoute = [
export default [
{
path: 'session-online',
name: 'SessionOnlineList',
@@ -92,11 +92,3 @@ const SessionsRoute = [
hidden: true
}
]
export default {
path: '/terminal/',
component: Layout,
redirect: '/terminal/session-online/',
name: 'Sessions',
meta: { title: 'Sessions', icon: 'rocket' },
children: SessionsRoute
}

View File

@@ -1,5 +1,4 @@
import Layout from '@/layout'
const TicketsRoutes = [
export default [
{
path: 'tickets',
name: 'TicketsList',
@@ -7,10 +6,3 @@ const TicketsRoutes = [
meta: { title: 'Tickets', icon: 'check-square-o' }
}
]
export default {
path: '/tickets/',
component: Layout,
redirect: '/tickets/tickets/',
children: TicketsRoutes
}

View File

@@ -1,5 +1,4 @@
import Layout from '@/layout'
const UsersRoute = [
export default [
{
path: 'users',
component: () => import('./users/UserList.vue'), // Parent router-view
@@ -55,16 +54,3 @@ const UsersRoute = [
meta: { title: 'UserGroupDetail', activeMenu: '/users/groups' }
}
]
export default {
path: '/users',
component: Layout,
redirect: '/users/users/',
name: 'Users',
meta: {
title: 'Users',
icon: 'users'
},
children: UsersRoute
}