feat: 工作空间.
This commit is contained in:
@@ -7,28 +7,23 @@ import {
|
||||
NOT_FOUND_ROUTER_NAME,
|
||||
} from '@/router/constants';
|
||||
|
||||
// 默认布局
|
||||
export const DEFAULT_LAYOUT = () => import('@/layout/default-layout.vue');
|
||||
|
||||
/**
|
||||
* 根页面
|
||||
*/
|
||||
// 根页面
|
||||
export const ROOT_ROUTER: RouteRecordRaw = {
|
||||
path: '/',
|
||||
redirect: DEFAULT_ROUTE_FULL_PATH,
|
||||
};
|
||||
|
||||
/**
|
||||
* 登录页面
|
||||
*/
|
||||
// 登录页面
|
||||
export const LOGIN_ROUTER: RouteRecordRaw = {
|
||||
path: '/login',
|
||||
name: LOGIN_ROUTE_NAME,
|
||||
component: () => import('@/views/authentication/login/index.vue'),
|
||||
};
|
||||
|
||||
/**
|
||||
* 重定向页面
|
||||
*/
|
||||
// 重定向页面
|
||||
export const REDIRECT_ROUTER: RouteRecordRaw = {
|
||||
path: '/redirect',
|
||||
name: 'redirectWrapper',
|
||||
@@ -49,18 +44,14 @@ export const REDIRECT_ROUTER: RouteRecordRaw = {
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* 403 页面
|
||||
*/
|
||||
// 403 页面
|
||||
export const FORBIDDEN_ROUTE: RouteRecordRaw = {
|
||||
path: '/403',
|
||||
name: FORBIDDEN_ROUTER_NAME,
|
||||
component: () => import('@/views/base/status/forbidden/index.vue'),
|
||||
};
|
||||
|
||||
/**
|
||||
* 404 页面
|
||||
*/
|
||||
// 404 页面
|
||||
export const NOT_FOUND_ROUTE: RouteRecordRaw = {
|
||||
// path: '/:pathMatch(.*)*',
|
||||
path: '/404',
|
||||
|
||||
@@ -3,6 +3,10 @@ import type { RouteRecordNormalized } from 'vue-router';
|
||||
// 应用模块
|
||||
const modules = import.meta.glob('./modules/*.ts', { eager: true });
|
||||
|
||||
// 应用路由
|
||||
export const appRoutes: RouteRecordNormalized[] = formatModules(modules, []);
|
||||
|
||||
// 格式化模块
|
||||
function formatModules(_modules: any, result: RouteRecordNormalized[]) {
|
||||
Object.keys(_modules).forEach((key) => {
|
||||
const defaultModule = _modules[key].default;
|
||||
@@ -14,8 +18,3 @@ function formatModules(_modules: any, result: RouteRecordNormalized[]) {
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用路由
|
||||
*/
|
||||
export const appRoutes: RouteRecordNormalized[] = formatModules(modules, []);
|
||||
|
||||
16
orion-ops-ui/src/router/routes/modules/host-workspcae.ts
Normal file
16
orion-ops-ui/src/router/routes/modules/host-workspcae.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const DASHBOARD: AppRouteRecordRaw = {
|
||||
name: 'hostWorkspace',
|
||||
path: '/host-workspace',
|
||||
component: () => import('@/layout/host-workspace-layout.vue'),
|
||||
children: [
|
||||
{
|
||||
name: 'hostTerminal',
|
||||
path: '/host-workspace/terminal',
|
||||
component: () => import('@/views/host-workspace/terminal/index.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default DASHBOARD;
|
||||
Reference in New Issue
Block a user