diff --git a/src/router/index.js b/src/router/index.js index 5fe0cde4e..8ecdc4372 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,6 +6,7 @@ Vue.use(Router) /* Layout */ import Layout from '@/layout' +const requireContext = require.context('@/views/', true, /router\.js$/) /** * Note: sub-menu only appear when route children.length >= 1 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html @@ -127,6 +128,7 @@ export const adminRoutes = [ meta: { title: 'Audits', icon: 'history' }, children: AuditsRoutes }, + ...requireContext.keys().map(key => requireContext(key).default), { path: '/settings', component: Layout, @@ -146,6 +148,7 @@ export const adminRoutes = [ meta: { title: 'CeleryTaskLog' } }, { path: '*', redirect: '/404', hidden: true } + ] /** * user routes diff --git a/src/views/Xpack/router.js b/src/views/Xpack/router.js new file mode 100644 index 000000000..ba447c7da --- /dev/null +++ b/src/views/Xpack/router.js @@ -0,0 +1,8 @@ +export default { + path: '/Xpack', + component: () => import('@/views/jobcenter/CeleryTaskLog'), + redirect: '/applications/remote-apps/', + name: 'Xpack', + meta: { title: 'Xpack', icon: 'th' } +} +