Skip to content

Flow #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 120 commits into from
Oct 28, 2024
Merged

Flow #73

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
9ee7c17
update
xlorne Sep 26, 2024
2a06828
add ui
xlorne Sep 26, 2024
499be3b
add admin-ui
xlorne Sep 26, 2024
22a58b9
add admin-ui
xlorne Sep 26, 2024
e047e89
add admin-ui
xlorne Sep 26, 2024
aee23ed
add menu page
xlorne Sep 26, 2024
a623434
add examples
xlorne Sep 26, 2024
420c0dc
add node page
xlorne Sep 27, 2024
03bd249
add jar
xlorne Sep 28, 2024
daf786d
ignore jars
xlorne Sep 29, 2024
8e56bc6
ignore jars
xlorne Sep 29, 2024
79fe962
ignore jars
xlorne Sep 29, 2024
6a23352
ignore jars
xlorne Sep 29, 2024
12e35e4
add flow
xlorne Sep 29, 2024
cf4ffaa
add flow
xlorne Sep 29, 2024
2c6ecb7
add SearchRequest
xlorne Sep 29, 2024
42b2c2c
add flow
xlorne Sep 30, 2024
bae4dc3
add flow
xlorne Sep 30, 2024
44f6a9f
add flow
xlorne Sep 30, 2024
02d65df
add flow
xlorne Sep 30, 2024
5aa5f93
add flow
xlorne Sep 30, 2024
46b543f
add flow
xlorne Sep 30, 2024
1a7d56a
add flow
xlorne Oct 2, 2024
552e0c7
add flow
xlorne Oct 2, 2024
d4f71e7
add flow
xlorne Oct 2, 2024
8ce5010
add flow
xlorne Oct 2, 2024
8af7217
add flow
xlorne Oct 3, 2024
cf52262
add flow
xlorne Oct 3, 2024
36b3f37
add flow
xlorne Oct 8, 2024
7318989
add flow
xlorne Oct 9, 2024
66696a2
add flow
xlorne Oct 9, 2024
288dd73
add flow
xlorne Oct 9, 2024
b87259b
add flow
xlorne Oct 9, 2024
b5faf97
add flow
xlorne Oct 9, 2024
c5fc696
add flow
xlorne Oct 9, 2024
fdf77d9
fix CodeEditor
xlorne Oct 9, 2024
48ab006
add users
xlorne Oct 9, 2024
9d55cde
fix preNodeCode
xlorne Oct 9, 2024
74e6fc4
add flow test
xlorne Oct 9, 2024
7657b27
add flow test
xlorne Oct 10, 2024
ec64825
add flow test
xlorne Oct 10, 2024
a79fa00
add FlowRelation
xlorne Oct 22, 2024
98564b6
remove example
xlorne Oct 22, 2024
2a9b0bb
flow domain
xlorne Oct 22, 2024
063040d
flow domain
xlorne Oct 22, 2024
6dbc5af
flow domain
xlorne Oct 22, 2024
eda1d3c
flow domain
xlorne Oct 22, 2024
f5a221f
flow domain
xlorne Oct 22, 2024
f78cb35
flow domain
xlorne Oct 22, 2024
c55a699
flow domain
xlorne Oct 23, 2024
39c7f6b
flow domain
xlorne Oct 23, 2024
1ce65af
flow domain
xlorne Oct 23, 2024
c19f2ea
flow domain
xlorne Oct 23, 2024
9fc61f3
flow domain
xlorne Oct 23, 2024
47c490f
flow domain
xlorne Oct 23, 2024
6a12471
flow domain
xlorne Oct 23, 2024
7a1e346
flow domain
xlorne Oct 23, 2024
6464ee3
#59
xlorne Oct 23, 2024
52f6669
fix #68
xlorne Oct 23, 2024
77c242a
fix #61
xlorne Oct 23, 2024
f0f9d5c
fix #62
xlorne Oct 23, 2024
d2e76f4
fix #64
xlorne Oct 23, 2024
e6f8409
fix #70 fix #66
xlorne Oct 23, 2024
44651db
fix #67
xlorne Oct 23, 2024
b0ec98d
#71
xlorne Oct 24, 2024
f12ec7f
#71
xlorne Oct 24, 2024
eaecaa7
#71
xlorne Oct 24, 2024
1bb25d2
fix #71
xlorne Oct 24, 2024
d9a967e
fix #71
xlorne Oct 24, 2024
5af9ddd
add example
xlorne Oct 24, 2024
d5b07d6
add example
xlorne Oct 24, 2024
a65a8a9
add example
xlorne Oct 24, 2024
01cd376
add example
xlorne Oct 24, 2024
5b7f0e1
add example
xlorne Oct 24, 2024
b7156fd
#69
xlorne Oct 24, 2024
02779ef
#69
xlorne Oct 24, 2024
4f1ee22
#69
xlorne Oct 24, 2024
08acb1e
#69
xlorne Oct 25, 2024
4ff6c54
#69
xlorne Oct 25, 2024
abe6a22
#69
xlorne Oct 25, 2024
97d6a57
#69
xlorne Oct 25, 2024
15f850c
#69
xlorne Oct 25, 2024
0be708a
#69
xlorne Oct 25, 2024
f49cff3
#69
xlorne Oct 25, 2024
6238f93
#69
xlorne Oct 25, 2024
baeb82a
#69
xlorne Oct 25, 2024
d71f7ef
#69
xlorne Oct 25, 2024
e98ff1f
#69
xlorne Oct 25, 2024
e3805b7
#69
xlorne Oct 25, 2024
a6c4282
#69
xlorne Oct 25, 2024
9a286d2
#69
xlorne Oct 25, 2024
8a7da85
#69
xlorne Oct 25, 2024
2e57509
#69
xlorne Oct 25, 2024
8594cab
#69
xlorne Oct 25, 2024
be09a04
#69
xlorne Oct 25, 2024
ed1e2e2
#69
xlorne Oct 25, 2024
7fee9cb
#69
xlorne Oct 25, 2024
f07c3ce
add FlowDirection
xlorne Oct 26, 2024
1d6e281
add FlowDirection
xlorne Oct 26, 2024
2c6623e
add FlowDirection
xlorne Oct 26, 2024
7ced140
add FlowDirection
xlorne Oct 26, 2024
4a059b9
fix bug
xlorne Oct 26, 2024
fe137f4
fix bug
xlorne Oct 26, 2024
7fa8b5a
fix bug
xlorne Oct 26, 2024
ecaab81
fix bug
xlorne Oct 26, 2024
f1b01ca
fix bug
xlorne Oct 26, 2024
7b69640
fix bug
xlorne Oct 26, 2024
6380479
fix bug
xlorne Oct 26, 2024
da8c11c
fix bug
xlorne Oct 26, 2024
3df4892
fix bug
xlorne Oct 26, 2024
1b8aca7
fix bug
xlorne Oct 26, 2024
2456a7e
fix bug
xlorne Oct 26, 2024
baf4d95
fix bug
xlorne Oct 26, 2024
d2db073
fix bug
xlorne Oct 26, 2024
0258cf0
add readme
xlorne Oct 26, 2024
5d1458e
add FlowSessionBeanRegister
xlorne Oct 26, 2024
96f3a5c
add FlowSessionBeanRegister
xlorne Oct 26, 2024
535cf7f
add copy
xlorne Oct 26, 2024
085669d
add copy
xlorne Oct 27, 2024
d04e848
fix getKeyType bug
xlorne Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ build/
.vscode/
*.db
*.trace.db

