Browse Source

Merge branch 'dev-check' of https://gitlink.org.cn/ci4s/ci4sManagement-cloud into dev-check

pull/268/head
chenzhihang 8 months ago
parent
commit
6ad1910cb0
2 changed files with 30 additions and 21 deletions
  1. +7
    -3
      react-ui/src/components/RightContent/AvatarDropdown.tsx
  2. +23
    -18
      react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx

+ 7
- 3
react-ui/src/components/RightContent/AvatarDropdown.tsx View File

@@ -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<GlobalHeaderRightProps> = ({ 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<GlobalHeaderRightProps> = ({ menu }) => {
}
// setTimeout(() => {
// gotoLoginPage();
// }, 1000);
// }, 100);
};
const actionClassName = useEmotionCss(({ token }) => {
return {


+ 23
- 18
react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx View File

@@ -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: <KFIcon type="icon-jibenxinxi" />,
children: <VersionBasicInfo info={versionInfo} />,
},
{
key: ModelDeploymentTabKey.Guide,
label: '调用指南',
icon: <KFIcon type="icon-tiaoyongzhinan" />,
children: <UserGuide info={versionInfo}></UserGuide>,
},
{
key: ModelDeploymentTabKey.Log,
label: '服务日志',
icon: <KFIcon type="icon-fuwurizhi" />,
children: <ServerLog info={versionInfo}></ServerLog>,
},
];

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: <KFIcon type="icon-yuce" />,
children: (
<div style={{ height: '100%', width: '100%' }}>
{versionInfo?.page_path && (
<FullScreenFrame url={versionInfo?.page_path}></FullScreenFrame>
)}
<FullScreenFrame url={versionInfo?.page_path}></FullScreenFrame>
</div>
),
});
}

if (versionInfo?.doc_path) {
tabItems.push({
key: ModelDeploymentTabKey.Guide,
label: '调用指南',
icon: <KFIcon type="icon-tiaoyongzhinan" />,
children: (
<div style={{ height: '100%', width: '100%' }}>
<FullScreenFrame url={versionInfo?.doc_path}></FullScreenFrame>
</div>
),
});
}

tabItems.push({
key: ModelDeploymentTabKey.Log,
label: '服务日志',
icon: <KFIcon type="icon-fuwurizhi" />,
children: <ServerLog info={versionInfo}></ServerLog>,
});

return (
<div className={styles['service-version-info']}>
<PageTitle title="服务版本详情"></PageTitle>


Loading…
Cancel
Save