diff --git a/.vscode/settings.json b/.vscode/settings.json index 21a3c47..c9327f7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,8 +33,8 @@ "editor.rulers": [88], "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true, - "source.fixAll.stylelint": true + "source.fixAll.eslint": "explicit", + "source.fixAll.stylelint": "explicit" }, "[markdown]": { "editor.quickSuggestions": { diff --git a/LEGAL.md b/LEGAL.md index 779629f..f968920 100644 --- a/LEGAL.md +++ b/LEGAL.md @@ -1,11 +1,7 @@ Legal Disclaimer -Within this source code, the comments in Chinese shall be the original, governing -version. Any comment in other languages are for reference only. In the event of any -conflict between the Chinese language version comments and other language version -comments, the Chinese language version shall prevail. +Within this source code, the comments in Chinese shall be the original, governing version. Any comment in other languages are for reference only. In the event of any conflict between the Chinese language version comments and other language version comments, the Chinese language version shall prevail. 法律免责声明 -关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存 -在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。 +关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。 \ No newline at end of file diff --git a/config/config.ts b/config/config.ts index 7fcf647..4815465 100644 --- a/config/config.ts +++ b/config/config.ts @@ -28,6 +28,9 @@ try { export default defineConfig({ routes, npmClient: 'pnpm', + codeSplitting: { + jsStrategy: 'granularChunks', + }, // https: {}, svgr: {}, title: 'SecretFlow Easy PSI', diff --git a/config/routes.ts b/config/routes.ts index 513565c..550402a 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -1,38 +1,23 @@ export const routes = [ - // { - // path: '/', - // wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-auth'], - // component: '@/modules/layout/layout.view', - // routes: [ - // { path: '/', component: 'new-home' }, - // { path: '/home', component: 'new-home' }, - // { path: '/dag', component: 'dag' }, - // { path: '/node', component: 'new-node', wrappers: ['@/wrappers/node-auth'] }, - // { path: '/record', component: 'record' }, - // { path: '/my-node', component: 'my-node', wrappers: ['@/wrappers/node-auth'] }, - // { path: '/message', component: 'message', wrappers: ['@/wrappers/node-auth'] }, - // ], - // }, - // { - // path: '/guide', - // wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-auth'], - // component: 'guide', - // }, { - path: '/', + path: '/home', + component: 'index', + wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-auth'], + }, + { + path: '/guide', + component: 'guide', + wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-auth'], + }, + { + path: '/task', + component: 'task', + wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-auth'], + }, + { + path: '/task-details', + component: 'task-details', wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-auth'], - routes: [ - { path: '/', component: 'index' }, - { path: '/guide', component: 'guide' }, - { - path: '/task', - component: 'task', - }, - { - path: '/task-details', - component: 'task-details', - }, - ], }, { @@ -40,4 +25,9 @@ export const routes = [ wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-wrapper'], component: 'login', }, + { + path: '/', + wrappers: ['@/wrappers/theme-wrapper'], + component: 'auth', + }, ]; diff --git a/package.json b/package.json index 002de75..11b23e8 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "start": "pnpm run dev", "lint": "umi lint", "prepare": "husky install", - "ci": "pnpm run lint:js & pnpm run lint:css & pnpm run lint:format", "lint:js": "eslint 'src/**/*.{js,jsx,ts,tsx}'", + "ci": "pnpm run lint:js & pnpm run lint:css & pnpm run lint:format", "lint:css": "stylelint --allow-empty-input 'src/**/*.{css,less}'", "lint:format": "prettier --check *.json 'src/**/*.{js,jsx,ts,tsx,css,less,md,json}'", "lint:typing": "tsc --noEmit", @@ -24,9 +24,11 @@ "ahooks": "^3.7.8", "antd": "^5.9.3", "classnames": "^2.3.2", + "copy-to-clipboard": "^3.3.3", "crypto-js": "^4.1.1", "dayjs": "^1.11.10", "dotenv": "^16.3.1", + "jsencrypt": "^3.3.2", "lodash": "^4.17.21", "monaco-editor": "^0.44.0", "query-string": "^8.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 86f0cd2..1b20c47 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + dependencies: '@ant-design/icons': specifier: ^5.2.6 @@ -19,6 +23,9 @@ dependencies: classnames: specifier: ^2.3.2 version: 2.3.2 + copy-to-clipboard: + specifier: ^3.3.3 + version: 3.3.3 crypto-js: specifier: ^4.1.1 version: 4.1.1 @@ -28,6 +35,9 @@ dependencies: dotenv: specifier: ^16.3.1 version: 16.3.1 + jsencrypt: + specifier: ^3.3.2 + version: 3.3.2 lodash: specifier: ^4.17.21 version: 4.17.21 @@ -6450,6 +6460,10 @@ packages: dependencies: argparse: 2.0.1 + /jsencrypt@3.3.2: + resolution: {integrity: sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A==} + dev: false + /jsesc@0.5.0: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true @@ -10222,7 +10236,3 @@ packages: /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false diff --git a/src/app.ts b/src/app.ts index 568bbe6..d726e2c 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,5 +1,10 @@ import { history } from 'umi'; import request from 'umi-request'; +import { message } from 'antd'; + +message.config({ + maxCount: 1, +}); request.interceptors.request.use((url, options) => { const token = localStorage.getItem('User-Token') || ''; diff --git a/src/components/text-ellipsis/index.less b/src/components/text-ellipsis/index.less new file mode 100644 index 0000000..91f62e9 --- /dev/null +++ b/src/components/text-ellipsis/index.less @@ -0,0 +1,3 @@ +.text { + width: 100%; +} diff --git a/src/components/text-ellipsis/index.tsx b/src/components/text-ellipsis/index.tsx index 3f8a44e..ad4fe39 100644 --- a/src/components/text-ellipsis/index.tsx +++ b/src/components/text-ellipsis/index.tsx @@ -1,5 +1,6 @@ import { Typography } from 'antd'; import React from 'react'; +import styles from './index.less'; interface IProps { children?: React.ReactNode; @@ -40,7 +41,7 @@ export const EllipsisMiddle: React.FC<{ suffixCount: number; children: string }> suffix = children?.slice(-suffixCount)?.trim(); } return ( - + {start} ); diff --git a/src/modules/guide-tour/guide-tour.service.ts b/src/modules/guide-tour/guide-tour.service.ts index 1d6a362..59bdf54 100644 --- a/src/modules/guide-tour/guide-tour.service.ts +++ b/src/modules/guide-tour/guide-tour.service.ts @@ -1,14 +1,14 @@ import { Model, getModel } from '@/util/valtio-helper'; import { GuideTourKey, GuideTourServiceProtocol } from './types'; -import { LoginService } from '../login/login.service'; +import { UserService } from '@/modules/user'; export class GuideTourService extends Model implements GuideTourServiceProtocol { - loginService = getModel(LoginService); + userService = getModel(UserService); // 默认已经未提示过 MyNodeTour: boolean = false; - CreateTaskTour: boolean = !this.loginService.userInfo?.noviceUser as boolean; - AddNodeRouteTour: boolean = !this.loginService.userInfo?.noviceUser as boolean; + CreateTaskTour: boolean = !this.userService.userInfo?.noviceUser as boolean; + AddNodeRouteTour: boolean = !this.userService.userInfo?.noviceUser as boolean; // guid tour GuidCreateTaskTour: boolean = true; diff --git a/src/modules/layout/guide-layout/index.less b/src/modules/layout/guide-layout/index.less index 9903048..5f67a20 100644 --- a/src/modules/layout/guide-layout/index.less +++ b/src/modules/layout/guide-layout/index.less @@ -73,6 +73,10 @@ display: flex; justify-content: center; align-items: center; + + .emptyDesc { + opacity: 0.65; + } } .title { @@ -104,6 +108,21 @@ box-sizing: border-box; border: 1px solid #f7f8fa; + .item { + display: flex; + align-items: start; + + .statusIcon { + margin-right: 8px; + } + + .itemInfo { + display: flex; + flex-direction: column; + width: 100%; + } + } + .routeHeaderLayout { display: flex; justify-content: space-between; @@ -173,9 +192,27 @@ .tourAddNode { width: 290px; height: 184px; + + .addTitle { + font-weight: 400; + font-size: 16px; + } + + .addDesc { + color: rgba(255, 255, 255, 85%); + } } .createTaskNode { width: 302px; height: 100px; + + .createTitle { + font-weight: 400; + font-size: 16px; + } +} + +.tooltipTitle { + width: 260px; } diff --git a/src/modules/layout/guide-layout/index.tsx b/src/modules/layout/guide-layout/index.tsx index 6b95104..fee2b22 100644 --- a/src/modules/layout/guide-layout/index.tsx +++ b/src/modules/layout/guide-layout/index.tsx @@ -5,18 +5,21 @@ import { history } from 'umi'; import styles from './index.less'; import classnames from 'classnames'; import { GuidePipeline } from '@/modules/guide-pipeline/guide-pipeline'; -import { AddNodeDrawer, addNodeDrawer } from '@/modules/node'; +import { + AddNodeDrawer, + NodeListItemRender, + NodeRoute, + addNodeDrawer, +} from '@/modules/node'; import { useModel, Model, getModel } from '@/util/valtio-helper'; import { DefaultModalManager } from '@/modules/modal-manager'; -import { NodeRouteItemRender } from './node-route-item'; import { PlusCircleFilled } from '@ant-design/icons'; import { GuideTourService, GuideTourKey } from '@/modules/guide-tour'; import { NodeRouteListView } from '@/modules/node/node-list.view'; import { NodeRouteInfoDrawer } from '@/modules/node/route-info-drawer'; import { EditNodeModal } from '@/modules/node/edit-node-modal'; -import API from '@/services/ezpsi-board'; -import { LoginService } from '@/modules/login/login.service'; -import React from 'react'; +import { listJob } from '@/services/ezpsi-board/ProjectController'; +import { UserService } from '@/modules/user'; export const GuideLayout = () => { const modalManager = useModel(DefaultModalManager); @@ -50,9 +53,9 @@ export const GuideLayout = () => { const addNodeSteps: TourProps['steps'] = [ { - title: 🎉节点添加成功~, + title: 🎉节点添加成功~, description: ( - + 还需要下载本方「节点公钥」和「通讯地址」并线下告知合作方,以便对方进入平台添加本方节点。 可点击节点名称查看相关信息。 @@ -67,9 +70,7 @@ export const GuideLayout = () => { const createTaskSteps: TourProps['steps'] = [ { - title: ( - 任务是在这里发起哦~ - ), + title: 任务是在这里发起哦~, description: null, target: () => createTaskRef.current, nextButtonProps: { children: '知道了' }, @@ -105,7 +106,9 @@ export const GuideLayout = () => {
我的任务
{/* TODO: Place holder */}
- 还没有任务哦~}> + 还没有任务哦~} + > {viewInstance.nodeRouteList.length ? ( -
- + )} + - - + > +