Browse Source

[Feature][UI Next]: Rearrange the routing and format the code (#7533)

* fix: Rearrange the routing and format the code

* To fix the problem

To fix the problem
3.0.0/version-upgrade
labbomb 3 years ago committed by GitHub
parent
commit
4c49a8b91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 34
      dolphinscheduler-ui-next/src/layouts/basic/components/header/index.tsx
  2. 20
      dolphinscheduler-ui-next/src/layouts/basic/components/logo/index.tsx
  3. 30
      dolphinscheduler-ui-next/src/layouts/basic/components/sider/index.tsx
  4. 158
      dolphinscheduler-ui-next/src/layouts/basic/index.tsx
  5. 12
      dolphinscheduler-ui-next/src/layouts/content/Content.tsx
  6. 24
      dolphinscheduler-ui-next/src/router/index.ts
  7. 41
      dolphinscheduler-ui-next/src/router/modules/datasource.ts
  8. 49
      dolphinscheduler-ui-next/src/router/modules/monitor.ts
  9. 49
      dolphinscheduler-ui-next/src/router/modules/projects.ts
  10. 49
      dolphinscheduler-ui-next/src/router/modules/resources.ts
  11. 49
      dolphinscheduler-ui-next/src/router/modules/security.ts
  12. 191
      dolphinscheduler-ui-next/src/router/routes.ts
  13. 2
      dolphinscheduler-ui-next/src/utils/index.ts

34
dolphinscheduler-ui-next/src/layouts/basic/components/header/index.tsx

@ -15,16 +15,16 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, ref } from "vue"; import { defineComponent, ref } from 'vue'
import styles from "./index.module.scss"; import styles from './index.module.scss'
import { NDropdown, NIcon, NLayoutHeader, NMenu } from "naive-ui"; import { NDropdown, NIcon, NLayoutHeader, NMenu } from 'naive-ui'
import { Logo } from "@/layouts/basic/components/logo"; import Logo from '@/layouts/basic/components/logo'
import { IosArrowDown } from "@vicons/ionicons4"; import { IosArrowDown } from '@vicons/ionicons4'
import { UserAlt } from "@vicons/fa"; import { UserAlt } from '@vicons/fa'
const Header = defineComponent({ const Header = defineComponent({
name: "Header", name: 'Header',
props: { props: {
inverted: { inverted: {
type: Boolean, type: Boolean,
@ -50,26 +50,26 @@ const Header = defineComponent({
}, },
}, },
setup(props, context) { setup(props, context) {
const currentMenuRef = ref({}); const currentMenuRef = ref({})
const handleMenuClick = (key, data) => { const handleMenuClick = (key, data) => {
currentMenuRef.value = data; currentMenuRef.value = data
context.emit("menuClick", data); context.emit('menuClick', data)
}; }
return { handleMenuClick }; return { handleMenuClick }
}, },
render() { render() {
return ( return (
<NLayoutHeader <NLayoutHeader
class={styles["header-model"]} class={styles['header-model']}
inverted={this.inverted} inverted={this.inverted}
bordered bordered
> >
<Logo /> <Logo />
<div class={styles.nav}> <div class={styles.nav}>
<NMenu <NMenu
mode="horizontal" mode='horizontal'
onUpdate:value={this.handleMenuClick} onUpdate:value={this.handleMenuClick}
defaultValue={this.defaultMenuKey} defaultValue={this.defaultMenuKey}
class={styles.menu} class={styles.menu}
@ -99,8 +99,8 @@ const Header = defineComponent({
</div> </div>
</div> </div>
</NLayoutHeader> </NLayoutHeader>
); )
}, },
}); })
export { Header }; export { Header }

20
dolphinscheduler-ui-next/src/layouts/basic/components/logo/index.tsx

@ -15,24 +15,20 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, ref } from "vue"; import { defineComponent } from 'vue'
import styles from "./index.module.scss"; import styles from './index.module.scss'
const Logo = defineComponent({ const Logo = defineComponent({
name: "Logo", name: 'Logo',
setup() { setup() {},
const invertedRef = ref(true);
return { invertedRef };
},
render() { render() {
return ( return (
<div class={styles.logo}> <div class={styles.logo}>
<img src="../../../src/assets/images/nav-logo.svg" alt="" /> <img src='./src/assets/images/nav-logo.svg' alt='' />
</div> </div>
); )
}, },
}); })
export { Logo }; export default Logo

30
dolphinscheduler-ui-next/src/layouts/basic/components/sider/index.tsx

@ -15,11 +15,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, ref } from "vue"; import { defineComponent, ref } from 'vue'
import { NLayoutSider, NMenu } from "naive-ui"; import { NLayoutSider, NMenu } from 'naive-ui'
const Sider = defineComponent({ const Sider = defineComponent({
name: "Sider", name: 'Sider',
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
@ -41,20 +41,21 @@ const Sider = defineComponent({
}, },
}, },
setup(props) { setup(props) {
const currentMenuRef = ref({}); const currentMenuRef = ref({})
const handleMenuClick = (key, data) => { const handleMenuClick = (key, data) => {
currentMenuRef.value = data; currentMenuRef.value = data
}; }
return { handleMenuClick }; return { handleMenuClick }
}, },
render() { render() {
if (this.visible) { return
return ( this.visible ?
(
<NLayoutSider <NLayoutSider
width={240} width={240}
collapseMode={"width"} collapseMode={'width'}
collapsedWidth={64} collapsedWidth={64}
inverted={this.inverted} inverted={this.inverted}
nativeScrollbar={false} nativeScrollbar={false}
@ -69,11 +70,8 @@ const Sider = defineComponent({
options={this.menuOptions} options={this.menuOptions}
/> />
</NLayoutSider> </NLayoutSider>
); ) : ''
} else {
return "";
}
}, },
}); })
export { Sider }; export { Sider }

158
dolphinscheduler-ui-next/src/layouts/basic/index.tsx

@ -15,186 +15,186 @@
* limitations under the License. * limitations under the License.
*/ */
import { h, defineComponent, ref } from "vue"; import { h, defineComponent, ref } from 'vue'
import styles from "./index.module.scss"; import styles from './index.module.scss'
import { useI18n } from "vue-i18n"; import { useI18n } from 'vue-i18n'
import { import {
PersonCircleOutline, PersonCircleOutline,
LogOutOutline, LogOutOutline,
FileTrayFullOutline, FileTrayFullOutline,
Server, Server,
SettingsOutline, SettingsOutline,
} from "@vicons/ionicons5"; } from '@vicons/ionicons5'
import { import {
HomeOutlined, HomeOutlined,
FolderOutlined, FolderOutlined,
SafetyCertificateOutlined, SafetyCertificateOutlined,
UserOutlined, UserOutlined,
} from "@vicons/antd"; } from '@vicons/antd'
import { Database, Notes, Users } from "@vicons/tabler"; import { Database, Notes, Users } from '@vicons/tabler'
import { MonitorFilled, AcUnitOutlined } from "@vicons/material"; import { MonitorFilled, AcUnitOutlined } from '@vicons/material'
import { Flow } from "@vicons/carbon"; import { Flow } from '@vicons/carbon'
import { Header } from "./components/header"; import { Header } from './components/header'
import { Sider } from "./components/sider"; import { Sider } from './components/sider'
import { NLayout, NLayoutContent, NIcon } from "naive-ui"; import { NLayout, NLayoutContent, NIcon } from 'naive-ui'
function renderIcon(icon) { function renderIcon(icon) {
return () => h(NIcon, null, { default: () => h(icon) }); return () => h(NIcon, null, { default: () => h(icon) })
} }
const switchLanguageOptions = [ const switchLanguageOptions = [
{ {
label: "English", label: 'English',
key: "en", key: 'en',
}, },
{ {
label: "中文", label: '中文',
key: "zh", key: 'zh',
}, },
]; ]
const profileOptions = [ const profileOptions = [
{ {
label: "用户信息", label: '用户信息',
key: "profile", key: 'profile',
icon: renderIcon(PersonCircleOutline), icon: renderIcon(PersonCircleOutline),
}, },
{ {
label: "退出登录", label: '退出登录',
key: "logout", key: 'logout',
icon: renderIcon(LogOutOutline), icon: renderIcon(LogOutOutline),
}, },
]; ]
const menuOptions = [ const menuOptions = [
{ {
label: "首页", label: '首页',
key: "home", key: 'home',
icon: renderIcon(HomeOutlined), icon: renderIcon(HomeOutlined),
}, },
{ {
label: "项目管理", label: '项目管理',
key: "project", key: 'project',
icon: renderIcon(Notes), icon: renderIcon(Notes),
children: [ children: [
{ {
label: "项目", label: '项目',
key: "projects-list", key: 'projects-list',
icon: renderIcon(Notes), icon: renderIcon(Notes),
}, },
{ {
label: "工作流监控", label: '工作流监控',
key: "projects-index", key: 'projects-index',
icon: renderIcon(Flow), icon: renderIcon(Flow),
}, },
], ],
}, },
{ {
label: "资源中心", label: '资源中心',
key: "resources", key: 'resources',
icon: renderIcon(FolderOutlined), icon: renderIcon(FolderOutlined),
children: [ children: [
{ {
label: "文件管理", label: '文件管理',
key: "file", key: 'file',
icon: renderIcon(FileTrayFullOutline), icon: renderIcon(FileTrayFullOutline),
}, },
{ {
label: "创建资源", label: '创建资源',
key: "resource-file-create", key: 'resource-file-create',
icon: renderIcon(AcUnitOutlined), icon: renderIcon(AcUnitOutlined),
}, },
], ],
}, },
{ {
label: "数据源中心", label: '数据源中心',
key: "datasource", key: 'datasource',
icon: renderIcon(Database), icon: renderIcon(Database),
children: [ children: [
{ {
label: "数据源中心", label: '数据源中心',
key: "datasource-list", key: 'datasource-list',
icon: renderIcon(Database), icon: renderIcon(Database),
}, },
], ],
}, },
{ {
label: "监控中心", label: '监控中心',
key: "monitor", key: 'monitor',
icon: renderIcon(MonitorFilled), icon: renderIcon(MonitorFilled),
children: [ children: [
{ {
key: "servers-master", key: 'servers-master',
title: "服务管理-Master", title: '服务管理-Master',
icon: renderIcon(Server), icon: renderIcon(Server),
}, },
{ {
key: "servers-worker", key: 'servers-worker',
title: "服务管理-Worker", title: '服务管理-Worker',
icon: renderIcon(SettingsOutline), icon: renderIcon(SettingsOutline),
}, },
], ],
}, },
{ {
label: "安全中心", label: '安全中心',
key: "security", key: 'security',
icon: renderIcon(SafetyCertificateOutlined), icon: renderIcon(SafetyCertificateOutlined),
children: [ children: [
{ {
key: "tenement-manage", key: 'tenement-manage',
label: "租户管理", label: '租户管理',
icon: renderIcon(UserOutlined), icon: renderIcon(UserOutlined),
}, },
{ {
key: "users-manage", key: 'users-manage',
label: "用户管理", label: '用户管理',
icon: renderIcon(Users), icon: renderIcon(Users),
}, },
], ],
}, },
]; ]
const basic = defineComponent({ const basic = defineComponent({
name: "basic", name: 'basic',
setup() { setup() {
const invertedRef = ref(true); const invertedRef = ref(true)
const hasSiderRef = ref(false); const hasSiderRef = ref(false)
const defaultMenuKeyRef = ref("home"); const defaultMenuKeyRef = ref('home')
const currentMenuRef = ref({}); const currentMenuRef = ref({})
const topMenuOptionsRef = ref([]); const topMenuOptionsRef = ref([])
const sideMenuOptionsRef = ref([]); const sideMenuOptionsRef = ref([])
const handleTopMenuClick = (data) => { const handleTopMenuClick = (data) => {
currentMenuRef.value = data; currentMenuRef.value = data
generateMenus(); generateMenus()
}; }
const handleSideMenuClick = (key, data) => { const handleSideMenuClick = (key, data) => {
console.log(data); console.log(data)
}; }
const generateMenus = () => { const generateMenus = () => {
topMenuOptionsRef.value = []; topMenuOptionsRef.value = []
sideMenuOptionsRef.value = []; sideMenuOptionsRef.value = []
hasSiderRef.value = false; hasSiderRef.value = false
menuOptions.forEach((option) => { menuOptions.forEach((option) => {
topMenuOptionsRef.value.push({ topMenuOptionsRef.value.push({
label: option.label, label: option.label,
key: option.key, key: option.key,
icon: option.icon, icon: option.icon,
}); })
if ( if (
currentMenuRef.value.key === option.key || currentMenuRef.value.key === option.key ||
defaultMenuKeyRef.value === option.key defaultMenuKeyRef.value === option.key
) { ) {
if (option.hasOwnProperty("children") && option.children) { if (option.hasOwnProperty('children') && option.children) {
sideMenuOptionsRef.value = option.children; sideMenuOptionsRef.value = option.children
hasSiderRef.value = true; hasSiderRef.value = true
} }
} }
}); })
}; }
generateMenus(); generateMenus()
return { return {
topMenuOptionsRef, topMenuOptionsRef,
sideMenuOptionsRef, sideMenuOptionsRef,
@ -203,7 +203,7 @@ const basic = defineComponent({
defaultMenuKeyRef, defaultMenuKeyRef,
handleTopMenuClick, handleTopMenuClick,
handleSideMenuClick, handleSideMenuClick,
}; }
}, },
render() { render() {
return ( return (
@ -227,8 +227,8 @@ const basic = defineComponent({
</NLayoutContent> </NLayoutContent>
</NLayout> </NLayout>
</NLayout> </NLayout>
); )
}, },
}); })
export default basic; export default basic

12
dolphinscheduler-ui-next/src/layouts/content/Content.tsx

@ -15,11 +15,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent } from "vue"; import { defineComponent } from 'vue'
import { NLayout, NLayoutContent } from "naive-ui"; import { NLayout, NLayoutContent } from 'naive-ui'
const Content = defineComponent({ const Content = defineComponent({
name: "Content", name: 'Content',
render() { render() {
return ( return (
<NLayout> <NLayout>
@ -27,8 +27,8 @@ const Content = defineComponent({
<router-view /> <router-view />
</NLayoutContent> </NLayoutContent>
</NLayout> </NLayout>
); )
}, },
}); })
export default Content; export default Content

24
dolphinscheduler-ui-next/src/router/index.ts

@ -20,17 +20,17 @@ import {
createWebHistory, createWebHistory,
NavigationGuardNext, NavigationGuardNext,
RouteLocationNormalized, RouteLocationNormalized,
} from "vue-router"; } from 'vue-router'
import routes from "./routes"; import routes from './routes'
// NProgress // NProgress
import NProgress from "nprogress"; import NProgress from 'nprogress'
import "nprogress/nprogress.css"; import 'nprogress/nprogress.css'
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHistory(),
routes, routes,
}); })
/** /**
* Routing to intercept * Routing to intercept
@ -41,14 +41,14 @@ router.beforeEach(
from: RouteLocationNormalized, from: RouteLocationNormalized,
next: NavigationGuardNext next: NavigationGuardNext
) => { ) => {
NProgress.start(); NProgress.start()
next(); next()
NProgress.done(); NProgress.done()
} }
); )
router.afterEach(() => { router.afterEach(() => {
NProgress.done(); NProgress.done()
}); })
export default router; export default router

41
dolphinscheduler-ui-next/src/router/modules/datasource.ts

@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Component } from 'vue'
import utils from '@/utils'
// All TSX files under the views folder automatically generate mapping relationship
const modules = import.meta.glob('/src/views/**/**.tsx')
const components: { [key: string]: Component } = utils.mapping(modules)
export default {
path: '/datasource',
name: 'datasource',
redirect: { name: 'datasource-list' },
meta: { title: '数据源中心' },
component: () => import('@/layouts/basic'),
children: [
{
path: '/datasource/list',
name: 'datasource-list',
component: components['home'],
meta: {
title: '数据源中心'
}
}
]
}

49
dolphinscheduler-ui-next/src/router/modules/monitor.ts

@ -0,0 +1,49 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Component } from 'vue'
import utils from '@/utils'
// All TSX files under the views folder automatically generate mapping relationship
const modules = import.meta.glob('/src/views/**/**.tsx')
const components: { [key: string]: Component } = utils.mapping(modules)
export default {
path: '/monitor',
name: 'monitor',
meta: { title: 'monitor' },
redirect: { name: 'servers-master' },
component: () => import('@/layouts/basic'),
children: [
{
path: '/monitor/servers/master',
name: 'servers-master',
component: components['home'],
meta: {
title: '服务管理-Master',
},
},
{
path: '/monitor/servers/worker',
name: 'servers-worker',
component: components['home'],
meta: {
title: '服务管理-Worker'
}
}
]
}

49
dolphinscheduler-ui-next/src/router/modules/projects.ts

@ -0,0 +1,49 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Component } from 'vue'
import utils from '@/utils'
// All TSX files under the views folder automatically generate mapping relationship
const modules = import.meta.glob('/src/views/**/**.tsx')
const components: { [key: string]: Component } = utils.mapping(modules)
export default {
path: '/projects',
name: 'projects',
redirect: { name: 'projects-list' },
meta: { title: '项目管理' },
component: () => import('@/layouts/basic'),
children: [
{
path: '/projects/list',
name: 'projects-list',
component: components['home'],
meta: {
title: '项目',
},
},
{
path: '/projects/:projectCode/index',
name: 'projects-index',
component: components['home'],
meta: {
title: '工作流监控'
}
}
]
}

