From 8ef236f5b43d5843f56f697e26c15fc0511a1bbc Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Thu, 22 May 2025 16:51:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=B0=83=E7=94=A8=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ModelDeployment/VersionInfo/index.tsx | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx index 6cabf87a..0729631d 100644 --- a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx @@ -13,7 +13,6 @@ import { useParams } from '@umijs/max'; import { Tabs } from 'antd'; import { useEffect, useState } from 'react'; import ServerLog from '../components/ServerLog'; -import UserGuide from '../components/UserGuide'; import VersionBasicInfo from '../components/VersionBasicInfo'; import { ServiceVersionData } from '../types'; import styles from './index.less'; @@ -51,35 +50,41 @@ function ServiceVersionInfo() { icon: , children: , }, - { - key: ModelDeploymentTabKey.Guide, - label: '调用指南', - icon: , - children: , - }, - { - key: ModelDeploymentTabKey.Log, - label: '服务日志', - icon: , - children: , - }, ]; - if (versionInfo?.run_state === ServiceRunStatus.Running) { - tabItems.splice(1, 0, { + if (versionInfo?.run_state === ServiceRunStatus.Running && versionInfo?.page_path) { + tabItems.push({ key: ModelDeploymentTabKey.Predict, label: '预测', icon: , children: (
- {versionInfo?.page_path && ( - - )} + +
+ ), + }); + } + + if (versionInfo?.doc_path) { + tabItems.push({ + key: ModelDeploymentTabKey.Guide, + label: '调用指南', + icon: , + children: ( +
+
), }); } + tabItems.push({ + key: ModelDeploymentTabKey.Log, + label: '服务日志', + icon: , + children: , + }); + return (
From 4a6f4d2120bc51d5867991394b45c91b68018965 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Thu, 22 May 2025 16:51:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96label-studio=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/RightContent/AvatarDropdown.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/react-ui/src/components/RightContent/AvatarDropdown.tsx b/react-ui/src/components/RightContent/AvatarDropdown.tsx index d3fa9e97..929109bb 100644 --- a/react-ui/src/components/RightContent/AvatarDropdown.tsx +++ b/react-ui/src/components/RightContent/AvatarDropdown.tsx @@ -1,8 +1,9 @@ import { clearSessionToken } from '@/access'; +import { getLabelStudioUrl } from '@/services/developmentEnvironment'; import { setRemoteMenu } from '@/services/session'; import { logout } from '@/services/system/auth'; import { ClientInfo } from '@/types'; -import { sleep } from '@/utils/promise'; +import { sleep, to } from '@/utils/promise'; import SessionStorage from '@/utils/sessionStorage'; import { oauthLogout } from '@/utils/ui'; import { LogoutOutlined, UserOutlined } from '@ant-design/icons'; @@ -63,7 +64,10 @@ const AvatarDropdown: React.FC = ({ menu }) => { * 退出登录,并且将当前的 url 保存 */ const loginOut = async () => { - oauthLogout('http://172.20.32.197:31209/oauth/logout'); + const [res] = await to(getLabelStudioUrl()); + if (res && res.data) { + oauthLogout(`${res.data}/oauth/logout`); + } // 至少 1 秒后跳转,希望子系统能完成注销 await Promise.all([logout(), sleep(1000)]); clearSessionToken(); @@ -76,7 +80,7 @@ const AvatarDropdown: React.FC = ({ menu }) => { } // setTimeout(() => { // gotoLoginPage(); - // }, 1000); + // }, 100); }; const actionClassName = useEmotionCss(({ token }) => { return {