@@ -24,12 +24,15 @@ import {
2424 BAITable ,
2525 BAITag ,
2626 BAIUnmountAfterClose ,
27+ BAIId ,
2728 INITIAL_FETCH_KEY ,
2829 type GraphQLFilter ,
2930 filterOutNullAndUndefined ,
31+ isValidUUID ,
3032 toLocalId ,
3133 useBAILogger ,
3234 useFetchKey ,
35+ BAIText ,
3336} from 'backend.ai-ui' ;
3437import dayjs from 'dayjs' ;
3538import * as _ from 'lodash-es' ;
@@ -51,12 +54,20 @@ import {
5154type RevisionNode = NonNullable <
5255 NonNullable <
5356 NonNullable <
54- DeploymentRevisionHistoryTabListQuery [ 'response' ] [ 'deployment' ]
55- > [ 'revisionHistory' ] [ 'edges' ] [ number ]
57+ NonNullable <
58+ DeploymentRevisionHistoryTabListQuery [ 'response' ] [ 'deployment' ]
59+ > [ 'revisionHistory' ]
60+ > [ 'edges' ] [ number ]
5661 > [ 'node' ]
5762> ;
5863
59- const availableRevisionSorterKeys = [ 'createdAt' ] as const ;
64+ const availableRevisionSorterKeys = [
65+ 'revisionNumber' ,
66+ 'createdAt' ,
67+ 'resourceGroup' ,
68+ 'clusterMode' ,
69+ 'runtimeVariantName' ,
70+ ] as const ;
6071const availableRevisionSorterValues = [
6172 ...availableRevisionSorterKeys ,
6273 ...availableRevisionSorterKeys . map ( ( key ) => `-${ key } ` as const ) ,
@@ -195,12 +206,16 @@ const DeploymentRevisionHistoryTab: React.FC<
195206 edges {
196207 node {
197208 id
209+ revisionNumber
198210 createdAt
199211
200212 clusterConfig {
201213 mode
202214 size
203215 }
216+ resourceConfig {
217+ resourceGroupName
218+ }
204219 modelRuntimeConfig {
205220 runtimeVariant {
206221 name
@@ -220,6 +235,13 @@ const DeploymentRevisionHistoryTab: React.FC<
220235 canonicalName
221236 }
222237 }
238+ modelMountConfig {
239+ vfolderId
240+ vfolder {
241+ id
242+ name
243+ }
244+ }
223245 ...DeploymentRevisionDetail_revision
224246 }
225247 }
@@ -277,12 +299,11 @@ const DeploymentRevisionHistoryTab: React.FC<
277299 } ;
278300
279301 const handleRollback = ( revision : RevisionNode ) : Promise < boolean > => {
280- const revisionLabel = toLocalId ( revision . id ) ;
281302 return new Promise < boolean > ( ( resolveOuter ) => {
282303 modal . confirm ( {
283304 title : t ( 'deployment.Deploy' ) ,
284305 content : t ( 'deployment.DeployConfirm' , {
285- revisionNumber : revisionLabel ,
306+ revisionNumber : revision . revisionNumber ,
286307 } ) ,
287308 okText : t ( 'deployment.Deploy' ) ,
288309 okButtonProps : {
@@ -315,7 +336,7 @@ const DeploymentRevisionHistoryTab: React.FC<
315336 upsertNotification ( {
316337 open : true ,
317338 message : t ( 'deployment.DeploySuccess' , {
318- revisionNumber : revisionLabel ,
339+ revisionNumber : revision . revisionNumber ,
319340 } ) ,
320341 } ) ;
321342 handleRefresh ( ) ;
@@ -342,10 +363,11 @@ const DeploymentRevisionHistoryTab: React.FC<
342363
343364 const columns : BAIColumnType < RevisionNode > [ ] = [
344365 {
345- title : t ( 'deployment.RevisionNumber ' ) ,
366+ title : t ( 'deployment.RevisionNumberWithID ' ) ,
346367 dataIndex : 'revisionNumber' ,
347368 key : 'revisionNumber' ,
348369 fixed : 'left' ,
370+ sorter : true ,
349371 render : ( _value , record ) => {
350372 // `currentRevisionId` and `deployingRevisionId` come back as raw
351373 // UUIDs from the scalar fields, while `record.id` is the
@@ -378,8 +400,15 @@ const DeploymentRevisionHistoryTab: React.FC<
378400 } )
379401 }
380402 >
381- { recordLocalId ?? '-' }
403+ { record . revisionNumber != null
404+ ? `#${ record . revisionNumber } `
405+ : '-' }
382406 </ Typography . Link >
407+ < BAIFlex gap = { 0 } align = "center" >
408+ { '(' }
409+ < BAIId globalId = { record . id } />
410+ { ')' }
411+ </ BAIFlex >
383412 { isCurrent ? (
384413 < BAITag color = "success" > { t ( 'deployment.Current' ) } </ BAITag >
385414 ) : null }
@@ -423,6 +452,7 @@ const DeploymentRevisionHistoryTab: React.FC<
423452 {
424453 title : t ( 'deployment.ModelVersion' ) ,
425454 key : 'modelVersion' ,
455+ defaultHidden : true ,
426456 render : ( _value , record ) => {
427457 const model = record . modelDefinition ?. models ?. [ 0 ] ;
428458 if ( ! model ) return '-' ;
@@ -441,40 +471,98 @@ const DeploymentRevisionHistoryTab: React.FC<
441471 } ,
442472 {
443473 title : t ( 'deployment.RuntimeVariant' ) ,
444- key : 'runtimeVariant' ,
445- dataIndex : 'runtimeVariant' ,
474+ key : 'runtimeVariantName' ,
475+ dataIndex : 'runtimeVariantName' ,
476+ sorter : true ,
446477 render : ( _value , record ) =>
447478 record . modelRuntimeConfig ?. runtimeVariant ?. name ?? '-' ,
448479 } ,
449480 {
450481 title : t ( 'deployment.Image' ) ,
451482 key : 'image' ,
483+ defaultHidden : true ,
452484 render : ( _value , record ) => {
453485 const canonicalName = record . imageV2 ?. identity ?. canonicalName ;
454- if ( ! canonicalName ) return '-' ;
486+ const imageGlobalId = record . imageV2 ?. id ;
487+ if ( ! canonicalName && ! imageGlobalId ) return '-' ;
455488 return (
456- < Typography . Text
457- copyable = { { text : canonicalName } }
458- ellipsis = { { tooltip : canonicalName } }
459- style = { { maxWidth : 240 } }
460- >
461- { canonicalName }
462- </ Typography . Text >
489+ < BAIFlex gap = "xs" align = "center" wrap = "wrap" >
490+ { canonicalName ? (
491+ < BAIText
492+ copyable
493+ ellipsis = { { tooltip : canonicalName } }
494+ style = { { maxWidth : 180 } }
495+ >
496+ { canonicalName }
497+ </ BAIText >
498+ ) : null }
499+ { imageGlobalId ? (
500+ < BAIFlex gap = { 0 } align = "center" >
501+ { '(' }
502+ < BAIId globalId = { imageGlobalId } />
503+ { ')' }
504+ </ BAIFlex >
505+ ) : null }
506+ </ BAIFlex >
463507 ) ;
464508 } ,
465509 } ,
466510 {
467- title : t ( 'deployment.ClusterSize' ) ,
468- key : 'clusterSize' ,
511+ title : t ( 'deployment.ModelFolder' ) ,
512+ key : 'modelFolder' ,
513+ defaultHidden : true ,
514+ render : ( _value , record ) => {
515+ const vfolder = record . modelMountConfig ?. vfolder ;
516+ const vfolderId = record . modelMountConfig ?. vfolderId ;
517+ if ( ! vfolder ?. name && ! vfolderId ) return '-' ;
518+ return (
519+ < BAIFlex gap = "xs" align = "center" wrap = "wrap" >
520+ { vfolder ?. name ? (
521+ < Typography . Text > { vfolder . name } </ Typography . Text >
522+ ) : null }
523+ { vfolder ?. id ? (
524+ < BAIFlex gap = { 0 } align = "center" >
525+ { '(' }
526+ < BAIId globalId = { vfolder . id } />
527+ { ')' }
528+ </ BAIFlex >
529+ ) : vfolderId ? (
530+ < Typography . Text type = "secondary" > { vfolderId } </ Typography . Text >
531+ ) : null }
532+ </ BAIFlex >
533+ ) ;
534+ } ,
535+ } ,
536+ {
537+ title : t ( 'deployment.ClusterMode' ) ,
538+ key : 'clusterMode' ,
539+ dataIndex : 'clusterMode' ,
540+ sorter : true ,
469541 render : ( _value , record ) => {
470542 const mode = record . clusterConfig ?. mode ;
471543 const size = record . clusterConfig ?. size ;
472- if ( size == null ) return '-' ;
473- return mode ? `${ size } (${ mode } )` : `${ size } ` ;
544+ if ( mode == null && size == null ) return '-' ;
545+ if ( mode == null ) return `${ size } ` ;
546+ if ( size == null ) return mode ;
547+ return `${ mode } / ${ size } ` ;
474548 } ,
475549 } ,
550+ {
551+ title : t ( 'deployment.ResourceGroup' ) ,
552+ key : 'resourceGroup' ,
553+ dataIndex : 'resourceGroup' ,
554+ sorter : true ,
555+ defaultHidden : true ,
556+ render : ( _value , record ) =>
557+ record . resourceConfig ?. resourceGroupName ?? '-' ,
558+ } ,
476559 ] ;
477560
561+ const uuidRule = {
562+ message : t ( 'general.InvalidUUID' ) ,
563+ validate : ( value : string ) => isValidUUID ( value . toLowerCase ( ) ) ,
564+ } ;
565+
478566 const filterProperties = [
479567 {
480568 key : 'revisionNumber' ,
@@ -488,6 +576,30 @@ const DeploymentRevisionHistoryTab: React.FC<
488576 operators : [ 'after' as const , 'before' as const ] ,
489577 defaultOperator : 'after' as const ,
490578 } ,
579+ {
580+ key : 'resourceGroup' ,
581+ propertyLabel : t ( 'deployment.ResourceGroup' ) ,
582+ type : 'string' as const ,
583+ } ,
584+ {
585+ key : 'clusterMode' ,
586+ propertyLabel : t ( 'deployment.ClusterMode' ) ,
587+ type : 'string' as const ,
588+ } ,
589+ {
590+ key : 'imageId' ,
591+ propertyLabel : t ( 'deployment.Image' ) ,
592+ type : 'uuid' as const ,
593+ fixedOperator : 'equals' as const ,
594+ rule : uuidRule ,
595+ } ,
596+ {
597+ key : 'modelVfolderId' ,
598+ propertyLabel : t ( 'deployment.ModelFolder' ) ,
599+ type : 'uuid' as const ,
600+ fixedOperator : 'equals' as const ,
601+ rule : uuidRule ,
602+ } ,
491603 ] ;
492604
493605 const filterValue : GraphQLFilter | undefined = queryParams . rvFilter
0 commit comments