File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed
components/InfoViewer/schemaInfo Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 11import type { InfoViewerItem } from '..' ;
22import { InfoViewer } from '..' ;
33import { getEntityName } from '../../../containers/Tenant/utils' ;
4+ import { EIndexType } from '../../../types/api/schema' ;
45import type { TEvDescribeSchemeResult } from '../../../types/api/schema' ;
56
67import i18n from './i18n' ;
@@ -22,16 +23,17 @@ export const TableIndexInfo = ({data}: TableIndexInfoProps) => {
2223
2324 const vectorSettings = TableIndex ?. VectorIndexKmeansTreeDescription ?. Settings ;
2425
25- if ( ! vectorSettings ) {
26- return < InfoViewer title = { entityName } info = { info } /> ;
27- }
26+ const isVectorIndex = TableIndex ?. Type === EIndexType . EIndexTypeGlobalVectorKmeansTree ;
2827
29- const vectorInfo : Array < InfoViewerItem > = buildVectorIndexInfo ( vectorSettings ) ;
28+ if ( isVectorIndex ) {
29+ const vectorInfo : Array < InfoViewerItem > = buildVectorIndexInfo ( vectorSettings ) ;
30+ return (
31+ < >
32+ < InfoViewer title = { i18n ( 'title_vector-index' ) } info = { info } />
33+ < InfoViewer info = { vectorInfo } />
34+ </ >
35+ ) ;
36+ }
3037
31- return (
32- < >
33- < InfoViewer title = { entityName } info = { info } />
34- < InfoViewer title = { i18n ( 'title_vector-index' ) } info = { vectorInfo } />
35- </ >
36- ) ;
38+ return < InfoViewer title = { entityName } info = { info } /> ;
3739} ;
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ export function buildVectorIndexInfo(vectorSettings?: VectorSettings): InfoViewe
6161 const settingsFormatter = createInfoFormatter < TVectorIndexKmeansTreeDescriptionSettingsInner > ( {
6262 values : {
6363 vector_dimension : ( v ) => ( typeof v === 'number' ? formatNumber ( v ) : v ) ,
64+ vector_type : ( v ) => ( typeof v === 'string' ? v . replace ( / ^ V E C T O R _ T Y P E _ / , '' ) : v ) ,
6465 } ,
6566 labels : {
6667 vector_dimension : i18n ( 'field_vector-dimension' ) ,
Original file line number Diff line number Diff line change @@ -26,14 +26,14 @@ export interface TIndexDescription {
2626 VectorIndexKmeansTreeDescription ?: TVectorIndexKmeansTreeDescription ;
2727}
2828
29- enum EIndexType {
29+ export enum EIndexType {
3030 EIndexTypeInvalid = 'EIndexTypeInvalid' ,
3131 EIndexTypeGlobal = 'EIndexTypeGlobal' ,
3232 EIndexTypeGlobalAsync = 'EIndexTypeGlobalAsync' ,
3333 EIndexTypeGlobalVectorKmeansTree = 'EIndexTypeGlobalVectorKmeansTree' ,
3434}
3535
36- enum EIndexState {
36+ export enum EIndexState {
3737 EIndexStateInvalid = 'EIndexStateInvalid' ,
3838 EIndexStateReady = 'EIndexStateReady' ,
3939 EIndexStateNotReady = 'EIndexStateNotReady' ,
You can’t perform that action at this time.
0 commit comments