@@ -13,7 +13,7 @@ import DeploymentStatusTag, {
1313} from '../components/DeploymentStatusTag' ;
1414import { useCurrentUserInfo } from '../hooks/backendai' ;
1515import { QuestionCircleOutlined } from '@ant-design/icons' ;
16- import { Skeleton , Tooltip , Typography , theme } from 'antd' ;
16+ import { Alert , Button , Skeleton , Tooltip , Typography , theme } from 'antd' ;
1717import { BAICard , BAIFlex , toGlobalId } from 'backend.ai-ui' ;
1818import React , { Suspense } from 'react' ;
1919import { useTranslation } from 'react-i18next' ;
@@ -40,6 +40,9 @@ const DeploymentDetailPage: React.FC = () => {
4040 name
4141 status
4242 }
43+ networkAccess {
44+ openToPublic
45+ }
4346 creator @since(version: "26.4.3") {
4447 basicInfo {
4548 email
@@ -74,6 +77,15 @@ const DeploymentDetailPage: React.FC = () => {
7477 const isOwnedByCurrentUser =
7578 ! creatorEmail || creatorEmail === currentUser . email ;
7679
80+ const isPrivateDeployment =
81+ deployment . networkAccess . openToPublic === false && ! isDeploymentDestroying ;
82+
83+ const scrollToAccessTokens = ( ) => {
84+ document
85+ . getElementById ( 'deployment-access-tokens' )
86+ ?. scrollIntoView ( { behavior : 'smooth' , block : 'start' } ) ;
87+ } ;
88+
7789 return (
7890 < BAIFlex direction = "column" align = "stretch" gap = "md" >
7991 < BAIFlex direction = "row" align = "center" gap = "sm" >
@@ -82,6 +94,19 @@ const DeploymentDetailPage: React.FC = () => {
8294 </ Typography . Title >
8395 < DeploymentStatusTag status = { deploymentStatus } />
8496 </ BAIFlex >
97+ { isPrivateDeployment && (
98+ < Alert
99+ type = "info"
100+ showIcon
101+ title = { t ( 'deployment.PrivateDeploymentAlertTitle' ) }
102+ description = { t ( 'deployment.PrivateDeploymentAlertDescription' ) }
103+ action = {
104+ < Button onClick = { scrollToAccessTokens } >
105+ { t ( 'deployment.ManageAccessTokens' ) }
106+ </ Button >
107+ }
108+ />
109+ ) }
85110 < DeploymentConfigurationSection
86111 deploymentId = { toGlobalId ( 'ModelDeployment' , deploymentId ) }
87112 isDeploymentDestroying = { isDeploymentDestroying }
@@ -109,12 +134,14 @@ const DeploymentDetailPage: React.FC = () => {
109134 </ BAIErrorBoundary >
110135 </ BAICard >
111136 < DeploymentAutoScalingTab deploymentFrgmt = { deployment } />
112- < DeploymentAccessTokensTab
113- deploymentFrgmt = { deployment }
114- deploymentId = { toGlobalId ( 'ModelDeployment' , deploymentId ) }
115- isOwnedByCurrentUser = { isOwnedByCurrentUser }
116- isDeploymentDestroying = { isDeploymentDestroying }
117- />
137+ < div id = "deployment-access-tokens" >
138+ < DeploymentAccessTokensTab
139+ deploymentFrgmt = { deployment }
140+ deploymentId = { toGlobalId ( 'ModelDeployment' , deploymentId ) }
141+ isOwnedByCurrentUser = { isOwnedByCurrentUser }
142+ isDeploymentDestroying = { isDeploymentDestroying }
143+ />
144+ </ div >
118145 </ BAIFlex >
119146 ) ;
120147} ;
0 commit comments