49
dolphinscheduler-ui-next/src/router/modules/resources.ts

@ -0,0 +1,49 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Component } from 'vue'
import utils from '@/utils'
// All TSX files under the views folder automatically generate mapping relationship
const modules = import.meta.glob('/src/views/**/**.tsx')
const components: { [key: string]: Component } = utils.mapping(modules)
export default {
path: '/resource',
name: 'resource',
redirect: { name: 'file' },
meta: { title: '资源中心' },
component: () => import('@/layouts/basic'),
children: [
{
path: '/resource/file',
name: 'file',
component: components['home'],
meta: {
title: '文件管理',
},
},
{
path: '/resource/file/create',
name: 'resource-file-create',
component: components['home'],
meta: {
title: '创建资源'
}
}
]
}

49
dolphinscheduler-ui-next/src/router/modules/security.ts

@ -0,0 +1,49 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Component } from 'vue'
import utils from '@/utils'
// All TSX files under the views folder automatically generate mapping relationship
const modules = import.meta.glob('/src/views/**/**.tsx')
const components: { [key: string]: Component } = utils.mapping(modules)
export default {
path: '/security',
name: 'security',
meta: { title: '安全中心' },
redirect: { name: 'tenement-manage' },
component: () => import('@/layouts/basic'),
children: [
{
path: '/security/tenant',
name: 'tenement-manage',
component: components['home'],
meta: {
title: '租户管理',
},
},
{
path: '/security/users',
name: 'users-manage',
component: components['home'],
meta: {
title: '用户管理'
}
}
]
}

191
dolphinscheduler-ui-next/src/router/routes.ts

@ -15,189 +15,58 @@
* limitations under the License. * limitations under the License.
*/ */
import type { RouteRecordRaw } from "vue-router"; import type { RouteRecordRaw } from 'vue-router'
import type { Component } from "vue"; import type { Component } from 'vue'
import utils from "@/utils"; import utils from '@/utils'
import { useI18n } from "vue-i18n"; import projectsPage from './modules/projects'
import resourcesPage from './modules/resources'
import datasourcePage from './modules/datasource'
import monitorPage from './modules/monitor'
import securityPage from './modules/security'
// All TSX files under the views folder automatically generate mapping relationship // All TSX files under the views folder automatically generate mapping relationship
const modules = import.meta.glob("/src/views/**/**.tsx"); const modules = import.meta.glob('/src/views/**/**.tsx')
const components: { [key: string]: Component } = utils.mapping(modules); const components: { [key: string]: Component } = utils.mapping(modules)
/** /**
* Basic page * Basic page
*/ */
const basePage: RouteRecordRaw[] = [ const basePage: RouteRecordRaw[] = [
{ {
path: "/", path: '/',
redirect: { name: "home" }, redirect: { name: 'home' },
meta: { title: "首页" }, meta: { title: '首页' },
component: () => import("@/layouts/basic"), component: () => import('@/layouts/basic'),
children: [ children: [
{ {
path: "/home", path: '/home',
name: "home", name: 'home',
component: components["home"], component: components['home'],
meta: { meta: {
title: "首页", title: '首页',
}, },
}, },
], ],
}, },
]; projectsPage,
resourcesPage,
const projectsPage = [ datasourcePage,
{ monitorPage,
path: "/projects", securityPage,
name: "projects", ]
redirect: { name: "projects-list" },
meta: { title: "项目管理" },
component: () => import("@/layouts/basic"),
children: [
{
path: "/projects/list",
name: "projects-list",
component: components["home"],
meta: {
title: "项目",
},
},
{
path: "/projects/:projectCode/index",
name: "projects-index",
component: components["home"],
meta: {
title: "工作流监控",
},
},
],
},
];
const resourcesPage = [
{
path: "/resource",
name: "resource",
redirect: { name: "file" },
meta: { title: "资源中心" },
component: () => import("@/layouts/basic"),
children: [
{
path: "/resource/file",
name: "file",
component: components["home"],
meta: {
title: "文件管理",
},
},
{
path: "/resource/file/create",
name: "resource-file-create",
component: components["home"],
meta: {
title: "创建资源",
},
},
],
},
];
const datasourcePage = [
{
path: "/datasource",
name: "datasource",
redirect: { name: "datasource-list" },
meta: { title: "数据源中心" },
component: () => import("@/layouts/basic"),
children: [
{
path: "/datasource/list",
name: "datasource-list",
component: components["home"],
meta: {
title: "数据源中心",
},
},
],
},
];
const monitorPage = [
{
path: "/monitor",
name: "monitor",
meta: { title: "monitor" },
redirect: { name: "servers-master" },
component: () => import("@/layouts/basic"),
children: [
{
path: "/monitor/servers/master",
name: "servers-master",
component: components["home"],
meta: {
title: "服务管理-Master",
},
},
{
path: "/monitor/servers/worker",
name: "servers-worker",
component: components["home"],
meta: {
title: "服务管理-Worker",
},
},
],
},
];
const securityPage: RouteRecordRaw[] = [
{
path: "/security",
name: "security",
meta: { title: "安全中心" },
redirect: { name: "tenement-manage" },
component: () => import("@/layouts/basicLayout"),
children: [
{
path: "/security/tenant",
name: "tenement-manage",
component: components["home"],
meta: {
title: "租户管理",
},
},
{
path: "/security/users",
name: "users-manage",
component: components["home"],
meta: {
title: "用户管理",
},
},
],
},
];
/** /**
* Login page * Login page
*/ */
const loginPage: RouteRecordRaw[] = [ const loginPage: RouteRecordRaw[] = [
{ {
path: "/login", path: '/login',
name: "login", name: 'login',
component: components["login"], component: components['login'],
}, },
]; ]
const routes: RouteRecordRaw[] = [ const routes: RouteRecordRaw[] = [...basePage, ...loginPage]
...basePage,
...loginPage,
...projectsPage,
...resourcesPage,
...datasourcePage,
...monitorPage,
...securityPage,
];
// 重新组织后导出 // 重新组织后导出
export default routes; export default routes

2
dolphinscheduler-ui-next/src/utils/index.ts

@ -18,7 +18,7 @@
import mapping from './mapping' import mapping from './mapping'
const utils = { const utils = {
mapping mapping,
} }
export default utils export default utils

Loading…
Cancel
Save