Skip to content

Commit

Permalink
Merge pull request #1 from secretflow/feat/add-trusted-node
Browse files Browse the repository at this point in the history
repo-sync-2024-03-20T10:43:05+0800
  • Loading branch information
NewByVector authored Mar 20, 2024
2 parents 6b18440 + 16b35d1 commit d5d965d
Show file tree
Hide file tree
Showing 54 changed files with 1,554 additions and 985 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 2 additions & 6 deletions LEGAL.md
Original file line number Diff line number Diff line change
@@ -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.

法律免责声明

关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存
在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
3 changes: 3 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ try {
export default defineConfig({
routes,
npmClient: 'pnpm',
codeSplitting: {
jsStrategy: 'granularChunks',
},
// https: {},
svgr: {},
title: 'SecretFlow Easy PSI',
Expand Down
54 changes: 22 additions & 32 deletions config/routes.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
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',
},
],
},

{
path: '/login',
wrappers: ['@/wrappers/theme-wrapper', '@/wrappers/login-wrapper'],
component: 'login',
},
{
path: '/',
wrappers: ['@/wrappers/theme-wrapper'],
component: 'auth',
},
];
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
18 changes: 14 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -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') || '';
Expand Down
3 changes: 3 additions & 0 deletions src/components/text-ellipsis/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.text {
width: 100%;
}
3 changes: 2 additions & 1 deletion src/components/text-ellipsis/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Typography } from 'antd';
import React from 'react';
import styles from './index.less';

interface IProps {
children?: React.ReactNode;
Expand Down Expand Up @@ -40,7 +41,7 @@ export const EllipsisMiddle: React.FC<{ suffixCount: number; children: string }>
suffix = children?.slice(-suffixCount)?.trim();
}
return (
<Text style={{ width: '100%' }} ellipsis={{ suffix, tooltip: children }}>
<Text className={styles.text} ellipsis={{ suffix, tooltip: children }}>
{start}
</Text>
);
Expand Down
8 changes: 4 additions & 4 deletions src/modules/guide-tour/guide-tour.service.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
37 changes: 37 additions & 0 deletions src/modules/layout/guide-layout/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
display: flex;
justify-content: center;
align-items: center;

.emptyDesc {
opacity: 0.65;
}
}

.title {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Loading

0 comments on commit d5d965d

Please sign in to comment.