### jars ###
/jars/
28 changes: 28 additions & 0 deletions admin-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

/.idea

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock

33 changes: 33 additions & 0 deletions admin-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Admin-ui with Antd For Micro Frontends

This is a simple React App with Webpack5 & Typescript.

## Features
1. Support Webpack 5 ModuleFederationPlugin for Micro Frontends
2. Support Dynamic zip component loading
3. Support Dynamic Routing & Dynamic Menu
4. Support Axios for API calls
5. Support Antd & Pro-Components UI Library
6. Support Redux for State Management
7. Support Mock Server for API Mocking
8. Support Monaco Editor for Code Editor
9. Support Access ControlPanel for Menu & Page Components

## Running
```shell
yarn

yarn start
```
## Build
```shell
yarn build
```

## Deploy
```shell
cd scripts
sh package.sh
sh deploy.sh
```

7 changes: 7 additions & 0 deletions admin-ui/mocks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const userMock = require('./user');
const productMock = require('./product');

module.exports = (app, helper) => {
userMock(app);
productMock(app);
};
16 changes: 16 additions & 0 deletions admin-ui/mocks/product.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const Mock = require('mockjs');

module.exports = (app, helper) => {
app.get('/api/products', (req, res) => {

const products = Mock.mock({
'list|100': [{
'id|+1': 1,
'name': '@name',
'price|100-1000': 1,
}]
}).list;

res.json(products);
});
};
28 changes: 28 additions & 0 deletions admin-ui/mocks/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = (app, helper) => {
app.post('/user/login', (req, res) => {
const username = req.body.username;

if(username==='admin'){
res.json({
success:true,
data:{
'username': username,
'token':'test token',
'avatar':'/logo.png',
'authorities': ['ROLE_ADMIN','ROLE_DEVELOPER'],
}
});
return;
}

res.json({
success:true,
data:{
'username': username,
'token':'test token',
'avatar':'/logo.png',
'authorities': ['ROLE_USER'],
}
});
});
};
73 changes: 73 additions & 0 deletions admin-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "admin-ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^5.4.0",
"@ant-design/pro-components": "^2.7.19",
"@babel/standalone": "^7.25.6",
"@logicflow/core": "^2.0.5",
"@logicflow/extension": "^2.0.9",
"@reduxjs/toolkit": "^2.2.7",
"@types/babel__standalone": "^7.1.7",
"@types/node": "^16.18.108",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"antd": "^5.20.6",
"axios": "^1.7.7",
"base64-js": "^1.5.1",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"monaco-editor": "^0.51.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^9.1.2",
"react-router": "^6.26.2",
"react-router-dom": "^6.26.2",
"typescript": "^5.6.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "webpack serve --config webpack.config.mock.js --open",
"dev": "webpack serve --config webpack.config.dev.js --open",
"build": "webpack --mode production --config webpack.config.prod.js"
},
"eslintConfig": {
"extends": [
"react-app"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/lodash": "^4.17.7",
"@types/lodash-es": "^4.17.12",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"express": "^4.21.0",
"html-webpack-plugin": "^5.6.0",
"mockjs": "^1.1.0",
"monaco-editor-webpack-plugin": "^7.1.0",
"sass": "^1.78.0",
"sass-loader": "^16.0.1",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-merge": "^6.0.1",
"webpack-mock-server": "^1.0.21"
}
}
Binary file added admin-ui/public/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions admin-ui/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Admin UI</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added admin-ui/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions admin-ui/scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/admin
8 changes: 8 additions & 0 deletions admin-ui/scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
serverHost=server
serverAccount=root
serverPort=22
serverPath=/opt/test/


