diff --git a/.circleci/config.yml b/.circleci/config.yml index ad565b3..f18e6e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,4 @@ + version: 2.1 jobs: diff --git a/.github/workflows/deploy-dev-docs.yml b/.github/workflows/gh-pages.yml similarity index 100% rename from .github/workflows/deploy-dev-docs.yml rename to .github/workflows/gh-pages.yml diff --git a/.vscode/settings.json b/.vscode/settings.json index c9327f7..21a3c47 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,8 +33,8 @@ "editor.rulers": [88], "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit", - "source.fixAll.stylelint": "explicit" + "source.fixAll.eslint": true, + "source.fixAll.stylelint": true }, "[markdown]": { "editor.quickSuggestions": { diff --git a/README.md b/README.md index b1247bb..b1549e4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ pnpm bootstrap pnpm dev ``` -For more details on development and deployment,please refer 🛠 [Dev Guidelines](https://secretflow.github.io/secretpad-frontend/dev-doc). +For more details on development and deployment,please refer 🛠 +[Dev Guidelines](https://secretflow.github.io/secretpad-frontend/dev-doc). See [CONTRIBUTING.md](CONTRIBUTING.md) for more info. diff --git a/README.zh-Hans.md b/README.zh-Hans.md index 48bc15e..fe8a2c0 100644 --- a/README.zh-Hans.md +++ b/README.zh-Hans.md @@ -8,6 +8,8 @@ pnpm bootstrap pnpm dev ``` -想了解更多开发和部署细节, 请参考 🛠 [Dev Guidelines](https://secretflow.github.io/secretpad-frontend/dev-doc) + +想了解更多开发和部署细节, 请参考 🛠 +[Dev Guidelines](https://secretflow.github.io/secretpad-frontend/dev-doc) 见 [CONTRIBUTING.md](CONTRIBUTING.zh-Hans.md). diff --git a/apps/docs/README.md b/apps/docs/README.md index 1553658..436ed5d 100644 --- a/apps/docs/README.md +++ b/apps/docs/README.md @@ -1,4 +1,4 @@ -# sceretpad DEV docs +# sceretpad-doc A static site base on [dumi](https://d.umijs.org). diff --git a/apps/docs/docs/dev-doc/index.md b/apps/docs/docs/dev-doc/index.md index 59dcee1..9aaf170 100644 --- a/apps/docs/docs/dev-doc/index.md +++ b/apps/docs/docs/dev-doc/index.md @@ -1,6 +1,6 @@ --- nav: - title: 文档 + title: 开发文档 order: -1 group: title: 入门 diff --git a/apps/docs/docs/dev-doc/qiankun.md b/apps/docs/docs/dev-doc/qiankun.md new file mode 100644 index 0000000..6cfe5e2 --- /dev/null +++ b/apps/docs/docs/dev-doc/qiankun.md @@ -0,0 +1,51 @@ +--- +nav: 文档 +group: + title: 微前端集成 + order: 6 +order: 1 +mobile: false +--- + +# qiankun + +支持通过 [qiankun](https://qiankun.umijs.org/zh/guide) 进行集成, 可快速将其配置为 [qiankun](https://qiankun.umijs.org/zh/guide) 的子应用。 + +只需要在 `platform/config.ts` 中开启如下配置即可 + +```ts +export default defineConfig({ + plugins: ['@umijs/plugins/dist/qiankun'], + qiankun: { + slave: {}, + }, +}); +``` + +如果你的主应用项目是基于 `Umi` 开发的,可以开启以下配置接入子应用, 具体可参考 [UmiJS 文档](https://umijs.org/docs/max/micro-frontend) + +```ts +export default defineConfig({ + qiankun: { + master: { + apps: [ + { + name: 'secretpad', + entry: '//localhost:8009', // 子应用启动的服务 + }, + ], + }, + }, + routes: [ + { + name: 'secretpad', + path: '/secretpad/*', + microApp: 'secretpad', + }, + ], +}); +``` + +在你的主应用项目中,访问 `/secretpad/*` 路由即可看到平台被成功接入。 + +如果你的主应用不是基于 `Umi` 开发的, 接入子应用请参考 [qiankun 文档](https://qiankun.umijs.org/zh/guide) diff --git a/apps/docs/package.json b/apps/docs/package.json index 8df9ec6..5feefdc 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -6,7 +6,8 @@ "start": "pnpm run dev", "dev": "PORT=8001 dumi dev", "build": "dumi build", - "prepare": "dumi setup" + "prepare": "dumi setup", + "preview": "dumi preview" }, "authors": [], "license": "MIT", diff --git a/apps/platform/config/config.ts b/apps/platform/config/config.ts index db137e3..194f131 100644 --- a/apps/platform/config/config.ts +++ b/apps/platform/config/config.ts @@ -44,7 +44,7 @@ export default defineConfig({ // apps: [ // { // name: 'secretpad', // 后端应用名 - // tag: 'feat/cx_merge', // 分支 tag + // tag: 'release/0.6.0b0_cml', // 分支 tag // source: 'ZAPPINFO', // 应用来源,默认 ZAPPINFO,其他来源可在官网的应用信息中查看 // }, // ], diff --git a/apps/platform/package.json b/apps/platform/package.json index 738cb7a..00114b6 100644 --- a/apps/platform/package.json +++ b/apps/platform/package.json @@ -1,5 +1,6 @@ { "private": true, + "name": "secretpad", "scripts": { "dev": "umi dev", "build": "umi build", diff --git a/apps/platform/src/components/datatable-preview.tsx b/apps/platform/src/components/datatable-preview.tsx index 179ec4c..ac1bf68 100644 --- a/apps/platform/src/components/datatable-preview.tsx +++ b/apps/platform/src/components/datatable-preview.tsx @@ -7,6 +7,8 @@ import { getProjectDatatable } from '@/services/secretpad/ProjectController'; import styles from './datatable-preview.less'; import { EdgeAuthWrapper } from './edge-wrapper-auth'; +import { useLocation } from 'umi'; +import { openNewTab } from '@/util/path'; interface DatatablePreviewInterface { // tableInfo: Record; @@ -65,7 +67,7 @@ export const DatatablePreview = (props: DatatablePreviewInterface) => { getDatatableInfo(props.node?.nodeId || '', props?.datatableId || ''); } }, [popoverOpen]); - + const { pathname } = useLocation(); const content = ( <> { { - const a = document.createElement('a'); - a.href = `/node?nodeId=${props.node.nodeId}&tab=data-management`; - a.target = '_blank'; - a.click(); + const serarch = `nodeId=${props.node.nodeId}&tab=data-management`; + openNewTab(pathname, '/node', serarch); }} > 查看全部 diff --git a/apps/platform/src/components/platform-wrapper.tsx b/apps/platform/src/components/platform-wrapper.tsx index 1dac96d..1aa6194 100644 --- a/apps/platform/src/components/platform-wrapper.tsx +++ b/apps/platform/src/components/platform-wrapper.tsx @@ -22,8 +22,8 @@ export const EdgeRouteWrapper = (props: { children?: React.ReactNode }) => { * 判断当前是不是p2p 的工作台页面 * @returns boolean */ -export const isP2PWorkbench = () => { - const { pathname, search } = window.location; +export const isP2PWorkbench = (pathname: string) => { + const { search } = window.location; const { tab } = parse(search); return pathname === '/edge' && tab === 'workbench'; }; diff --git a/apps/platform/src/modules/component-config/config-item-render/config-render-contribution.ts b/apps/platform/src/modules/component-config/config-item-render/config-render-contribution.ts index 90a7db6..986f4bb 100644 --- a/apps/platform/src/modules/component-config/config-item-render/config-render-contribution.ts +++ b/apps/platform/src/modules/component-config/config-item-render/config-render-contribution.ts @@ -106,6 +106,10 @@ export class DefaultConfigRender implements ConfigRenderProtocol { canHandle: (node: AtomicConfigNode) => (node.type === 'AT_STRING' ? 1 : false), component: DefaultInput, }, + { + canHandle: (node: AtomicConfigNode) => (node.type === 'AT_PARTY' ? 1 : false), + component: DefaultNodeSelect, + }, ]; } } diff --git a/apps/platform/src/modules/component-config/template-quick-config/quick-config-psi.tsx b/apps/platform/src/modules/component-config/template-quick-config/quick-config-psi.tsx index 319b1a0..7bd72d5 100644 --- a/apps/platform/src/modules/component-config/template-quick-config/quick-config-psi.tsx +++ b/apps/platform/src/modules/component-config/template-quick-config/quick-config-psi.tsx @@ -5,14 +5,13 @@ import { parse } from 'query-string'; import type { Dispatch, SetStateAction } from 'react'; import { useState, useEffect } from 'react'; import { useLocation } from 'umi'; +import { MultiTableFeatureSelection } from '../config-item-render/default-feature-selection/table-feature-selection'; import { getProject, getProjectDatatable, } from '@/services/secretpad/ProjectController'; -import { MultiTableFeatureSelection } from '../config-item-render/default-feature-selection/table-feature-selection'; - import styles from './index.less'; const { Option } = Select; @@ -40,6 +39,13 @@ export const QuickConfigPSIComponent = (props: QuickConfigPSIComponentProps) => const { search } = useLocation(); const { projectId } = parse(search) as { projectId: string }; + const [nodeOptions, setNodeOptions] = useState< + { + label: string; + value: string; + }[] + >([]); + const [selectedTableInfo, setSelectedTableInfo] = useState< { datatableId: string; @@ -85,6 +91,14 @@ export const QuickConfigPSIComponent = (props: QuickConfigPSIComponentProps) => }[]; if (tableSelected.length > 1) setSelectedTableInfo(tableSelected); + if (tableSelected.length > 0) { + setNodeOptions( + tableSelected.map((table) => ({ + value: table.nodeId as string, + label: table.nodeName as string, + })), + ); + } }, [selectedReceiver, selectedSender, projectId]); useEffect(() => { @@ -279,7 +293,24 @@ export const QuickConfigPSIComponent = (props: QuickConfigPSIComponentProps) => )) } - + {type === 'MPC' && ( + 左表节点} + required + messageVariables={{ label: '左表节点' }} + valuePropName="value" + getValueProps={(value) => { + return { value: value?.ss }; + }} + tooltip={'和允许求交键重复的求交类型搭配使用'} + getValueFromEvent={(value) => { + return { ss: [value] }; + }} + > + + + } + > - + + } + placeholder="请输入通讯地址" + > diff --git a/apps/platform/src/modules/cooperative-node-list/edit-modal.tsx b/apps/platform/src/modules/cooperative-node-list/edit-modal.tsx index 9eccb86..8faf02b 100644 --- a/apps/platform/src/modules/cooperative-node-list/edit-modal.tsx +++ b/apps/platform/src/modules/cooperative-node-list/edit-modal.tsx @@ -1,10 +1,10 @@ import { Form, Input, message, Modal } from 'antd'; -import { useEffect } from 'react'; - +import { useEffect, useState } from 'react'; import { hasAccess, Platform } from '@/components/platform-wrapper'; import { useModel } from '@/util/valtio-helper'; import { CooperativeNodeService } from './cooperative-node.service'; +import { getProtocol, replaceProtocol, SelectBefore } from './slectBefore'; export const EditCooperativeNodeModal = ({ open, @@ -18,16 +18,23 @@ export const EditCooperativeNodeModal = ({ onOk: () => void; }) => { const [messageApi, contextHolder] = message.useMessage(); + const [serviceType, setServiceType] = useState('http://'); + const service = useModel(CooperativeNodeService); const isP2p = hasAccess({ type: [Platform.AUTONOMY] }); - const [form] = Form.useForm(); - useEffect(() => { if (open) { form.setFieldsValue({ - address: isP2p ? data.srcNetAddress : data?.dstNode?.netAddress || '', + address: isP2p + ? replaceProtocol(data.srcNetAddress) + : replaceProtocol(data?.dstNode?.netAddress || ''), }); + const protocol = getProtocol( + isP2p ? data.srcNetAddress : data?.dstNode?.netAddress || '', + isP2p ? data?.srcNode?.protocol : data?.dstNode?.protocol, + ); + setServiceType(protocol); } }, [data, open]); @@ -35,8 +42,18 @@ export const EditCooperativeNodeModal = ({ form.validateFields().then(async (value) => { const { status } = await service.editCooperativeNode({ routerId: data.routeId, - dstNetAddress: isP2p ? data?.dstNode?.netAddress : value.address, - srcNetAddress: isP2p ? value.address : data.srcNetAddress, + dstNetAddress: isP2p + ? `${getProtocol( + data?.dstNode?.netAddress, + data?.dstNode?.protocol, + )}${replaceProtocol(data?.dstNode?.netAddress)}` + : `${serviceType}${value.address}`, + srcNetAddress: isP2p + ? `${serviceType}${value.address}` + : `${getProtocol( + data.srcNetAddress, + data?.srcNode?.protocol, + )}${replaceProtocol(data?.dstNode?.netAddress)}`, routeType: data.routeType, }); if (status && status.code !== 0) { @@ -68,7 +85,11 @@ export const EditCooperativeNodeModal = ({ }, ]} > - + + } + /> diff --git a/apps/platform/src/modules/cooperative-node-list/slectBefore.tsx b/apps/platform/src/modules/cooperative-node-list/slectBefore.tsx new file mode 100644 index 0000000..5c83b37 --- /dev/null +++ b/apps/platform/src/modules/cooperative-node-list/slectBefore.tsx @@ -0,0 +1,43 @@ +import { Select } from 'antd'; + +interface SelectBeforeType { + serviceType: string; + onChange: (e: string) => void; +} + +export enum ProtocolEnum { + 'NOTLS' = 'notls', + 'TLS' = 'tls', + 'MTLS' = 'mtls', +} + +export const Protocol = { + [ProtocolEnum.NOTLS]: 'http://', + [ProtocolEnum.TLS]: 'https://', + [ProtocolEnum.MTLS]: 'https://', +}; + +const { Option } = Select; + +export const SelectBefore = (props: SelectBeforeType) => { + const { serviceType, onChange } = props; + return ( + + ); +}; + +export const getProtocol = (url?: string, protocolType?: ProtocolEnum) => { + if (!url) return 'http://'; + const type = protocolType ? Protocol[protocolType] : 'http://'; + const protocolMatch = url.match(/^(https?):/); + const protocol = protocolMatch ? `${protocolMatch[1]}://` : type; + return protocol; +}; + +export const replaceProtocol = (url?: string) => { + if (!url) return ''; + return url.replace(/(^\w+:|^)\/\//, ''); +}; diff --git a/apps/platform/src/modules/dag-log/dag-log.service.ts b/apps/platform/src/modules/dag-log/dag-log.service.ts index bc92a33..ea63eef 100644 --- a/apps/platform/src/modules/dag-log/dag-log.service.ts +++ b/apps/platform/src/modules/dag-log/dag-log.service.ts @@ -1,5 +1,4 @@ import type { GraphNode } from '@secretflow/dag'; - import { DefaultModalManager, ModalsEnum, diff --git a/apps/platform/src/modules/dag-model-submission/node-address/index.less b/apps/platform/src/modules/dag-model-submission/node-address/index.less new file mode 100644 index 0000000..4339b66 --- /dev/null +++ b/apps/platform/src/modules/dag-model-submission/node-address/index.less @@ -0,0 +1,15 @@ +.title { + margin-bottom: 6px; +} + +.canvasPath { + align-items: center; + justify-content: center; + padding: 16px 16px 16px 12px; + border-radius: 6px; + background: rgb(0 10 26 / 2%); +} + +.content { + margin-bottom: 16px; +} diff --git a/apps/platform/src/modules/dag-model-submission/node-address/index.tsx b/apps/platform/src/modules/dag-model-submission/node-address/index.tsx new file mode 100644 index 0000000..37b02e0 --- /dev/null +++ b/apps/platform/src/modules/dag-model-submission/node-address/index.tsx @@ -0,0 +1,41 @@ +import { Col, Empty, Input, Row } from 'antd'; +import styles from './index.less'; + +type IProps = { + addressList: API.ModelPartyPathResponse[]; +}; + +export const NodeAddress = (props: IProps) => { + const { addressList } = props; + + return ( +
+ {addressList.length === 0 ? ( + + ) : ( +
+ {addressList.map((item, index) => { + return ( +
+
{'存储节点' + (index + 1)}
+
+ +
+ + + + + + + + + ); + })} + + )} + + ); +}; diff --git a/apps/platform/src/modules/dag-model-submission/submission-drawer.tsx b/apps/platform/src/modules/dag-model-submission/submission-drawer.tsx index b6de08a..80aa4c8 100644 --- a/apps/platform/src/modules/dag-model-submission/submission-drawer.tsx +++ b/apps/platform/src/modules/dag-model-submission/submission-drawer.tsx @@ -1,11 +1,9 @@ -import { QuestionCircleOutlined } from '@ant-design/icons'; import { Drawer, Button, Space, Form, Input, - Select, Empty, Spin, message, @@ -13,20 +11,20 @@ import { Alert, } from 'antd'; import classnames from 'classnames'; -import { parse } from 'query-string'; -import { useEffect, useCallback, useMemo } from 'react'; +import { useEffect, useCallback } from 'react'; import { history } from 'umi'; - import { DefaultModalManager } from '@/modules/dag-modal-manager'; -import { SubmitGraphService } from '@/modules/dag-submit/graph-service'; -import { DagLayoutMenu, DagLayoutView } from '@/modules/layout/dag-layout'; import submissionLayoutStyle from '@/modules/layout/model-submission-layout/index.less'; import { getModel, useModel } from '@/util/valtio-helper'; import styles from './index.less'; import { PreviewSubmitNode } from './preview-submit-node'; import { SubmissionDrawerService } from './submission-service'; +import { parse } from 'query-string'; import { useFormValidateOnly } from './useFormValidateOnly'; +import { SubmitGraphService } from '@/modules/dag-submit/graph-service'; +import { DagLayoutMenu, DagLayoutView } from '@/modules/layout/dag-layout'; +import { NodeAddress } from './node-address'; const WIDTH = 560; @@ -52,8 +50,6 @@ export const SubmissionDrawer = () => { const { visible } = modalManager.modals[ModelSubmissionDrawerItem.id]; - const addressFormData = Form.useWatch('address', form); - const { submittable } = useFormValidateOnly(form); const [messageApi, contextHolder] = message.useMessage(); @@ -93,36 +89,6 @@ export const SubmissionDrawer = () => { } }; - const addressOptions = addressNodeList.map((item) => ({ - value: item.nodeId, - label: item.nodeName, - })); - - const getDataSourcePath = (key: number) => { - if (!addressFormData) return; - const formItem = addressFormData[key]; - return addressNodeList.find((item) => item.nodeId === formItem.nodeName) - ?.dataSourcePath; - }; - - const nodeOptionsFilter = addressOptions.map((item) => { - if ( - (addressFormData || []).some( - (v: { nodeName: string }) => v.nodeName === item.value, - ) - ) { - return { - ...item, - disabled: true, - }; - } else { - return { - ...item, - disabled: false, - }; - } - }); - const getAddress = useCallback( async (modelId: string) => { await getModelNodesAddress(modelId); @@ -130,19 +96,11 @@ export const SubmissionDrawer = () => { [modelId], ); - useEffect(() => { - const initFormList = addressNodeList.map(() => ({})); - if (initFormList.length === 0) { - form.setFieldValue('address', [{}, {}]); - } else { - form.setFieldValue('address', initFormList); - } - }, [addressNodeList]); - useEffect(() => { if (!visible) return; if (isSubmitting) { form.setFieldsValue(currentSubmitParams); + submissionDrawerService.addressNodeList = currentSubmitParams.address; } else { form.resetFields(); if (modelId) { @@ -153,10 +111,6 @@ export const SubmissionDrawer = () => { } }, [visible, modelId, isSubmitting]); - const timestamp = useMemo(() => { - return Date.now(); - }, [modelId, visible]); - const goToModelManager = () => { history.push({ pathname: '/dag', @@ -166,22 +120,11 @@ export const SubmissionDrawer = () => { dagLayoutView.setModelManagerShow(); }; - const handlePathChange = (value: string) => { - // 当前只有一个文件地址路径,所以节点文件必须相同 - const newFormAddress = addressFormData.map((item: { nodeName: string }) => ({ - nodeName: item.nodeName, - path: value, - })); - form.setFieldsValue({ - address: newFormAddress, - }); - }; - const handleSubmit = async () => { const value = await form.validateFields(); submissionDrawerService.currentSubmitParams = { ...value, - timestamp, + address: addressNodeList, }; // 如果即有模型训练算子,也有模型预测算子,则modelComponent只提交模型预测算子.trainId提交模型训练算子id const submitNodes = @@ -194,14 +137,11 @@ export const SubmissionDrawer = () => { graphNodeOutPutId: modelId, modelName: value.name, modelDesc: value.desc, - modelPartyConfig: value.address.map( - (item: { nodeName: string; path: string }) => ({ - modelParty: item.nodeName, - modelDataName: `${item.path}_${timestamp}`, - modelDataSource: addressNodeList.find((node) => node.nodeId === item.nodeName) - ?.dataSourcePath, - }), - ), + modelPartyConfig: addressNodeList.map((item) => ({ + modelParty: item.nodeId, + modelDataSource: item.dataSourcePath, + modelDataName: item.nodeName, + })), modelComponent: submitNodes.map((item) => ({ graphNodeId: item.id, domain: item.nodeDef.domain, @@ -293,7 +233,12 @@ export const SubmissionDrawer = () => { footer={ )} {item.nodeId === currentLoginNodeId && hasAccess({ type: [Platform.AUTONOMY] }) && ( - { + openNewTab( + pathname, + '/edge', + `nodeId=${item.nodeId}&tab=data-management`, + ); + }} style={{ fontSize: 12, color: '#0068fa', }} > 去数据管理添加 - + )} } @@ -247,15 +273,14 @@ export class DatatableTreeView extends Model { datatableTreeService = getModel(DatatableTreeService); loginService = getModel(LoginService); - gotoNodeCenter(nodeId: string) { + gotoNodeCenter(nodeId: string, pathname: string) { // history.push(`node?nodeId=${nodeId}`); const isP2p = this.loginService.userInfo?.platformType === Platform.AUTONOMY; - const a = document.createElement('a'); - a.href = isP2p - ? `/edge?tab=data-management&nodeId=${nodeId}` - : `/node?nodeId=${nodeId}&tab=data-management`; - a.target = '_blank'; - a.click(); + const search = isP2p + ? `tab=data-management&nodeId=${nodeId}` + : `nodeId=${nodeId}&tab=data-management`; + const router = isP2p ? '/edge' : '/node'; + openNewTab(pathname, router, search); } async getDatatables() { diff --git a/apps/platform/src/modules/layout/header-project-list/project-list.view.tsx b/apps/platform/src/modules/layout/header-project-list/project-list.view.tsx index 83aed55..54cb94a 100644 --- a/apps/platform/src/modules/layout/header-project-list/project-list.view.tsx +++ b/apps/platform/src/modules/layout/header-project-list/project-list.view.tsx @@ -1,7 +1,7 @@ import { DownOutlined, LoadingOutlined } from '@ant-design/icons'; import { Select, Tag } from 'antd'; import React from 'react'; -import { history, useSearchParams } from 'umi'; +import { history, useLocation, useSearchParams } from 'umi'; import { DagLayoutView } from '@/modules/layout/dag-layout'; import { StatusEnum } from '@/modules/p2p-project-list/components/auth-project-tag'; @@ -21,6 +21,7 @@ export type ProjectVO = API.ProjectVO; export const ProjectListComponent: React.FC = () => { const viewInstance = useModel(HeaderProjectListView); const [searchParams] = useSearchParams(); + const { pathname } = useLocation(); React.useEffect(() => { viewInstance.selectValue = searchParams.get('projectId') || ''; }, [searchParams, viewInstance.projectList]); @@ -29,7 +30,7 @@ export const ProjectListComponent: React.FC = () => {
{ viewInstance.getList(); }} options={ - isP2PWorkbench() || hasAccess({ type: [Platform.AUTONOMY] }) + isP2PWorkbench(pathname) || hasAccess({ type: [Platform.AUTONOMY] }) ? P2PSelectMessageOptions : SelectMessageOptions } /> )} - {!isP2PWorkbench() && ( + {!isP2PWorkbench(pathname) && ( viewInstance.searchNode(e)} @@ -235,7 +262,7 @@ export const MessageComponent: React.FC = () => { > 10 ? false : true, @@ -280,7 +307,9 @@ export const MessageComponent: React.FC = () => { }&type=${item?.voteTypeMessage?.computeFunc || 'DAG'}`, }, { - origin: isP2PWorkbench() ? 'workbench' : 'my-project', + origin: isP2PWorkbench(pathname) + ? 'workbench' + : 'my-project', }, ) } @@ -297,7 +326,11 @@ export const MessageComponent: React.FC = () => { type="primary" size="small" onClick={() => - viewInstance.processMessage(StatusEnum.AGREE, item.voteID!) + viewInstance.processMessage( + StatusEnum.AGREE, + item.voteID!, + pathname, + ) } > 同意 @@ -326,7 +359,11 @@ export const MessageComponent: React.FC = () => { ghost: true, }} onConfirm={async () => { - viewInstance.processMessage(StatusEnum.REJECT, item.voteID!); + viewInstance.processMessage( + StatusEnum.REJECT, + item.voteID!, + pathname, + ); }} > + diff --git a/apps/platform/src/modules/message-center/message.service.ts b/apps/platform/src/modules/message-center/message.service.ts index 496935c..c6b9aab 100644 --- a/apps/platform/src/modules/message-center/message.service.ts +++ b/apps/platform/src/modules/message-center/message.service.ts @@ -34,7 +34,15 @@ export class MessageService extends Model { /** * Message process loading */ - processLoading = false; + processLoading: { + rejectLoading: boolean; + agreeLoading: boolean; + type: string | undefined; + } = { + rejectLoading: false, + agreeLoading: false, + type: undefined, + }; /** * Messages list @@ -61,9 +69,17 @@ export class MessageService extends Model { * @param Agree or reject */ process = async (params: API.VoteReplyRequest) => { - this.processLoading = true; + this.processLoading = { + type: params.action, + rejectLoading: params.action === StatusEnum.REJECT ? true : false, + agreeLoading: params.action === StatusEnum.AGREE ? true : false, + }; const res = await reply(params); - this.processLoading = false; + this.processLoading = { + rejectLoading: false, + agreeLoading: false, + type: undefined, + }; return res; }; diff --git a/apps/platform/src/modules/model-manager/index.tsx b/apps/platform/src/modules/model-manager/index.tsx index f2dcbe4..9b56686 100644 --- a/apps/platform/src/modules/model-manager/index.tsx +++ b/apps/platform/src/modules/model-manager/index.tsx @@ -1,5 +1,4 @@ import { SearchOutlined } from '@ant-design/icons'; -import type { BadgeProps } from 'antd'; import { Space, Input, @@ -9,23 +8,25 @@ import { Badge, Typography, Popconfirm, + BadgeProps, } from 'antd'; import { parse } from 'query-string'; import { useEffect } from 'react'; import { useLocation } from 'umi'; -import { Platform, hasAccess } from '@/components/platform-wrapper'; import { formatTimestamp } from '@/modules/dag-result/utils'; -import { LoginService } from '@/modules/login/login.service'; import { Model, useModel } from '@/util/valtio-helper'; -import { ModelStatusSelectOptions } from './actions'; -import styles from './index.less'; -import { ModelDetailModal } from './model-detail/model-detail.view'; import { ModelReleaseInfoModal } from './model-info/model-info.view'; import { ModelReleaseModal } from './model-release/model-release.view'; import { ModelService } from './model-service'; import { ModelStatus } from './types'; +import { ModelStatusSelectOptions } from './actions'; + +import styles from './index.less'; +import { Platform, hasAccess } from '@/components/platform-wrapper'; +import { ModelDetailModal } from './model-detail/model-detail.view'; +import { LoginService } from '@/modules/login/login.service'; const statusMap = { [ModelStatus.PENDING]: { status: 'warning', text: '待发布' }, diff --git a/apps/platform/src/modules/model-manager/model-detail/model-detail.view.tsx b/apps/platform/src/modules/model-manager/model-detail/model-detail.view.tsx index 610c51a..b7e4624 100644 --- a/apps/platform/src/modules/model-manager/model-detail/model-detail.view.tsx +++ b/apps/platform/src/modules/model-manager/model-detail/model-detail.view.tsx @@ -1,12 +1,14 @@ import { Descriptions, Drawer } from 'antd'; import { useEffect } from 'react'; -import { PreviewGraphComponents } from '@/modules/result-details/graph'; -import { FullscreenGraphModalComponent } from '@/modules/result-details/graph-fullscreen-modal'; -import API from '@/services/secretpad'; import { Model, useModel } from '@/util/valtio-helper'; import styles from './index.less'; +import { PreviewGraphComponents } from '@/modules/result-details/graph'; +import { FullscreenGraphModalComponent } from '@/modules/result-details/graph-fullscreen-modal'; + +import API from '@/services/secretpad'; +import { ModelStatus } from '../types'; type ModelDetail = { visible: boolean; @@ -37,6 +39,19 @@ export const ModelDetailModal = (props: ModelDetail) => { {data.modelName} {data.modelId} {data.modelDesc} + {/* TODO: 已发布的才展示,待服务端联调 */} + {modelDetailService.modelDetail.modelStats === ModelStatus.PUBLISHED && ( + <> + {(modelDetailService.modelDetail.servingDetails || []).map((item) => ( + + {item?.sourcePath || '-'} + + ))} + + )}
diff --git a/apps/platform/src/modules/model-manager/model-info/model-info.view.tsx b/apps/platform/src/modules/model-manager/model-info/model-info.view.tsx index 4f51558..e9eac12 100644 --- a/apps/platform/src/modules/model-manager/model-info/model-info.view.tsx +++ b/apps/platform/src/modules/model-manager/model-info/model-info.view.tsx @@ -88,6 +88,9 @@ export const ModelReleaseInfoModal = (props: ModelInfoModalType) => { >
+ + {modelService.modelServingDetail.servingId || '-'} + {modelService.modelServingDetail.modelId || '-'} diff --git a/apps/platform/src/modules/model-manager/model-release/common.tsx b/apps/platform/src/modules/model-manager/model-release/common.tsx index 2b85874..6fb7422 100644 --- a/apps/platform/src/modules/model-manager/model-release/common.tsx +++ b/apps/platform/src/modules/model-manager/model-release/common.tsx @@ -11,6 +11,7 @@ import { useEffect } from 'react'; import type { Dispatch, SetStateAction } from 'react'; import styles from './index.less'; +import { Tooltip } from 'antd/lib'; export const ToggleButton = (props: { disabled: boolean; @@ -193,17 +194,25 @@ export const FeatureTable = (props: { key: 'online', render: (text: string, record: FeaturesItem) => { return ( - handleFeatureOnlineChange(fieldKey, value, record)} + /> + ); }, }, diff --git a/apps/platform/src/modules/model-manager/model-release/model-release.service.ts b/apps/platform/src/modules/model-manager/model-release/model-release.service.ts index 80a2184..7bbc5a0 100644 --- a/apps/platform/src/modules/model-manager/model-release/model-release.service.ts +++ b/apps/platform/src/modules/model-manager/model-release/model-release.service.ts @@ -1,8 +1,6 @@ -import { parse } from 'query-string'; - import API from '@/services/secretpad'; import { Model } from '@/util/valtio-helper'; - +import { parse } from 'query-string'; import { ModelStatus } from '../types'; export class ModelReleaseService extends Model { diff --git a/apps/platform/src/modules/model-manager/model-release/model-release.view.tsx b/apps/platform/src/modules/model-manager/model-release/model-release.view.tsx index 02e5ec3..12f3b29 100644 --- a/apps/platform/src/modules/model-manager/model-release/model-release.view.tsx +++ b/apps/platform/src/modules/model-manager/model-release/model-release.view.tsx @@ -1,18 +1,19 @@ import { Form, Drawer, Button, Space, Select, Empty, Row, Spin, Tag } from 'antd'; -import { parse } from 'query-string'; import { useEffect } from 'react'; import { useState } from 'react'; -import { Platform, hasAccess } from '@/components/platform-wrapper'; -import { LoginService } from '@/modules/login/login.service'; import { useModel } from '@/util/valtio-helper'; import { ModelService } from '../model-service'; import type { FeaturesItem } from './common'; import { FeatureTable, MatchTag, ToggleButton } from './common'; -import styles from './index.less'; import { ModelReleaseService } from './model-release.service'; +import { Platform, hasAccess } from '@/components/platform-wrapper'; +import { LoginService } from '@/modules/login/login.service'; +import { parse } from 'query-string'; + +import styles from './index.less'; type ModelReleaseModalType = { visible: boolean; diff --git a/apps/platform/src/modules/model-manager/model-service.ts b/apps/platform/src/modules/model-manager/model-service.ts index 5161ae5..bb70be5 100644 --- a/apps/platform/src/modules/model-manager/model-service.ts +++ b/apps/platform/src/modules/model-manager/model-service.ts @@ -1,13 +1,12 @@ -import { message } from 'antd'; -import type { FilterValue } from 'antd/es/table/interface'; -import { parse } from 'query-string'; -import type { ChangeEvent } from 'react'; - -import API from '@/services/secretpad'; import { Model } from '@/util/valtio-helper'; -import type { ModelServingDetail } from './model-info/model-info.view'; import { ModelStatus, type ModelServiceProtocol } from './types'; +import { FilterValue } from 'antd/es/table/interface'; +import { ChangeEvent } from 'react'; +import { parse } from 'query-string'; +import { ModelServingDetail } from './model-info/model-info.view'; +import API from '@/services/secretpad'; +import { message } from 'antd'; export class ModelService extends Model implements ModelServiceProtocol { loading = false; diff --git a/apps/platform/src/modules/my-node/index.tsx b/apps/platform/src/modules/my-node/index.tsx index 27491c5..5d68413 100644 --- a/apps/platform/src/modules/my-node/index.tsx +++ b/apps/platform/src/modules/my-node/index.tsx @@ -341,7 +341,6 @@ export const MyNodeComponent: React.FC = () => { {isEdit ? ( { setIsEdit(false); @@ -367,6 +366,9 @@ export const MyNodeComponent: React.FC = () => {
)} + + {nodeInfo?.protocol} + {hasAccess({ type: [Platform.CENTER] }) && ( {nodeInfo.cert && nodeInfo.cert === DomainCertConfigEnum.configured diff --git a/apps/platform/src/modules/p2p-project-list/components/auth-project-tag.tsx b/apps/platform/src/modules/p2p-project-list/components/auth-project-tag.tsx index 0042b27..b9c8410 100644 --- a/apps/platform/src/modules/p2p-project-list/components/auth-project-tag.tsx +++ b/apps/platform/src/modules/p2p-project-list/components/auth-project-tag.tsx @@ -8,6 +8,7 @@ import { P2pProjectListService } from '../p2p-project-list.service'; import styles from './auth-project-tag.less'; import { ProjectStatus } from './common'; +import { useLocation } from 'umi'; interface IProps { currentNode: { @@ -42,6 +43,7 @@ export const moveItemToFrontById = (array: API.PartyVoteInfoVO[], id: string) => export const AuthProjectTag = (props: IProps) => { const { currentNode, project, simple } = props; const { partyVoteInfos = [], initiatorName, initiator, voteId } = project; + const { pathname } = useLocation(); const applyList = [ { name: initiatorName, @@ -90,7 +92,9 @@ export const AuthProjectTag = (props: IProps) => {
viewInstance.process(StatusEnum.AGREE, voteId)} + onClick={() => + viewInstance.process(StatusEnum.AGREE, voteId, pathname) + } > 同意
@@ -117,7 +121,9 @@ export const AuthProjectTag = (props: IProps) => { danger: true, ghost: true, }} - onConfirm={() => viewInstance.process(StatusEnum.REJECT, voteId)} + onConfirm={() => + viewInstance.process(StatusEnum.REJECT, voteId, pathname) + } >
拒绝
diff --git a/apps/platform/src/modules/p2p-project-list/components/common.tsx b/apps/platform/src/modules/p2p-project-list/components/common.tsx index b43e833..cf70510 100644 --- a/apps/platform/src/modules/p2p-project-list/components/common.tsx +++ b/apps/platform/src/modules/p2p-project-list/components/common.tsx @@ -4,7 +4,7 @@ import { Select, Radio, Modal, Button, Tooltip } from 'antd'; import classNames from 'classnames'; import { parse } from 'query-string'; import React from 'react'; -import { history } from 'umi'; +import { history, useLocation } from 'umi'; import { getPadMode, isP2PWorkbench } from '@/components/platform-wrapper'; import { useModel } from '@/util/valtio-helper'; @@ -141,6 +141,7 @@ export const confirmArchive = (props: { export const P2pProjectButtons = (props: { project: API.ProjectVO }) => { const { project } = props; const { nodeId } = parse(window.location.search); + const { pathname } = useLocation(); const p2pProjectService = useModel(P2pProjectListService); @@ -200,7 +201,7 @@ export const P2pProjectButtons = (props: { project: API.ProjectVO }) => { }&type=${project.computeFunc || 'DAG'}`, }, { - origin: isP2PWorkbench() ? 'workbench' : 'my-project', + origin: isP2PWorkbench(pathname) ? 'workbench' : 'my-project', }, ); }} diff --git a/apps/platform/src/modules/p2p-project-list/index.tsx b/apps/platform/src/modules/p2p-project-list/index.tsx index fecec88..ce8f38c 100644 --- a/apps/platform/src/modules/p2p-project-list/index.tsx +++ b/apps/platform/src/modules/p2p-project-list/index.tsx @@ -7,7 +7,7 @@ import { parse } from 'query-string'; import type { ChangeEvent } from 'react'; import { useEffect, useState } from 'react'; import React from 'react'; -import { history } from 'umi'; +import { history, useLocation } from 'umi'; import { EdgeRouteWrapper, isP2PWorkbench } from '@/components/platform-wrapper'; import { P2PCreateProjectModal } from '@/modules/create-project/p2p-create-project/p2p-create-project.view'; @@ -44,6 +44,8 @@ export const P2pProjectListComponent: React.FC = () => { const projectListModel = useModel(ProjectListModel); const p2pProjectService = useModel(P2pProjectListService); + const { pathname } = useLocation(); + const { handleCreateProject } = projectListModel; const [isModalOpen, setIsModalOpen] = useState(false); @@ -64,7 +66,7 @@ export const P2pProjectListComponent: React.FC = () => { const { Link } = Typography; - const loadMore = isP2PWorkbench() && projectList.length > 6 && ( + const loadMore = isP2PWorkbench(pathname) && projectList.length > 6 && (
{ return (
- {isP2PWorkbench() ? ( + {isP2PWorkbench(pathname) ? (
我的项目
) : ( @@ -153,10 +155,10 @@ export const P2pProjectListComponent: React.FC = () => { ) : (
- {(isP2PWorkbench() ? projectList.slice(0, 6) : projectList).map( + {(isP2PWorkbench(pathname) ? projectList.slice(0, 6) : projectList).map( (item, index) => { return (
{ ); }, )} - {!isP2PWorkbench() && ( + {!isP2PWorkbench(pathname) && ( <> diff --git a/apps/platform/src/modules/p2p-project-list/p2p-project-list.service.ts b/apps/platform/src/modules/p2p-project-list/p2p-project-list.service.ts index cfa2d93..aeb2dd9 100644 --- a/apps/platform/src/modules/p2p-project-list/p2p-project-list.service.ts +++ b/apps/platform/src/modules/p2p-project-list/p2p-project-list.service.ts @@ -60,7 +60,7 @@ export class P2pProjectListService extends Model { * @param action c * @param id */ - process = async (action: StatusEnum, id: string) => { + process = async (action: StatusEnum, id: string, pathname: string) => { const { status } = await API.MessageController.reply({ action, reason: this.comment, @@ -72,7 +72,7 @@ export class P2pProjectListService extends Model { } else { message.success('处理成功'); this.getListProject(); - if (isP2PWorkbench()) { + if (isP2PWorkbench(pathname)) { if (this.messageGetList) { await this.messageGetList(); } diff --git a/apps/platform/src/modules/pipeline-record-list/record-service.ts b/apps/platform/src/modules/pipeline-record-list/record-service.ts index d7c40b5..0a303a5 100644 --- a/apps/platform/src/modules/pipeline-record-list/record-service.ts +++ b/apps/platform/src/modules/pipeline-record-list/record-service.ts @@ -24,23 +24,6 @@ export class DefaultRecordService extends Model { onRecordListUpdatedEmitter = new Emitter(); onRecordListUpdated = this.onRecordListUpdatedEmitter.on; - constructor() { - super(); - const { search, pathname } = window.location; - const { projectId, dagId } = parse(search); - const { pipelineId } = (history.location.state || {}) as { - pipelineId?: string; - pipelineName?: string; - }; - - this.getRecordList( - projectId as string, - pathname === '/dag' ? (dagId as string) : pipelineId, - 5, - 1, - ); - } - getRecordList = async ( projectId: string, pipelineId?: string, diff --git a/apps/platform/src/modules/pipeline/templates/pipeline-template-psi-guide.ts b/apps/platform/src/modules/pipeline/templates/pipeline-template-psi-guide.ts index 5fe9dd4..05d8f64 100644 --- a/apps/platform/src/modules/pipeline/templates/pipeline-template-psi-guide.ts +++ b/apps/platform/src/modules/pipeline/templates/pipeline-template-psi-guide.ts @@ -83,27 +83,58 @@ export class TemplateGuidePSI extends Model implements PipelineTemplateContribut { outputs: [`${graphId}-node-3-output-0`], nodeDef: { - domain: `data_prep`, - name: `psi`, - version: `0.0.2`, + domain: 'data_prep', + name: 'psi', + version: '0.0.4', attrPaths: [ 'input/receiver_input/key', 'input/sender_input/key', 'protocol', + 'disable_alignment', + 'skip_duplicates_check', + 'check_hash_digest', + 'left_side', + 'join_type', + 'missing_value', 'ecdh_curve', ], attrs: [ { ss: ['id1'], + is_na: false, }, { ss: ['id2'], + is_na: false, }, { s: 'PROTOCOL_ECDH', + is_na: false, + }, + { + is_na: true, + }, + { + is_na: true, + }, + { + is_na: true, + }, + { + ss: ['alice'], + is_na: false, + }, + { + s: 'ADVANCED_JOIN_TYPE_UNSPECIFIED', + is_na: false, + }, + { + s: 'NA', + is_na: false, }, { s: 'CURVE_FOURQ', + is_na: false, }, ], }, diff --git a/apps/platform/src/modules/pipeline/templates/pipeline-template-psi.ts b/apps/platform/src/modules/pipeline/templates/pipeline-template-psi.ts index 7185e3d..6511dcb 100644 --- a/apps/platform/src/modules/pipeline/templates/pipeline-template-psi.ts +++ b/apps/platform/src/modules/pipeline/templates/pipeline-template-psi.ts @@ -19,6 +19,7 @@ export class TemplatePSI extends Model implements PipelineTemplateContribution { receiverKey, senderKey, featureSelects, + leftSide, } = quickConfigs || {}; return { edges: [ @@ -90,18 +91,23 @@ export class TemplatePSI extends Model implements PipelineTemplateContribution { { outputs: [`${graphId}-node-3-output-0`], nodeDef: { - ...(receiverKey && senderKey + ...(receiverKey && senderKey && leftSide ? { - attrPaths: ['input/receiver_input/key', 'input/sender_input/key'], + attrPaths: [ + 'input/receiver_input/key', + 'input/sender_input/key', + 'left_side', + ], attrs: [ { ...receiverKey, is_na: false }, { ...senderKey, is_na: false }, + { ...leftSide, is_na: false }, ], } : {}), domain: `data_prep`, name: `psi`, - version: `0.0.2`, + version: `0.0.4`, }, inputs: [`${graphId}-node-1-output-0`, `${graphId}-node-2-output-0`], codeName: `data_prep/psi`, diff --git a/apps/platform/src/modules/pipeline/templates/pipeline-template-risk-guide.ts b/apps/platform/src/modules/pipeline/templates/pipeline-template-risk-guide.ts index 1e39e00..6fea961 100644 --- a/apps/platform/src/modules/pipeline/templates/pipeline-template-risk-guide.ts +++ b/apps/platform/src/modules/pipeline/templates/pipeline-template-risk-guide.ts @@ -365,33 +365,60 @@ export class TemplateGuideRisk extends Model implements PipelineTemplateContribu { outputs: [`${graphId}-node-3-output-0`], nodeDef: { + domain: 'data_prep', + name: 'psi', + version: '0.0.4', attrPaths: [ 'input/receiver_input/key', 'input/sender_input/key', 'protocol', + 'disable_alignment', + 'skip_duplicates_check', + 'check_hash_digest', + 'left_side', + 'join_type', + 'missing_value', 'ecdh_curve', ], attrs: [ { - is_na: false, ss: ['id1'], + is_na: false, }, { - is_na: false, ss: ['id2'], + is_na: false, }, { - is_na: false, s: 'PROTOCOL_ECDH', + is_na: false, + }, + { + is_na: true, }, { + is_na: true, + }, + { + is_na: true, + }, + { + ss: ['alice'], + is_na: false, + }, + { + s: 'ADVANCED_JOIN_TYPE_UNSPECIFIED', + is_na: false, + }, + { + s: 'NA', is_na: false, + }, + { s: 'CURVE_FOURQ', + is_na: false, }, ], - domain: 'data_prep', - name: 'psi', - version: '0.0.2', }, inputs: [`${graphId}-node-1-output-0`, `${graphId}-node-2-output-0`], codeName: `data_prep/psi`, diff --git a/apps/platform/src/modules/pipeline/templates/pipeline-template-risk.ts b/apps/platform/src/modules/pipeline/templates/pipeline-template-risk.ts index de8beff..4364500 100644 --- a/apps/platform/src/modules/pipeline/templates/pipeline-template-risk.ts +++ b/apps/platform/src/modules/pipeline/templates/pipeline-template-risk.ts @@ -22,6 +22,7 @@ export class TemplateRisk extends Model implements PipelineTemplateContribution labelSelects, receiver, pred, + leftSide, } = quickConfigs || {}; return { edges: [ @@ -335,18 +336,23 @@ export class TemplateRisk extends Model implements PipelineTemplateContribution { outputs: [`${graphId}-node-3-output-0`], nodeDef: { - ...(receiverKey && senderKey + ...(receiverKey && senderKey && leftSide ? { - attrPaths: ['input/receiver_input/key', 'input/sender_input/key'], + attrPaths: [ + 'input/receiver_input/key', + 'input/sender_input/key', + 'left_side', + ], attrs: [ { ...receiverKey, is_na: false }, { ...senderKey, is_na: false }, + { ...leftSide, is_na: false }, ], } : {}), domain: `data_prep`, name: `psi`, - version: `0.0.2`, + version: `0.0.4`, }, inputs: [`${graphId}-node-1-output-0`, `${graphId}-node-2-output-0`], codeName: `data_prep/psi`, diff --git a/apps/platform/src/services/secretpad/FeatureDatasourceController.ts b/apps/platform/src/services/secretpad/FeatureDatasourceController.ts index c9137e2..3d3de36 100644 --- a/apps/platform/src/services/secretpad/FeatureDatasourceController.ts +++ b/apps/platform/src/services/secretpad/FeatureDatasourceController.ts @@ -17,24 +17,6 @@ export async function createFeatureDatasource( }); } -/** 此处后端没有提供注释 POST /api/v1alpha1/feature_datasource/list */ -export async function featureDatasourceList( - body?: API.ListFeatureDatasourceRequest, - options?: { [key: string]: any }, -) { - return request( - '/api/v1alpha1/feature_datasource/list', - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: body, - ...(options || {}), - }, - ); -} - /** 此处后端没有提供注释 POST /api/v1alpha1/feature_datasource/auth/list */ export async function projectFeatureTableList( body?: API.ListProjectFeatureDatasourceRequest, diff --git a/apps/platform/src/services/secretpad/GraphController.ts b/apps/platform/src/services/secretpad/GraphController.ts index e871674..77c9d0f 100644 --- a/apps/platform/src/services/secretpad/GraphController.ts +++ b/apps/platform/src/services/secretpad/GraphController.ts @@ -134,6 +134,27 @@ export async function getGraphNodeOutput( ); } +/** Refresh node max index api +@param request update graph node request +@return successful SecretPadResponse with null data + POST /api/v1alpha1/graph/node/max_index */ +export async function graphNodeMaxIndexRefresh( + body?: API.GraphNodeMaxIndexRefreshRequest, + options?: { [key: string]: any }, +) { + return request( + '/api/v1alpha1/graph/node/max_index', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }, + ); +} + /** List component international config api @return successful SecretPadResponse with component international config POST /api/v1alpha1/component/i18n */ diff --git a/apps/platform/src/services/secretpad/index.ts b/apps/platform/src/services/secretpad/index.ts index af5fedc..4d49a79 100644 --- a/apps/platform/src/services/secretpad/index.ts +++ b/apps/platform/src/services/secretpad/index.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -// API 更新时间:2024-02-29 00:59:22 -// API 唯一标识:65df665d86de3c8b28f1d2c6 +// API 更新时间:2024-03-21 10:50:26 +// API 唯一标识:65fba07274d99af691b91c74 // 该文件由 OneAPI 自动生成,请勿手动修改! import * as ApprovalController from './ApprovalController'; @@ -18,8 +18,8 @@ import * as ModelManagementController from './ModelManagementController'; import * as NodeController from './NodeController'; import * as NodeRouteController from './NodeRouteController'; import * as NodeUserController from './NodeUserController'; -import * as P2PProjectController from './P2PProjectController'; import * as P2pNodeController from './P2pNodeController'; +import * as P2PProjectController from './P2PProjectController'; import * as ProjectController from './ProjectController'; import * as RemoteUserController from './RemoteUserController'; import * as UserController from './UserController'; diff --git a/apps/platform/src/services/secretpad/typings.d.ts b/apps/platform/src/services/secretpad/typings.d.ts index c5c954f..7c0ed4e 100644 --- a/apps/platform/src/services/secretpad/typings.d.ts +++ b/apps/platform/src/services/secretpad/typings.d.ts @@ -130,13 +130,11 @@ manipulate, derived from the value returned by the back end in the uplink mouth interface CreateModelServingRequest { modelId?: string; projectId?: string; - partyConfigs?: Array; + partyConfigs?: Array; } type CreateModelServingRequest$PartyConfig = Record; - type CreateModelServingRequestPartyConfig = Record; - interface CreateNodeRequest { /** Node name, the value cannot be empty and can be the same */ name?: string; @@ -303,7 +301,13 @@ manipulate, derived from the value returned by the back end in the uplink mouth columns?: Array; } - type FeatureTableErrorCode = 202012301 | 'FEATURE_TABLE_NOT_EXIST'; + type FeatureTableErrorCode = + | 202012301 + | 'FEATURE_TABLE_NOT_EXIST' + | 202012302 + | 'FEATURE_TABLE_IP_FILTER' + | 202012303 + | 'FEATURE_TABLE_IP_NOT_KNOWN'; type FileMeta = Record; @@ -372,13 +376,6 @@ manipulate, derived from the value returned by the back end in the uplink mouth graphId?: string; } - interface GetProjectGraphRequest { - /** Project id, it can not be blank */ - projectId?: string; - /** graphId, it can not be blank */ - graphId?: string; - } - interface GetProjectJobRequest { /** Project id */ projectId?: string; @@ -544,6 +541,17 @@ manipulate, derived from the value returned by the back end in the uplink mouth graphNodeId?: string; } + interface GraphNodeMaxIndexRefreshRequest { + /** Project id, it can not be blank */ + projectId?: string; + /** Graph id, it can not be blank */ + graphId?: string; + } + + interface GraphNodeMaxIndexRefreshVO { + maxIndex?: number; + } + interface GraphNodeOutputRequest { /** Project id, it can not be blank */ projectId?: string; @@ -647,10 +655,6 @@ Unavailable:Datatables that filter unavailable status Other values or null:A teeNodeId?: string; } - interface ListFeatureDatasourceRequest { - nodeId?: string; - } - interface ListGraphNodeStatusRequest { /** Project id */ projectId?: string; @@ -808,16 +812,16 @@ waiting approved } interface ModelPackDetailVO { - parties?: Array; + parties?: Array; } type ModelPackDetailVO$Parties = Record; - type ModelPackDetailVOParties = Record; - interface ModelPackInfoVO { graphDetailVO?: GraphDetailVO; modelGraphDetail?: Array; + modelStats?: string; + servingDetails?: Array; } interface ModelPackListVO { @@ -834,17 +838,16 @@ waiting approved modelName?: string; modelDesc?: string; modelStats?: string; - createTime?: string; + gmtCreate?: string; + ownerId?: string; } interface ModelPartiesVO { - parties?: Array; + parties?: Array; } type ModelPartiesVO$Party = Record; - type ModelPartiesVOParty = Record; - interface ModelPartyConfig { modelParty?: string; modelDataSource?: string; @@ -1111,11 +1114,19 @@ result management list interface */ data?: OrgSecretflowSecretpadCommonDtoSecretPadResponse_SyncDataDTO; } - type OrgSecretflowSecretpadServiceModelApprovalParticipantVoteInfo = Record< + type OrgSecretflowSecretpadServiceModelApprovalParticipantVoteInfo = Record; + + type OrgSecretflowSecretpadServiceModelModelCreateModelServingRequestPartyConfig = Record< string, any >; + type OrgSecretflowSecretpadServiceModelModelModelPackDetailVOParties = Record; + + type OrgSecretflowSecretpadServiceModelModelModelPartiesVOParty = Record; + + type OrgSecretflowSecretpadServiceModelServingServingDetailVOServingDetail = Record; + interface P2pCreateNodeRequest { /** Node name, the value cannot be empty and can be the same */ name?: string; @@ -1541,6 +1552,11 @@ result management list interface */ data?: GraphDetailVO; } + interface SecretPadResponse_GraphNodeMaxIndexRefreshVO_ { + status?: SecretPadResponseSecretPadResponseStatus; + data?: GraphNodeMaxIndexRefreshVO; + } + interface SecretPadResponse_GraphNodeOutputVO_ { status?: SecretPadResponseSecretPadResponseStatus; data?: GraphNodeOutputVO; @@ -1725,13 +1741,12 @@ result management list interface */ interface ServingDetailVO { modelId?: string; - servingDetails?: Array; + servingDetails?: Array; + servingId?: string; } type ServingDetailVO$ServingDetail = Record; - type ServingDetailVOServingDetail = Record; - type SseEmitter = Record; interface StartGraphRequest { @@ -1797,7 +1812,9 @@ result management list interface */ | 202011110 | 'SYNC_ERROR' | 2020111011 - | 'REMOTE_CALL_ERROR'; + | 'REMOTE_CALL_ERROR' + | 2020111012 + | 'REQUEST_FREQUENCY_ERROR'; interface TableColumnConfigParam { /** Column name, it can not be blank */ @@ -1939,15 +1956,7 @@ create operation */ voteParticipantID?: string; } - type VoteStatusEnum = - | 0 - | 'REVIEWING' - | 1 - | 'APPROVED' - | 2 - | 'REJECTED' - | 3 - | 'NOT_INITIATED'; + type VoteStatusEnum = 0 | 'REVIEWING' | 1 | 'APPROVED' | 2 | 'REJECTED' | 3 | 'NOT_INITIATED'; interface VoteSyncRequest { /** vote request vote result diff --git a/apps/platform/src/util/path.ts b/apps/platform/src/util/path.ts new file mode 100644 index 0000000..a374f6a --- /dev/null +++ b/apps/platform/src/util/path.ts @@ -0,0 +1,18 @@ +/** + * 打开新窗口 + * @param locationPathName 使用 useLocation 获取的pathname + * @param search + * @param router 要跳转的路由地址 + */ +export const openNewTab = ( + locationPathName: string, + router: string, + search: string, +) => { + const a = document.createElement('a'); + const currentUrlPathname = window.location.pathname; + const newPathName = currentUrlPathname.replace(locationPathName, router); + a.href = `${newPathName}?${search}`; + a.target = '_blank'; + a.click(); +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 244cd9a..4f13c0d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7008,6 +7008,7 @@ packages: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} hasBin: true + requiresBuild: true /csso@4.2.0: resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} diff --git a/tooling/tsup/package.json b/tooling/tsup/package.json index dd9eca1..454ec85 100644 --- a/tooling/tsup/package.json +++ b/tooling/tsup/package.json @@ -10,8 +10,8 @@ "dependencies": { "@swc/core": "^1.3.42", "colorette": "^2.0.19", - "cross-spawn": "^7.0.3", "esbuild-plugin-svgr": "^1.1.0", + "cross-spawn": "^7.0.3", "tsup": "^6.7.0" } }