diff --git a/pom.xml b/pom.xml index 80a91deb0..778067f94 100644 --- a/pom.xml +++ b/pom.xml @@ -85,6 +85,7 @@ scaleph-ui-react + scaleph-ui-react2 scaleph-common scaleph-dao diff --git a/scaleph-ui-react2/.editorconfig b/scaleph-ui-react2/.editorconfig new file mode 100644 index 000000000..7e3649acc --- /dev/null +++ b/scaleph-ui-react2/.editorconfig @@ -0,0 +1,16 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/scaleph-ui-react2/.env b/scaleph-ui-react2/.env new file mode 100644 index 000000000..e57859d2d --- /dev/null +++ b/scaleph-ui-react2/.env @@ -0,0 +1 @@ +PORT=8001 diff --git a/scaleph-ui-react2/.eslintignore b/scaleph-ui-react2/.eslintignore new file mode 100644 index 000000000..8336e9350 --- /dev/null +++ b/scaleph-ui-react2/.eslintignore @@ -0,0 +1,8 @@ +/lambda/ +/scripts +/config +.history +public +dist +.umi +mock \ No newline at end of file diff --git a/scaleph-ui-react2/.eslintrc.js b/scaleph-ui-react2/.eslintrc.js new file mode 100644 index 000000000..b882c20e8 --- /dev/null +++ b/scaleph-ui-react2/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + extends: [require.resolve('@umijs/fabric/dist/eslint')], + globals: { + ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, + page: true, + REACT_APP_ENV: true, + }, +}; diff --git a/scaleph-ui-react2/.gitignore b/scaleph-ui-react2/.gitignore new file mode 100644 index 000000000..64d515631 --- /dev/null +++ b/scaleph-ui-react2/.gitignore @@ -0,0 +1,41 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +**/node_modules +# roadhog-api-doc ignore +/src/utils/request-temp.js +_roadhog-api-doc + +# production +/dist +/dist-bin + +# misc +.DS_Store +npm-debug.log* +yarn-error.log + +/coverage +.idea +yarn.lock +package-lock.json +pnpm-lock.yaml +*bak + + +# visual studio code +.history +*.log +functions/* +.temp/** + +# umi +.umi +.umi-production + +# screenshot +screenshot +.firebase +.eslintcache + +build diff --git a/scaleph-ui-react2/.hintrc b/scaleph-ui-react2/.hintrc new file mode 100644 index 000000000..39c7e01ba --- /dev/null +++ b/scaleph-ui-react2/.hintrc @@ -0,0 +1,15 @@ +{ + "extends": [ + "development" + ], + "hints": { + "no-inline-styles": "off", + "typescript-config/consistent-casing": "off", + "axe/forms": [ + "default", + { + "label": "off" + } + ] + } +} \ No newline at end of file diff --git a/scaleph-ui-react2/.npmrc b/scaleph-ui-react2/.npmrc new file mode 100644 index 000000000..2d6d1c408 --- /dev/null +++ b/scaleph-ui-react2/.npmrc @@ -0,0 +1,2 @@ +# registry=https://registry.npmjs.org/ +registry=https://registry.npm.taobao.org/ diff --git a/scaleph-ui-react2/.prettierignore b/scaleph-ui-react2/.prettierignore new file mode 100644 index 000000000..d17efb442 --- /dev/null +++ b/scaleph-ui-react2/.prettierignore @@ -0,0 +1,23 @@ +**/*.svg +package.json +.umi +.umi-production +/dist +.dockerignore +.DS_Store +.eslintignore +*.png +*.toml +docker +.editorconfig +Dockerfile* +.gitignore +.prettierignore +LICENSE +.eslintcache +*.lock +yarn-error.log +.history +CNAME +/build +/public \ No newline at end of file diff --git a/scaleph-ui-react2/.prettierrc.js b/scaleph-ui-react2/.prettierrc.js new file mode 100644 index 000000000..7b597d789 --- /dev/null +++ b/scaleph-ui-react2/.prettierrc.js @@ -0,0 +1,5 @@ +const fabric = require('@umijs/fabric'); + +module.exports = { + ...fabric.prettier, +}; diff --git a/scaleph-ui-react2/config/config.ts b/scaleph-ui-react2/config/config.ts new file mode 100644 index 000000000..f7cc7d3a2 --- /dev/null +++ b/scaleph-ui-react2/config/config.ts @@ -0,0 +1,120 @@ +// https://umijs.org/config/ +import { defineConfig } from "@umijs/max"; +import defaultSettings from "./defaultSettings"; +import proxy from "./proxy"; +import routes from "./routes"; + +const { REACT_APP_ENV = "dev" } = process.env; + +export default defineConfig({ + /** + * @name 开启 hash 模式 + * @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。 + * @doc https://umijs.org/docs/api/config#hash + */ + hash: true, + + /** + * @name 兼容性设置 + * @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖 + * @doc https://umijs.org/docs/api/config#targets + */ + // targets: { + // ie: 11, + // }, + /** + * @name 路由的配置,不在路由中引入的文件不会编译 + * @description 只支持 path,component,routes,redirect,wrappers,title 的配置 + * @doc https://umijs.org/docs/guides/routes + */ + // umi routes: https://umijs.org/docs/routing + routes, + /** + * @name 主题的配置 + * @description 虽然叫主题,但是其实只是 less 的变量设置 + * @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn + * @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme + */ + theme: { + // 如果不想要 configProvide 动态设置主题需要把这个设置为 default + // 只有设置为 variable, 才能使用 configProvide 动态设置主色调 + "root-entry-name": "variable", + }, + /** + * @name moment 的国际化配置 + * @description 如果对国际化没有要求,打开之后能减少js的包大小 + * @doc https://umijs.org/docs/api/config#ignoremomentlocale + */ + ignoreMomentLocale: true, + /** + * @name 代理配置 + * @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了 + * @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。 + * @doc 代理介绍 https://umijs.org/docs/guides/proxy + * @doc 代理配置 https://umijs.org/docs/api/config#proxy + */ + proxy: proxy[REACT_APP_ENV as keyof typeof proxy], + /** + * @name 快速热更新配置 + * @description 一个不错的热更新组件,更新时可以保留 state + */ + fastRefresh: true, + //============== 以下都是max的插件配置 =============== + /** + * @name 数据流插件 + * @@doc https://umijs.org/docs/max/data-flow + */ + model: {}, + dva: {}, + /** + * 一个全局的初始数据流,可以用它在插件之间共享数据 + * @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。 + * @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81 + */ + initialState: {}, + /** + * @name layout 插件 + * @doc https://umijs.org/docs/max/layout-menu + */ + layout: { + locale: true, + ...defaultSettings, + }, + /** + * @name 国际化插件 + * @doc https://umijs.org/docs/max/i18n + */ + locale: { + // default zh-CN + default: "zh-CN", + antd: true, + // default true, when it is true, will use `navigator.language` overwrite default + baseNavigator: true, + }, + /** + * @name antd 插件 + * @description 内置了 babel import 插件 + * @doc https://umijs.org/docs/max/antd#antd + */ + antd: {}, + /** + * @name 网络请求配置 + * @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。 + * @doc https://umijs.org/docs/max/request + */ + request: {}, + /** + * @name 权限插件 + * @description 基于 initialState 的权限插件,必须先打开 initialState + * @doc https://umijs.org/docs/max/access + */ + access: {}, + icons: {}, + //================ pro 插件配置 ================= + presets: ["umi-presets-pro"], + mfsu: { + strategy: "normal", + }, + requestRecord: {}, + esbuildMinifyIIFE: true, +}); diff --git a/scaleph-ui-react2/config/defaultSettings.ts b/scaleph-ui-react2/config/defaultSettings.ts new file mode 100644 index 000000000..648ecc655 --- /dev/null +++ b/scaleph-ui-react2/config/defaultSettings.ts @@ -0,0 +1,30 @@ +import { Settings as LayoutSettings } from "@ant-design/pro-components"; + +const {PUBLIC_PATH} = process.env; +const baseURL = PUBLIC_PATH ? + (PUBLIC_PATH.endsWith("/") ? PUBLIC_PATH.substring(0, PUBLIC_PATH.length - 1) : PUBLIC_PATH) + : '' + +/** + * @name + */ +const Settings: LayoutSettings & { + pwa?: boolean; + logo?: string; +} = { + navTheme: "light", + colorPrimary: "#1890ff", + layout: "mix", + contentWidth: "Fluid", + fixedHeader: true, + fixSiderbar: true, + colorWeak: false, + title: "Scaleph", + pwa: false, + logo: `${baseURL}/scaleph.svg`, + iconfontUrl: "", + splitMenus: true, + siderMenuType: "sub", +}; + +export default Settings; diff --git a/scaleph-ui-react2/config/proxy.ts b/scaleph-ui-react2/config/proxy.ts new file mode 100644 index 000000000..da93dfad7 --- /dev/null +++ b/scaleph-ui-react2/config/proxy.ts @@ -0,0 +1,25 @@ +/** + * @name 代理的配置 + * @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置 + * ------------------------------- + * The agent cannot take effect in the production environment + * so there is no configuration of the production environment + * For details, please see + * https://pro.ant.design/docs/deploy + * + * @doc https://umijs.org/docs/guides/proxy + */ +export default { + dev: { + '/api/': { + target: 'http://localhost:8080/scaleph', + changeOrigin: true, + }, + }, + pre: { + '/api/': { + target: 'http://localhost:8080/scaleph', + changeOrigin: true, + }, + }, +}; diff --git a/scaleph-ui-react2/config/routes.ts b/scaleph-ui-react2/config/routes.ts new file mode 100644 index 000000000..e52c56033 --- /dev/null +++ b/scaleph-ui-react2/config/routes.ts @@ -0,0 +1,406 @@ +import { PRIVILEGES } from "../src/constants"; + +/** + * @name umi 的路由配置 + * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置 + * @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。 + * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。 + * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。 + * @param redirect 配置路由跳转 + * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验 + * @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题 + * @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 则取值应为 user 或者 User + * @doc https://umijs.org/docs/guides/routes + */ +export default [ + { + path: "/user", + layout: false, + routes: [ + { + name: "login", + path: "/user/login", + component: "./User/Login", + exact: true, + }, + { + name: "register", + path: "/user/register", + component: "./User/Register", + exact: true, + }, + ], + }, + { + path: "/", + redirect: "/studio", + }, + { + name: 'studio', + path: '/studio', + icon: 'codeSandbox', + routes: [ + { + path: '/studio', + redirect: '/studio/databoard', + }, + { + name: 'databoard', + path: '/studio/databoard', + icon: 'dashboard', + component: './Studio/DataBoard', + }, + ], + }, + { + name: 'project', + path: '/project', + icon: 'project', + routes: [ + { + path: '/project', + component: './Project', + }, + ], + }, + { + path: '/workspace', + routes: [ + { + path: '/workspace', + redirect: '/workspace/artifact', + }, + { + name: 'project.artifact', + path: '/workspace/artifact', + icon: 'code', + routes: [ + { + path: '/workspace/artifact', + redirect: '/workspace/artifact/jar', + }, + { + name: 'jar', + path: '/workspace/artifact/jar', + component: './Project/Workspace/Artifact/Jar', + }, + { + path: '/workspace/artifact/history', + component: './Project/Workspace/Artifact/Jar/History', + }, + { + name: 'sql', + path: '/workspace/artifact/sql', + component: './Project/Workspace/Artifact/Sql', + }, + { + path: '/workspace/artifact/editor', + component: './Project/Workspace/Artifact/Sql/CodeEditor', + }, + { + name: 'seatunnel', + path: '/workspace/artifact/seatunnel', + component: './Project/Workspace/Artifact/DI/DiJobView', + }, + { + path: '/workspace/artifact/seatunnel/dag', + component: './Project/Workspace/Artifact/DI/DiJobFlow', + }, + ] + }, + { + name: 'project.flink.kubernetes', + path: '/workspace/flink/kubernetes', + icon: 'deploymentUnit', + routes: [ + { + path: '/workspace/flink/kubernetes', + redirect: '/workspace/flink/kubernetes/template', + }, + { + name: 'template', + path: '/workspace/flink/kubernetes/template', + component: './Project/Workspace/Kubernetes/Template', + }, + { + path: '/workspace/flink/kubernetes/template/steps/new', + component: './Project/Workspace/Kubernetes/Template/Steps/New', + }, + { + path: '/workspace/flink/kubernetes/template/steps/update', + component: './Project/Workspace/Kubernetes/Template/Steps/Update', + }, + { + name: 'session-cluster', + path: '/workspace/flink/kubernetes/session-cluster', + component: './Project/Workspace/Kubernetes/SessionCluster', + }, + { + path: '/workspace/flink/kubernetes/session-cluster/steps/new', + component: './Project/Workspace/Kubernetes/SessionCluster/Steps/New', + }, + { + path: '/workspace/flink/kubernetes/session-cluster/steps/update', + component: './Project/Workspace/Kubernetes/SessionCluster/Steps/Update', + }, + { + path: '/workspace/flink/kubernetes/session-cluster/detail', + component: './Project/Workspace/Kubernetes/SessionCluster/Detail', + }, + { + name: 'deployment', + path: '/workspace/flink/kubernetes/deployment', + component: './Project/Workspace/Kubernetes/Deployment', + }, + { + path: '/workspace/flink/kubernetes/deployment/steps/new', + component: './Project/Workspace/Kubernetes/Deployment/Steps/New', + }, + { + path: '/workspace/flink/kubernetes/deployment/steps/update', + component: './Project/Workspace/Kubernetes/Deployment/Steps/Update', + }, + { + path: '/workspace/flink/kubernetes/deployment/detail', + component: './Project/Workspace/Kubernetes/Deployment/Detail', + }, + { + name: 'job', + path: '/workspace/flink/kubernetes/job', + component: './Project/Workspace/Kubernetes/Job', + }, + { + path: '/workspace/flink/kubernetes/job/detail', + component: './Project/Workspace/Kubernetes/Job/Detail', + }, + ] + }, + { + name: 'project.doris', + path: '/workspace/doris', + icon: 'solution', + routes: [ + { + path: '/workspace/doris', + redirect: '/workspace/doris/template', + }, + { + name: 'template', + path: '/workspace/doris/template', + component: './Project/Workspace/Doris/OperatorTemplate', + }, + { + path: '/workspace/doris/template/steps', + component: './Project/Workspace/Doris/OperatorTemplate/Steps', + }, + { + path: '/workspace/doris/template/detail', + component: './Project/Workspace/Doris/OperatorTemplate/Detail', + }, + { + name: 'instance', + path: '/workspace/doris/instance', + component: './Project/Workspace/Doris/OperatorInstance', + }, + { + path: '/workspace/doris/instance/steps', + component: './Project/Workspace/Doris/OperatorInstance/Steps', + }, + { + path: '/workspace/doris/instance/detail', + component: './Project/Workspace/Doris/OperatorInstance/Detail', + }, + ] + }, + ] + }, + { + name: 'resource', + path: '/resource', + icon: 'fileText', + routes: [ + { + path: '/resource', + redirect: '/resource/jar', + }, + { + name: 'jar', + path: '/resource/jar', + component: './Resource/Jar', + }, + { + name: 'flinkRelease', + path: '/resource/flink-release', + component: './Resource/FlinkRelease', + }, + { + name: 'seatunnelRelease', + path: '/resource/seatunnel-release', + component: './Resource/SeaTunnelRelease', + }, + { + path: '/resource/seatunnel-release/connectors', + component: './Resource/SeaTunnelConnector', + }, + { + name: 'kerberos', + path: '/resource/kerberos', + component: './Resource/Kerberos', + }, + { + name: 'clusterCredential', + path: '/resource/cluster-credential', + component: './Resource/ClusterCredential', + } + ] + }, + { + name: 'dataSource', + path: '/dataSource', + icon: 'compass', + routes: [ + { + path: '/dataSource', + component: './DataSource', + }, + { + path: '/dataSource/stepForms', + component: './DataSource/StepForms', + } + ] + }, + { + name: 'stdata', + path: '/stdata', + icon: 'database', + routes: [ + { + path: '/stdata', + redirect: '/stdata/system', + }, + { + name: 'system', + path: '/stdata/system', + icon: 'group', + component: './Stdata/System', + }, + { + name: 'dataElement', + path: '/stdata/dataElement', + icon: 'hdd', + component: './Stdata/DataElement', + }, + { + name: 'refdata', + path: '/stdata/refdata', + icon: 'profile', + component: './Stdata/RefData', + }, + { + path: '/stdata/refdata/value', + component: './Stdata/RefData/Value', + }, + { + name: 'refdataMap', + path: '/stdata/refdataMap', + icon: 'oneToOne', + component: './Stdata/RefDataMap', + } + ] + }, + { + name: 'admin', + path: '/admin', + icon: 'setting', + routes: [ + { + path: '/admin', + redirect: '/admin/dept', + }, + { + name: 'dept', + path: '/admin/dept', + icon: 'apartment', + component: './Admin/Dept', + }, + { + name: 'role', + path: '/admin/role', + icon: 'safety', + component: './Admin/Role', + }, + { + name: 'user', + path: '/admin/user', + icon: 'user', + component: './Admin/User', + }, + { + name: 'resource.web', + path: '/admin/resource/web', + icon: 'team', + component: './Admin/Resource/Web', + }, + { + name: 'privilege', + path: '/admin/privilege', + icon: 'team', + component: './Admin/Privilege', + }, + { + name: 'quartz', + path: '/admin/workflow/quartz', + icon: 'fieldTime', + component: './Workflow/Definition/Quartz', + }, + { + path: '/admin/workflow/quartz/task', + component: './Workflow/Definition/Quartz/Task', + }, + { + path: '/admin/workflow/schedule', + component: './Workflow/Schedule', + }, + { + name: 'dict', + path: '/admin/dict', + icon: 'table', + component: './Admin/Dict', + }, + { + name: 'setting', + path: '/admin/setting', + icon: 'setting', + component: './Admin/Setting', + }, + ], + }, + { + path: "/user/center", + component: "./User", + exact: true, + }, + { + path: "/403", + component: "./Abnormal/403", + layout: false, + exact: true, + }, + { + path: "/404", + component: "./Abnormal/404", + layout: false, + exact: true, + }, + { + path: "/500", + component: "./Abnormal/500", + layout: false, + exact: true, + }, + { + path: "*", + layout: false, + component: "./Abnormal/404", + }, +]; diff --git a/scaleph-ui-react2/jsconfig.json b/scaleph-ui-react2/jsconfig.json new file mode 100644 index 000000000..197bee5d5 --- /dev/null +++ b/scaleph-ui-react2/jsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/scaleph-ui-react2/package.json b/scaleph-ui-react2/package.json new file mode 100644 index 000000000..880a4e311 --- /dev/null +++ b/scaleph-ui-react2/package.json @@ -0,0 +1,107 @@ +{ + "name": "scaleph", + "version": "2.0.3", + "private": true, + "description": "Scaleph", + "scripts": { + "analyze": "cross-env ANALYZE=1 max build", + "build": "max build", + "deploy": "npm run build && npm run gh-pages", + "dev": "npm run start:dev", + "gh-pages": "gh-pages -d dist", + "i18n-remove": "pro i18n-remove --locale=zh-CN --write", + "postinstall": "max setup", + "jest": "jest", + "lint": "npm run lint:js && npm run lint:prettier && npm run tsc", + "lint-staged": "lint-staged", + "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", + "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ", + "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", + "lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto", + "openapi": "max openapi", + "prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"", + "preview": "npm run build && max preview --port 8000", + "record": "cross-env NODE_ENV=development REACT_APP_ENV=test max record --scene=login", + "serve": "umi-serve", + "start": "cross-env UMI_ENV=dev max dev", + "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev", + "start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev", + "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev", + "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev", + "test": "jest", + "test:coverage": "npm run jest -- --coverage", + "test:update": "npm run jest -- -u", + "tsc": "tsc --noEmit" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js", + "**/*.{js,jsx,tsx,ts,less,md,json}": [ + "prettier --write" + ] + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 10" + ], + "dependencies": { + "@ant-design/icons": "^4.7.0", + "@ant-design/pro-components": "^2.3.47", + "@antv/xflow": "^2.0.3", + "@ant-design/pro-layout": "^7.10.3", + "@ant-design/use-emotion-css": "1.0.4", + "@monaco-editor/react": "^4.4.6", + "@types/babel__template": "^7.4.1", + "@umijs/route-utils": "^2.1.3", + "ag-grid-community": "^29.2.0", + "ag-grid-react": "^29.2.0", + "antd": "^5.0.0", + "classnames": "^2.3.2", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "monaco-editor": "^0.37.0", + "monaco-themes": "^0.4.4", + "omit.js": "^2.0.2", + "rc-menu": "^9.6.4", + "rc-util": "^5.24.4", + "react": "^18.0.0", + "react-cookies": "^0.1.1", + "react-dev-inspector": "^1.8.1", + "react-dom": "^18.0.0", + "react-helmet-async": "^1.3.0", + "react-split": "^2.0.14", + "sql-formatter": "^12.2.4", + "socket.io-client": "^4.7.2" + }, + "devDependencies": { + "@ant-design/pro-cli": "^2.1.0", + "@testing-library/react": "^13.4.0", + "@types/classnames": "^2.3.1", + "@types/express": "^4.17.14", + "@types/history": "^4.7.11", + "@types/jest": "^29.2.1", + "@types/lodash": "^4.14.186", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", + "@types/react-helmet": "^6.1.5", + "@umijs/lint": "^4.0.34", + "@umijs/max": "^4.0.33", + "cross-env": "^7.0.3", + "eslint": "^8.0.0", + "express": "^4.18.2", + "gh-pages": "^3.2.0", + "jest": "^29.2.2", + "jest-environment-jsdom": "^29.2.2", + "lint-staged": "^10.0.0", + "mockjs": "^1.1.0", + "monaco-editor-webpack-plugin": "^7.0.1", + "prettier": "^2.7.1", + "swagger-ui-dist": "^4.14.2", + "ts-node": "^10.9.1", + "typescript": "^4.8.4", + "umi-presets-pro": "^2.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/scaleph-ui-react2/pom.xml b/scaleph-ui-react2/pom.xml new file mode 100644 index 000000000..54858ba99 --- /dev/null +++ b/scaleph-ui-react2/pom.xml @@ -0,0 +1,93 @@ + + + + + 4.0.0 + + cn.sliew + scaleph + 2.0.3-SNAPSHOT + ../pom.xml + + scaleph-ui-react2 + scaleph-ui-react2 + + + v16.14.0 + 8.5.4 + run build --prod + + + + + dist + + run dist-build + + + + + + + + com.github.eirslett + frontend-maven-plugin + + + install node and npm + + install-node-and-npm + + generate-resources + + + npm install + + npm + + generate-resources + + install --force + + + + npm run build + + npm + + compile + + ${build.command} + + + + + ${build.node.version} + ${build.npm.version} + target + https://npm.taobao.org/mirrors/node/ + https://registry.npm.taobao.org/npm/-/ + + + + + + \ No newline at end of file diff --git a/scaleph-ui-react2/public/CNAME b/scaleph-ui-react2/public/CNAME new file mode 100644 index 000000000..a0cc5ea31 --- /dev/null +++ b/scaleph-ui-react2/public/CNAME @@ -0,0 +1 @@ +basedt.dms \ No newline at end of file diff --git a/scaleph-ui-react2/public/favicon.ico b/scaleph-ui-react2/public/favicon.ico new file mode 100644 index 000000000..7228300c9 Binary files /dev/null and b/scaleph-ui-react2/public/favicon.ico differ diff --git a/scaleph-ui-react2/public/icons/scaleph.png b/scaleph-ui-react2/public/icons/scaleph.png new file mode 100644 index 000000000..e9f18eedb Binary files /dev/null and b/scaleph-ui-react2/public/icons/scaleph.png differ diff --git a/scaleph-ui-react2/public/icons/scaleph@0.5x.png b/scaleph-ui-react2/public/icons/scaleph@0.5x.png new file mode 100644 index 000000000..187eae195 Binary files /dev/null and b/scaleph-ui-react2/public/icons/scaleph@0.5x.png differ diff --git a/scaleph-ui-react2/public/icons/scaleph@2x.png b/scaleph-ui-react2/public/icons/scaleph@2x.png new file mode 100644 index 000000000..2d8ec6178 Binary files /dev/null and b/scaleph-ui-react2/public/icons/scaleph@2x.png differ diff --git a/scaleph-ui-react2/public/icons/scaleph@3x.png b/scaleph-ui-react2/public/icons/scaleph@3x.png new file mode 100644 index 000000000..474033664 Binary files /dev/null and b/scaleph-ui-react2/public/icons/scaleph@3x.png differ diff --git a/scaleph-ui-react2/public/icons8-github.svg b/scaleph-ui-react2/public/icons8-github.svg new file mode 100644 index 000000000..631e1ff4a --- /dev/null +++ b/scaleph-ui-react2/public/icons8-github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/scaleph-ui-react2/public/images/DataSource/Cassandra.png b/scaleph-ui-react2/public/images/DataSource/Cassandra.png new file mode 100644 index 000000000..b51b2cdbd Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Cassandra.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/ClickHouse.png b/scaleph-ui-react2/public/images/DataSource/ClickHouse.png new file mode 100644 index 000000000..48fe97c41 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/ClickHouse.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/DataHub.png b/scaleph-ui-react2/public/images/DataSource/DataHub.png new file mode 100644 index 000000000..268a5cbf8 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/DataHub.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/DmDB.png b/scaleph-ui-react2/public/images/DataSource/DmDB.png new file mode 100644 index 000000000..b92dfd66e Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/DmDB.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Doris.png b/scaleph-ui-react2/public/images/DataSource/Doris.png new file mode 100644 index 000000000..dd75723eb Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Doris.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Druid.png b/scaleph-ui-react2/public/images/DataSource/Druid.png new file mode 100644 index 000000000..8b49cc0d9 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Druid.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Elasticsearch.png b/scaleph-ui-react2/public/images/DataSource/Elasticsearch.png new file mode 100644 index 000000000..61e8c1590 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Elasticsearch.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Ftp.png b/scaleph-ui-react2/public/images/DataSource/Ftp.png new file mode 100644 index 000000000..9bc86f4eb Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Ftp.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/GBase8a.png b/scaleph-ui-react2/public/images/DataSource/GBase8a.png new file mode 100644 index 000000000..9eee8e089 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/GBase8a.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Greenplum.png b/scaleph-ui-react2/public/images/DataSource/Greenplum.png new file mode 100644 index 000000000..3e95bf5d1 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Greenplum.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/HBase.png b/scaleph-ui-react2/public/images/DataSource/HBase.png new file mode 100644 index 000000000..eada91787 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/HBase.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/HDFS.png b/scaleph-ui-react2/public/images/DataSource/HDFS.png new file mode 100644 index 000000000..720b762fd Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/HDFS.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Hive.png b/scaleph-ui-react2/public/images/DataSource/Hive.png new file mode 100644 index 000000000..93d5d32dd Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Hive.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Http.svg b/scaleph-ui-react2/public/images/DataSource/Http.svg new file mode 100644 index 000000000..9f50669da --- /dev/null +++ b/scaleph-ui-react2/public/images/DataSource/Http.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/scaleph-ui-react2/public/images/DataSource/Hudi.png b/scaleph-ui-react2/public/images/DataSource/Hudi.png new file mode 100644 index 000000000..c0438154f Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Hudi.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Iceberg.png b/scaleph-ui-react2/public/images/DataSource/Iceberg.png new file mode 100644 index 000000000..c179a2963 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Iceberg.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Impala.png b/scaleph-ui-react2/public/images/DataSource/Impala.png new file mode 100644 index 000000000..646a31d50 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Impala.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/InfluxDB.png b/scaleph-ui-react2/public/images/DataSource/InfluxDB.png new file mode 100644 index 000000000..ac8575c75 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/InfluxDB.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/IoTDB.png b/scaleph-ui-react2/public/images/DataSource/IoTDB.png new file mode 100644 index 000000000..0b007a032 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/IoTDB.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Kafka.png b/scaleph-ui-react2/public/images/DataSource/Kafka.png new file mode 100644 index 000000000..6510985ff Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Kafka.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Kudu.png b/scaleph-ui-react2/public/images/DataSource/Kudu.png new file mode 100644 index 000000000..3b37af35a Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Kudu.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Kylin.png b/scaleph-ui-react2/public/images/DataSource/Kylin.png new file mode 100644 index 000000000..3e669cfde Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Kylin.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/MaxCompute.png b/scaleph-ui-react2/public/images/DataSource/MaxCompute.png new file mode 100644 index 000000000..f7454ad66 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/MaxCompute.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/MongoDB.png b/scaleph-ui-react2/public/images/DataSource/MongoDB.png new file mode 100644 index 000000000..90c90158e Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/MongoDB.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/MySQL.png b/scaleph-ui-react2/public/images/DataSource/MySQL.png new file mode 100644 index 000000000..68d2adedd Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/MySQL.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Neo4j.png b/scaleph-ui-react2/public/images/DataSource/Neo4j.png new file mode 100644 index 000000000..e6bc5102e Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Neo4j.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/OSS.png b/scaleph-ui-react2/public/images/DataSource/OSS.png new file mode 100644 index 000000000..d731b4fb8 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/OSS.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Oracle.png b/scaleph-ui-react2/public/images/DataSource/Oracle.png new file mode 100644 index 000000000..ae25e6f71 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Oracle.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Phoenix.png b/scaleph-ui-react2/public/images/DataSource/Phoenix.png new file mode 100644 index 000000000..b909b693d Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Phoenix.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/PostgreSQL.png b/scaleph-ui-react2/public/images/DataSource/PostgreSQL.png new file mode 100644 index 000000000..c4e1ac272 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/PostgreSQL.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Pulsar.png b/scaleph-ui-react2/public/images/DataSource/Pulsar.png new file mode 100644 index 000000000..9cc6aeaa0 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Pulsar.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Redis.png b/scaleph-ui-react2/public/images/DataSource/Redis.png new file mode 100644 index 000000000..0afb57fd8 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Redis.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/S3.png b/scaleph-ui-react2/public/images/DataSource/S3.png new file mode 100644 index 000000000..dacd2b979 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/S3.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/SQLServer.png b/scaleph-ui-react2/public/images/DataSource/SQLServer.png new file mode 100644 index 000000000..6b27c257e Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/SQLServer.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Sftp.png b/scaleph-ui-react2/public/images/DataSource/Sftp.png new file mode 100644 index 000000000..e842fa798 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Sftp.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Socket.png b/scaleph-ui-react2/public/images/DataSource/Socket.png new file mode 100644 index 000000000..e76eb64e7 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Socket.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/Solr.png b/scaleph-ui-react2/public/images/DataSource/Solr.png new file mode 100644 index 000000000..f63b329c6 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/Solr.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/TiDB.png b/scaleph-ui-react2/public/images/DataSource/TiDB.png new file mode 100644 index 000000000..5a4d97de7 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/TiDB.png differ diff --git a/scaleph-ui-react2/public/images/DataSource/WebSocket.png b/scaleph-ui-react2/public/images/DataSource/WebSocket.png new file mode 100644 index 000000000..1b96c8db9 Binary files /dev/null and b/scaleph-ui-react2/public/images/DataSource/WebSocket.png differ diff --git a/scaleph-ui-react2/public/images/EditorResult/folderMinus.svg b/scaleph-ui-react2/public/images/EditorResult/folderMinus.svg new file mode 100644 index 000000000..a9f82cc3d --- /dev/null +++ b/scaleph-ui-react2/public/images/EditorResult/folderMinus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/scaleph-ui-react2/public/images/EditorResult/folderOpen.svg b/scaleph-ui-react2/public/images/EditorResult/folderOpen.svg new file mode 100644 index 000000000..a4e2f42ec --- /dev/null +++ b/scaleph-ui-react2/public/images/EditorResult/folderOpen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\345\210\206\347\261\273.svg" "b/scaleph-ui-react2/public/images/EditorResult/\345\210\206\347\261\273.svg" new file mode 100644 index 000000000..6b020b727 --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\345\210\206\347\261\273.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\345\210\267\346\226\260.svg" "b/scaleph-ui-react2/public/images/EditorResult/\345\210\267\346\226\260.svg" new file mode 100644 index 000000000..a0e64faa3 --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\345\210\267\346\226\260.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\345\220\221\344\270\213.svg" "b/scaleph-ui-react2/public/images/EditorResult/\345\220\221\344\270\213.svg" new file mode 100644 index 000000000..1e4bcec2b --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\345\220\221\344\270\213.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\345\244\215\345\210\266.svg" "b/scaleph-ui-react2/public/images/EditorResult/\345\244\215\345\210\266.svg" new file mode 100644 index 000000000..32a0ac531 --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\345\244\215\345\210\266.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\346\210\220\345\212\237.svg" "b/scaleph-ui-react2/public/images/EditorResult/\346\210\220\345\212\237.svg" new file mode 100644 index 000000000..78c62e850 --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\346\210\220\345\212\237.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\346\220\234\347\264\242.svg" "b/scaleph-ui-react2/public/images/EditorResult/\346\220\234\347\264\242.svg" new file mode 100644 index 000000000..406eb7524 --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\346\220\234\347\264\242.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\346\222\255\346\224\276.svg" "b/scaleph-ui-react2/public/images/EditorResult/\346\222\255\346\224\276.svg" new file mode 100644 index 000000000..26d61443f --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\346\222\255\346\224\276.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\346\237\234\345\255\220.svg" "b/scaleph-ui-react2/public/images/EditorResult/\346\237\234\345\255\220.svg" new file mode 100644 index 000000000..0c501e2c8 --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\346\237\234\345\255\220.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\346\237\245\347\234\213.svg" "b/scaleph-ui-react2/public/images/EditorResult/\346\237\245\347\234\213.svg" new file mode 100644 index 000000000..a6a739f3a --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\346\237\245\347\234\213.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git "a/scaleph-ui-react2/public/images/EditorResult/\347\233\256\345\275\225.svg" "b/scaleph-ui-react2/public/images/EditorResult/\347\233\256\345\275\225.svg" new file mode 100644 index 000000000..75e3e5b28 --- /dev/null +++ "b/scaleph-ui-react2/public/images/EditorResult/\347\233\256\345\275\225.svg" @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/scaleph-ui-react2/public/images/bg.png b/scaleph-ui-react2/public/images/bg.png new file mode 100644 index 000000000..edc40be8d Binary files /dev/null and b/scaleph-ui-react2/public/images/bg.png differ diff --git a/scaleph-ui-react2/public/scaleph.svg b/scaleph-ui-react2/public/scaleph.svg new file mode 100644 index 000000000..68348600a --- /dev/null +++ b/scaleph-ui-react2/public/scaleph.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scaleph-ui-react2/src/access.ts b/scaleph-ui-react2/src/access.ts new file mode 100644 index 000000000..c13fb4d4c --- /dev/null +++ b/scaleph-ui-react2/src/access.ts @@ -0,0 +1,19 @@ +import { AuthService } from "./services/admin/auth.service"; + +/** + * @see https://umijs.org/zh-CN/plugins/plugin-access + * */ +export default function access( + initialState: { currentUser?: Scaleph.SysUser } | undefined +) { + const { currentUser } = initialState ?? {}; + + return { + canAccess: (code: string) => { + return Promise.resolve(true); + }, + normalRouteFilter: (route: any) => { + return Promise.resolve(true); + }, + }; +} diff --git a/scaleph-ui-react2/src/app.tsx b/scaleph-ui-react2/src/app.tsx new file mode 100644 index 000000000..d094ceca2 --- /dev/null +++ b/scaleph-ui-react2/src/app.tsx @@ -0,0 +1,177 @@ +import {useEffect, useState} from "react"; +import {Space} from "antd"; +import {LinkOutlined} from "@ant-design/icons"; +import {Settings as LayoutSettings} from "@ant-design/pro-components"; +import type {RunTimeLayoutConfig} from "@umijs/max"; +import {history, Link} from "@umijs/max"; +import defaultSettings from "../config/defaultSettings"; +import RightContent from "@/components/Header/RightContent"; +import Footer from "@/components/Footer"; +import {errorConfig} from "./requestErrorConfig"; +import {USER_AUTH} from "@/constants"; +import Icon from './icon'; +import {OnlineUserInfo, ResponseBody} from "@/typings"; +import {UserService} from "@/services/admin/user.service"; +import {AuthService} from "@/services/auth"; + +const isDev = process.env.NODE_ENV === "development"; +const whiteList: string[] = ["/user/login", "/user/register"]; + +/** + * @see https://umijs.org/zh-CN/plugins/plugin-initial-state + * */ +export async function getInitialState(): Promise<{ + settings?: Partial; + currentUser?: OnlineUserInfo; + loading?: boolean; + collapsed?: boolean; + fetchUserInfo?: () => Promise; +}> { + const fetchUserInfo = async () => { + let user: OnlineUserInfo = {}; + try { + await UserService.getOnlineUserInfo(localStorage.getItem(USER_AUTH.token)).then((resp) => { + if (resp.success && resp.data) { + user = resp.data; + } else { + console.log('fetchUserInfo', resp) + history.push("/user/login"); + } + }); + } catch (error) { + console.log('fetchUserInfo', error) + history.push("/user/login"); + } + return user; + }; + + // 如果不是登录页面,执行 + const {location} = history; + if (!whiteList.includes(location.pathname)) { + const currentUser = await fetchUserInfo(); + return { + fetchUserInfo, + currentUser, + collapsed: false, + settings: defaultSettings, + }; + } + return { + fetchUserInfo, + collapsed: false, + settings: defaultSettings, + }; +} + +// ProLayout 支持的api https://procomponents.ant.design/components/layout +export const layout: RunTimeLayoutConfig = ({initialState, setInitialState}) => { + + const [defaultMenus, setDefaultMenus] = useState<{}[]>([]); + useEffect(() => { + const fetchData = async () => { + const dataList: ResponseBody = await AuthService.menuRoutes(); + if (dataList) { + setDefaultMenus(dataList); + } + }; + fetchData(); + }, []); + + return { + siderWidth: 256, + token: { + bgLayout: "#fff", + header: { + colorBgHeader: "#fff", + }, + sider: { + colorMenuBackground: "#fff", + }, + pageContainer: { + colorBgPageContainer: "#fff", + }, + }, + breakpoint: false, + headerTitleRender: (logo, title, _) => { + const defaultDom = ( +
+ {logo} + {title} +
+ ); + return (<>{defaultDom}); + }, + rightContentRender: () => , + menuDataRender: () => defaultMenus, + menuItemRender: (menuItemProps: any, defaultDom: any) => { + return ( + + {menuItemProps.icon && } + history.push(menuItemProps.path)}>{menuItemProps?.name} + + ); + }, + subMenuItemRender: (menuItemProps: any, defaultDom: any) => { + return ( + + {menuItemProps.icon && } + {menuItemProps?.name} + + ); + }, + footerRender: () =>