scp -o ConnectTimeout=30 -P $serverPort -r * $serverAccount@$serverHost:$serverPath
ssh -p $serverPort $serverAccount@$serverHost "cd $serverPath && sed -i 's/\r//g' *.sh && sh install.sh"
12 changes: 12 additions & 0 deletions admin-ui/scripts/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"

services:
admin-nginx:
image: nginx:latest
volumes:
- "./admin:/usr/share/nginx/html"
environment:
TZ: "Asia/Shanghai"
restart: always
ports:
- "13000:80"
3 changes: 3 additions & 0 deletions admin-ui/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker-compose build --no-cache
docker-compose up -d
docker ps -a
8 changes: 8 additions & 0 deletions admin-ui/scripts/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rm -rf admin

cd ..
yarn
yarn run build


cp -r ./dist/ ./scripts/admin/
27 changes: 27 additions & 0 deletions admin-ui/src/api/account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {post} from "@/api/index";

export async function login(body: Account.LoginRequest) {
return post('/user/login', body);
}

export function clearUser() {
localStorage.removeItem('username');
localStorage.removeItem('token');
localStorage.removeItem('authorities');
localStorage.removeItem('avatar');
}

export function initUser(user: {
username: string;
token: string;
authorities: string[];
avatar: string;
}) {
const {username, token, authorities, avatar} = user;
localStorage.setItem('username', username);
localStorage.setItem('token', token);
if(authorities) {
localStorage.setItem('authorities', JSON.stringify(authorities));
}
localStorage.setItem('avatar', avatar || "/logo.png");
}
Loading