Skip to content
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

feat/p2p #7

Merged
merged 8 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: ^7.29
version: ^8.8.0
run_install: false

- name: Get pnpm store directory
Expand All @@ -57,4 +57,4 @@ jobs:
# https://nx.dev/recipes/ci/monorepo-ci-github-actions

- name: Run linters and tests
run: pnpm ci
run: pnpm run ci
17 changes: 0 additions & 17 deletions .github/workflows/pr-label-branch-name.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/pr-label-file-paths.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/pr-label-patch-size.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/pr-label-status-dummy.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/pr-label-status.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/pr-label-title-body.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ yarn-error.log*
.env

repo_sync

syncSecretPad.js

.nx
7 changes: 3 additions & 4 deletions apps/docs/docs/dev-doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ mobile: false
---

# 构建与前后端集成
当完成二开或者功能更新后,需要将项目重新构建并放在后端项目中一同部署。

当完成二开或者功能更新后,需要将项目重新构建并放在后端项目中一同部署。

Expand All @@ -17,11 +16,11 @@ mobile: false
```bash
$ pnpm build
```
构建产物会在 `dist` 目录下生成。

构建产物会在 `dist` 目录下生成。

## 部署
如果是与 [SecretPad](https://github.com/secretflow/secretpad/tree/main ) 一同部署,需要先将构建产物放在 SecretPad 项目中,之后执行 SecretPad 镜像构建脚本。

在 SecretPad 下新建 `/secretpad-web/src/main/resources/static` 目录,将 `dist` 目录下的产物放在该目录中(如果已有该目录则进行文件替换),之后运行 SecretPad 的 `bash ./scripts/build.sh` 命令重新构建镜像(注意不是 `make build` 命令,`make build` 会拉取官方 Release 的前端产物构建镜像)。
如果是与 [SecretPad](https://github.com/secretflow/secretpad/tree/main) 一同部署,需要先将构建产物放在 SecretPad 项目中,之后执行 SecretPad 镜像构建脚本。

在 SecretPad 下新建 `/secretpad-web/src/main/resources/static` 目录,将 `dist` 目录下的产物放在该目录中(如果已有该目录则进行文件替换),之后运行 SecretPad 的 `bash ./scripts/build.sh` 命令重新构建镜像(注意不是 `make build` 命令,`make build` 会拉取官方 Release 的前端产物构建镜像)。
6 changes: 3 additions & 3 deletions apps/docs/docs/dev-doc/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ mobile: false

## 环境准备

确保正确安装 [Node.js](https://nodejs.org/en/) 且版本为 14+ 即可。
确保正确安装 [Node.js](https://nodejs.org/en/) 且版本为 16+ 即可。

```bash
$ node -v
v14.19.1
v16.14.2
```

确保已安装[pnpm](https://pnpm.io/installation#using-npm)

```bash
$ pnpm -v
7.29.1
8.8.0
```

## 初始化项目
Expand Down
21 changes: 17 additions & 4 deletions apps/platform/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,36 @@ export const routes = [
{
path: '/dag',
component: 'dag',
wrappers: ['@/wrappers/center-auth', '@/wrappers/component-wrapper'],
wrappers: ['@/wrappers/p2p-center-auth', '@/wrappers/component-wrapper'],
},
{
path: '/record',
component: 'record',
wrappers: ['@/wrappers/center-auth', '@/wrappers/component-wrapper'],
wrappers: ['@/wrappers/p2p-center-auth', '@/wrappers/component-wrapper'],
},
{
path: '/node',
component: 'new-node',
wrappers: ['@/wrappers/edge-auth', '@/wrappers/component-wrapper'],
},
{ path: '/my-node', component: 'my-node', wrappers: ['@/wrappers/edge-auth'] },
{
path: '/my-node',
component: 'my-node',
wrappers: ['@/wrappers/basic-node-auth', '@/wrappers/p2p-edge-center-auth'],
},
{
path: '/message',
component: 'message',
wrappers: ['@/wrappers/edge-auth', '@/wrappers/component-wrapper'],
wrappers: [
'@/wrappers/basic-node-auth',
'@/wrappers/p2p-edge-center-auth',
'@/wrappers/component-wrapper',
],
},
{
path: '/edge',
component: 'edge',
wrappers: ['@/wrappers/basic-node-auth', '@/wrappers/p2p-login-auth'],
},
{ path: '/*', redirect: '/login' },
],
Expand Down
5 changes: 3 additions & 2 deletions apps/platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"start": "npm run dev",
"lint:js": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"lint:css": "stylelint --allow-empty-input 'src/**/*.{css,less}'",
"lint:format": "prettier --check *.json 'src/**/*.{js,jsx,ts,tsx,css,less,md,json}'",
"lint:format": "prettier --check *.json 'src/[^.umi]**/*.{js,jsx,ts,tsx,css,less,md,json}'",
"lint:typing": "tsc --noEmit",
"test": "jest --coverage --passWithNoTests",
"test": "jest --coverage",
"preview": "umi preview",
"openapi": "node config/openapi.config.js"
},
Expand All @@ -20,6 +20,7 @@
"@antv/x6": "^2.11.1",
"@antv/x6-plugin-keyboard": "2.2.1",
"@antv/x6-plugin-selection": "^2.1.7",
"@antv/x6-react-shape": "^2.2.2",
"@secretflow/dag": "workspace:^",
"@secretflow/utils": "workspace:^",
"ahooks": "^3.7.8",
Expand Down
7 changes: 7 additions & 0 deletions apps/platform/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://cdn.jsdelivr.net/npm/nx@latest/schemas/project-schema.json",
"targets": {
"lint": {},
"ci": {}
}
}
4 changes: 3 additions & 1 deletion apps/platform/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { history } from 'umi';
import request from 'umi-request';

request.interceptors.request.use((url, options) => {
const token = localStorage.getItem('User-Token') || '';
return {
url: `${url}`,
options: {
Expand All @@ -11,14 +12,15 @@ request.interceptors.request.use((url, options) => {
interceptors: true,
headers: {
'Content-Type': 'application/json',
'User-Token': token,
},
},
};
});

request.interceptors.response.use(async (response) => {
const { status } = await response.clone().json();
if (status.code === 202011601 || status.code === 202011602) {
if (status.code === 202011602) {
history.push('/login');
}
return response;
Expand Down
16 changes: 16 additions & 0 deletions apps/platform/src/assets/alice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/platform/src/assets/bob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions apps/platform/src/assets/fold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions apps/platform/src/assets/jiaochabiao.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions apps/platform/src/assets/p2p-all.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions apps/platform/src/assets/p2p-mpc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading