diff --git a/react-ui/src/components/IFramePage/index.tsx b/react-ui/src/components/IFramePage/index.tsx index 53629ce6..8832b049 100644 --- a/react-ui/src/components/IFramePage/index.tsx +++ b/react-ui/src/components/IFramePage/index.tsx @@ -53,7 +53,9 @@ const getRequestAPI = (type: IframePageType): (() => Promise) => { type IframePageProps = { /** 子系统 */ - type: IframePageType; + type?: IframePageType; + /** url */ + url?: string; /** 是否可以在页签上打开 */ openInTab?: boolean; /** 自定义样式类名 */ @@ -63,13 +65,13 @@ type IframePageProps = { }; /** 系统内嵌 iframe,目前系统有数据标注、应用开发、开发环境、GitLink 四个子系统,使用时可以添加其他子系统 */ -function IframePage({ type, openInTab = false, className, style }: IframePageProps) { +function IframePage({ type, url, openInTab = false, className, style }: IframePageProps) { const [iframeUrl, setIframeUrl] = useState(''); // const [loading, setLoading] = useState(false); useEffect(() => { - const requestIframeUrl = async () => { - //setLoading(true); + const requestIframeUrl = async (type: IframePageType) => { + // setLoading(true); Loading.show(); const [res] = await to(getRequestAPI(type)()); if (res && res.data) { @@ -80,8 +82,13 @@ function IframePage({ type, openInTab = false, className, style }: IframePagePro } }; - requestIframeUrl(); - }, [type]); + if (type) { + requestIframeUrl(type); + } else if (url) { + Loading.show(); + setIframeUrl(url); + } + }, [type, url]); const handleLoad = () => { // setLoading(false); @@ -97,7 +104,7 @@ function IframePage({ type, openInTab = false, className, style }: IframePagePro return (
{/* {loading && createPortal(, document.body)} */} - + {iframeUrl && } {openInTab && window.open(iframeUrl, '_blank')} />}
); diff --git a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx index ad59fd23..6809ed88 100644 --- a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx @@ -3,7 +3,7 @@ * @Date: 2024-04-16 13:58:08 * @Description: 服务版本详情 */ -import FullScreenFrame from '@/components/FullScreenFrame'; +import IframePage from '@/components/IFramePage'; import KFIcon from '@/components/KFIcon'; import PageTitle from '@/components/PageTitle'; import { ServiceRunStatus } from '@/enums'; @@ -58,11 +58,7 @@ function ServiceVersionInfo() { key: ModelDeploymentTabKey.Predict, label: '预测', icon: , - children: ( -
- -
- ), + children: , }); } @@ -71,11 +67,7 @@ function ServiceVersionInfo() { key: ModelDeploymentTabKey.Guide, label: '调用指南', icon: , - children: ( -
- -
- ), + children: , }); } }