@@ -11,8 +11,7 @@ import { convertToOrderBy } from '../helper';
1111import { useBAISettingUserState } from '../hooks/useBAISetting' ;
1212import ReplicaStatusTag , { ReplicaStatus } from './ReplicaStatusTag' ;
1313import SessionDetailDrawer from './SessionDetailDrawer' ;
14- import { Descriptions , Drawer , Tag , Typography } from 'antd' ;
15- import { DescriptionsItemType } from 'antd/es/descriptions' ;
14+ import { Tag , Typography } from 'antd' ;
1615import {
1716 BAIColumnType ,
1817 BAIFetchKeyButton ,
@@ -24,7 +23,6 @@ import {
2423 BAIUnmountAfterClose ,
2524 type GraphQLFilter ,
2625 filterOutEmpty ,
27- toLocalId ,
2826} from 'backend.ai-ui' ;
2927import dayjs from 'dayjs' ;
3028import * as _ from 'lodash-es' ;
@@ -88,7 +86,6 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
8886 current : parseAsInteger . withDefault ( 1 ) ,
8987 pageSize : parseAsInteger . withDefault ( 10 ) ,
9088 order : parseAsStringLiteral ( availableReplicaSorterValues ) ,
91- selected : parseAsString ,
9289 rFilter : parseAsString ,
9390 } ,
9491 {
@@ -97,18 +94,15 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
9794 current : 'rCurrent' ,
9895 pageSize : 'rPageSize' ,
9996 order : 'rOrder' ,
100- selected : 'rSelected' ,
10197 rFilter : 'rFilter' ,
10298 } ,
10399 } ,
104100 ) ;
105101
106- const deployment = useFragment (
102+ useFragment (
107103 graphql `
108104 fragment DeploymentReplicasTab_deployment on ModelDeployment {
109- networkAccess {
110- endpointUrl
111- }
105+ id
112106 }
113107 ` ,
114108 deploymentFrgmt ,
@@ -198,10 +192,6 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
198192
199193 type ReplicaNode = ( typeof replicas ) [ number ] ;
200194
201- const selectedReplica = replicas . find (
202- ( replica ) => replica . id === queryParams . selected ,
203- ) ;
204-
205195 const doRefetch = ( overrides ?: {
206196 filter ?: ReturnType < typeof parseReplicaFilter > ;
207197 orderBy ?: ReturnType < typeof convertToOrderBy < ReplicaOrderBy > > ;
@@ -240,13 +230,7 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
240230 title : t ( 'deployment.ReplicaId' ) ,
241231 dataIndex : 'id' ,
242232 fixed : 'left' ,
243- render : ( value : string , record : ReplicaNode ) => (
244- < BAINameActionCell
245- title = { toLocalId ( value ) }
246- showActions = "always"
247- onTitleClick = { ( ) => setQueryParams ( { selected : record . id } ) }
248- />
249- ) ,
233+ render : ( value : string ) => < BAIId globalId = { value } copyable /> ,
250234 } ,
251235 {
252236 key : 'livenessStatus' ,
@@ -278,13 +262,17 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
278262 render : ( value ) => value ?? '-' ,
279263 } ,
280264 {
265+ // TODO(needs-backend): BA-5838 — ModelReplica.sessionId returns the
266+ // replica's own route_id instead of the compute session ID. Hidden by
267+ // default until the backend fix lands so users don't see wrong data.
281268 key : 'sessionId' ,
282269 title : t ( 'deployment.SessionId' ) ,
283270 dataIndex : 'sessionId' ,
271+ defaultHidden : true ,
284272 render : ( value : string | null | undefined ) =>
285273 value ? (
286274 < BAINameActionCell
287- title = { value }
275+ title = { < BAIId uuid = { value } /> }
288276 showActions = "always"
289277 onTitleClick = { ( ) => setSelectedSessionId ( value ) }
290278 />
@@ -310,84 +298,6 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
310298 } ,
311299 ] ) ;
312300
313- const drawerItems : DescriptionsItemType [ ] = selectedReplica
314- ? filterOutEmpty ( [
315- {
316- key : 'replicaId' ,
317- label : t ( 'deployment.ReplicaId' ) ,
318- children : < BAIId globalId = { selectedReplica . id } ellipsis = { false } /> ,
319- } ,
320- {
321- key : 'readinessStatus' ,
322- label : t ( 'deployment.ReadinessStatus' ) ,
323- children : (
324- < Tag >
325- { t (
326- `replicaStatus.${ readinessStatusI18nKey (
327- selectedReplica . readinessStatus ,
328- ) } `,
329- {
330- defaultValue : selectedReplica . readinessStatus ?? '-' ,
331- } ,
332- ) }
333- </ Tag >
334- ) ,
335- } ,
336- {
337- key : 'livenessStatus' ,
338- label : t ( 'deployment.LivenessStatus' ) ,
339- children : (
340- < ReplicaStatusTag
341- status = { toReplicaTagStatus ( selectedReplica . livenessStatus ) }
342- />
343- ) ,
344- } ,
345- {
346- key : 'activenessStatus' ,
347- label : t ( 'deployment.ActivenessStatus' ) ,
348- children : (
349- < Tag
350- color = {
351- selectedReplica . activenessStatus === 'ACTIVE'
352- ? 'green'
353- : 'default'
354- }
355- >
356- { selectedReplica . activenessStatus ?? '-' }
357- </ Tag >
358- ) ,
359- } ,
360- selectedReplica . sessionId && {
361- key : 'sessionId' ,
362- label : t ( 'deployment.SessionId' ) ,
363- children : (
364- < BAIId uuid = { selectedReplica . sessionId } ellipsis = { false } copyable />
365- ) ,
366- } ,
367- selectedReplica . revision && {
368- key : 'revision' ,
369- label : t ( 'deployment.Revision' ) ,
370- children : selectedReplica . revision . name ,
371- } ,
372- deployment ?. networkAccess ?. endpointUrl && {
373- key : 'endpointUrl' ,
374- label : t ( 'deployment.EndpointUrl' ) ,
375- children : (
376- < Typography . Text copyable >
377- { deployment . networkAccess . endpointUrl }
378- </ Typography . Text >
379- ) ,
380- } ,
381- {
382- key : 'createdAt' ,
383- label : t ( 'deployment.CreatedAt' ) ,
384- children : selectedReplica . createdAt
385- ? dayjs ( selectedReplica . createdAt ) . format ( 'lll' )
386- : '-' ,
387- } ,
388- ] )
389- : [ ] ;
390-
391301 return (
392302 < >
393303 < BAIFlex
@@ -445,17 +355,6 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
445355 } ,
446356 } }
447357 />
448- < Drawer
449- title = { t ( 'deployment.ReplicaDetail' ) }
450- size = "large"
451- open = { ! ! selectedReplica }
452- onClose = { ( ) => setQueryParams ( { selected : null } ) }
453- destroyOnHidden
454- >
455- { selectedReplica && (
456- < Descriptions column = { 1 } size = "small" bordered items = { drawerItems } />
457- ) }
458- </ Drawer >
459358 < BAIUnmountAfterClose >
460359 < SessionDetailDrawer
461360 open = { ! ! selectedSessionId }
@@ -467,23 +366,4 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
467366 ) ;
468367} ;
469368
470- /**
471- * Maps the GraphQL `ReadinessStatus` enum to the i18n key suffix registered
472- * under `replicaStatus.*`. Defaults to `NotChecked` for unknown values so the
473- * tag always renders something readable.
474- */
475- const readinessStatusI18nKey = (
476- readinessStatus : string | null | undefined ,
477- ) : string => {
478- switch ( readinessStatus ) {
479- case 'HEALTHY' :
480- return 'Healthy' ;
481- case 'UNHEALTHY' :
482- return 'Unhealthy' ;
483- case 'NOT_CHECKED' :
484- default :
485- return 'NotChecked' ;
486- }
487- } ;
488-
489369export default DeploymentReplicasTab ;
0 commit comments