Skip to content

Commit

Permalink
[Feature][scaleph-ui-react] refactor project sub menu routes (#694)
Browse files Browse the repository at this point in the history
* feature: refactor scaleph-ui-react

* feature: upgrade github actions version

* feature: upgrade github actions version

* feature: update routes

* feature: update routes

* feature: update routes

* feature: update routes

* feature: update routes

---------

Co-authored-by: wangqi <wangqi@xinxuan.net>
  • Loading branch information
kalencaya and wangqi authored Feb 29, 2024
1 parent 5b13743 commit 314f84d
Show file tree
Hide file tree
Showing 835 changed files with 6,711 additions and 6,720 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Setup Java JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
Expand All @@ -51,7 +51,7 @@ jobs:
timeout-minutes: 360
run: mvn -B -U -T 4C clean package
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./**/target/site/jacoco/jacoco.xml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Build scaleph-ui-react-dist
run: mvn -B -U package -pl scaleph-ui-react -am -DskipTests
- name: Build with NPM
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-dist-bin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
steps:
- id: checkout
name: Checkout Codes
uses: actions/checkout@v3
uses: actions/checkout@v4
- id: prepare_jdk
name: Prepare JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-manual-docker-flink-cdc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-manual-docker-flink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-manual-docker-seatunnel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-manual-docker-sql-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Setup Java JDK 11
uses: actions/setup-java@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-master-docker-scaleph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-tag-docker-scaleph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
timeout-minutes: 360
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Log in to the Container registry
uses: docker/login-action@v1.10.0
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 11
distribution: adopt
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@
<akka.version>2.6.21</akka.version>
<protobuf.version>3.21.5</protobuf.version>
<netty.version>4.1.82.Final</netty.version>
<flink.version>1.18.0</flink.version>
<flink.base.version>1.17</flink.base.version>
<flink-jdbc.version>3.1.1</flink-jdbc.version>
<paimon.version>0.5.0-incubating</paimon.version>
<flink.version>1.18.1</flink.version>
<flink.base.version>1.18</flink.base.version>
<flink-jdbc.version>3.1.2</flink-jdbc.version>
<paimon.version>0.7.0-incubating</paimon.version>
<kubernetes.client.version>6.2.0</kubernetes.client.version>
<spring-cloud-openfeign.version>3.1.7</spring-cloud-openfeign.version>
<zjsonpatch.version>0.4.14</zjsonpatch.version>
Expand Down
1 change: 1 addition & 0 deletions scaleph-ui-react/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=8000
File renamed without changes.
File renamed without changes.
152 changes: 103 additions & 49 deletions scaleph-ui-react/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,120 @@
// https://umijs.org/config/
import {defineConfig} from '@umijs/max';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';
import { defineConfig } from "@umijs/max";
import defaultSettings from "./defaultSettings";
import proxy from "./proxy";
import routes from "./routes";

const {REACT_APP_ENV} = process.env;
const { REACT_APP_ENV = "dev" } = process.env;

export default defineConfig({
publicPath: REACT_APP_ENV === 'dist' ? '/scaleph/ui/' : '/',
outputPath: REACT_APP_ENV === 'dist' ? 'dist-bin' : 'dist',
history: {
type: 'hash'
},
/**
* @name 开启 hash 模式
* @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。
* @doc https://umijs.org/docs/api/config#hash
*/
hash: true,
antd: {},
request: {},
initialState: {},

/**
* @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: {
// https://umijs.org/zh-CN/plugins/plugin-layout
locale: true,
siderWidth: 208,
...defaultSettings,
},
// https://umijs.org/zh-CN/plugins/plugin-locale
/**
* @name 国际化插件
* @doc https://umijs.org/docs/max/i18n
*/
locale: {
default: 'zh-CN',
// default zh-CN
default: "zh-CN",
antd: true,
title: true,
// default true, when it is true, will use `navigator.language` overwrite default
baseNavigator: true,
baseSeparator: '-',
},

targets: {
chrome: '86',
},
// umi routes: https://umijs.org/docs/routing
routes,
/**
* @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: {},
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
theme: {
// 如果不想要 configProvide 动态设置主题需要把这个设置为 default
// 只有设置为 variable, 才能使用 configProvide 动态设置主色调
// https://ant.design/docs/react/customize-theme-variable-cn
'root-entry-name': 'variable',
},
ignoreMomentLocale: true,
proxy: proxy[REACT_APP_ENV || 'dev'],
manifest: {
basePath: '/',
icons: {},
//================ pro 插件配置 =================
presets: ["umi-presets-pro"],
mfsu: {
strategy: "normal",
},
// Fast Refresh 热更新
fastRefresh: true,
presets: ['umi-presets-pro'],
dva: {}
// openAPI: [
// {
// requestLibPath: "import { request } from '@umijs/max'",
// schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
// projectName: 'swagger',
// },
// ],
requestRecord: {},
esbuildMinifyIIFE: true,
});


20 changes: 12 additions & 8 deletions scaleph-ui-react/config/defaultSettings.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
import { Settings as LayoutSettings } from '@ant-design/pro-components';
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',
primaryColor: '#1890ff',
layout: 'mix',
contentWidth: 'Fluid',
navTheme: "light",
colorPrimary: "#1890ff",
layout: "mix",
contentWidth: "Fluid",
fixedHeader: true,
fixSiderbar: true,
colorWeak: false,
splitMenus: true,
title: 'Scaleph',
title: "Scaleph",
pwa: false,
logo: `${baseURL}/scaleph.svg`,
iconfontUrl: '',
iconfontUrl: "",
splitMenus: true,
siderMenuType: "sub",
};

export default Settings;
Loading

0 comments on commit 314f84d

Please sign in to comment.